/// <summary> /// Extension method converts and AppValue to its string registry key. /// </summary> /// <param name="value">The AppValue enum value to convert.</param> /// <returns>The steam registry key for the given value.</returns> public static string ToRegistryKey(this AppValue value) { switch (value) { case AppValue.DisplayIcon: return("DisplayIcon"); case AppValue.DisplayName: return("DisplayName"); case AppValue.HelpLink: return("HelpLink"); case AppValue.InstallLocation: return("InstallLocation"); case AppValue.Publisher: return("Publisher"); case AppValue.UninstallString: return("UninstallString"); case AppValue.UrlInfoAbout: return("UrlInfoAbout"); } return(string.Empty); }
public static object ReadValue(int appid, AppValue value) { if (appid <= 0) { throw new ArgumentOutOfRangeException("appid"); } try { const string RegistryAppPath = "SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; string name = string.Concat(RegistryAppPath, "\\Steam App ", appid); using (var key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(name)) { if (key != null) { return(key.GetValue(value.ToRegistryKey())); } } } catch (Exception) { throw; } return(null); }
public async Task <IActionResult> Post([FromBody] AppValue value) { context.AppValues.Add(value); await context.SaveChangesAsync(); return(Ok(value)); }
public frmSetAlgorithm() { InitializeComponent(); AutoScaleMode = AutoScaleMode.Dpi; this.DockAreas = DockAreas.Document; this._AppValue = AppValue.Instance(); checkConfigDir(this._AppValue._ConfigDir); }
public async Task <IActionResult> Put(string id, [FromBody] AppValue value) { var found = await context.AppValues.FirstOrDefaultAsync(x => x.Id == id); if (found == null) { return(BadRequest("The specified Id doesn't exists. Use http post to create a new entry")); } else { found.Value = value.Value; await context.SaveChangesAsync(); return(Ok(value)); } }
public frmSetMatch() { InitializeComponent(); AutoScaleMode = AutoScaleMode.Dpi; this.DockAreas = DockAreas.Document; this._AppValue = AppValue.Instance(); checkConfigDir(this._AppValue._ConfigDir); this._contextMenuStrip_ImageControl = new ContextMenuStrip(); this.viewPort.ContextMenuStrip = this._contextMenuStrip_ImageControl; this._ImageControl = new ToolStripMenuItem("图像操作"); this._ROIControl = new ToolStripMenuItem("添加模板ROI"); this._zoomImage = new ToolStripMenuItem("缩放"); this._zoomImage.Click += new EventHandler(zoomButton_CheckedChanged); this._ImageControl.DropDownItems.Add(this._zoomImage); this._moveImage = new ToolStripMenuItem("移动"); this._moveImage.Click += new EventHandler(moveButton_CheckedChanged); this._ImageControl.DropDownItems.Add(this._moveImage); this._noneImage = new ToolStripMenuItem("None"); this._noneImage.Click += new EventHandler(noneButton_CheckedChanged); this._ImageControl.DropDownItems.Add(this._noneImage); this._resetImage = new ToolStripMenuItem("复位"); this._resetImage.Click += new EventHandler(resetButton_Click); this._ImageControl.DropDownItems.Add(this._resetImage); this._RoiRectangle1 = new ToolStripMenuItem("Rectangle1"); this._RoiRectangle1.Click += new EventHandler(Rect1Button_Click); this._ROIControl.DropDownItems.Add(this._RoiRectangle1); this._RoiRectangle2 = new ToolStripMenuItem("Rectangle2"); this._RoiRectangle2.Click += new EventHandler(Rect2Button_Click); this._ROIControl.DropDownItems.Add(this._RoiRectangle2); this._RoiCircle = new ToolStripMenuItem("Circle"); this._RoiCircle.Click += new EventHandler(CircleButton_Click); this._ROIControl.DropDownItems.Add(this._RoiCircle); this.viewPort.ContextMenuStrip.Items.Add(this._ImageControl); this.viewPort.ContextMenuStrip.Items.Add(this._ROIControl); }
void ReleaseDesignerOutlets() { if (address != null) { address.Dispose(); address = null; } if (APNSSummary != null) { APNSSummary.Dispose(); APNSSummary = null; } if (AppValue != null) { AppValue.Dispose(); AppValue = null; } if (Cashout != null) { Cashout.Dispose(); Cashout = null; } if (Comparebook != null) { Comparebook.Dispose(); Comparebook = null; } if (ExpDate != null) { ExpDate.Dispose(); ExpDate = null; } if (VehicleDetails != null) { VehicleDetails.Dispose(); VehicleDetails = null; } }
public virtual bool SaveAs() { SaveFileDialog dlg = new SaveFileDialog(); dlg.InitialDirectory = AppValue.Instance().FlowChartFile; if (Doc.Name != "") { dlg.FileName = Doc.Name; } if (dlg.ShowDialog() == DialogResult.OK) { String loc = dlg.FileName; String loc_xml = string.Format("{0}_flowStep.xml", loc); FileStream file = null; FileStream file_xml = null; try { file = File.Open(loc, FileMode.Create); this.Doc.Store(file, loc); file_xml = File.Open(loc_xml, FileMode.Create); this.Doc.StoreA(file_xml, loc_xml, View); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "Error saving graph as a file"); return(false); } finally { if (file != null) { file.Close(); } if (file_xml != null) { file_xml.Close(); } } } return(true); }
void ReleaseDesignerOutlets() { if (address != null) { address.Dispose(); address = null; } if (apnsAlert != null) { apnsAlert.Dispose(); apnsAlert = null; } if (apnsCloseButton != null) { apnsCloseButton.Dispose(); apnsCloseButton = null; } if (APNSDone != null) { APNSDone.Dispose(); APNSDone = null; } if (APNSMessage != null) { APNSMessage.Dispose(); APNSMessage = null; } if (APNSSummary != null) { APNSSummary.Dispose(); APNSSummary = null; } if (AppValue != null) { AppValue.Dispose(); AppValue = null; } if (Cashout != null) { Cashout.Dispose(); Cashout = null; } if (CloseBtn != null) { CloseBtn.Dispose(); CloseBtn = null; } if (Comparebook != null) { Comparebook.Dispose(); Comparebook = null; } if (ExpDate != null) { ExpDate.Dispose(); ExpDate = null; } if (VehicleDetails != null) { VehicleDetails.Dispose(); VehicleDetails = null; } }