示例#1
0
        /// <summary>
        ///     Adds an environment and it's resources to the tree
        /// </summary>
        public void AddEnvironment(IEnvironmentModel environment)
        {
            VerifyArgument.IsNotNull("environment", environment);
            var environmentId = environment.ID;

            StudioResourceRepository.AddServerNode(new ExplorerItemModel(_connectControlSingleton, StudioResourceRepository)
            {
                ResourcePath  = "",
                DisplayName   = environment.Name,
                ResourceType  = ResourceType.Server,
                EnvironmentId = environment.ID,
                IsConnected   = false,
            });

            if (Environments.All(e => e.ID != environmentId))
            {
                Environments.Add(environment);
            }

            UpdateNavigationView();

            if (environment.Equals(EnvironmentRepository.Source) && environment.Connection != null)
            {
                environment.Connection.StartAutoConnect();
            }
        }
示例#2
0
            /// <summary>
            /// Adds an event to the appropriate list for its type; returns the event.
            /// </summary>
            public Event Add(Event evnt)
            {
                switch (evnt)
                {
                case Event.Light e: Lights.Add(e); break;

                case Event.Sound e: Sounds.Add(e); break;

                case Event.SFX e: SFX.Add(e); break;

                case Event.Wind e: Wind.Add(e); break;

                case Event.Treasure e: Treasures.Add(e); break;

                case Event.Generator e: Generators.Add(e); break;

                case Event.Message e: Messages.Add(e); break;

                case Event.ObjAct e: ObjActs.Add(e); break;

                case Event.SpawnPoint e: SpawnPoints.Add(e); break;

                case Event.MapOffset e: MapOffsets.Add(e); break;

                case Event.Navmesh e: Navmeshes.Add(e); break;

                case Event.Environment e: Environments.Add(e); break;

                case Event.PseudoMultiplayer e: PseudoMultiplayers.Add(e); break;

                default:
                    throw new ArgumentException($"Unrecognized type {evnt.GetType()}.", nameof(evnt));
                }
                return(evnt);
            }
        private void CreateRibbon()
        {
            try
            {
                Inventor.UserInterfaceManager userInterFaceMgr = mInventorApp.UserInterfaceManager;
                userInterFaceMgr.UserInterfaceEvents.OnEnvironmentChange += new UserInterfaceEventsSink_OnEnvironmentChangeEventHandler(OnEnvironmentChange);

                //retrieve the GUID for this class
                GuidAttribute addInCLSID = (GuidAttribute)GuidAttribute.GetCustomAttribute(typeof(RubiksCube.RubiksAddInServer), typeof(GuidAttribute));
                string        clientId   = "{" + addInCLSID.Value + "}";

                Icon         appLarge     = Resources.Rubiks_Cube_32;
                object       applargeIcon = AxHostConverter.ImageToPictureDisp(appLarge.ToBitmap());
                Icon         appStand     = Resources.Rubiks_Cube_16;
                object       appStandIcon = AxHostConverter.ImageToPictureDisp(appStand.ToBitmap());
                Environments envs         = userInterFaceMgr.Environments;
                mEnvironment = envs.Add(Resources.IDC_ENV_DISPLAY_NAME, Resources.IDC_ENV_INTERNAL_NAME, null, appStandIcon, applargeIcon);
                mEnvironment.AdditionalVisibleRibbonTabs = new string[] { Resources.IDC_ENV_INTERNAL_NAME };

                mObjCollection = mInventorApp.TransientObjects.CreateObjectCollection();

                //get the ribbon associated with part document
                Inventor.Ribbons ribbons = userInterFaceMgr.Ribbons;
                mPartRibbon = ribbons[Resources.IDC_ENV_PART];

                //get the tabs associated with part ribbon
                Inventor.RibbonTabs rubikRibbonTabs = mPartRibbon.RibbonTabs;
                mRubiksPartTab = rubikRibbonTabs.Add(Resources.IDC_TAB_DISPLAY_NAME, Resources.IDC_TAB_INTERNAL_NAME, "F0911DF2-478B-49EC-808D-D7C1F5271B6D", Resources.IDC_TARGET_TAB_NAME, true, true);

                //Adding solve Panel.
                RibbonPanel             solvePanel   = mRubiksPartTab.RibbonPanels.Add(Resources.IDC_SOLVE_DISPLAY_NAME, Resources.IDC_SOLVE_INTERNAL_NAME, "60A50C33-F7EE-4B74-BCB0-C5CE03C1B3E6");
                Inventor.CommandControl solveControl = solvePanel.CommandControls.AddButton(mSolve, true, true);

                //Adding randomize Panel.
                RibbonPanel             scramblePanel   = mRubiksPartTab.RibbonPanels.Add(Resources.IDC_SCRAMBLE_DISPLAY_NAME, Resources.IDC_SCRAMBLE_INTERNAL_NAME, "D20674CE-A855-4403-850B-FDE59C4A167B");
                Inventor.CommandControl scrambleControl = scramblePanel.CommandControls.AddButton(mScramble, true, true);

                //Adding randomize Panel.
                RibbonPanel playPanel = mRubiksPartTab.RibbonPanels.Add(Resources.IDC_PLAY_DISPLAY_NAME, Resources.IDC_PLAY_INTERNAL_NAME, "343D703C-1194-4715-BF54-3BE4E3B9FF64");
                //Inventor.CommandControl playControl = playPanel.CommandControls.AddButton(mPlay, true, true, "", false);

                mObjCollection.Add(mPlay);
                mObjCollection.Add(mNext);
                CommandControl partCmdCtrl = playPanel.CommandControls.AddSplitButtonMRU(mObjCollection, true);

                mEnvironment.DefaultRibbonTab = Resources.IDC_TAB_INTERNAL_NAME;
                userInterFaceMgr.ParallelEnvironments.Add(mEnvironment);
                mEnvCtrlDef = mInventorApp.CommandManager.ControlDefinitions[Resources.IDC_ENV_INTERNAL_NAME];
                mEnvCtrlDef.ProgressiveToolTip.ExpandedDescription = Resources.IDC_APPLICATION_BTN_TOOLTIP_EXPANDED;
                mEnvCtrlDef.ProgressiveToolTip.Description         = Resources.IDC_APPLICATION_BTN_TOOLTIP_DESCRIPTION;
                mEnvCtrlDef.ProgressiveToolTip.Title = Resources.IDC_APPLICATION_BTN_TITLE;

                AddToDisabledList();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.InnerException.Message);
            }
        }
