Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Once created, the

...

.NET Component can be used the same way as any other Visual LANSA component.

...

An instance of

...

the component can be created and its properties, methods and events can be used. Some components are very simple and little programming is required to use them, others provide complex functionality and may require much more coding than using native Visual LANSA controls.

Define an instance of a component

Use the DEFINE_COM command. If the class does not have a Use the DEFINE_COM command. If the class does not have a constructor or has a constructor which takes no parameters then you may define the instance as either static or dynamic. Otherwise you must define the instance as dynamic:

...

Panel
bgColor#ffffcc

EVTROUTINE --- HANDLING ( Variable Name . Event Name )------------ >
>---------------------------------------------------------------------------- >
                               |                                                                             |
                                 ---- Parameter Name( Variable Name ) ---- ) -–
                                    |                                                            |
                                      ---------------------<-----------------

Example

     C#
   public

...

 class EventArgs1    
{
      private String         mName;

        public EventArgs1() {   }

        public String Name

      {
         get { return mName; }
         set \{ mName = value; }
     }
  }

     Public class EventTests
  {
      public event MyEventDelegate MyEvent;
      public delegate void MyEventDelegate( String str, EventArgs1 eventArgs );
  }

  RDML
   Define_Com Class(#DOTNET1.TestClasses.EventTests) Name(#EventTest)

     Evtroutine Handling(#EventTest.MyEvent) Str(#s1) EventArgs(#c1)
      #STD_TEXT := #s1
      #STD_NAME := #c1.Name

...


   Endroutine