public RdsExplorerPanel GetRdsExplorerPanel(TabItem _TabItem)
        {
            if (_TabItem == null)
            {
                return(null);
            }
            if (_TabItem.Content == null)
            {
                return(null);
            }

            RdsExplorerPanel rtn = null;

            try
            {
                rtn = (RdsExplorerPanel)_TabItem.FindChildren <RdsExplorerPanel>().First <RdsExplorerPanel>();
            }
            catch (System.Exception x)
            {
#if DEBUG
                Jrfc.Exception.HandleException(x, System.Diagnostics.EventLogEntryType.Warning, Exception.DisplayMessage.Yes);
#else
                Jrfc.Exception.HandleException(x, System.Diagnostics.EventLogEntryType.Warning, Exception.DisplayMessage.No);
#endif
            }

            return(rtn);
        }
        public RdsExplorerPanel GetRdsExplorerPanel(int _index)
        {
            TabItem          ti  = this.GetTabItem(_index);
            RdsExplorerPanel rep = this.GetRdsExplorerPanel(ti);

            return(rep);
        }
        public RdsExplorerPanel GetRdsExplorerPanel(string _TabHeaderText)
        {
            TabItem          ti  = this.GetTabItem(_TabHeaderText);
            RdsExplorerPanel rep = this.GetRdsExplorerPanel(ti);

            return(rep);
        }
        private string PromptUserForNewTabName()
        {
            Window          mywin      = Window.GetWindow(this);
            UserInputWindow prompt_win = new UserInputWindow("Create new app group tab...",
                                                             "Enter name of new app group tab",
                                                             MaxTabNameLength, mywin);

            TabItem          ti  = Jrfc.Utility.FindTabByHeader(this.uc_MainTabControl, "All Apps");
            RdsExplorerPanel rep = (RdsExplorerPanel)Jrfc.Utility.FindChildren <RdsExplorerPanel>(ti).First <RdsExplorerPanel>();

            if (rep != null)
            {
                prompt_win.Left = (mywin.Left + mywin.Width) - (prompt_win.Width + 5);
                Point relativeLocation = rep.TranslatePoint(new Point(0, 0), mywin);
                prompt_win.Top = mywin.Top + relativeLocation.Y + uc_RdsExplorer_ButtonGrid.Height + 5;
            }
            else
            {
                prompt_win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            }

            if (prompt_win.ShowDialog() == true)
            {
                if (!string.IsNullOrWhiteSpace(prompt_win.UserInput))
                {
                    return(prompt_win.UserInput);
                }
            }
            return(null);
        }
Esempio n. 5
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.uc_RdsExplorerPanel = ((Jrfc.RdsExplorerPanel)(target));

            #line 8 "..\..\RdsExplorerPanel.xaml"
                this.uc_RdsExplorerPanel.Loaded += new System.Windows.RoutedEventHandler(this.uc_RdsExplorerPanel_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.uc_RdsExplorerPanel_ListView = ((System.Windows.Controls.ListView)(target));

            #line 90 "..\..\RdsExplorerPanel.xaml"
                this.uc_RdsExplorerPanel_ListView.ContextMenuOpening += new System.Windows.Controls.ContextMenuEventHandler(this.uc_RdsExplorerPanel_ContextMenu_Opening);

            #line default
            #line hidden

            #line 91 "..\..\RdsExplorerPanel.xaml"
                this.uc_RdsExplorerPanel_ListView.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.uc_RdsExplorerPanel_ListView_MouseDoubleClick);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        public static RdsExplorerPanel CreatFromXmlDictionaryString(string _xml)
        {
            XmlDictionary XmlList = Jrfc.Utility.ObjectSerializer <XmlDictionary> .FromXml(_xml);

            Jrfc.RdsExplorerPanel rep = new RdsExplorerPanel();
            string ServerList_Xml     = XmlList["ServerList"];

            if (ServerList_Xml != null)
            {
                RdsServerList rds_servers = (RdsServerList)Jrfc.Utility.ObjectSerializer <RdsServerList> .FromXml(ServerList_Xml);

                rep.ServerList.Copy(rds_servers);
            }
            string AppList_Xml = XmlList["AppList"];

            if (AppList_Xml != null)
            {
                RdsAppList apps = (RdsAppList)Jrfc.Utility.ObjectSerializer <RdsAppList> .FromXml(AppList_Xml);

                rep.m_RdsAppList.Copy(apps);
            }
            string ExpandedServerList_Xml = XmlList["ExpandedServerList"];

            if (ExpandedServerList_Xml != null)
            {
                ExpandedServerList exp_servers = (ExpandedServerList)Jrfc.Utility.ObjectSerializer <ExpandedServerList> .FromXml(ExpandedServerList_Xml);

                rep.m_ExandedServerList.Copy(exp_servers);
            }
            return(rep);
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            TabItem          ti  = Jrfc.Utility.FindTabByHeader(this.uc_MainTabControl, "All Apps");
            RdsExplorerPanel rep = (RdsExplorerPanel)Jrfc.Utility.FindChildren <RdsExplorerPanel>(ti).First <RdsExplorerPanel>();

            if (rep == null)
            {
                return;
            }

            rep.IsAnAllAppsPanel = true;
        }
        private void uc_RdsExplorerPanel_ContextMenu_AddAppToTab_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mnu = (MenuItem)sender;

            RdsExplorerContainer rec           = Jrfc.Utility.FindParent <RdsExplorerContainer>(this);
            string           target_tab_header = mnu.Header.ToString().Replace("Add selected App(s) to ", "").Replace(" tab", "");
            TabItem          t   = Jrfc.Utility.FindTabByHeader(rec.uc_MainTabControl, target_tab_header);
            RdsExplorerPanel exp = (RdsExplorerPanel)t.Content;

            foreach (RdsApp app in this.uc_RdsExplorerPanel_ListView.SelectedItems)
            {
                exp.AppList.Add(app);
            }
        }
        private void uc_RdsExplorer_RefreshButton_Click(object sender, RoutedEventArgs e)
        {
            // Known bug: Fix code to proper refresh ExplorerPanels other than Main
            //foreach(TabItem ti in this.uc_MainTabControl.Items)
            //{
            //    RdsExplorerPanel rep = (RdsExplorerPanel)Jrfc.Utility.FindChildren<RdsExplorerPanel>(ti).First<RdsExplorerPanel>();
            //    if (rep != null)
            //    {
            //        rep.RefreshPanel();
            //    }
            //}
            TabItem          ti  = (TabItem)this.uc_MainTabControl.Items.GetItemAt(0);
            RdsExplorerPanel rep = (RdsExplorerPanel)Jrfc.Utility.FindChildren <RdsExplorerPanel>(ti).First <RdsExplorerPanel>();

            if (rep != null)
            {
                rep.RefreshPanel();
            }
        }
