Esempio n. 1
0
        void ChangeInstanceCount(object item, int dcount)
        {
            Gtk.TreeIter iter;

            if (item == null || treeview1 == null || treeview1.Model == null || !treeview1.Model.GetIterFirst(out iter))
            {
                return;
            }

            do
            {
                ComponentFactoryInformation cfi = treeview1.Model.GetValue(iter, CFIIndex) as ComponentFactoryInformation;
                if (cfi.ComponentType == item.GetType())
                {
                    object str   = treeview1.Model.GetValue(iter, InstanceCountIndex);// as string;
                    int    count = Convert.ToInt32(str);
                    count += dcount;
                    treeview1.Model.SetValue(iter, InstanceCountIndex, count);
                }
            }while (treeview1.Model.IterNext(ref iter));
        }
Esempio n. 2
0
        Component CreateInstance(ComponentFactoryInformation info, ComponentManager cm)
        {
            Component component = info.CreateInstance(cm);

            return(component);
        }
            public UIComponentDescriptor(ComponentFactoryInformation cfi, Component component = null)
            {
                m_ComponentFactoryInformation = cfi;
                m_Icon = cfi.Icon;
                Instance = component;

                if(!String.IsNullOrEmpty(cfi.MenuPath))
                {
                   // TODO we in future want to display the localized component name here.
                   // Currently that is impossible because the getter for that name currently does not sit in the factory, but in the instance.
                   // As a workaround, we take the menu item string (which usually matches the window title).
                   string[] portions = cfi.MenuPath.Split('\\');
                   m_Text = portions[portions.Length-1];
                }
                else
                {
                   m_Text = "(unnamed component)";
                }
            }
 Component CreateInstance(ComponentFactoryInformation info, ComponentManager cm)
 {
     Component component = info.CreateInstance(cm);
      return component;
 }