示例#4
0
        public ExportWindowViewModel(ICollection <EnvironmentViewModel> environments) : this()
        {
            var converter = new EnvironmentExportConverter();

            foreach (var environment in environments)
            {
                var converted = converter.From(environment);
                Environments.Add(converted);
            }
        }
 public TestLoadEnvironmentRespository(IEnvironmentModel source, params IEnvironmentModel[] environments)
     : base(source)
 {
     if (environments != null)
     {
         foreach (var environment in environments)
         {
             Environments.Add(environment);
         }
     }
 }
示例#6
0
 void ValidateEnvironments(IShellViewModel shellViewModel)
 {
     foreach (var env in shellViewModel?.ExplorerViewModel?.Environments)
     {
         var exists = Environments.FirstOrDefault(model => model.ResourceId == env.ResourceId);
         if (env.IsConnected && exists == null)
         {
             Environments.Add(env);
         }
     }
 }
示例#7
0
 public TestLoadServerRespository(IServer source, params IServer[] environments)
     : base(source)
 {
     if (environments != null)
     {
         foreach (var environment in environments)
         {
             Environments.Add(environment);
         }
     }
 }
示例#8
0
        private ApplicationEnvironment AddEnvironment(string name, bool isDefault)
        {
            Guard.IsNotNull(Environments);
            Guard.IsFalse(Environments.Any(x => x.Name == name), "This environment already exits");

            var environment = ApplicationEnvironment.NewEnv(Id, name, isDefault);


            Environments.Add(environment);

            return(environment);
        }
