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(); }
//test¿ë Applist private void CreateAppList() { AppList.Add(new CmxApp { AppName = "Plug", AppIconSvgUri = new Uri("ms-appx:///Assets/svg/plug-icon.svg"), AppLinkCommand = AppNavigateCommand, AppLinkParam = "IOTOIApp.ViewModels.Plug.PlugMainViewModel" }); AppList.Add(new CmxApp { AppName = "Light", AppIcon = "\xEB50", AppLinkCommand = AppNavigateCommand, AppLinkParam = "IOTOIApp.ViewModels.Light.LightMainViewModel" }); AppList.Add(new CmxApp { AppName = "Nest", AppIconSvgUri = new Uri("ms-appx:///Assets/svg/thermostat-icon.svg"), //AppLinkCommand = AppLaunchCommand, //AppLinkParam = "thermostat-launchmainpage://HostMainpage/Path1?param=This is param" AppLinkCommand = AppNavigateCommand, AppLinkParam = "IOTOIApp.ViewModels.Thermostat.ThermostatMainViewModel" }); AppList.Add(new CmxApp { AppName = "Sensors", AppIcon = "\xE957", AppLinkCommand = AppNavigateCommand, AppLinkParam = "IOTOIApp.ViewModels.Sensor.SensorMainViewModel" }); AppList.Add(new CmxApp { AppName = "CCTV", AppIcon = "\xE714", AppLinkCommand = AppNavigateCommand, AppLinkParam = "IOTOIApp.ViewModels.CCTV.CCTVMainViewModel" }); AppList.Add(new CmxApp { AppName = "Settings", AppIcon = "\xE115", AppLinkCommand = AppNavigateCommand, AppLinkParam = "IOTOIApp.ViewModels.SettingsViewModel" }); }
///<summary> ///добавить доки/инстанции - только доки ///</summary> protected void includeButton_Click(object sender, EventArgs e) { SaveStates(); if (routeTable != null) { routeTable.Rows.Clear(); } if (PointList.Count == 0) { return; } if (AppList == null) { AppList = new List <Application>(); } if (EventList == null) { EventList = new List <RouteEvent>(); } foreach (ListItem item in ApplicationList.Items) { if (item.Selected) { var a = new Application(); a.InitApplication(item.Value); foreach (var routePoint in PointList) { var routeEvent = new RouteEvent(); routeEvent.InitEvent(a, routePoint); EventList.Add(routeEvent); } AppList.Add(a); } } ApplicationFilterBox.Text = string.Empty; FillLists(); DataBind(); //BuildRoute(); }
public void BeforeEachTest() { using (var scope = Container.BeginLifetimeScope()) { _settingsService = scope.Resolve <ISettingsService>(); } _deviceSettings = _settingsService.GetDevicesSettings(); var platformSettings = _deviceSettings.Settings.FirstOrDefault(s => s.Platform == Platform.ToString()) ?? throw new ArgumentNullException("PlatformSettings is null"); foreach (var item in platformSettings.SerialNumbers) { AppList.Add(AppInitializer.StartApp(Platform, item, platformSettings.AssemblyPath)); } }
public static void ParseAppList() { List <XElement> XMLAppElements = XDocument.Parse(Desktop.AppList.text).Descendants("app").ToList(); XMLAppElements.ForEach(A => { AppList.Add(int.Parse(A.Attribute("id").Value), new AppData { name = A.Attribute("name").Value, icon = Resources.Load <Sprite>(@"Icons\" + A.Attribute("name").Value), prefab = Resources.Load(@"Windows\" + A.Attribute("name").Value) as GameObject, hidden = A.Attribute("hidden") != null ? bool.Parse(A.Attribute("hidden").Value) : false, resize = A.Attribute("resize") != null ? bool.Parse(A.Attribute("resize").Value) : false, min = A.Attribute("min") != null ? new Vector2(int.Parse(A.Attribute("min").Value.Split('x')[0]), int.Parse(A.Attribute("min").Value.Split('x')[1])) : Vector2.zero, max = A.Attribute("max") != null ? new Vector2(int.Parse(A.Attribute("max").Value.Split('x')[0]), int.Parse(A.Attribute("max").Value.Split('x')[1])) : Vector2.zero, expand = A.Attribute("expandable") != null ? bool.Parse(A.Attribute("expandable").Value) : false }); }); }
private void AddItem(object sender, RoutedEventArgs e) { try { OpenFileDialog ofd = new OpenFileDialog() { Filter = $"{FindResource("EditWindow_Filter_App")}|*.exe" }; if (ofd.ShowDialog() == true) { string file = ofd.FileName; string path = $"{AppDomain.CurrentDomain.BaseDirectory}APPCONF\\{DateTime.Now.Ticks}.appconf"; Appconf ac = Appconf.Create(path, file.Substring(file.LastIndexOf('\\') + 1, file.LastIndexOf('.') - file.LastIndexOf('\\') - 1), file); al.Add(ac); Lb_Apps.Items.Add(ac.AppName); Lb_Apps.SelectedIndex = Lb_Apps.Items.Count - 1; } } catch (Exception ex) { MessageBox.Show(ex.Message, FindResource("MessageBoxTitle_Error") as string); } }
public async Task LogonCheck() { string _dbserver = ""; string _shareserver = ""; string _cod3 = ""; try { var _dnsDB = Dns.GetHostEntry("appdb.local"); _dbserver = _dnsDB.HostName; var _dnsShare = Dns.GetHostEntry("appshare.local"); _shareserver = _dnsShare.HostName; _cod3 = _dbserver.Substring(0, 3); } catch { //CTWin.InputBox("", "Enter database server name or IP.", ref _dbserver); External = true; } //#if DEBUG // _dbserver = "db01"; // _shareserver = "valsrv02"; //#endif // string _pathLogonHosts; ServicePointManager.DnsRefreshTimeout = 0; var _serverDB = new cServer() { HostName = _dbserver, // _line.Split('|')[1], COD3 = _cod3, //_line.Split('|')[4], Type = ServerTypes.DATABASE, User = "******", Password = "******" }; var _serverShare = new cServer() { HostName = _shareserver, //_line.Split('|')[2], COD3 = _cod3, //_line.Split('|')[4], Type = ServerTypes.DATABASE, User = "******", Password = "******" }; ShareServerList.Add(_serverShare); COD3 = _cod3;// _line.Split('|')[4]; await getSystemVersions(_serverShare); AppList.Add(new cAppBot("logon", "LOGON", "SISTEMAS", "logon.exe", "LOC", _serverDB, _serverShare, "")); if (!External) { var _clean = Values.AppList[0].CheckUpdatedXML(); if (!_clean) { AppList[0].Status = AppBotStatus.PENDING_UPDATE; } if (Values.AppList.PendingApps.Count != 0) { Message = "Updating LogOn."; Application.DoEvents(); System.Threading.Thread.Sleep(250); ActiveThreads++; var _thread = new Updater(Values.UpdateList); // launch task not async await _thread.Start(); } this.Message = "LogOn updated. Launching."; System.Threading.Thread.Sleep(250); } await AppList[0].LaunchApp(true); // }
public void Add(cAppBot pApp) { AppList.Add(pApp); }