Ejemplo n.º 1
0
        public void GetPluginMenuItems(System.Windows.Forms.ToolStripItemCollection menu)
        {
            ICollection <System.Windows.Forms.ToolStripItem> _items = new List <System.Windows.Forms.ToolStripItem>();

            Server.GetPluginMenuItems(_items);
            menu.AddRange(_items.ToArray <System.Windows.Forms.ToolStripItem>());
        }
Ejemplo n.º 2
0
 internal void GetImportMenu(System.Windows.Forms.ToolStripItemCollection items)
 {
     if (this.TestIfReadOnlyAndRetrunTrueIfReadOnly())
     {
         return;
     }
     ImportOPCDAAddressSpace.CreateImportMenuItems(items, new EventHandler(CreateImportMenuClick));
 }
Ejemplo n.º 3
0
        private void AddMenuItems(System.Windows.Forms.ToolStripItemCollection items)
        {
            _currentFreqLabel = new System.Windows.Forms.ToolStripLabel("???");
            items.Add(_currentFreqLabel);

            _freqWatchStatus = new System.Windows.Forms.ToolStripLabel("???");
            items.Add(_freqWatchStatus);

            items.Add(new System.Windows.Forms.ToolStripSeparator());

            items.Add(new System.Windows.Forms.ToolStripMenuItem("Set PWM frequency", null, setFreq_Click));

            items.Add(new System.Windows.Forms.ToolStripSeparator());

            items.Add(new System.Windows.Forms.ToolStripMenuItem("Exit", null, onExit_Clicked));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Translate the toolstripitemcollection.
 /// </summary>
 /// <param name="toolstripitemcollection">Collection of ToolStripItems to translate.</param>
 private static void TranslateToolStripItemCollection(System.Windows.Forms.ToolStripItemCollection toolstripitemcollection)
 {
     for (int i = 0; i < toolstripitemcollection.Count; ++i)
     {
         System.Windows.Forms.ToolStripMenuItem toolStripMenuItem = (System.Windows.Forms.ToolStripMenuItem)toolstripitemcollection[i];
         toolStripMenuItem.Text = GetTranslationControl(toolstripitemcollection[i].Text, toolstripitemcollection[i].Name);
         if (toolStripMenuItem.DropDownItems.Count > 0)
         {
             // translate subitems:
             for (int n = 0; n < toolStripMenuItem.DropDownItems.Count; ++n)
             {
                 ////Log.Write(LogType.info, "found subitem: " + toolStripMenuItem.DropDownItems[n].Text);
                 toolStripMenuItem.DropDownItems[n].Text = GetTranslationControl(toolStripMenuItem.DropDownItems[n].Text, toolStripMenuItem.DropDownItems[n].Name);
             }
         }
     }
 }
Ejemplo n.º 5
0
 public static IEnumerable <System.Windows.Forms.ToolStripItem> AsEnumerable(this System.Windows.Forms.ToolStripItemCollection source)
 {
     TypeCheckEnumerable(source, (s) => s.AsEnumerable(), (s) => s[0]);
     return(source.Cast <System.Windows.Forms.ToolStripItem>());
 }