Пример #1
0
        public void Loaded(ViewLoadedParams p)
        {
            if (publishViewModel == null || inviteViewModel == null)
            {
                return;
            }

            publishViewModel.Workspaces            = p.WorkspaceModels;
            publishViewModel.CurrentWorkspaceModel = p.CurrentWorkspaceModel;

            dynamoMenu        = p.dynamoMenu;
            extensionMenuItem = GenerateMenuItem();
            p.AddMenuItem(MenuBarType.File, extensionMenuItem, 11);

            manageCustomizersMenuItem = GenerateManageCustomizersMenuItem();
            p.AddMenuItem(MenuBarType.File, manageCustomizersMenuItem, 12);

            inviteMenuItem = GenerateInviteMenuItem();
            p.AddMenuItem(MenuBarType.File, inviteMenuItem, 11);

            p.AddSeparator(MenuBarType.File, separator, 14);

            p.CurrentWorkspaceChanged += (ws) =>
            {
                publishViewModel.CurrentWorkspaceModel = ws;

                var isEnabled = ws is HomeWorkspaceModel && publishModel.HasAuthProvider;
                extensionMenuItem.IsEnabled = isEnabled;
            };
        }
Пример #2
0
        public void Loaded(ViewLoadedParams p)
        {
            ViewModel  = new TuneUpWindowViewModel(p);
            TuneUpView = new TuneUpWindow(p, UniqueId)
            {
                // Set the data context for the main grid in the window.
                NodeAnalysisTable = { DataContext = ViewModel },
                MainGrid          = { DataContext = ViewModel }
            };

            TuneUpMenuItem = new MenuItem {
                Header = "Show TuneUp", IsCheckable = true, IsChecked = false
            };
            TuneUpMenuItem.Click += (sender, args) =>
            {
                if (TuneUpMenuItem.IsChecked)
                {
                    p.AddToExtensionsSideBar(this, TuneUpView);
                    ViewModel.EnableProfiling();
                }
                else
                {
                    p.CloseExtensioninInSideBar(this);
                }
            };
            p.AddMenuItem(MenuBarType.View, TuneUpMenuItem);
        }
Пример #3
0
        public void Loaded(ViewLoadedParams p)
        {
            // Save a reference to your loaded parameters.
            // You'll need these later when you want to use
            // the supplied workspaces

            sampleMenuItem = new MenuItem {
                Header = "Show View Extension Sample Window"
            };
            sampleMenuItem.Click += (sender, args) =>
            {
                var viewModel = new SampleWindowViewModel(p);
                var window    = new SampleWindow
                {
                    // Set the data context for the main grid in the window.
                    MainGrid = { DataContext = viewModel },

                    // Set the owner of the window to the Dynamo window.
                    Owner = p.DynamoWindow
                };

                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;

                // Show a modeless window.
                window.Show();
            };
            p.AddMenuItem(MenuBarType.View, sampleMenuItem);

            // JL
            this.loadedParams             = p;
            p.DynamoWindow.LayoutUpdated += DynamoWindow_ContentRendered;
        }
Пример #4
0
        public void Loaded(ViewLoadedParams p)
        {
            menuItem = new MenuItem {
                Header = "Browse Warnings..."
            };
            menuItem.Click += (sender, args) =>
            {
                var dynViewModel = p.DynamoWindow.DataContext as DynamoViewModel;
                var viewModel    = new WarningsWindowViewModel(p, dynViewModel);
                var window       = new WarningsWindow
                {
                    // Set the data context for the main grid in the window

                    MainGrid = { DataContext = viewModel },

                    // Set the owner of the window to the Dynamo window

                    Owner = p.DynamoWindow
                };

                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;

                // Show our modeless window

                window.Show();
            };
            p.AddMenuItem(MenuBarType.View, menuItem);
        }