示例#9
0
        void ExecEnvClone()
        {
            if (!(EnvList.SelectedItem is Environment senv))
            {
                return;
            }

            var name = senv.Name;

            if (Environments.Any(e => e.IsLocal && (e.Name.Equals(name, StringComparison.OrdinalIgnoreCase))))
            {
                var ibox = new InputBox("New environment name:", "Clone Environment", name + " - Copy");

                ibox.Closing += (sender, args) => {
                    var ib = (InputBox)sender;

                    if (ib.DialogResult != true)
                    {
                        return;
                    }

                    name = ib.Text.Trim();
                    if (Environments.Any(e => e.IsLocal && (e.Name.Equals(name, StringComparison.OrdinalIgnoreCase))))
                    {
                        MessageBox.Show(
                            $"Environment '{name}' already exists.\nPlease choose a different name.",
                            Strings.APP_NAME,
                            MessageBoxButton.OK,
                            MessageBoxImage.Error
                            );
                        args.Cancel = true;
                    }
                    ;
                };

                if (ibox.ShowDialog() != true)
                {
                    return;
                }
            }

            var nenv = senv.Clone(name);

            nenv.Dirty = true;
            nenv.Save();

            Environments.Add(nenv);
            EnvList.SelectedItem = Environments.First(e => e.Id == nenv.Id);
        }
示例#10
0
        public AppFunc AppFuncBuilder(AppFunc next)
        {
            ++AppFuncBuilderCallCount;

            #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
            return(async(IDictionary <string, object> environment) => {
                Environments.Add(environment);
                Nexts.Add(next);

                Action?.Invoke();

                if (ChainToNextAppFunc)
                {
                    next(environment).Wait();
                }
            });
        }
示例#11
0
 protected void btnAdd_Click(Object Sender, EventArgs e)
 {
     if (Request.Form[hdnId.UniqueID] == "0")
     {
         oEnvironment.Add(txtName.Text, (chkForecast.Checked ? 1 : 0), (chkEcom.Checked ? 1 : 0), txtNCBDomain.Text, txtPNCDomain.Text, (chkEnabled.Checked ? 1 : 0));
     }
     else
     {
         oEnvironment.Update(Int32.Parse(Request.Form[hdnId.UniqueID]), txtName.Text, (chkForecast.Checked ? 1 : 0), (chkEcom.Checked ? 1 : 0), txtNCBDomain.Text, txtPNCDomain.Text, (chkEnabled.Checked ? 1 : 0));
     }
     if (Request.Form[hdnOrder.UniqueID] != "")
     {
         string strOrder = Request.Form[hdnOrder.UniqueID];
         int    intCount = 0;
         while (strOrder != "")
         {
             intCount++;
             int intId = Int32.Parse(strOrder.Substring(0, strOrder.IndexOf("&")));
             strOrder = strOrder.Substring(strOrder.IndexOf("&") + 1);
             oEnvironment.UpdateOrder(intId, intCount);
         }
     }
     Response.Redirect(Request.Path);
 }
 public void AddMockEnvironment(IEnvironmentModel environmentToAdd)
 {
     Environments.Add(environmentToAdd);
 }
