Create depending Actions (like SFTP)
Last Post 11 May 2010 01:30 AM by Linne. 2 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Resolved


Linne


Posts:10


--
01 Mar 2010 01:16 AM

    Hello,

    I need to create a .NET-action in the same way as your SFTP Action group.

    One action should open a connection to a measuring table controller and another e.g. should drive to a certain position. So I need to access an .NET-object from different actions.

    I looked inside your SFTP implementation:

    You are using

    base.DesignTimeContext.ProjectObjectService.RegisterObject(..)
    while (base.DesignTimeContext.ProjectObjectService.IsDuplicateObject(..)
    base.DesignTimeContext.ProjectObjectService.UnRegisterObject(..);
    base.Context.ProjectObjectService.GetRegisteredObject(..)

    in your action, but they are not really documented, do you have an example for it?

    In the action you use also a combobox, that is automatically filled up with the available connections (SFTP Connection). Do you have an script / example, how you filled up the control?

     

    Thanks in advance

    Jan

     



    Paul Samways


    Posts:1592


    --
    01 Mar 2010 04:45 PM

    Hi Jan,

    I've attached an example action which uses the project object API to create a simple connection object which is then used by subsequent actions, hopefully this helps. We'll try and get the documentation updated as soon as possible.

    The combobox which contains the list of project objects is available in the Component Palette as a 'ProjectObjectComboBox', it will automatically list the available items once the 'CategoryFilter' property is specified.

    Regards,
    Paul.



    Linne


    Posts:10


    --
    11 May 2010 01:30 AM

    There is a small mistake in your example. It must be the following in ConnectAction.cs:

     

    public void Cleanup(VSoft.CustomActionApi.Interop.ICustomActionDesignTimeContext Context)
    {
                if ((this.serialPort != null) && (Context.ProjectObjectService != null))
                    Context.ProjectObjectService.UnRegisterObject(serialPort);
     }

     

    Regards,

    Jan

    You are not authorized to post a reply.


    ipt>