Пример #5
0
        public void Loaded(ViewLoadedParams p)
        {
            ViewModel = new NodePropertyPaletteWindowViewModel(p);
            NodePropertyPaletteView = new NodePropertyPaletteWindow(p, ViewModel)
            {
                // Set the data context for the main grid in the window.
                NodesTable = { DataContext = ViewModel },
                MainGrid   = { DataContext = ViewModel },
                Owner      = p.DynamoWindow
            };

            NodePropertyPaletteMenuItem = new MenuItem {
                Header = "Show NodePropertyPalette", IsCheckable = true, IsChecked = false
            };
            NodePropertyPaletteMenuItem.Click += (sender, args) =>
            {
                if (NodePropertyPaletteMenuItem.IsChecked)
                {
                    p.AddToExtensionsSideBar(this, NodePropertyPaletteView);
                }
                else
                {
                    p.CloseExtensioninInSideBar(this);
                }
            };
            p.AddMenuItem(MenuBarType.View, NodePropertyPaletteMenuItem);
        }
        public void Loaded(ViewLoadedParams p)
        {
            // Specify the text displayed on the menu item
            rechargeMenuItem = new MenuItem {
                Header = "Show View Extension Recharge Window"
            };

            // Define the behavior when menu item is clicked
            rechargeMenuItem.Click += (sender, args) =>
            {
                // Instantiate a viewModel and window
                var viewModel = new RechargeWindowViewModel(p);
                var window    = new RechargeWindow
                {
                    // Set the data context for the main grid in the window
                    // This refers to the main grid also seen in our xaml file
                    MainGrid = { DataContext = viewModel },

                    // Set the owner of the window to the Dynamo window.
                    Owner = p.DynamoWindow
                };

                // Set the window position
                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;

                // Show a modeless window.
                window.Show();
            };

            // add the menu item to our loaded parameters
            p.AddMenuItem(MenuBarType.View, rechargeMenuItem);
        }
        public void Loaded(ViewLoadedParams p)
        {
            menuItem = new MenuItem {
                Header = "Capture Refinery Study..."
            };
            menuItem.Click += (sender, args) =>
            {
                var dynViewModel = p.DynamoWindow.DataContext as DynamoViewModel;
                var viewModel    = new CapturefineryWindowViewModel(p, dynViewModel);
                var window       = new CapturefineryWindow
                {
                    // Set the data context for the main grid in the window

                    MainGrid = { DataContext = viewModel },

                    // Set the owner of the window to the Dynamo window

                    Owner = p.DynamoWindow
                };

                window.Left = window.Owner.Left + window.Owner.Width / 2 - window.Width / 2;
                window.Top  = window.Owner.Top + window.Owner.Height / 2 - window.Height / 2;

                // Show our modeless window

                window.Show();
            };
            p.AddMenuItem(MenuBarType.View, menuItem);
        }
Пример #8
0
        public void Loaded(ViewLoadedParams p)
        {
            Clustering a = new Clustering();

            // Save a reference to your loaded parameters.
            // You'll need these later when you want to use
            // the supplied workspaces

            sampleMenuItem = new MenuItem {
                Header = "Seurat Extension"
            };
            sampleMenuItem.Click += (sender, args) =>
            {
                var dynViewModel = p.DynamoWindow.DataContext as DynamoViewModel;
                var viewModel    = new SeuratExtensionWindowViewModel(p, dynViewModel);
                var window       = new SeuratExtensionWindow
                {
                    // Set the data context for the main grid in the window.
                    MainGrid = { DataContext = viewModel },

                    // Set the owner of the window to the Dynamo window.
                    Owner = p.DynamoWindow
                };

                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;

                // Show a modeless window.
                window.Show();
            };
            p.AddMenuItem(MenuBarType.View, sampleMenuItem);
        }
Пример #9
0
        public void Loaded(ViewLoadedParams viewLoadedParams)
        {
            DependencyView = new WorkspaceDependencyView(this, viewLoadedParams);
            // when a package is loaded update the DependencyView
            // as we may have installed a missing package.

            pmExtension.PackageLoader.PackgeLoaded += (package) =>
            {
                DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel);
            };

            DependencyView.OnExtensionTabClosed += OnCloseExtension;

            // Adding a button in view menu to refresh and show manually
            workspaceReferencesMenuItem = new MenuItem {
                Header = Resources.MenuItemString, IsCheckable = true, IsChecked = false
            };
            workspaceReferencesMenuItem.Click += (sender, args) =>
            {
                if (workspaceReferencesMenuItem.IsChecked)
                {
                    // Refresh dependency data
                    DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel);
                    viewLoadedParams.AddToExtensionsSideBar(this, DependencyView);
                    workspaceReferencesMenuItem.IsChecked = true;
                }
                else
                {
                    viewLoadedParams.CloseExtensioninInSideBar(this);
                    workspaceReferencesMenuItem.IsChecked = false;
                }
            };
            viewLoadedParams.AddMenuItem(MenuBarType.View, workspaceReferencesMenuItem);
        }
        public void Loaded(ViewLoadedParams p)
        {
            DisposeWindow = false;
            var mainViewModel = new GitHubForDynamoWPF.ViewModels.MainViewModel(p, p.DynamoWindow, UniqueId, Name);

            gitHubWindow = new GitHubForDynamoWPF.Views.MainView(mainViewModel)
            {
                Title       = this.Name,
                Owner       = p.DynamoWindow,
                DataContext = mainViewModel
            };

            // When closing, actually hide the window so it is kept on the background
            gitHubWindow.Closing += (sender, args) =>
            {
                if (!DisposeWindow)
                {
                    args.Cancel = true;
                    (sender as Window).Hide();
                }
            };

            gitHubMenuItem = new MenuItem
            {
                Header = this.Name
            };

            gitHubMenuItem.Click += (sender, args) =>
            {
                gitHubWindow.Show();
            };

            p.AddSeparator(MenuBarType.Packages, new Separator());
            p.AddMenuItem(MenuBarType.Packages, gitHubMenuItem);
        }
Пример #11
0
        public void Loaded(ViewLoadedParams p)
        {
            // Specify the text displayed on the menu item
            viewportMenuItem = new MenuItem {
                Header = "Launch Viewport"
            };

            // Define the behavior when menu item is clicked
            viewportMenuItem.Click += (sender, args) =>
            {
                // Instantiate a viewModel and window
                var viewModel = new ViewportWindowViewModel(p);
                var window    = new ViewportWindow(viewModel)
                {
                    // Set the data context for the main grid in the window
                    // This refers to the main grid also seen in our xaml file
                    MainGrid = { DataContext = viewModel },

                    // Set the owner of the window to the Dynamo window.
                    Owner = p.DynamoWindow
                };

                // Show a modeless window.
                window.Show();
            };

            // add the menu item to our loaded parameters
            p.AddMenuItem(MenuBarType.View, viewportMenuItem);
        }
        public void Loaded(ViewLoadedParams p)
        {
            // Specify the text displayed on the menu item
            viewportMenuItem = new MenuItem {
                Header = "Launch Viewport", IsCheckable = true, IsChecked = false
            };

            // Define the behavior when menu item is clicked
            viewportMenuItem.Click += (sender, args) =>
            {
                var viewLoadedParams = p;

                if (viewportMenuItem.IsChecked)
                {
                    var controller = new ViewportViewController(p.DynamoWindow, p.CommandExecutive, viewLoadedParams, PackagePath);
                    controller.AddViewportToExtensionsPanel(this, p);
                }
                else
                {
                    p.CloseExtensioninInSideBar(this);
                }
            };

            // Add the menu item to our loaded parameters
            p.AddMenuItem(MenuBarType.View, viewportMenuItem);
        }
Пример #13
0
        public void Loaded(ViewLoadedParams p)
        {
            this.loadedParams = p;

            dynamoMenu        = p.dynamoMenu;
            extensionMenuItem = GenerateMenuItem();
            p.AddMenuItem(MenuBarType.File, extensionMenuItem, 11);

            manageCustomizersMenuItem = GenerateManageCustomizersMenuItem();
            p.AddMenuItem(MenuBarType.File, manageCustomizersMenuItem, 12);

            inviteMenuItem = GenerateInviteMenuItem();
            p.AddMenuItem(MenuBarType.File, inviteMenuItem, 11);

            p.AddSeparator(MenuBarType.File, separator, 14);

            p.CurrentWorkspaceChanged += CurrentWorkspaceChanged;
        }
Пример #14
0
 private void AddMenuItem(ViewLoadedParams p)
 {
     #if DEBUG
     p.AddSeparator(MenuBarType.Packages, new Separator());
     packageManagerMenuItem = new MenuItem()
     {
         Header = "Package Manager", Name = "PackageManager"
     };
     packageManagerMenuItem.Click += (object sender, RoutedEventArgs e) => OnPackageManagerClick();
     p.AddMenuItem(MenuBarType.Packages, packageManagerMenuItem);
     #endif
 }
Пример #15
0
        public void Loaded(ViewLoadedParams viewLoadedParams)
        {
            DependencyView = new PackageDependencyView(this, viewLoadedParams);

            // Adding a button in view menu to refresh and show manually
            packageDependencyMenuItem = new MenuItem {
                Header = Resources.MenuItemString
            };
            packageDependencyMenuItem.Click += (sender, args) =>
            {
                // Refresh dependency data
                DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel);
                viewLoadedParams.AddToExtensionsSideBar(this, DependencyView);
            };
            viewLoadedParams.AddMenuItem(MenuBarType.View, packageDependencyMenuItem);
        }
Пример #16
0
 public void Loaded(ViewLoadedParams p)
 {
     sampleMenuItem = new MenuItem {
         Header = "Sample ViewExtension, AliT"
     };
     sampleMenuItem.Click += (sender, args) =>
     {
         var viewModel = new SampleWindowViewModel(p);
         var window    = new SampleWindow
         {
             MainGrid = { DataContext = viewModel },
             Owner    = p.DynamoWindow
         };
         window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
         window.Show();
     };
     p.AddMenuItem(MenuBarType.View, sampleMenuItem);
 }
Пример #17
0
        public void Loaded(ViewLoadedParams p)
        {
            // Specify the text displayed on the menu item
            viewportMenuItem = new MenuItem {
                Header = "Launch Viewport"
            };

            // Define the behavior when menu item is clicked
            viewportMenuItem.Click += (sender, args) =>
            {
                var viewLoadedParams = p;
                var controller       = new ViewportViewController(p.DynamoWindow, p.CommandExecutive, viewLoadedParams, PackagePath);
                controller.AddViewportView();
            };

            // add the menu item to our loaded parameters
            p.AddMenuItem(MenuBarType.View, viewportMenuItem);
        }
Пример #18
0
        public void Loaded(ViewLoadedParams p)
        {
            ViewModel  = new TuneUpWindowViewModel(p);
            TuneUpView = new TuneUpWindow(p, UniqueId)
            {
                // Set the data context for the main grid in the window.
                NodeAnalysisTable = { DataContext = ViewModel },
                MainGrid          = { DataContext = ViewModel }
            };

            TuneUpMenuItem = new MenuItem {
                Header = "Open Tune Up"
            };
            TuneUpMenuItem.Click += (sender, args) =>
            {
                p.AddToExtensionsSideBar(this, TuneUpView);
                ViewModel.EnableProfiling();
            };
            p.AddMenuItem(MenuBarType.View, TuneUpMenuItem);
        }