Esempio n. 10
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\RdsExplorerContainer.xaml"
                ((Jrfc.RdsExplorerContainer)(target)).Loaded += new System.Windows.RoutedEventHandler(this.UserControl_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.uc_RdsExplorer_MainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.uc_MainTabControl = ((System.Windows.Controls.TabControl)(target));

            #line 11 "..\..\RdsExplorerContainer.xaml"
                this.uc_MainTabControl.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.uc_MainTabControl_SelectionChanged);

            #line default
            #line hidden

            #line 12 "..\..\RdsExplorerContainer.xaml"
                this.uc_MainTabControl.ContextMenuClosing += new System.Windows.Controls.ContextMenuEventHandler(this.uc_MainTabControl_ContextMenu_Closing);

            #line default
            #line hidden

            #line 13 "..\..\RdsExplorerContainer.xaml"
                this.uc_MainTabControl.ContextMenuOpening += new System.Windows.Controls.ContextMenuEventHandler(this.uc_MainTabControl_ContextMenu_Opening);

            #line default
            #line hidden

            #line 13 "..\..\RdsExplorerContainer.xaml"
                this.uc_MainTabControl.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.uc_MainTabControl_MouseRightButtonUp);

            #line default
            #line hidden
                return;

            case 4:
                this.uc_MainTabControl_ContextMenu = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 5:
                this.uc_MainTabControl_ContextMenu_DeleteTab = ((System.Windows.Controls.MenuItem)(target));

            #line 21 "..\..\RdsExplorerContainer.xaml"
                this.uc_MainTabControl_ContextMenu_DeleteTab.Click += new System.Windows.RoutedEventHandler(this.uc_MainTabControl_ContextMenu_DeleteTab_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.uc_MainTabControl_ContextMenu_RefreshTab = ((System.Windows.Controls.MenuItem)(target));

            #line 22 "..\..\RdsExplorerContainer.xaml"
                this.uc_MainTabControl_ContextMenu_RefreshTab.Click += new System.Windows.RoutedEventHandler(this.uc_MainTabControl_ContextMenu_RefreshTab_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.uc_AllAppsTabItem = ((System.Windows.Controls.TabItem)(target));
                return;

            case 8:
                this.uc_AllAppsPanel = ((Jrfc.RdsExplorerPanel)(target));
                return;

            case 9:
                this.uc_RdsExplorer_ButtonGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 10:
                this.uc_RdsExplorer_AddTabButton = ((System.Windows.Controls.Button)(target));

            #line 40 "..\..\RdsExplorerContainer.xaml"
                this.uc_RdsExplorer_AddTabButton.Click += new System.Windows.RoutedEventHandler(this.uc_RdsExplorer_AddTabButton_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.uc_RdsExplorer_RefreshButton = ((System.Windows.Controls.Button)(target));

            #line 42 "..\..\RdsExplorerContainer.xaml"
                this.uc_RdsExplorer_RefreshButton.Click += new System.Windows.RoutedEventHandler(this.uc_RdsExplorer_RefreshButton_Click);

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