Exemplo n.º 1
0
        private System.IO.TextWriter m_textWriter;  //Used to re-route any standard IO to the WPF UI.


        #endregion

        /// <summary>
        /// Called by Revit to initialize dockable pane settings set in DockingSetupDialog.
        /// </summary>
        /// <param name="data"></param>
        public void SetupDockablePane(Autodesk.Revit.UI.DockablePaneProviderData data)
        {
            data.FrameworkElement = this as FrameworkElement;
            DockablePaneProviderData d = new DockablePaneProviderData();


            data.InitialState = new Autodesk.Revit.UI.DockablePaneState();
            data.InitialState.DockPosition = m_position;
            DockablePaneId targetPane;

            if (m_targetGuid == Guid.Empty)
            {
                targetPane = null;
            }
            else
            {
                targetPane = new DockablePaneId(m_targetGuid);
            }
            if (m_position == DockPosition.Tabbed)
            {
                data.InitialState.TabBehind = targetPane;
            }


            if (m_position == DockPosition.Floating)
            {
                data.InitialState.SetFloatingRectangle(new Autodesk.Revit.UI.Rectangle(m_left, m_top, m_right, m_bottom));
            }

            Log.Message("***Intial docking parameters***");
            Log.Message(APIUtility.GetDockStateSummary(data.InitialState));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add UI for registering, showing, and hiding dockable panes.
        /// </summary>
        public Result OnStartup(UIControlledApplication application)
        {
            thisApp      = this;
            m_APIUtility = new APIUtility();

            application.CreateRibbonTab(Globals.DiagnosticsTabName);
            RibbonPanel panel = application.CreateRibbonPanel(Globals.DiagnosticsTabName, Globals.DiagnosticsPanelName);

            panel.AddSeparator();

            PushButtonData pushButtonRegisterPageData = new PushButtonData(Globals.RegisterPage, Globals.RegisterPage,
                                                                           FileUtility.GetAssemblyFullName(), typeof(ExternalCommandRegisterPage).FullName);

            pushButtonRegisterPageData.LargeImage = new BitmapImage(new Uri(FileUtility.GetApplicationResourcesPath() + "Register.png"));
            PushButton pushButtonRegisterPage = panel.AddItem(pushButtonRegisterPageData) as PushButton;

            pushButtonRegisterPage.AvailabilityClassName = typeof(ExternalCommandRegisterPage).FullName;


            PushButtonData pushButtonShowPageData = new PushButtonData(Globals.ShowPage, Globals.ShowPage, FileUtility.GetAssemblyFullName(), typeof(ExternalCommandShowPage).FullName);

            pushButtonShowPageData.LargeImage = new BitmapImage(new Uri(FileUtility.GetApplicationResourcesPath() + "Show.png"));
            PushButton pushButtonShowPage = panel.AddItem(pushButtonShowPageData) as PushButton;

            pushButtonShowPage.AvailabilityClassName = typeof(ExternalCommandShowPage).FullName;


            PushButtonData pushButtonHidePageData = new PushButtonData(Globals.HidePage, Globals.HidePage, FileUtility.GetAssemblyFullName(), typeof(ExternalCommandHidePage).FullName);

            pushButtonHidePageData.LargeImage = new BitmapImage(new Uri(FileUtility.GetApplicationResourcesPath() + "Hide.png"));
            PushButton pushButtonHidePage = panel.AddItem(pushButtonHidePageData) as PushButton;

            pushButtonHidePage.AvailabilityClassName = typeof(ExternalCommandHidePage).FullName;

            return(Result.Succeeded);
        }