Ejemplo n.º 1
0
 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));
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command == "UpdateDefaultSettings")
     {
         this.DefaultSettingsChanged(DefaultSettings.Instance);
     }
 }
Ejemplo n.º 3
0
        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();
                }
            }
        }
Ejemplo n.º 4
0
 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);
             }
         }
     }
 }
Ejemplo n.º 5
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command == "UpdateDefaultSettings")
     {
         this.Clear();
     }
 }
Ejemplo n.º 6
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase))
     {
         this.Clear();
     }
 }
Ejemplo n.º 7
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase))
     {
         this._consoleWriteGeneratedDetails = DefaultSettings.Instance.ConsoleWriteGeneratedDetails;
     }
 }
Ejemplo n.º 8
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase))
     {
         sqlToolUserControl1.RefreshConnectionInfo();
         BindForm();
     }
 }
Ejemplo n.º 9
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command == "UpdateDefaultSettings")
     {
         PromptForSave(false);
         Clear();
     }
 }
Ejemplo n.º 10
0
        public static IMyGenContent CreateContent(IMyGenerationMDI mdi, string key)
        {
            IMyGenContent mygencontent = null;

            if (PluginManager.ContentManagers.ContainsKey(key))
            {
                mygencontent = PluginManager.ContentManagers[key].Create(mdi);
            }
            return(mygencontent);
        }
Ejemplo n.º 11
0
 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.");
 }
Ejemplo n.º 12
0
        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);
        }
Ejemplo n.º 13
0
        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);
            }
        }
Ejemplo n.º 14
0
        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);
            }
        }
Ejemplo n.º 15
0
        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);
                }
            }
        }
Ejemplo n.º 16
0
        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();
                }
            }
        }
Ejemplo n.º 17
0
        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();
            }
        }
Ejemplo n.º 18
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     //
 }
Ejemplo n.º 19
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command == "UpdateDefaultSettings")
     {
         PromptForSave(false);
         Clear();
     }
 }
Ejemplo n.º 20
0
 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.");
 }
Ejemplo n.º 21
0
        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);
            }
        }
Ejemplo n.º 22
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     //throw new Exception("The method or operation is not implemented.");
 }
Ejemplo n.º 23
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     //
 }
Ejemplo n.º 24
0
 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));
             }
         }
     }
 }
Ejemplo n.º 25
0
        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);
                        }
                    }
                }
            }
        }
Ejemplo n.º 26
0
        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);
                }
            }
        }
Ejemplo n.º 27
0
        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;
        }
Ejemplo n.º 28
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase))
     {
         this._consoleWriteGeneratedDetails = DefaultSettings.Instance.ConsoleWriteGeneratedDetails;
     }
 }
Ejemplo n.º 29
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase))
     {
         this.DefaultSettingsChanged(DefaultSettings.Instance);
     }
 }
Ejemplo n.º 30
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     //throw new Exception("The method or operation is not implemented.");
 }
Ejemplo n.º 31
0
        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);
            }
        }
Ejemplo n.º 32
0
        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();
            }
        }
Ejemplo n.º 33
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase))
     {
         PromptForSave(false);
         this.Clear();
     }
 }
Ejemplo n.º 34
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command == "UpdateDefaultSettings")
     {
         this.DefaultSettingsChanged(DefaultSettings.Instance);
     }
 }
Ejemplo n.º 35
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command == "UpdateDefaultSettings")
     {
         this.Clear();
     }
 }
Ejemplo n.º 36
0
 public void ProcessAlert(IMyGenContent sender, string command, params object[] args)
 {
     if (command.Equals("UpdateDefaultSettings", StringComparison.CurrentCultureIgnoreCase))
     {
         sqlToolUserControl1.RefreshConnectionInfo();
         BindForm();
     }
 }
Ejemplo n.º 37
0
        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);
        }