Пример #19
0
        public void Loaded(ViewLoadedParams p)
        {
            speckleAccountsMenu = new MenuItem {
                Header = "Speckle Accounts"
            };
            speckleAccountsMenu.Click += (sender, args) =>
            {
                //var viewModel = new SampleWindowViewModel(p);
                var window = new SpecklePopup.MainWindow(false)
                {
                    Owner = p.DynamoWindow
                };

                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;

                // Show a modeless window.
                window.Show();
            };
            p.AddMenuItem(MenuBarType.View, speckleAccountsMenu);
        }
        public void Loaded(ViewLoadedParams p)
        {
            // Save a reference to your loaded parameters.
            // You'll need these later when you want to use
            // the supplied workspaces

            view = p.DynamoWindow as DynamoView;

            dynaThanosMenuItem = new MenuItem {
                Header = "DynaThanos"
            };
            dynaThanosMenuItem.Foreground = Brushes.BlueViolet;


            dynaThanosMenuItem.Icon = new System.Windows.Controls.Image
            {
                Source = new BitmapImage(new Uri("pack://application:,,,/DynaThanosViewExtension;component/Resources/thanosEmoji.png"))
            };

            dynaThanosMenuItem.Click += (sender, args) =>
            {
                var viewModel = new DynaThanosViewModel(p);
                var window    = new DynaThanosWindow
                {
                    // Set the data context for the main grid in the window.
                    MainGrid = { DataContext = viewModel },

                    // Set the owner of the window to the Dynamo window.
                    Owner = p.DynamoWindow
                };

                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;

                // Show a modeless window.
                window.Show();
            };
            p.AddMenuItem(MenuBarType.Help, dynaThanosMenuItem, 0);
            //p.dynamoMenu.Items.Add(dynaThanosMenuItem);
        }
Пример #21
0
        public void Loaded(ViewLoadedParams viewLoadedParams)
        {
            DependencyView = new WorkspaceDependencyView(this, viewLoadedParams);
            // when a package is loaded update the DependencyView
            // as we may have installed a missing package.

            pmExtension.PackageLoader.PackgeLoaded += (package) =>
            {
                DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel);
            };

            // Adding a button in view menu to refresh and show manually
            packageDependencyMenuItem = new MenuItem {
                Header = Resources.MenuItemString
            };
            packageDependencyMenuItem.Click += (sender, args) =>
            {
                // Refresh dependency data
                DependencyView.DependencyRegen(viewLoadedParams.CurrentWorkspaceModel as WorkspaceModel);
                viewLoadedParams.AddToExtensionsSideBar(this, DependencyView);
            };
            viewLoadedParams.AddMenuItem(MenuBarType.View, packageDependencyMenuItem);
        }
Пример #22
0
        public override void Loaded(ViewLoadedParams p)
        {
            // Save a reference to your loaded parameters.
            // You'll need these later when you want to use
            // the supplied workspaces

            var viewModel = new SampleWindowViewModel(p);
            var window    = new SampleWindow
            {
                // Set the data context for the main grid in the window.
                MainGrid = { DataContext = viewModel },

                // Set the owner of the window to the Dynamo window.
                Owner = p.DynamoWindow
            };

            sampleMenuItem = new MenuItem {
                Header = "Show View Extension Sample Window", IsCheckable = true
            };
            sampleMenuItem.Checked   += (sender, args) => p.AddToExtensionsSideBar(this, window);
            sampleMenuItem.Unchecked += (sender, args) => p.CloseExtensioninInSideBar(this);
            p.AddMenuItem(MenuBarType.View, sampleMenuItem);
        }
Пример #23
0
        public void Loaded(ViewLoadedParams p)
        {
            menuItem = new MenuItem {
                Header = "MigratorExtension"
            };
            menuItem.Click += (sender, args) =>
            {
                var window = new MigrationWindow()
                {
                    DataContext = this,
                    MainPanel   = { DataContext = this },

                    // Set the owner of the window to the Dynamo window.
                    Owner = p.DynamoWindow
                };

                window.Left = window.Owner.Left + 400;
                window.Top  = window.Owner.Top + 200;

                // Show a modeless window.
                window.Show();
            };
            p.AddMenuItem(MenuBarType.View, menuItem);
        }
