예제 #1
0
    public static void RegisterDockablePane(this UIControlledApplication application,
        Guid id, string title,FrameworkElement dockElement, DockablePaneState state )
    {
        var dPid = new DockablePaneId(id);

        var dataProvider = new DockablePaneProviderData {FrameworkElement = dockElement,InitialState = state};
        IDockablePaneProvider provider = new DockPageProvider(dataProvider);
        application.RegisterDockablePane(dPid, title, provider);
    }
예제 #2
0
 /// <summary>
 /// Display docking state information as a string.
 /// </summary>
 public static string GetDockStateSummary(DockablePaneState paneState)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder();
     sb.AppendLine(" -DockablePaneState-");
     sb.AppendLine(" Left: " + paneState.FloatingRectangle.Left.ToString());
     sb.AppendLine(" Right: " + paneState.FloatingRectangle.Right.ToString());
     sb.AppendLine(" Top: " + paneState.FloatingRectangle.Top.ToString());
     sb.AppendLine(" Bottom: " + paneState.FloatingRectangle.Bottom.ToString());
     sb.AppendLine(" Position: " + paneState.DockPosition.ToString());
     sb.AppendLine(" Tab target guid:" + paneState.TabBehind.Guid.ToString());
     return(sb.ToString());
 }
예제 #3
0
        public Result OnStartup(UIControlledApplication application)
        {
            var container = CommandContainer.Instance();
            if (container.Valid)
            {
                container.BuildRibbon(application);
            }

            var dPid = new DockablePaneId(DockConstants.Id);
            if (!DockablePane.PaneIsRegistered(dPid))
            {
                var state = new DockablePaneState {DockPosition = DockPosition.Right};
                var element = new DockPage();
                application.RegisterDockablePane(DockConstants.Id, DockConstants.Name, element, state);
            }

            return Result.Succeeded;
        }
예제 #4
0
        // view activated event
        //public void Application_ViewActivated(object sender, ViewActivatedEventArgs e)
        //{
        //    // provide ExternalCommandData object to dockable page
        //    dockableWindow.CustomInitiator(edata);

        //}

        //// document opened event
        //private void Application_DocumentOpened(object sender, Autodesk.Revit.DB.Events.DocumentOpenedEventArgs e)
        //{
        //    // provide ExternalCommandData object to dockable page
        //    dockableWindow.CustomInitiator(edata);
        //}

        public Result Execute(UIApplication app)
        {
            var data   = new DockablePaneProviderData();
            var Viewer = new UI.Viewer();

            data.FrameworkElement = Viewer as FrameworkElement;

            // Setup initial state.
            var state = new DockablePaneState
            {
                DockPosition = DockPosition.Right,
            };

            var dpid = new DockablePaneId(new Guid("{ecea6d2f-533c-4e9d-a439-1c025aa0faee}"));

            app.RegisterDockablePane(dpid, "Crash Viewer", Viewer as IDockablePaneProvider);
            return(Result.Succeeded);
        }
예제 #5
0
        ///// <summary>
        ///// Executes the specified command data.
        ///// </summary>
        ///// <param name="commandData">The command data.</param>
        ///// <param name="message">The message.</param>
        ///// <param name="elements">The elements.</param>
        ///// <returns></returns>
        //public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        //{
        //    return Execute(commandData.Application);
        //}

        /// <summary>
        /// Register dockable pane.
        /// </summary>
        /// <param name="uIApplication">The u i application.</param>
        /// <returns></returns>
        public Result Execute(UIApplication uIApplication)
        {
            var data        = new DockablePaneProviderData();
            var managerPage = new FamilyManagerMainPage();

            data.FrameworkElement = managerPage as FrameworkElement;

            // Setup initial state.
            var state = new DockablePaneState
            {
                DockPosition = DockPosition.Right,
            };

            // Use unique guid identifier for this dockable pane.
            var dpid = new DockablePaneId(PaneIdentifiers.GetManagerPaneIdentifier());

            // Register pane.
            uIApplication.RegisterDockablePane(dpid, "Family Manager", managerPage as IDockablePaneProvider);

            return(Result.Succeeded);
        }
예제 #6
0
        public Result OnStartup(UIControlledApplication application)
        {
            var container = CommandContainer.Instance();

            if (container.Valid)
            {
                container.BuildRibbon(application);
            }

            var dPid = new DockablePaneId(DockConstants.Id);

            if (!DockablePane.PaneIsRegistered(dPid))
            {
                var state = new DockablePaneState {
                    DockPosition = DockPosition.Right
                };
                var element = new DockPage();
                application.RegisterDockablePane(DockConstants.Id, DockConstants.Name, element, state);
            }


            return(Result.Succeeded);
        }
예제 #7
0
    public static void RegisterDockablePane(this UIControlledApplication application,
                                            Guid id, string title, FrameworkElement dockElement, DockablePaneState state)
    {
        var dPid = new DockablePaneId(id);

        var dataProvider = new DockablePaneProviderData {
            FrameworkElement = dockElement, InitialState = state
        };
        IDockablePaneProvider provider = new DockPageProvider(dataProvider);

        application.RegisterDockablePane(dPid, title, provider);
    }