Example #1
0
 public ObjectEditorEntry(PropertyInfo prop, object obj, object optionable, object range, object hue)
 {
     this.m_Property = prop;
     this.m_Object = obj;
     this.m_Optionable = optionable as OptionableAttribute;
     this.m_Range = range as OptionRangeAttribute;
     this.m_Hue = hue as OptionHueAttribute;
 }
Example #2
0
 public ObjectEditorEntry(PropertyInfo prop, object obj, object optionable, object range, object hue)
 {
     this.m_Property   = prop;
     this.m_Object     = obj;
     this.m_Optionable = optionable as OptionableAttribute;
     this.m_Range      = range as OptionRangeAttribute;
     this.m_Hue        = hue as OptionHueAttribute;
 }
Example #3
0
        public GObjectEditor(object obj) : base(0, 0, 0x13d, 0x188)
        {
            Gumps.Focus   = this;
            this.m_Object = obj;
            base.m_NonRestrictivePicking = true;
            base.Text = "Option Editor";
            PropertyInfo[] properties = obj.GetType().GetProperties();
            Hashtable      c          = new Hashtable();

            for (int i = 0; i < properties.Length; i++)
            {
                PropertyInfo        mi         = properties[i];
                OptionableAttribute optionable = this.GetAttribute(mi, typeof(OptionableAttribute)) as OptionableAttribute;
                if (optionable != null)
                {
                    ArrayList list = (ArrayList)c[optionable.Category];
                    if (list == null)
                    {
                        c[optionable.Category] = list = new ArrayList();
                    }
                    list.Add(new ObjectEditorEntry(mi, obj, optionable, this.GetAttribute(mi, typeof(OptionRangeAttribute)), this.GetAttribute(mi, typeof(OptionHueAttribute))));
                }
            }
            ArrayList list2 = new ArrayList(c);

            list2.Sort(new CategorySorter());
            ArrayList panels = new ArrayList();

            foreach (DictionaryEntry entry in list2)
            {
                string         key     = (string)entry.Key;
                ArrayList      entries = (ArrayList)entry.Value;
                GCategoryPanel panel   = new GCategoryPanel(obj, key, entries);
                panels.Add(panel);
            }
            GEditorPanel toAdd = new GEditorPanel(panels, 360);

            this.m_Panel = toAdd;
            toAdd.X     += 2;
            toAdd.Y     += 3;
            base.Client.m_NonRestrictivePicking = true;
            base.Client.Children.Add(toAdd);
            this.Center();
        }