Showing results 1 to 10 of 18

Thread: Sample How to create a OnlineContainer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    28.07.2008
    Posts
    64

    Default Sample How to create a OnlineContainer

    using System;
    using System.Windows.Controls;
    using System.Data;
    
    
    namespace ProjectAddin
    {
        [System.AddIn.AddIn("ThisProject", Version = "1.0", Publisher = "", Description = "")]
        public partial class ThisProject
        {      
            zenOn.IOnlineVariable obOnlineVar = null;
    
    
            private void ThisProject_Startup(object sender, EventArgs e)
            {
                try
                {
                    ///Create OnlineContainer
                    obOnlineVar = this.OnlineVariables().CreateOnlineVariables("MyContainer");
                    obOnlineVar.Add("Intern_Variable_UINT_1");
                    obOnlineVar.Add("Intern_Variable_UINT_2");
                    obOnlineVar.Add("Intern_Variable_UINT_3");
                    obOnlineVar.Add("Intern_Variable_UINT_4");
                    obOnlineVar.Define();
                    obOnlineVar.VariableChange += new zenOn.VariableChangeEventHandler(obOnlineVar_VariableChange);
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.Print("ERROR ThisProject_Startup : " + ex.Message + " "+ ex.Source);
                }
            }
    
            private void ThisProject_Shutdown(object sender, EventArgs e)
            {
                try
                {
    		///Relase OnlineContainer
                    obOnlineVar.VariableChange -= new zenOn.VariableChangeEventHandler(obOnlineVar_VariableChange);
                    obOnlineVar.Undefine();
                    obOnlineVar = null;
    
                }
                catch (Exception ex)
                {
                     System.Diagnostics.Debug.Print("ERROR ThisProject_Startup : " + ex.Message + " " + ex.Source);
                }
            }
    
     
    	///Event for OnlineContainer Variable changes
            void obOnlineVar_VariableChange(zenOn.IVariable obVar)
            {
               	///Do something
            }
          }	
    }
    Last edited by tulon : 25th May 2010 at 12:59

Similar Threads

  1. Replies: 0
    Last Post: 12th May 2010, 10:07
  2. Replies: 0
    Last Post: 12th May 2010, 09:58
  3. Sample How to use DynProbertiesEnum
    By tulon in forum VSTA
    Replies: 0
    Last Post: 16th March 2010, 09:05
  4. Replies: 5
    Last Post: 16th July 2009, 14:39
  5. Information Unlimited 16 - Sample
    By robertf in forum VBA
    Replies: 0
    Last Post: 28th November 2008, 13:34

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •