示例#1
0
        protected override void HandleAddItemButton(Control AddItemButton, Point p)
        {
            ICollection <string> names = TriggerSystemMain.mTriggerDefinitions.GetConditionNames();

            if (mpe != null && mpe.IsDisposed == false)
            {
                mpe.BringToFront();
                return;
            }
            AdvancedListItemPicker picker = new AdvancedListItemPicker();

            //Set all
            picker.SetAllChoices(names);
            picker.ListItemSelected += new EventHandler(picker_ListItemSelected);

            //Group by input parameter type
            Dictionary <string, List <string> > inputParamGroups = new Dictionary <string, List <string> >();

            foreach (string s in names)
            {
                foreach (string type in TriggerSystemMain.mTriggerDefinitions.GetInputTypesUsed(s))
                {
                    if (inputParamGroups.ContainsKey(type) == false)
                    {
                        inputParamGroups[type] = new List <string>();
                    }
                    inputParamGroups[type].Add(s);
                }
            }
            picker.AddTab("Input Type", inputParamGroups);

            //Group by outpu parameter type
            Dictionary <string, List <string> > outputParamGroups = new Dictionary <string, List <string> >();

            foreach (string s in names)
            {
                foreach (string type in TriggerSystemMain.mTriggerDefinitions.GetOutputTypesUsed(s))
                {
                    if (outputParamGroups.ContainsKey(type) == false)
                    {
                        outputParamGroups[type] = new List <string>();
                    }
                    outputParamGroups[type].Add(s);
                }
            }
            picker.AddTab("Output Type", outputParamGroups);

            //Group by input parameter type
            Dictionary <string, List <string> > allParamGroups = new Dictionary <string, List <string> >();

            foreach (string s in names)
            {
                foreach (string type in TriggerSystemMain.mTriggerDefinitions.GetInputTypesUsed(s))
                {
                    if (allParamGroups.ContainsKey(type) == false)
                    {
                        allParamGroups[type] = new List <string>();
                    }
                    allParamGroups[type].Add(s);
                }
                foreach (string type in TriggerSystemMain.mTriggerDefinitions.GetOutputTypesUsed(s))
                {
                    if (allParamGroups.ContainsKey(type) == false)
                    {
                        allParamGroups[type] = new List <string>();
                    }
                    allParamGroups[type].Add(s);
                }
            }
            picker.AddTab("Type", allParamGroups);


            PopupEditor pe = new PopupEditor();

            mpe = pe.ShowPopup(this, picker);
        }
示例#2
0
        protected override void HandleAddItemButton(Control AddItemButton, Point p)
        {
            ICollection <string> names = TriggerSystemMain.mTriggerDefinitions.GetEffectNames();

            if (mpe != null && mpe.IsDisposed == false)
            {
                mpe.BringToFront();
                return;
            }
            //////////////////////////////////////////////////////
            ////mSmartTree.Init(names);
            ////TreeNode root = mSmartTree.BuildTree();
            //TreeNode root = SmartStringTree.BuildTree(names, new string[] { "KBSF" });
            //PopupEditor pe2 = new PopupEditor();
            //TreeView tv = new TreeView();
            //tv.Height = 500;
            //tv.Width = 300;
            //tv.Nodes.Add(root);
            //mpe = pe2.ShowPopup(this, tv);
            //return;

            ///////////////////////////////////////////////////////
            //PopupEditor pe2 = new PopupEditor();
            //SuperPicker tv = new SuperPicker();

            //string filename = CoreGlobals.getWorkPaths().mEditorSettings + "\\tempMenu.xml";
            //CategoryTreeNode settings = new CategoryTreeNode();
            //if (File.Exists(filename))
            //{
            //   settings = BaseLoader<CategoryTreeNode>.Load(filename);
            //}
            //settings.mFileName = filename;
            //settings.mAllEntries.AddRange(names);
            //tv.Setup(settings);

            //tv.mContentProfivider = this;

            //mpe = pe2.ShowPopup(this, tv);
            //return;

            AdvancedListItemPicker picker = new AdvancedListItemPicker();

            //Set all
            picker.SetAllChoices(names);
            picker.ListItemSelected += new EventHandler(picker_ListItemSelected);

            //Group by input parameter type
            Dictionary <string, List <string> > inputParamGroups = new Dictionary <string, List <string> >();

            foreach (string s in names)
            {
                foreach (string type in TriggerSystemMain.mTriggerDefinitions.GetInputTypesUsed(s))
                {
                    if (inputParamGroups.ContainsKey(type) == false)
                    {
                        inputParamGroups[type] = new List <string>();
                    }
                    inputParamGroups[type].Add(s);
                }
            }
            picker.AddTab("Input Type", inputParamGroups);

            //Group by outpu parameter type
            Dictionary <string, List <string> > outputParamGroups = new Dictionary <string, List <string> >();

            foreach (string s in names)
            {
                foreach (string type in TriggerSystemMain.mTriggerDefinitions.GetOutputTypesUsed(s))
                {
                    if (outputParamGroups.ContainsKey(type) == false)
                    {
                        outputParamGroups[type] = new List <string>();
                    }
                    outputParamGroups[type].Add(s);
                }
            }
            picker.AddTab("Output Type", outputParamGroups);

            //Group by input parameter type
            Dictionary <string, List <string> > allParamGroups = new Dictionary <string, List <string> >();

            foreach (string s in names)
            {
                foreach (string type in TriggerSystemMain.mTriggerDefinitions.GetInputTypesUsed(s))
                {
                    if (allParamGroups.ContainsKey(type) == false)
                    {
                        allParamGroups[type] = new List <string>();
                    }
                    allParamGroups[type].Add(s);
                }
                foreach (string type in TriggerSystemMain.mTriggerDefinitions.GetOutputTypesUsed(s))
                {
                    if (allParamGroups.ContainsKey(type) == false)
                    {
                        allParamGroups[type] = new List <string>();
                    }
                    allParamGroups[type].Add(s);
                }
            }
            picker.AddTab("Type", allParamGroups);

            PopupEditor pe = new PopupEditor();

            picker.Height += 100;
            picker.Width  += 50;
            mpe            = pe.ShowPopup(this, picker);
        }