Beispiel #1
0
        public Result OnStartup(UIControlledApplication a)
        {
            ParentSupportMethods myParentSupportMethods = new ParentSupportMethods();

            myParentSupportMethods.myTA = this;

            string stringCommand01Button = "Set Development Path Root";

            Properties.Settings.Default.AssemblyNeedLoading = true;
            Properties.Settings.Default.Save();

            String exeConfigPath = Path.GetDirectoryName(path) + "\\" + dllName + ".dll";

            a.CreateRibbonTab(TabName);
            RibbonPanelCurrent = a.CreateRibbonPanel(TabName, PanelName);

            PushButtonData myPushButtonData01 = new PushButtonData(stringCommand01Button, stringCommand01Button, exeConfigPath, dllName + ".InvokeSetDevelopmentPath");

            ComboBoxData cbData = new ComboBoxData("DeveloperSwitch")
            {
                ToolTip = "Select an Option", LongDescription = "Select a number or letter"
            };
            ComboBox ComboBox01 = RibbonPanelCurrent.AddStackedItems(cbData, myPushButtonData01)[0] as ComboBox;

            string stringProductVersion = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Pedersen Read Limited\\cSharpPlaypen joshnewzealand").GetValue("ProductVersion").ToString();

            //Bug fix here by Max Sun (01/05/19)

            ComboBox01.AddItem(new ComboBoxMemberData("Release", "Release: " + stringProductVersion));
            ComboBox01.AddItem(new ComboBoxMemberData("Development", "C# Developer Mode"));
            ComboBox01.CurrentChanged += new EventHandler <Autodesk.Revit.UI.Events.ComboBoxCurrentChangedEventArgs>(SwitchBetweenDeveloperAndRelease);

            //RibbonPanelCurrent.AddItem(myParentSupportMethods.myPushButton_01(Button_01, path));
            RibbonPanelCurrent.AddItem(myParentSupportMethods.Button01_Start("Button01_Start", Button01_Start, path));
            RibbonPanelCurrent.AddItem(myParentSupportMethods.Button02_DrawWallTypes("Button02_DrawWallTypes", Button02_DrawWallTypes, path));
            RibbonPanelCurrent.AddItem(myParentSupportMethods.Button03_SetDefault("Button03_SetDefault", Button03_SetDefault, path));
            RibbonPanelCurrent.AddItem(myParentSupportMethods.Button04_ManualOverrideColor("Button04_ManualOverrideColor", Button04_ManualOverrideColor, path));
            RibbonPanelCurrent.AddItem(myParentSupportMethods.Button07_ExtensibleStorage("Button07_ExtensibleStorage", Button07_ExtensibleStorage, path));

            PushButtonData myPushButtonData_OneClickBackup   = myParentSupportMethods.Button15_SingleClickFamilyBackup("Button15_SingleClickFamilyBackup", Button15_SingleClickFamilyBackup, path);
            PushButtonData myPushButtonData_OpenBackupFolder = new PushButtonData("Button15_OpenBackupFolder", "Open Backup Folder", exeConfigPath, dllName + ".InvokeOpenBackupFolder");

            SplitButtonData sb1 = new SplitButtonData("OneClickBackupSystem", "One Click Backup System");
            SplitButton     sb  = RibbonPanelCurrent.AddItem(sb1) as SplitButton;

            sb.AddPushButton(myPushButtonData_OneClickBackup);
            sb.AddPushButton(myPushButtonData_OpenBackupFolder);
            sb.IsSynchronizedWithCurrentItem = false;



            RibbonPanelCurrent.AddItem(myParentSupportMethods.Button1617_AddEditParameters("Button1617_AddEditParameters", Button1617_AddEditParameters, path));
            RibbonPanelCurrent.AddItem(myParentSupportMethods.Button1819_UnderstandingTransforms("Button1819_UnderstandingTransforms", Button1819_UnderstandingTransforms, path));
            RibbonPanelCurrent.AddItem(myParentSupportMethods.Button02_Uninstall("Button_02_Uninstall", Button_02_Uninstall, path));

            //PRLChecklistsPanel2.Visible = false;
            //RibbonPanel PRLChecklistsPanel2 = a.CreateRibbonPanel(TabName, PanelTransferring);
            //myParentSupportMethods.PlaceButtonOnModifyRibbon();
            return(Result.Succeeded);
        }
        public Result OnStartup(UIControlledApplication a)
        {
            ParentSupportMethods myParentSupportMethods = new ParentSupportMethods();

            myParentSupportMethods.myTA = this;

            string stringCommand01Button = "Set Development Path Root";

            Properties.Settings.Default.AssemblyNeedLoading = true;
            Properties.Settings.Default.Save();

            String exeConfigPath = Path.GetDirectoryName(path) + "\\" + dllName + ".dll";

            a.CreateRibbonTab(TabName);
            RibbonPanelCurrent = a.CreateRibbonPanel(TabName, PanelName);

            PushButtonData myPushButtonData01 = new PushButtonData(stringCommand01Button, stringCommand01Button, exeConfigPath, dllName + ".InvokeSetDevelopmentPath");

            ComboBoxData cbData = new ComboBoxData("DeveloperSwitch")
            {
                ToolTip = "Select an Option", LongDescription = "Select a number or letter"
            };
            ComboBox ComboBox01 = RibbonPanelCurrent.AddStackedItems(cbData, myPushButtonData01)[0] as ComboBox;


            string stringProductVersion = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Default Company Name\\CSharp PLAYPEN II Google 'Josh API Revit'").GetValue("ProductVersion").ToString();

            //Bug fix here by Max Sun (01/05/19)

            ComboBox01.AddItem(new ComboBoxMemberData("Release", "Release: " + stringProductVersion));
            ComboBox01.AddItem(new ComboBoxMemberData("Development", "C# Developer Mode"));
            ComboBox01.CurrentChanged += new EventHandler <Autodesk.Revit.UI.Events.ComboBoxCurrentChangedEventArgs>(SwitchBetweenDeveloperAndRelease);

            RibbonPanelCurrent.AddItem(myParentSupportMethods.myPushButton_01(Button_01, path));
            RibbonPanelCurrent.AddItem(myParentSupportMethods.myPushButton_02(Button_02, path));
            RibbonPanel PRLChecklistsPanel2 = a.CreateRibbonPanel(TabName, PanelTransferring);

            //PRLChecklistsPanel2.Visible = false;

            myParentSupportMethods.PlaceButtonOnModifyRibbon();
            return(Result.Succeeded);
        }