Пример #24
0
        public void Loaded(ViewLoadedParams p)
        {
            //get our executing path for usage throughout
            ExecutingPath = Assembly.GetExecutingAssembly().Location;

            // Save a reference to your loaded parameters.
            // You'll need these later when you want to use
            // the supplied workspaces
            // Save a reference to your loaded parameters.
            // You'll need these later when you want to use
            // the supplied workspaces
            view = p.DynamoWindow as DynamoView;
            //this is our main menu item
            _theDamMenuItem = new MenuItem {
                Header = "theDAM"
            };



            #region graph Analysis
            MenuItem analyzeGraphs = new MenuItem {
                Header = "Better DYN Browser"
            };
            ////_theDamMenuItem.Items.Add(analyzeGraphs);
            //MenuItem analyzegraphPurpose = new MenuItem { Header = "Set Graph Purpose" };
            //analyzegraphPurpose.Click += (sender, args) =>
            //{
            //    AnalyzeGraphs.AnalyzeGraphs aGraphs = new AnalyzeGraphs.AnalyzeGraphs();
            //    aGraphs.Show();
            //};
            //analyzeGraphs.Items.Add(analyzegraphPurpose);

            MenuItem graphBrowser = new MenuItem {
                Header = "Browse Graphs"
            };
            graphBrowser.Click += (sender, args) =>
            {
                GraphBrowser.GraphBrowser graphBrowserWindow = new GraphBrowser.GraphBrowser();
                graphBrowserWindow.Show();
            };
            analyzeGraphs.Items.Add(graphBrowser);
            #endregion
            #region About
            MenuItem about = new MenuItem {
                Header = "About"
            };
            analyzeGraphs.Items.Add(about);
            about.Click += (sender, args) =>
            {
                About.About aboutDam = new About.About();
                aboutDam.Show();
            };
            #endregion
            #region MarcelloPrototyping
            //this enables this portion for just marcello
            if (Environment.UserName.ToLower().Contains("Marcello"))
            {
                //this menu now allows a flyout
                MenuItem prototyping = new MenuItem {
                    Header = "Prototyping"
                };
                _theDamMenuItem.Items.Add(prototyping);

                MenuItem nodeCount = new MenuItem {
                    Header = "CountNodes"
                };
                nodeCount.Click += (sender, args) =>
                {
                    MessageBox.Show(NodeDescriptions.nodedesc.GetNODECOUNT().ToString());
                };
                prototyping.Items.Add(nodeCount);

                MenuItem nodeDesciption = new MenuItem {
                    Header = "Node Description"
                };
                nodeDesciption.Click += (sender, args) =>
                {
                    //MessageBox.Show(NodeDescriptions.nodedesc.GetNODEdesc());
                    string[] my_local_arraydesc = NodeDescriptions.nodedesc.GetNODEdesc();
                    System.IO.File.WriteAllLines(@"D:\working_revit_organics\dynamo\HACKAthon02\theDAM\Descriptions.txt", my_local_arraydesc);
                };
                prototyping.Items.Add(nodeDesciption);


                MenuItem nodeName = new MenuItem {
                    Header = "Node Name"
                };
                nodeName.Click += (sender, args) =>
                {
                    string[] my_local_arrayName = NodeDescriptions.nodedesc.GetNODEName();
                    //string totalFileName = @"D:\working_revit_organics\dynamo\HACKAthon02\theDAM\" + NodeDescriptions.nodedesc.myPublicFileName + ".txt";
                    string totalFileName = @"D:\working_revit_organics\dynamo\HACKAthon02\theDAM\" + "NODE" + ".txt";
                    System.IO.File.WriteAllLines(totalFileName, my_local_arrayName);
                    MessageBox.Show(NodeDescriptions.nodedesc.myPublicFileName);
                };
                prototyping.Items.Add(nodeName);
                #endregion
            }
            p.AddMenuItem(MenuBarType.File, analyzeGraphs, 3);
            //on its own menu
            //p.dynamoMenu.Items.Add(_theDamMenuItem);
        }