private void AddError(IMyGenError error) { if (_errors.Count == 0) { _errors.Add(error); } else { _errors.Insert(0, error); } }
private void DeleteMatchingTemplateErrors(IMyGenError error) { if (error.Class == MyGenErrorClass.Template) { List <IMyGenError> errorsToHack = new List <IMyGenError>(); foreach (IMyGenError ee in _errors) { if ((error.TemplateIdentifier == ee.TemplateIdentifier) || (error.TemplateFileName == ee.TemplateFileName)) { errorsToHack.Add(ee); } } foreach (IMyGenError ee in errorsToHack) { _errors.Remove(ee); } } }
private void DeleteMatchingTemplateErrors(IMyGenError error) { if (error.Class == MyGenErrorClass.Template) { List<IMyGenError> errorsToHack = new List<IMyGenError>(); foreach (IMyGenError ee in _errors) { if ((error.TemplateIdentifier == ee.TemplateIdentifier) || (error.TemplateFileName == ee.TemplateFileName)) { errorsToHack.Add(ee); } } foreach (IMyGenError ee in errorsToHack) { _errors.Remove(ee); } } }
private void listView1_MouseDoubleClick(object sender, MouseEventArgs e) { IMyGenError error = SelectedError; if (error.Class == MyGenErrorClass.Template) { if (this.listView1.SelectedItems.Count > 0) { this._mdi.PerformMdiFuntion(this, "NavigateToTemplateError", this.SelectedError); } } else { if (this.listView1.SelectedItems.Count > 0) { this._mdi.PerformMdiFuntion(this, "ShowErrorDetail", this.SelectedErrors); } } }
private void BindErrors() { this.listView1.Items.Clear(); for (int i = _errors.Count - 1; i >= 0; i--) { IMyGenError error = _errors[i]; ListViewItem item = new ListViewItem(error.DateTimeOccurred.ToString()); item.SubItems.Add(error.Class.ToString()); item.SubItems.Add(error.Message); item.SubItems.Add(error.Detail); item.Tag = error; this.listView1.Items.Add(item); } Application.DoEvents(); if (this.IsHidden) { this.Show(this._mdi.DockPanel); this.VisibleState = DockState.DockBottomAutoHide; } this.Activate(); this.Refresh(); }
public void Update(IMyGenError error) { this.error = error; this.BindControl(); }
public void NavigateTo(IMyGenError error) { NavigateTo(error.IsTemplateCodeSegment, error.LineNumber, error.ColumnNumber); }
public object PerformMdiFunction(IMyGenContent sender, string function, params object[] args) { if (function.Equals("getstaticdbroot", StringComparison.CurrentCultureIgnoreCase)) { return(MetaDataBrowser.StaticMyMetaObj); } if (function.Equals("showoledbdialog", StringComparison.CurrentCultureIgnoreCase) && args.Length == 1) { return(BrowseOleDbConnectionString(args[0].ToString())); } if (function.Equals("executionqueuestart", StringComparison.CurrentCultureIgnoreCase)) { toolStripStatusQueue.Visible = true; timerImgAnimate.Start(); } else if (function.Equals("executionqueueupdate", StringComparison.CurrentCultureIgnoreCase)) { if (ZeusProcessManager.ProcessCount == 0) { timerImgAnimate.Stop(); toolStripStatusQueue.Visible = false; } else if (ZeusProcessManager.ProcessCount > 0) { toolStripStatusQueue.Visible = true; timerImgAnimate.Start(); } } else if (function.Equals("showerrordetail", StringComparison.CurrentCultureIgnoreCase) && args.Length >= 1) { if (args[0] is List <IMyGenError> ) { List <IMyGenError> errors = args[0] as List <IMyGenError>; ErrorDetailDockContent.Update(errors[0]); if (ErrorDetailDockContent.IsHidden) { ErrorDetailDockContent.Show(MainDockPanel); } else { ErrorDetailDockContent.Activate(); } } } else if (function.Equals("navigatetotemplateerror", StringComparison.CurrentCultureIgnoreCase) && args.Length >= 1) { if (args[0] is IMyGenError) { IMyGenError error = args[0] as IMyGenError; TemplateEditor edit = null; if (string.IsNullOrEmpty(error.SourceFile)) { //it's a new unsaved template bool isopen = IsDocumentOpen(error.TemplateIdentifier); if (isopen) { edit = FindDocument(error.TemplateIdentifier) as TemplateEditor; edit.Activate(); } } else { FileInfo file = new FileInfo(error.TemplateFileName); if (file.Exists) { bool isopen = IsDocumentOpen(file.FullName); if (!isopen) { edit = new TemplateEditor(this); edit.FileOpen(file.FullName); } else { edit = FindDocument(file.FullName) as TemplateEditor; if (edit != null) { edit.Activate(); } } } } if (edit != null) { edit.NavigateTo(error); } } } else if (function.Equals("getmymetadbdriver", StringComparison.CurrentCultureIgnoreCase)) { return(DefaultSettings.Instance.DbDriver); } else if (function.Equals("getmymetaconnection", StringComparison.CurrentCultureIgnoreCase)) { return(DefaultSettings.Instance.ConnectionString); } else if (function.Equals("openfile", StringComparison.CurrentCultureIgnoreCase) && args.Length == 1) { if (args[0] is List <FileInfo> ) { List <FileInfo> files = args[0] as List <FileInfo>; foreach (FileInfo fi in files) { Zeus.WindowsTools.LaunchFile(fi.FullName); } } else if (args[0] is FileInfo) { FileInfo file = args[0] as FileInfo; Zeus.WindowsTools.LaunchFile(file.FullName); } else if (args[0] is String) { Zeus.WindowsTools.LaunchFile(args[0].ToString()); } } return(null); }
public void Update(IMyGenError error) { this.errorDetailControl.Update(error); }
private void AddError(IMyGenError error) { if (_errors.Count == 0) _errors.Add(error); else _errors.Insert(0, error); }