public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("FileGenerated", StringComparison.CurrentCultureIgnoreCase)) { List <FileInfo> files = new List <FileInfo>(); foreach (object arg in args) { if (arg is FileInfo) { this.AddFile(arg as FileInfo); } else if (arg is String) { this.AddFile(new FileInfo(arg.ToString())); } else if (arg is List <FileInfo> ) { foreach (FileInfo finf in (arg as List <FileInfo>)) { this.AddFile(finf); } } else if (arg is List <String> ) { List <String> strs = arg as List <String>; foreach (string s in strs) { this.AddFile(new FileInfo(s)); } } } } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command == "UpdateDefaultSettings") { this.DefaultSettingsChanged(DefaultSettings.Instance); } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { DefaultSettings settings = DefaultSettings.Instance; if (command == "UpdateDefaultSettings") { bool doRefresh = false; try { if (this.treeBuilder.DefaultTemplatePath != settings.DefaultTemplateDirectory) { doRefresh = true; } } catch { doRefresh = true; } if (doRefresh) { this.RefreshTree(); } } }
private void OpenContent(params string[] keys) { foreach (var key in keys) { if (_dynamicContentWindows.ContainsKey(key)) { IMyGenContent mygenContent = _dynamicContentWindows[key]; if (mygenContent.DockContent.Visible) { mygenContent.DockContent.Hide(); } else { mygenContent.DockContent.Show(MainDockPanel); } } else { IMyGenContent mygenContent = ContentManager.CreateContent(this, key); if (mygenContent != null) { _dynamicContentWindows[key] = mygenContent; mygenContent.DockContent.Show(MainDockPanel); } } } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command == "UpdateDefaultSettings") { this.Clear(); } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { this.Clear(); } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { this._consoleWriteGeneratedDetails = DefaultSettings.Instance.ConsoleWriteGeneratedDetails; } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { sqlToolUserControl1.RefreshConnectionInfo(); BindForm(); } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command == "UpdateDefaultSettings") { PromptForSave(false); Clear(); } }
public static IMyGenContent CreateContent(IMyGenerationMDI mdi, string key) { IMyGenContent mygencontent = null; if (PluginManager.ContentManagers.ContainsKey(key)) { mygencontent = PluginManager.ContentManagers[key].Create(mdi); } return(mygencontent); }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { /*if (sender is ErrorsForm) * { * if (command == "ErrorDetail") * { * args[0]; * } * }*/ //throw new Exception("The method or operation is not implemented."); }
private bool Shutdown(bool allowPrevent) { var shutdown = true; try { string dockConfigFileName = _startupPath + DOCK_CONFIG_FILE; IMyGenContent mygenContent = null; DockContentCollection dockContentCollection = MainDockPanel.Contents; var canClose = true; if (allowPrevent && !ZeusProcessManager.IsDormant) { return(false); } foreach (IDockContent dockContent in dockContentCollection) { mygenContent = dockContent as IMyGenContent; // We need the MetaDataBrowser window to be closed last // because it houses the UserMetaData if (!(mygenContent is MetaDataBrowser)) { canClose = mygenContent.CanClose(allowPrevent); if (allowPrevent && !canClose) { shutdown = false; break; } } if (dockContent.DockHandler.IsHidden) { dockContent.DockHandler.Close(); } } if (shutdown) { MainDockPanel.SaveAsXml(dockConfigFileName); } } catch { shutdown = true; } return(shutdown); }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { DefaultSettings settings = DefaultSettings.Instance; PromptForSave(false); this.dbDriver = settings.DbDriver; PopulateComboBox(settings); PopulateGrid(this.dbDriver); MarkAsDirty(false); } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command == "UpdateDefaultSettings") { DefaultSettings settings = DefaultSettings.Instance; PromptForSave(false); this.dbDriver = settings.DbDriver; PopulateComboBox(settings); PopulateGrid(this.dbDriver); MarkAsDirty(false); } }
public void SendAlert(IMyGenContent sender, string command, params object[] args) { IMyGenContent contentItem = null; DockContentCollection contents = MainDockPanel.Contents; DefaultSettings settings = DefaultSettings.Instance; for (int i = 0; i < contents.Count; i++) { contentItem = contents[i] as IMyGenContent; if (contentItem != null) { contentItem.ProcessAlert(sender, command, args); } } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { DefaultSettings settings = DefaultSettings.Instance; if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { this._consoleWriteGeneratedDetails = settings.ConsoleWriteGeneratedDetails; bool doRefresh = false; if (DefaultSettings.Instance.ExecuteFromTemplateBrowserAsync) { this.templateBrowserControl.ExecuteTemplateOverride = new ExecuteTemplateDelegate(ExecuteTemplateOverride); } else { this.templateBrowserControl.ExecuteTemplateOverride = null; } try { if (this.templateBrowserControl.TreeBuilder.DefaultTemplatePath != settings.DefaultTemplateDirectory) { doRefresh = true; } } catch { doRefresh = true; } if (doRefresh) { templateBrowserControl.RefreshTree(); } } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { DefaultSettings settings = DefaultSettings.Instance; if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { this._consoleWriteGeneratedDetails = settings.ConsoleWriteGeneratedDetails; bool doRefresh = false; if (DefaultSettings.Instance.ExecuteFromTemplateBrowserAsync) this.templateBrowserControl.ExecuteTemplateOverride = new ExecuteTemplateDelegate(ExecuteTemplateOverride); else this.templateBrowserControl.ExecuteTemplateOverride = null; try { if (this.templateBrowserControl.TreeBuilder.DefaultTemplatePath != settings.DefaultTemplateDirectory) doRefresh = true; } catch { doRefresh = true; } if (doRefresh) templateBrowserControl.RefreshTree(); } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { // }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { /*if (sender is ErrorsForm) { if (command == "ErrorDetail") { args[0]; } }*/ //throw new Exception("The method or operation is not implemented."); }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { //throw new Exception("The method or operation is not implemented."); }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("FileGenerated", StringComparison.CurrentCultureIgnoreCase)) { List<FileInfo> files = new List<FileInfo>(); foreach (object arg in args) { if (arg is FileInfo) { this.AddFile(arg as FileInfo); } else if (arg is String) { this.AddFile(new FileInfo(arg.ToString())); } else if (arg is List<FileInfo>) { foreach (FileInfo finf in (arg as List<FileInfo>)) this.AddFile(finf); } else if (arg is List<String>) { List<String> strs = arg as List<String>; foreach (string s in strs) this.AddFile(new FileInfo(s)); } } } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { DefaultSettings settings = DefaultSettings.Instance; SetCodePageOverride(settings.CodePage); SetFontOverride(settings.FontFamily); this.scintillaTemplateCode.TabWidth = settings.Tabs; this.copyOutputToClipboardToolStripMenuItem.Checked = settings.EnableClipboard; } if (command.Equals("UpdateTemplate", StringComparison.CurrentCultureIgnoreCase)) { if (args.Length > 0) { if (string.Equals(args[0].ToString(), this._template.UniqueID, StringComparison.CurrentCultureIgnoreCase)) { if (MessageBox.Show(this, "The file \r\n\"" + this._template.FileName + "\"\r\n has been updated outside of the editor.\r\nWould you like to refresh with the new contents?", "Refresh Updated File?", MessageBoxButtons.YesNo) == DialogResult.Yes) { this.Activate(); this._Initialize(this.FileName); } } } } }
public void SendAlert(IMyGenContent sender, string command, params object[] args) { IMyGenContent contentItem = null; DockContentCollection contents = this.dockPanel.Contents; DefaultSettings settings = DefaultSettings.Instance; for (int i = 0; i < contents.Count; i++) { contentItem = contents[i] as IMyGenContent; if (contentItem != null) { contentItem.ProcessAlert(sender, command, args); } } }
public object PerformMdiFuntion(IMyGenContent sender, string function, params object[] args) { if (function.Equals("getstaticdbroot", StringComparison.CurrentCultureIgnoreCase)) { return MetaDataBrowser.StaticMyMetaObj; } else if (function.Equals("showoledbdialog", StringComparison.CurrentCultureIgnoreCase) && args.Length == 1) { return BrowseOleDbConnectionString(args[0].ToString()); } else if (function.Equals("executionqueuestart", StringComparison.CurrentCultureIgnoreCase)) { this.toolStripStatusQueue.Visible = true; timerImgAnimate.Start(); } else if (function.Equals("executionqueueupdate", StringComparison.CurrentCultureIgnoreCase)) { if (ZeusProcessManager.ProcessCount == 0) { timerImgAnimate.Stop(); this.toolStripStatusQueue.Visible = false; } else if (ZeusProcessManager.ProcessCount > 0) { this.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 (this.ErrorDetailDockContent.IsHidden) { this.ErrorDetailDockContent.Show(this.dockPanel); } else { this.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 = this.IsDocumentOpen(error.TemplateIdentifier); if (isopen) { edit = this.FindDocument(error.TemplateIdentifier) as TemplateEditor; edit.Activate(); } } else { FileInfo file = new FileInfo(error.TemplateFileName); if (file.Exists) { bool isopen = this.IsDocumentOpen(file.FullName); if (!isopen) { edit = new TemplateEditor(this); edit.FileOpen(file.FullName); } else { edit = this.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.ToString()); } } 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 ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { this.DefaultSettingsChanged(DefaultSettings.Instance); } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { DefaultSettings settings = DefaultSettings.Instance; if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { bool doRefresh = false; try { if (this.treeBuilder.DefaultTemplatePath != settings.DefaultTemplateDirectory) { doRefresh = true; } } catch { doRefresh = true; } if (doRefresh) this.RefreshTree(); } }
public void ProcessAlert(IMyGenContent sender, string command, params object[] args) { if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase)) { PromptForSave(false); this.Clear(); } }
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); }