示例#13
0
        /// <summary>
        /// Sets up the form
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {
            //setup for testing
            CoreExtensions.Host.InitializeService();
            //get the test suite
            TestSuite suite = TestUtility.GetTestSuite(Constants.DefaultWebTestAssembly);

            //get dictionaries for forms and querying
            foreach (TestMethod tm in suite.GetMethods())
            {
                Methods.Add(tm.TestName.FullName, tm);
            }
            foreach (TestFixture tf in suite.GetFixtures())
            {
                Fixtures.Add(tf.ClassName, tf);
            }
            foreach (TestEnvironment t in EnvironmentProvider.GetEnvironments().OrderBy(a => a.Name))
            {
                Environments.Add(t.ID, t);
            }
            foreach (TestSystem tsys in SystemProvider.GetSystems().OrderBy(a => a.Name))
            {
                Systems.Add(tsys.ID, tsys);
            }
            foreach (TestSite ts in SiteProvider.GetEnabledSites().OrderBy(a => a.SystemID).ThenBy(a => a.Name))
            {
                try {
                    Sites.Add(ts.ID, ts);
                } catch (ArgumentException aex) {
                    throw new ArgumentException(string.Format("This key has already been added: {0}-{1}", ts.SystemID, ts.Name));
                }
            }

            ltlResults.Text = string.Empty;             //reset output
            ltlError.Text   = string.Empty;
            ltlLog.Text     = string.Empty;

            if (!IsPostBack)               //setup form
            {
                foreach (KeyValuePair <string, TestFixture> kvp in Fixtures)
                {
                    ListItem li = new ListItem(TestUtility.GetClassName(kvp.Value.ClassName), kvp.Value.TestName.FullName);
                    cblTests.Items.Add(li);
                }
                foreach (KeyValuePair <int, TestEnvironment> ekvp in Environments)
                {
                    ListItem li = new ListItem(ekvp.Value.Name, ekvp.Key.ToString());
                    cblEnv.Items.Add(li);
                }
                foreach (KeyValuePair <int, TestSystem> sykvp in Systems)
                {
                    ListItem li = new ListItem(sykvp.Value.Name, sykvp.Value.Name);
                    cblSystems.Items.Add(li);
                }
                foreach (KeyValuePair <int, TestSite> skvp in Sites)
                {
                    ListItem li = new ListItem(string.Format("{1}<span class='systemName'>{0}</span>", Systems[skvp.Value.SystemID].Name, skvp.Value.Name), skvp.Key.ToString());
                    li.Attributes.Add("class", Systems[skvp.Value.SystemID].Name);
                    cblSites.Items.Add(li);
                }
            }
            else
            {
                foreach (ListItem li in cblSites.Items)                   //css classes get lost on postback
                {
                    li.Attributes.Add("class", Systems[Sites[int.Parse(li.Value)].SystemID].Name);
                }
            }
        }
示例#14
0
 public void Add(HostEnvironment environment)
 {
     Environments.Add(environment);
 }
