Пример #1
0
        public bool PropertyGridItemsSetValue(PropertyValueChangedEventArgs e)
        {
            bool r = false;

            foreach (AvailablePlugIn <IPlugIn> p in this.AvailablePlugInCollection)
            {
                CustomProperty.CustomPropertyDescriptor d = e.ChangedItem.PropertyDescriptor as CustomProperty.CustomPropertyDescriptor;
                if (d == null)
                {
                    continue;
                }
                CustomProperty c = d.CustomProperty as CustomProperty;
                if (c == null || false == c.Tag.Equals(p.Instance.ID))
                {
                    continue;
                }
                IPlugInUI u = p.Instance as IPlugInUI;
                if (u != null)
                {
                    u.UISetValue(e);
                    r = true;
                    break;
                }
            }
            return(r);
        }
Пример #2
0
 public void PropertyGridItemsInitialization(ZForge.Controls.PropertyGridEx.CustomPropertyCollection items, bool global)
 {
     foreach (AvailablePlugIn <IPlugIn> pi in this.AvailablePlugInCollection)
     {
         IPlugInUI u = pi.Instance as IPlugInUI;
         if (u == null)
         {
             continue;
         }
         if (global == false)
         {
             List <ZForge.Controls.PropertyGridEx.CustomProperty> plist = u.UIPropertyItems;
             if (plist == null)
             {
                 continue;
             }
             foreach (ZForge.Controls.PropertyGridEx.CustomProperty t in plist)
             {
                 if (pi.Instance is IPlugInVideoSource)
                 {
                     t.Visible = false;
                 }
                 items.Add(t);
             }
         }
         else
         {
             IPlugInUIWithGlobal ig = pi.Instance as IPlugInUIWithGlobal;
             if (ig != null)
             {
                 ig.GlobalOperation = true;
                 List <ZForge.Controls.PropertyGridEx.CustomProperty> plist = u.UIPropertyItems;
                 if (plist == null)
                 {
                     continue;
                 }
                 foreach (CustomProperty t in plist)
                 {
                     items.Add(t);
                 }
             }
         }
     }
 }
Пример #3
0
 public void ToolStripItemsInitialization(ToolStripItemCollection items)
 {
     foreach (AvailablePlugIn <IPlugIn> pi in this.AvailablePlugInCollection)
     {
         IPlugInUI u = pi.Instance as IPlugInUI;
         if (u == null)
         {
             continue;
         }
         List <System.Windows.Forms.ToolStripItem> list = u.UIEditFormToolStripItems;
         if (list == null)
         {
             continue;
         }
         foreach (System.Windows.Forms.ToolStripItem b in list)
         {
             items.Add(b);
         }
     }
 }
Пример #4
0
        private void SetVideoSourceItemVisible(bool v)
        {
            IPlugInVideoSource i = this.Camera.PlugInVideoSource;

            if (i == null)
            {
                return;
            }
            IPlugInUI u = i as IPlugInUI;

            if (u == null)
            {
                return;
            }
            if (u.UIPropertyItems != null)
            {
                foreach (ZForge.Controls.PropertyGridEx.CustomProperty p in u.UIPropertyItems)
                {
                    p.Visible = v;
                }
            }
            //this.pGridCamera.Refresh();
        }