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; }
private bool DoesAppExist(string appName) { var AppExists = false; var sra = new SystemRemoteApps(); foreach (RemoteAppLib.New.RemoteApp App in sra.GetAll()) { if ((App.Name ?? "") == (appName ?? "")) { AppExists = true; } } return(AppExists); }
public static void RemoveUnusedFtAs() { var KeyNames = Registry.ClassesRoot.GetSubKeyNames(); var RemoveCount = 0; foreach (var KeyName in KeyNames) { var ftaKey = Registry.ClassesRoot.OpenSubKey(KeyName); var raValue = (string)ftaKey.GetValue("RemoteApp", ""); if (string.IsNullOrEmpty(raValue)) { continue; } foreach (var KeyName2 in KeyNames) { try { var ftKey = Registry.ClassesRoot.OpenSubKey(KeyName2); var ftValue = (string)ftKey.GetValue("", ""); if ((ftValue ?? "") != (KeyName ?? "")) { continue; } var sra = new SystemRemoteApps(); var AppExists = false; foreach (RemoteAppLib.New.RemoteApp app in sra.GetAll()) { if ((app.Name ?? "") == (GetAppForFta(KeyName2) ?? "")) { AppExists = true; } } if (AppExists) { continue; } DeleteFta(KeyName2); RemoveCount++; } catch (Exception) { } } } MessageBox.Show("Unused file type associations removed: " + RemoveCount, "File Type Association", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void SaveRemoteApp(string shortName, string fullName, string path, string vPath, string commandLine, int commandLineSetting, string iconPath, int iconIndex, int showInTswa) { var SysApps = new SystemRemoteApps(); if (_remoteApp.Name != null && Text != "New RemoteApp") { if ((_remoteApp.Name ?? "") != (shortName ?? "")) { SysApps.RenameApp(_remoteApp.Name, shortName); } } _remoteApp.Name = shortName; _remoteApp.FullName = fullName; _remoteApp.Path = path; _remoteApp.VPath = vPath; _remoteApp.IconPath = iconPath; _remoteApp.IconIndex = iconIndex; _remoteApp.CommandLine = commandLine; _remoteApp.CommandLineOption = commandLineSetting; _remoteApp.TSWA = showInTswa != 0; SysApps.SaveApp(_remoteApp); }
private void CreateClientConnection_Click(object sender, EventArgs e) { var sra = new SystemRemoteApps(); Forms.RemoteAppCreateClientConnection.CreateClientConnection(sra.GetApp(AppList.SelectedItems[0].Text)); }
private void EditRemoteApp(string appName) { var sra = new SystemRemoteApps(); Forms.RemoteAppEditWindow.EditRemoteApp(sra.GetApp(appName)); }