示例#15
0
        private async Task LoadAsync()
        {
            try
            {
                ObservableCollection <Heritage> heritages = await HeritageAPIService.GetAsyncHeritages(CurrentUser.CompanyId);

                Heritages.Clear();

                foreach (Heritage heritage in heritages)
                {
                    Heritages.Add(heritage);
                }

                IsBusy = true;
            }
            catch (Exception ex)
            {
                DialogParameters param = new DialogParameters
                {
                    { "Message", "Erro ao carregar patrimônios" },
                    { "Title", "Erro" },
                    { "Icon", IconTheme.IconName("bug") }
                };

                DialogService.ShowDialog("DialogPage", param, CloseDialogCallback);
                Console.WriteLine($"Ocorreu um erro ao baixar os dados: {ex.Message}, Página: Patrimônios");
            }
            finally
            {
                IsBusy = false;
            }

            try
            {
                ObservableCollection <Environment> environments = await HeritageAPIService.GetAsyncEnvironments(CurrentUser.CompanyId);

                Environments.Clear();

                foreach (Environment environment in environments)
                {
                    Environments.Add(environment);
                }

                IsBusy = true;
            }
            catch (Exception ex)
            {
                DialogParameters param = new DialogParameters
                {
                    { "Message", "Erro ao carregar ambientes" },
                    { "Title", "Erro" },
                    { "Icon", IconTheme.IconName("bug") }
                };

                DialogService.ShowDialog("DialogPage", param, CloseDialogCallback);

                Console.WriteLine($"Ocorreu um erro ao baixar os dados: {ex.Message}, Página: Ambientes");
            }
            finally
            {
                IsBusy = false;
            }

            try
            {
                ObservableCollection <User> users = await HeritageAPIService.GetAsyncUsers(CurrentUser.CompanyId);

                Users.Clear();

                foreach (User user in users)
                {
                    if (user.UserLevel == 1)
                    {
                        user.UserLevelDescription = "Administrador";
                    }
                    else if (user.UserLevel == 2)
                    {
                        user.UserLevelDescription = "Gerenciador";
                    }
                    else if (user.UserLevel == 3)
                    {
                        user.UserLevelDescription = "Suporte";
                    }

                    if (CurrentUser.Id != user.Id)
                    {
                        Users.Add(user);
                    }
                }
            }
            catch (Exception ex)
            {
                DialogParameters param = new DialogParameters
                {
                    { "Message", "Erro ao carregar usuários" },
                    { "Title", "Erro" },
                    { "Icon", IconTheme.IconName("bug") }
                };

                DialogService.ShowDialog("DialogPage", param, CloseDialogCallback);

                Console.WriteLine($"Ocorreu um erro ao baixar os dados: {ex.Message}, Página: Usuários");
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#16
0
 public void AddEnvironment(string env)
 {
     Environments.Add(env);
 }
示例#17
0
            internal override Event ReadEntry(BinaryReaderEx br)
            {
                EventType type = br.GetEnum32 <EventType>(br.Position + 8);

                switch (type)
                {
                case EventType.Light:
                    var light = new Event.Light(br);
                    Lights.Add(light);
                    return(light);

                case EventType.Sound:
                    var sound = new Event.Sound(br);
                    Sounds.Add(sound);
                    return(sound);

                case EventType.SFX:
                    var sfx = new Event.SFX(br);
                    SFXs.Add(sfx);
                    return(sfx);

                case EventType.WindSFX:
                    var windSFX = new Event.WindSFX(br);
                    WindSFXs.Add(windSFX);
                    return(windSFX);

                case EventType.Treasure:
                    var treasure = new Event.Treasure(br);
                    Treasures.Add(treasure);
                    return(treasure);

                case EventType.Generator:
                    var generator = new Event.Generator(br);
                    Generators.Add(generator);
                    return(generator);

                case EventType.Message:
                    var message = new Event.Message(br);
                    Messages.Add(message);
                    return(message);

                case EventType.ObjAct:
                    var objAct = new Event.ObjAct(br);
                    ObjActs.Add(objAct);
                    return(objAct);

                case EventType.SpawnPoint:
                    var spawnPoint = new Event.SpawnPoint(br);
                    SpawnPoints.Add(spawnPoint);
                    return(spawnPoint);

                case EventType.MapOffset:
                    var mapOffset = new Event.MapOffset(br);
                    MapOffsets.Add(mapOffset);
                    return(mapOffset);

                case EventType.Navmesh:
                    var navmesh = new Event.Navmesh(br);
                    Navmeshes.Add(navmesh);
                    return(navmesh);

                case EventType.Environment:
                    var environment = new Event.Environment(br);
                    Environments.Add(environment);
                    return(environment);

                case EventType.PseudoMultiplayer:
                    var pseudoMultiplayer = new Event.PseudoMultiplayer(br);
                    PseudoMultiplayers.Add(pseudoMultiplayer);
                    return(pseudoMultiplayer);

                default:
                    throw new NotImplementedException($"Unsupported event type: {type}");
                }
            }
示例#18
0
        /// <summary>
        /// Called when the <see cref="StandardAddInServer"/> is being loaded
        /// </summary>
        /// <param name="AddInSiteObject"></param>
        /// <param name="FirstTime"></param>
        public void Activate(ApplicationAddInSite AddInSiteObject, bool FirstTime)
        {
            MainApplication = AddInSiteObject.Application; //Gets the application object, which is used in many different ways throughout this whole process
            string ClientID = "{0c9a07ad-2768-4a62-950a-b5e33b88e4a3}";

            Utilities.LoadSettings();

            #region Add Parallel Environment

            #region Load Images

            stdole.IPictureDisp ExportRobotIconSmall = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.SynthesisLogo16));
            stdole.IPictureDisp ExportRobotIconLarge = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.SynthesisLogo32));

            stdole.IPictureDisp SaveRobotIconSmall = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Save16));
            stdole.IPictureDisp SaveRobotIconLarge = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Save32));

            stdole.IPictureDisp ExportSetupRobotIconSmall = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Gears16));
            stdole.IPictureDisp ExportSetupRobotIconLarge = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Gears32));

            stdole.IPictureDisp YeetRobotIconSmall = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Wand16));//these are still here at request of QA
            stdole.IPictureDisp YeetRobotIconLarge = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Wand32));

            stdole.IPictureDisp WeightRobotIconSmall = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Weight16));
            stdole.IPictureDisp WeightRobotIconLarge = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Weight32));

            stdole.IPictureDisp SynthesisLogoSmall = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.SynthesisLogo16));
            stdole.IPictureDisp SynthesisLogoLarge = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.SynthesisLogo32));

            #region DEBUG
