Beispiel #1
0
        public void Execute(object funcDef)
        {
            if (funcDef is List <FunctionDefinition> )
            {
                var fs = funcDef as List <FunctionDefinition>;

                foreach (var f in fs)
                {
                    var pkg = dynSettings.PackageLoader.GetOwnerPackage(f);

                    if (dynSettings.PackageLoader.GetOwnerPackage(f) != null)
                    {
                        var m = MessageBox.Show("The node is part of the dynamo package called \"" + pkg.Name +
                                                "\" - do you want to submit a new version of this package?  \n\nIf not, this node will be moved to the new package you are creating.",
                                                "Package Warning", MessageBoxButton.YesNo, MessageBoxImage.Question);
                        if (m == MessageBoxResult.Yes)
                        {
                            pkg.PublishNewPackageVersionCommand.Execute();
                            return;
                        }
                    }
                }

                dynSettings.Controller.PublishPackageViewModel = new PublishPackageViewModel(dynSettings.Controller.PackageManagerClient);
                dynSettings.Controller.PublishPackageViewModel.FunctionDefinitions = fs;
            }
            else
            {
                dynSettings.Controller.DynamoViewModel.Log("Failed to obtain function definition from node.");
                return;
            }

            _view = new PackageManagerPublishView(dynSettings.Controller.PublishPackageViewModel);
        }
Beispiel #2
0
        void _vm_RequestShowPackageManagerPublish(PublishPackageViewModel model)
        {
            if (_pubPkgView == null)
            {
                _pubPkgView         = new PackageManagerPublishView(model);
                _pubPkgView.Closed += (sender, args) => _pubPkgView = null;
                _pubPkgView.Show();
            }

            _pubPkgView.Focus();
        }
Beispiel #3
0
        void _vm_RequestRequestPackageManagerPublish(PublishPackageViewModel model)
        {
            if (_pubPkgView == null)
            {
                _pubPkgView         = new PackageManagerPublishView(model);
                _pubPkgView.Closed += (sender, args) => _pubPkgView = null;
                _pubPkgView.Show();

                if (_pubPkgView.IsLoaded && this.IsLoaded)
                {
                    _pubPkgView.Owner = this;
                }
            }

            _pubPkgView.Focus();
        }