public void LoadSaveFileChannels()
        {
            ExpectModal("SettingsForm", "CreateTestChannels");

            //Plugin should save its channels in the project

            Env.Current.Commands.FindCommandByName(PredefinedContexts.Communication, StringConstants.PropertyCommandName).Execute();

            Assert.AreEqual(ChannelTypes.Length, plugin.Channels.Length);
            Env.Current.Project.Save(projectFile);

            //Plugin should load its channels from the project on its loading
            Env.Deinitialize();
            System.Windows.Forms.MenuStrip menu = new System.Windows.Forms.MenuStrip();
            Env.Initialize(null, new Commands(menu, null), FreeSCADA.Interfaces.EnvironmentMode.Designer);
            plugin = (Plugin)Env.Current.CommunicationPlugins["data_simulator_plug"];
            Env.Current.Project.Load(projectFile);

            Assert.AreEqual(ChannelTypes.Length, plugin.Channels.Length);
            for (int i = 0; i < plugin.Channels.Length; i++)
            {
                FreeSCADA.Interfaces.IChannel ch = plugin.Channels[i];
                Assert.IsNotNull(ch);
                Assert.AreEqual(string.Format("variable_{0}", i + 1), ch.Name);
            }
        }
 void OnSelectProjectNode(FreeSCADA.Designer.Views.ProjectNodes.BaseNode node)
 {
     if (node is FreeSCADA.Designer.Views.ProjectNodes.ChannelNode)
     {
         FreeSCADA.Interfaces.IChannel ch = (node as FreeSCADA.Designer.Views.ProjectNodes.ChannelNode).Channel;
         propertyBrowserView.ShowProperties(ch);
     }
 }
        public void LoadSaveChannels()
        {
            ExpectModal("SettingsForm", "CreateTestChannels");

            //Plugin should save its channels in the project

            Env.Current.Commands.FindCommandByName(PredefinedContexts.Communication, StringConstants.PropertyCommandName).Execute();

            Assert.AreEqual(ChannelTypes.Length, plugin.Channels.Length);

            //Plugin should load its channels from the project
            plugin = new Plugin();
            plugin.Initialize(Env.Current);

            Assert.AreEqual(ChannelTypes.Length, plugin.Channels.Length);
            for (int i = 0; i < plugin.Channels.Length; i++)
            {
                FreeSCADA.Interfaces.IChannel ch = plugin.Channels[i];
                Assert.IsNotNull(ch);
                Assert.AreEqual(string.Format("variable_{0}", i + 1), ch.Name);
            }
        }
 void OnChannelValueChanged(object sender, System.EventArgs e)
 {
     FreeSCADA.Interfaces.IChannel ch = (FreeSCADA.Interfaces.IChannel)sender;
     channelchangedNotification[(int)ch.Tag]++;
 }