#if DEBUG
            stdole.IPictureDisp DebugButtonSmall = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Wand16));
            stdole.IPictureDisp DebugButtonLarge = PictureDispConverter.ToIPictureDisp(new Bitmap(Resource.Wand32));
#endif
            #endregion

            #endregion

            #region UI Creation

            #region Setup New Environment and Ribbon
            Environments environments = MainApplication.UserInterfaceManager.Environments;
            ExporterEnv = environments.Add("Robot Exporter", "BxD:RobotExporter:Environment", null, SynthesisLogoSmall, SynthesisLogoLarge);

            Ribbon    assemblyRibbon = MainApplication.UserInterfaceManager.Ribbons["Assembly"];
            RibbonTab ExporterTab    = assemblyRibbon.RibbonTabs.Add("Robot Exporter", "BxD:RobotExporter:RobotExporterTab", ClientID, "", false, true);

            ControlDefinitions ControlDefs = MainApplication.CommandManager.ControlDefinitions;

            SetupPanel    = ExporterTab.RibbonPanels.Add("Start Over", "BxD:RobotExporter:SetupPanel", ClientID);
            SettingsPanel = ExporterTab.RibbonPanels.Add("Settings", "BxD:RobotExporter:SettingsPanel", ClientID);
            FilePanel     = ExporterTab.RibbonPanels.Add("File", "BxD:RobotExporter:FilePanel", ClientID);

            // Reset positioning of panels
            SettingsPanel.Reposition("BxD:RobotExporter:SetupPanel", false);
            FilePanel.Reposition("BxD:RobotExporter:SettingsPanel", false);
            #endregion

            #region Setup Buttons
            //Begin Wizard Export
            WizardExportButton            = ControlDefs.AddButtonDefinition("Exporter Setup", "BxD:RobotExporter:BeginWizardExport", CommandTypesEnum.kNonShapeEditCmdType, ClientID, null, "Quickly configure wheel and joint information.", ExportSetupRobotIconSmall, ExportSetupRobotIconLarge);
            WizardExportButton.OnExecute += BeginWizardExport_OnExecute;
            WizardExportButton.OnHelp    += _OnHelp;
            SetupPanel.CommandControls.AddButton(WizardExportButton, true);

            //Set Weight
            SetWeightButton            = ControlDefs.AddButtonDefinition("Robot Weight", "BxD:RobotExporter:SetWeight", CommandTypesEnum.kNonShapeEditCmdType, ClientID, null, "Change the weight of the robot.", WeightRobotIconSmall, WeightRobotIconLarge);
            SetWeightButton.OnExecute += SetWeight_OnExecute;
            SetWeightButton.OnHelp    += _OnHelp;
            SettingsPanel.CommandControls.AddButton(SetWeightButton, true);

            //Save Button
            SaveButton            = ControlDefs.AddButtonDefinition("Save Configuration", "BxD:RobotExporter:SaveRobot", CommandTypesEnum.kNonShapeEditCmdType, ClientID, null, "Save robot configuration to your assembly file for future exporting.", SaveRobotIconSmall, SaveRobotIconLarge);
            SaveButton.OnExecute += SaveButton_OnExecute;
            SaveButton.OnHelp    += _OnHelp;
            FilePanel.CommandControls.AddButton(SaveButton, true);

            //Export Button
            ExportButton            = ControlDefs.AddButtonDefinition("Export to Synthesis", "BxD:RobotExporter:ExportRobot", CommandTypesEnum.kNonShapeEditCmdType, ClientID, null, "Export your robot's model to Synthesis.", ExportRobotIconSmall, ExportRobotIconLarge);
            ExportButton.OnExecute += ExportButton_OnExecute;
            ExportButton.OnHelp    += _OnHelp;
            FilePanel.CommandControls.AddButton(ExportButton, true);

            #endregion

            #region DEBUG
