Exemple #1
0
 public RdsAppList Copy(RdsAppList _NewList)
 {
     this.Clear();
     foreach (RdsApp app in _NewList)
     {
         this.Add(app);
     }
     return(this);
 }
Exemple #2
0
 public RdsServerList(RdsAppList _RdsAppsList)
 {
     foreach (RdsApp app in _RdsAppsList)
     {
         if (this[app.Hostname] == null)
         {
             //this.Add(new RdsServer(app.RdsServerGuid));
             this.Add(new RdsServer(app.Hostname));
         }
     }
 }
Exemple #3
0
 public RdsAppList(StringCollection _RegistryFullKeyStrings, RdsAppList _MasterAppList)
 {
     RdsServerIds = new RdsServerIdList();
     // Creat an AppList made up of every app that can be found using _RegistryFullKeyStrings to
     // search another source RdsAppList _MasterAppList
     foreach (string regkey in _RegistryFullKeyStrings)
     {
         RdsApp app = _MasterAppList[regkey];
         if (app != null)  // if null then a previous favorite is not in the _MasterAppList. Ignore it.
         {
             this.Add(app);
         }
     }
 }
        public RdsExplorerPanel()
        {
            InitializeComponent();
            this.DataContext         = this;
            this.m_RdsServerList     = new RdsServerList(false);
            this.m_RdsAppList        = new RdsAppList();
            this.m_ExandedServerList = new ExpandedServerList();
            this.uc_RdsExplorerPanel_ListView.ItemsSource = this.m_RdsAppList;

            CollectionView           view_ex             = (CollectionView)CollectionViewSource.GetDefaultView(this.uc_RdsExplorerPanel_ListView.ItemsSource);
            PropertyGroupDescription groupDescription_ex = new PropertyGroupDescription("Hostname");

            view_ex.GroupDescriptions.Add(groupDescription_ex);
            view_ex.SortDescriptions.Add(new SortDescription("Hostname", ListSortDirection.Ascending));
            view_ex.SortDescriptions.Add(new SortDescription("DisplayName", ListSortDirection.Ascending));
        }
Exemple #5
0
 private void ReconcileWithRefreshedAppList(RdsAppList _RefreshedAppList)
 {
     this.SetAllAppsUnavailableFromServer();
     foreach (RdsApp refreshed_app in _RefreshedAppList)
     {
         RdsApp current_app = this.Find(refreshed_app.Hostname, refreshed_app.DisplayName);
         if (current_app != null)
         {
             current_app.AvailableFromServer = true;
             current_app.Refresh();
         }
         else
         {
             this.Add(refreshed_app);
         }
     }
 }
Exemple #6
0
        public void RefreshList()
        {
            if (this.RdsServerIds == null)
            {
                return;
            }

            RdsAppList refreshed_apps = new RdsAppList();

            //this.Clear();
            foreach (RdsServerId id in this.RdsServerIds)
            {
                RegistryKey regkey = null;
                try
                {
                    string rootkey = @"SOFTWARE\Microsoft\Workspaces\Feeds\{" + id.GUID.ToString() + @"}\ResourceMap";
                    regkey = Registry.CurrentUser.OpenSubKey(rootkey);
                    if (regkey != null)
                    {
                        string[] subkeys = regkey.GetSubKeyNames();

                        foreach (string subkey in subkeys)
                        {
                            refreshed_apps.Add(new RdsApp(rootkey, subkey, id.GUID, id.Hostname));
                            //this.Add(new RdsApp(rootkey, subkey, id.GUID, id.Hostname));
                        }
                    }
                }
                catch (System.Exception x)
                {
                    Jrfc.Exception.HandleException(x);
                }
                finally
                {
                    if (regkey != null)
                    {
                        regkey.Close();
                    }
                }
            }
            this.ReconcileWithRefreshedAppList(refreshed_apps);
        }