Пример #1
0
        public override void ExecuteCommand(IList <Microsoft.EnterpriseManagement.ConsoleFramework.NavigationModelNodeBase> nodes, Microsoft.EnterpriseManagement.ConsoleFramework.NavigationModelNodeTask task, ICollection <string> parameters)
        {
            try
            {
                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;
                    }
                }

                //var newWindow = new ConnectionsForm(dataItem);
                var newWindow = new ConnectionsForm(dataItem);
                newWindow.Show();
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(DateTime.Now + " : " + "ExecuteCommand Error : " + ex.Message);
            }
        }
Пример #2
0
        public override void ExecuteCommand(IList <Microsoft.EnterpriseManagement.ConsoleFramework.NavigationModelNodeBase> nodes, Microsoft.EnterpriseManagement.ConsoleFramework.NavigationModelNodeTask task, ICollection <string> parameters)
        {
            try
            {
                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;
                    }
                }

                //var newWindow = new ConnectionsForm(dataItem);
                var newWindow = new ConnectionsForm(dataItem);
                newWindow.Show();

                // Guid G = new Guid(SelectedTreeItem.Tag.ToString());
                //EMO = emg.EntityObjects.GetObject<EnterpriseManagementObject>(G, ObjectQueryOptions.Default);

                ////Guid Id_NA = new Guid();
                //if (EMO.IsInstanceOf(classModule))
                //{
                //    EnterpriseManagementObjectDataType dataType = new EnterpriseManagementObjectDataType(classModule);
                //    IDataItem itemIdentity = dataType.CreateProxyInstance(EMO);
                //    Microsoft.EnterpriseManagement.GenericForm.FormUtilities.Instance.PopoutForm(itemIdentity);
                //}
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show(DateTime.Now + " : " + "ExecuteCommand Error : " + ex.Message);
            }
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.CableWindow = ((SMCenter.NetworkTasks.ConnectionsForm)(target));

            #line 5 "..\..\Copy of ConnectionsForm.xaml"
                this.CableWindow.Loaded += new System.Windows.RoutedEventHandler(this.ConnectionsWindow_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.LocationsTreeView = ((System.Windows.Controls.TreeView)(target));

            #line 18 "..\..\Copy of ConnectionsForm.xaml"
                this.LocationsTreeView.AddHandler(System.Windows.Controls.TreeViewItem.ExpandedEvent, new System.Windows.RoutedEventHandler(this.LocationsTreeView_Expanded));

            #line default
            #line hidden

            #line 18 "..\..\Copy of ConnectionsForm.xaml"
                this.LocationsTreeView.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.LocationsTreeView_SelectedItemChanged);

            #line default
            #line hidden
                return;

            case 3:
                this.NodesTreeView = ((System.Windows.Controls.TreeView)(target));

            #line 19 "..\..\Copy of ConnectionsForm.xaml"
                this.NodesTreeView.AddHandler(System.Windows.Controls.TreeViewItem.ExpandedEvent, new System.Windows.RoutedEventHandler(this.NodesTreeView_Expanded));

            #line default
            #line hidden

            #line 19 "..\..\Copy of ConnectionsForm.xaml"
                this.NodesTreeView.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.NodesTreeView_SelectedItemChanged);

            #line default
            #line hidden
                return;

            case 4:
                this.ConnectionsTreeView = ((System.Windows.Controls.TreeView)(target));

            #line 20 "..\..\Copy of ConnectionsForm.xaml"
                this.ConnectionsTreeView.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.ConnectionsTreeView_SelectedItemChanged);

            #line default
            #line hidden
                return;

            case 5:
                this.CabelsTreeView = ((System.Windows.Controls.TreeView)(target));

            #line 21 "..\..\Copy of ConnectionsForm.xaml"
                this.CabelsTreeView.SelectedItemChanged += new System.Windows.RoutedPropertyChangedEventHandler <object>(this.CabelsTreeView_SelectedItemChanged);

            #line default
            #line hidden

            #line 21 "..\..\Copy of ConnectionsForm.xaml"
                this.CabelsTreeView.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.CabelsTreeView_MouseDoubleClick);

            #line default
            #line hidden
                return;

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

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

            #line 25 "..\..\Copy of ConnectionsForm.xaml"
                this.lbCancel.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.lbCancel_MouseDown);

            #line default
            #line hidden
                return;

            case 8:
                this.txtTargetObject = ((System.Windows.Controls.TextBox)(target));
                return;

            case 9:
                this.txtLocation = ((System.Windows.Controls.TextBox)(target));
                return;

            case 10:
                this.ConnectionsButtons = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 11:
                this.brd_Con_Add = ((System.Windows.Controls.Border)(target));
                return;

            case 12:
                this.Con_Image_Add = ((System.Windows.Controls.Image)(target));
                return;

            case 13:
                this.brd_Con_Edit = ((System.Windows.Controls.Border)(target));
                return;

            case 14:
                this.Con_Image_Edit = ((System.Windows.Controls.Image)(target));
                return;

            case 15:
                this.CablesButtons = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 16:
                this.brd_CI_Add = ((System.Windows.Controls.Border)(target));
                return;

            case 17:
                this.CI_Image_Add = ((System.Windows.Controls.Image)(target));
                return;

            case 18:
                this.brd_CI_Edit = ((System.Windows.Controls.Border)(target));
                return;

            case 19:
                this.CI_Image_Edit = ((System.Windows.Controls.Image)(target));
                return;

            case 20:
                this.brd_CI_Delete = ((System.Windows.Controls.Border)(target));
                return;

            case 21:
                this.CI_Image_Delete = ((System.Windows.Controls.Image)(target));
                return;
            }
            this._contentLoaded = true;
        }