public AdvPropGrid_ObjectPropertiesHelper(AdvPropertyGrid advPropGrid, ObjectComboList objComboList, BehaviorInfoList behaviors, string behaviorPropName, string bParamPropName)
        {
            CbEditorBParam1       = null;
            CbEditorBParam2       = null;
            CbEditorBParam3       = null;
            CbEditorBParam4       = null;
            CbEditorBehavAddr     = null;
            AdvPropertyGrid1      = advPropGrid;
            myObjectCombos        = objComboList;
            myBehaviors           = behaviors;
            this.behaviorPropName = behaviorPropName;
            this.bParamPropName   = bParamPropName;
            General.LoadBehaviorInfosIfEmpty();
            General.LoadObjectCombosIfEmpty();
            LoadComboBoxObjComboEntries(objComboList);

            // Add B. Param Editors to Property Grid
            var bpeditor = new ContentSelectorEditor();

            bpeditor.EditorCreated  += ContentSelectorEditor_EditorCreated;
            bpeditor.EditorCreating += ContentSelectorEditor_EditorCreating;
            var bp1PropSet = new PropertySettings(bParamPropName + Conversions.ToString(1));
            var bp2PropSet = new PropertySettings(bParamPropName + Conversions.ToString(2));
            var bp3PropSet = new PropertySettings(bParamPropName + Conversions.ToString(3));
            var bp4PropSet = new PropertySettings(bParamPropName + Conversions.ToString(4));

            bp1PropSet.ValueEditor = bpeditor;
            bp2PropSet.ValueEditor = bpeditor;
            bp3PropSet.ValueEditor = bpeditor;
            bp4PropSet.ValueEditor = bpeditor;
            AdvPropertyGrid1.PropertySettings.Add(bp1PropSet);
            AdvPropertyGrid1.PropertySettings.Add(bp2PropSet);
            AdvPropertyGrid1.PropertySettings.Add(bp3PropSet);
            AdvPropertyGrid1.PropertySettings.Add(bp4PropSet);

            // Add Behavior Address Editor to Property Grid
            var behavaddreditor = new ContentSelectorEditor();

            behavaddreditor.EditorCreating += ContentSelectorEditor_EditorCreating;
            behavaddreditor.EditorCreated  += ContentSelectorEditor_EditorCreated;
            var behavaddrPropSet = new PropertySettings(behaviorPropName);

            behavaddrPropSet.ValueEditor = behavaddreditor;
            AdvPropertyGrid1.PropertySettings.Add(behavaddrPropSet);

            // Add Position/Rotation Editors (NumberInputEditor for Increment/Decrement)
            foreach (string l in new[] { "X", "Y", "Z" })
            {
                foreach (string e in new[] { "Position", "Rotation" })
                {
                    var xyzeditor = new PropertyIntegerEditorX()
                    {
                        ShowUpDownButton = true, MinValue = short.MinValue, MaxValue = short.MaxValue
                    };
                    var xyzPropSet = new PropertySettings(e + l);
                    xyzPropSet.ValueEditor = xyzeditor;
                    AdvPropertyGrid1.PropertySettings.Add(xyzPropSet);
                }
            }
        }
예제 #2
0
 public MinimalAdvPropertyGridManager(AdvPropertyGrid advPropGrid)
 {
     AdvPropertyGrid1 = advPropGrid;
 }