public async Task RunSearch()
        {
            if (string.IsNullOrWhiteSpace(_searchQueryText))
            {
                return;
            }

            IsSearching = true;

            var searchResults = await _dataSource.SearchAppsAsync(_searchQueryText);

            if (searchResults != null)
            {
                AppList = new List <AppInfo>(searchResults);
            }
            else
            {
                AppList.Clear();
            }

            LastSearchQuery = string.Format("Results for \"{0}\"", _searchQueryText);

            string resultFormat = AppList.Count == 1 ? "{0} app" : "{0} apps";

            ResultCount = string.Format(resultFormat, AppList.Count);

            IsSearching = false;
        }
예제 #2
0
        private void GetFiles(string path)
        {
            AppList.Clear();

            var files = Directory.GetFiles(@Environment.GetFolderPath(Environment.SpecialFolder.Desktop)).ToList();

            files.AddRange(Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory)));
            if (!String.IsNullOrEmpty(path))
            {
                files.AddRange(Directory.GetFiles(path));
            }
            foreach (var file in files)
            {
                string name = Path.GetFileNameWithoutExtension(file);
                if (File.GetAttributes(file).HasFlag(FileAttributes.Hidden) || String.IsNullOrEmpty(name))
                {
                    continue;
                }
                AppList.Add(new AppItem()
                {
                    FilePath = file,
                });
            }
            InputText = String.Empty; //force filter
            InputBox.Focus();
        }
예제 #3
0
        public void ReloadApps()
        {
            AppList.Clear();
            var Apps = new SystemRemoteApps().GetAll();

            foreach (RemoteAppLib.New.RemoteApp App in Apps)
            {
                SmallIcons.Images.RemoveByKey(App.Name);
                Image TheBitmap = RemoteAppFunction.GetAppBitmap(App.Name);
                var   AppItem   = new ListViewItem(App.Name)
                {
                    ToolTipText = App.FullName,
                    ImageIndex  = 0
                };
                SmallIcons.Images.Add(App.Name, TheBitmap);
                AppItem.ImageKey = App.Name;
                AppList.Items.Add(AppItem);
            }

            NoAppsLabel.Visible = Apps.Count == 0;

            EditButton.Enabled             = false;
            DeleteButton.Enabled           = false;
            CreateClientConnection.Enabled = false;
        }
예제 #4
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    AppList.ToList().ForEach(x => x.Dispose());
                    AppList.Clear();
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }
예제 #5
0
 public void Clear()
 {
     AppList.Clear();
 }