#if DEBUG
            DebugPanel = ExporterTab.RibbonPanels.Add("Debug", "BxD:RobotExporter:DebugPanel", ClientID);
            //Selection Test
            DedectionTestButton            = ControlDefs.AddButtonDefinition("Detection Test", "BxD:RobotExporter:DetectionTestButton", CommandTypesEnum.kNonShapeEditCmdType, ClientID, null, null, DebugButtonSmall, DebugButtonLarge);
            DedectionTestButton.OnExecute += delegate(NameValueMap context)
            {
                if (Wizard.WizardUtilities.DetectWheels(Utilities.GUI.SkeletonBase, out List <RigidNode_Base> leftWheels, out List <RigidNode_Base> rightWheels))
                {
                    List <RigidNode_Base> allWheels = new List <RigidNode_Base>();
                    allWheels.AddRange(leftWheels);
                    allWheels.AddRange(rightWheels);
                    SelectNodes(allWheels);
                }
            };
            DebugPanel.CommandControls.AddButton(DedectionTestButton, true);
            //UI Test
            UITestButton            = ControlDefs.AddButtonDefinition("UI Test", "BxD:RobotExporter:UITestButton", CommandTypesEnum.kNonShapeEditCmdType, ClientID, null, null, DebugButtonSmall, DebugButtonLarge);
            UITestButton.OnExecute += delegate(NameValueMap context)
            {
                Wizard.WizardForm wizard = new Wizard.WizardForm();

                wizard.ShowDialog();
                if (Properties.Settings.Default.ShowExportOrAdvancedForm)
                {
                    Form finishDialog = new Wizard.ExportOrAdvancedForm();
                    finishDialog.ShowDialog();
                }
            };
            DebugPanel.CommandControls.AddButton(UITestButton, true);
#endif
            #endregion

            #endregion

            #region Final Environment Setup
            ExporterEnv.DefaultRibbonTab = "BxD:RobotExporter:RobotExporterTab";
            MainApplication.UserInterfaceManager.ParallelEnvironments.Add(ExporterEnv);
            ExporterEnv.DisabledCommandList.Add(MainApplication.CommandManager.ControlDefinitions["BxD:RobotExporter:Environment"]);
            #endregion

            #region Event Handler Assignment
            MainApplication.UserInterfaceManager.UserInterfaceEvents.OnEnvironmentChange += UIEvents_OnEnvironmentChange;
            MainApplication.ApplicationEvents.OnActivateDocument   += ApplicationEvents_OnActivateDocument;
            MainApplication.ApplicationEvents.OnDeactivateDocument += ApplicationEvents_OnDeactivateDocument;
            MainApplication.ApplicationEvents.OnCloseDocument      += ApplicationEvents_OnCloseDocument;
            LegacyInterchange.LegacyEvents.RobotModified           += new Action(() => { PendingChanges = true; });
            #endregion

            #endregion

            Instance = this;
        }
            public void Add(IMsbEvent item)
            {
                switch (item)
                {
                case Event.Light e:
                    Lights.Add(e);
                    break;

                case Event.Sound e:
                    Sounds.Add(e);
                    break;

                case Event.SFX e:
                    SFXs.Add(e);
                    break;

                case Event.WindSFX e:
                    WindSFXs.Add(e);
                    break;

                case Event.Treasure e:
                    Treasures.Add(e);
                    break;

                case Event.Generator e:
                    Generators.Add(e);
                    break;

                case Event.Message e:
                    Messages.Add(e);
                    break;

                case Event.ObjAct e:
                    ObjActs.Add(e);
                    break;

                case Event.SpawnPoint e:
                    SpawnPoints.Add(e);
                    break;

                case Event.MapOffset e:
                    MapOffsets.Add(e);
                    break;

                case Event.Navmesh e:
                    Navmeshes.Add(e);
                    break;

                case Event.Environment e:
                    Environments.Add(e);
                    break;

                case Event.PseudoMultiplayer e:
                    PseudoMultiplayers.Add(e);
                    break;

                default:
                    throw new ArgumentException(
                              message: "Item is not recognized",
                              paramName: nameof(item));
                }
            }