Ejemplo n.º 1
0
        public override void ExecuteCommand(IList <Microsoft.EnterpriseManagement.ConsoleFramework.NavigationModelNodeBase> nodes, Microsoft.EnterpriseManagement.ConsoleFramework.NavigationModelNodeTask task, ICollection <string> parameters)
        {
            try
            {
                //LogFile _LogFile = new LogFile(@"C:\LogForms.txt",true);
                IDataItem dataItem = null;
                //There will only ever be one item because we are going to limit this task to single select
                foreach (NavigationModelNodeBase node in nodes)
                {
                    //Check if task was started from form
                    bool startedFromForm = FormUtilities.Instance.IsNodeWithinForm(nodes[0]);
                    //If started from form
                    if (startedFromForm)
                    {
                        dataItem = FormUtilities.Instance.GetFormDataContext(node);
                    }
                    //Else started from view
                    else
                    {
                        dataItem = node;
                    }
                }

                EnterpriseManagementGroup emg = GetSession();

                Guid CurrentNodeId             = (Guid)dataItem["$Id$"];
                EnterpriseManagementObject EMO = emg.EntityObjects.GetObject <EnterpriseManagementObject>(CurrentNodeId, ObjectQueryOptions.Default);
                var newWindow = new CreateVersionTaskForm(EMO);
                newWindow.Show();
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(DateTime.Now + " : " + "ExecuteCommand Error : " + ex.Message);
            }
        }
Ejemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CreateSoftwareVersion = ((SMCenter.Forms.CreateVersionTaskForm)(target));

            #line 5 "..\..\CreateVersionTaskForm.xaml"
                this.CreateSoftwareVersion.Loaded += new System.Windows.RoutedEventHandler(this.AddToCatalogWindow_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.lblSoftwareTitle = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.txtSoftwareTitle = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.lblDisplayName = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.txtDisplayName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.Logo = ((System.Windows.Controls.Image)(target));
                return;

            case 7:
                this.lbCancel = ((System.Windows.Controls.Label)(target));

            #line 23 "..\..\CreateVersionTaskForm.xaml"
                this.lbCancel.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.lbCancel_MouseDown);

            #line default
            #line hidden
                return;

            case 8:
                this.lbOk = ((System.Windows.Controls.Label)(target));

            #line 24 "..\..\CreateVersionTaskForm.xaml"
                this.lbOk.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.lbOk_MouseDown);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }