示例#1
0
 public override void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     base.init(utility, theParent);
     if (cls != null && cls.Length > 0)
     {
         inheritstyle = cls;
     }
 }
示例#2
0
 public override void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     base.init(utility, theParent);
     if (cls != null && cls.Length > 0)
     {
         inheritstyle = cls;
     }
 }
示例#3
0
 public virtual void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     if (theParent == null)
     {
         _parent = (ConfigFile)this;
     }
     else
     {
         _parent = theParent;
     }
 }
示例#4
0
 public virtual void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     if (theParent == null)
     {
         _parent = (ConfigFile)this;
     }
     else
     {
         _parent = theParent;
     }
 }
示例#5
0
 public override void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     ConfigFile configFile = null;
     includedFiles = new ConfigFile[0];
     base.init(utility, theParent);
     if (includes == null)
     {
         includes = new include[0];
     }
     for (int j = 0; j < includes.Length; j++)
     {
         includes[j].init(utility, _parent);
     }
     for (int i = 0; i < includes.Length; i++)
     {
         configFile = (ConfigFile)utility.LoadConfiguration(base.GetType(), includes[i].file, (ConfigFile)_parent);
         addIncludedFile(configFile);
     }
     CollectScintillaNodes(null);
 }
示例#6
0
        public override void init(ConfigurationUtility utility, ConfigFile theParent)
        {
            ConfigFile configFile = null;

            includedFiles = new ConfigFile[0];
            base.init(utility, theParent);
            if (includes == null)
            {
                includes = new include[0];
            }
            for (int j = 0; j < includes.Length; j++)
            {
                includes[j].init(utility, _parent);
            }
            for (int i = 0; i < includes.Length; i++)
            {
                configFile = (ConfigFile)utility.LoadConfiguration(base.GetType(), includes[i].file, (ConfigFile)_parent);
                addIncludedFile(configFile);
            }
            CollectScintillaNodes(null);
        }
示例#7
0
 public override void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     base.init(utility, theParent);
     if (languages == null)
     {
         languages = new Language[0];
     }
     if (styleclasses == null)
     {
         styleclasses = new StyleClass[0];
     }
     if (keywordclass == null)
     {
         keywordclass = new KeywordClass[0];
     }
     if (globals == null)
     {
         globals = new Value[0];
     }
     for (int i2 = 0; i2 < languages.Length; i2++)
     {
         languages[i2].init(utility, _parent);
     }
     for (int k = 0; k < styleclasses.Length; k++)
     {
         styleclasses[k].init(utility, _parent);
     }
     for (int j = 0; j < keywordclass.Length; j++)
     {
         keywordclass[j].init(utility, _parent);
     }
     for (int i1 = 0; i1 < globals.Length; i1++)
     {
         globals[i1].init(utility, _parent);
     }
 }
示例#8
0
 public override void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     base.init(utility, theParent);
     if (usekeywords == null)
     {
         usekeywords = new UseKeyword[0];
     }
     if (usestyles == null)
     {
         usestyles = new UseStyle[0];
     }
     for (int j = 0; j < usekeywords.Length; j++)
     {
         usekeywords[j].init(utility, _parent);
     }
     for (int i = 0; i < usestyles.Length; i++)
     {
         usestyles[i].init(utility, _parent);
     }
     if (lexer != null)
     {
         lexer.init(utility, _parent);
     }
 }
示例#9
0
文件: Language.cs 项目: zhh007/MyGen
 public override void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     base.init(utility, theParent);
     if (usekeywords == null)
     {
         usekeywords = new UseKeyword[0];
     }
     if (usestyles == null)
     {
         usestyles = new UseStyle[0];
     }
     for (int j = 0; j < usekeywords.Length; j++)
     {
         usekeywords[j].init(utility, _parent);
     }
     for (int i = 0; i < usestyles.Length; i++)
     {
         usestyles[i].init(utility, _parent);
     }
     if (lexer != null)
     {
         lexer.init(utility, _parent);
     }
 }
示例#10
0
        /// <summary>
        /// Constructor loads up the default settings, starts an async version check, loads the scintilla config, etc.
        /// </summary>
        /// <param name="startupPath"></param>
        /// <param name="args"></param>
        public MDIParent(string startupPath, params string[] args)
        {
            TheParent = this;
            DefaultSettings settings = DefaultSettings.Instance;
            languageMappings = new LanguageMappings(this);
            dbTargetMappings = new DbTargetMappings(this);
       metaDataBrowser = new MetaDataBrowser(this);
        userMetaData = new UserMetaData(this);
        globalUserMetaData = new GlobalUserMetaData(this);
        metaProperties = new MetaProperties(this);


            //Any files that were locked when the TemplateLibrary downloaded and tried to replace them will be replaced now.
            ProcessReplacementFiles();

            StartVersionCheck(settings);

            userMetaData.MetaDataBrowser = this.metaDataBrowser;
            globalUserMetaData.MetaDataBrowser = this.metaDataBrowser;

            InitializeComponent();

            this.startupPath = startupPath;

            //Configuration.MyGeneration x = Configuration.MyGeneration.PopulatedObject;
            Scintilla.Configuration.Legacy.ConfigurationUtility cu = new Scintilla.Configuration.Legacy.ConfigurationUtility();

            // If the file doesn't exist, create it.
            FileInfo scintillaConfigFile = new FileInfo(startupPath + @"\settings\ScintillaNET.xml");
            if (scintillaConfigFile.Exists)
            {
                //TODO: Retry this with a copy of the file until we can upgrade Scintilla.Net with a fix.
                int maxTries = 3;
                while (maxTries > 0)
                {
                    try
                    {
                        //ConfigFile cf = new ConfigFile();
                        configFile = cu.LoadConfiguration(scintillaConfigFile.FullName) as ConfigFile;
                        //cf.
                        //object o = cu.LoadConfiguration(typeof(Configuration.MyGeneration), scintillaConfigFile.FullName);
                        //configFile = o as Configuration.;
                        //configFile.CollectScintillaNodes(null);
                        break;
                    }
                    catch
                    {
                        if (--maxTries == 1)
                        {
                            File.Copy(scintillaConfigFile.FullName, scintillaConfigFile.FullName + ".tmp", true);
                            scintillaConfigFile = new FileInfo(scintillaConfigFile.FullName + ".tmp");
                        }
                        else
                        {
                            System.Threading.Thread.Sleep(10);
                        }
                    }
                }
            }

            if (configFile != null)
            {
                configureDelegate = configFile.MasterScintilla.Configure;
                ZeusScintillaControl.StaticConfigure = configureDelegate;
            }

            this.IsMdiContainer = true;
            this.MdiChildActivate += new EventHandler(this.MDIChildActivated);

            startupFiles = args;

            if (settings.CompactMemoryOnStartup) FlushMemory();

            this.RefreshRecentFiles();
        }
        private void MyGenerationMDI_Load(object sender, EventArgs e)
        {
            switch (settings.WindowState)
            {
                case "Maximized":

                    this.WindowState = FormWindowState.Maximized;
                    break;

                case "Minimized":

                    this.WindowState = FormWindowState.Minimized;
                    break;

                case "Normal":

                    int x = Convert.ToInt32(settings.WindowPosLeft);
                    int y = Convert.ToInt32(settings.WindowPosTop);
                    int w = Convert.ToInt32(settings.WindowPosWidth);
                    int h = Convert.ToInt32(settings.WindowPosHeight);

                    this.Location = new System.Drawing.Point(x, y);
                    this.Size = new Size(w, h);
                    break;
            }

            // Load up the scintilla configuration
            ConfigurationUtility cu = new ConfigurationUtility();

            FileInfo scintillaConfigFile = new FileInfo(startupPath + SCINTILLA_CONFIG_FILE);
            #region HACK: this needs to be cleaned up at some point.
            // If the file doesn't exist, create it.
            if (scintillaConfigFile.Exists)
            {
                //TODO: Retry this with a copy of the file until we can upgrade Scintilla.Net with a fix.
                int maxTries = 3;
                while (maxTries > 0)
                {
                    try
                    {
                        configFile = cu.LoadConfiguration(scintillaConfigFile.FullName) as ConfigFile;
                        break;
                    }
                    catch
                    {
                        if (--maxTries == 1)
                        {
                            File.Copy(scintillaConfigFile.FullName, scintillaConfigFile.FullName + ".tmp", true);
                            scintillaConfigFile = new FileInfo(scintillaConfigFile.FullName + ".tmp");
                        }
                        else
                        {
                            System.Threading.Thread.Sleep(10);
                        }
                    }
                }
            }
            #endregion
            if (configFile != null)
            {
                configureDelegate = configFile.MasterScintilla.Configure;
                ZeusScintillaControl.StaticConfigure = configureDelegate;
            }

            // Dock Content configuration
            DeserializeDockContent deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
            string dockConfigFileName = startupPath + DOCK_CONFIG_FILE;

            if (File.Exists(dockConfigFileName))
            {
                try 
                {
                    dockPanel.LoadFromXml(dockConfigFileName, deserializeDockContent);
                }
                catch (Exception ex)
                {
                    try 
                    {
                        File.Delete(dockConfigFileName);
                    }
                    catch {}
                }
            }

            // Startup files from the command line
            if (this.startupFiles != null)
            {
                OpenDocuments(startupFiles);
            }

            // Show Default Properties if this is the first load.
            if (settings.FirstLoad)
            {
                if (!settings.EnableDocumentStyleSettings)
                {
                    if (options != null) { this.OptionsDockContent.Hide(); this.options = null; }
                    DefaultSettingsDialog dsd = new DefaultSettingsDialog(this);
                    dsd.ShowDialog(this);
                }
                else
                {
                    if (this.OptionsDockContent.IsHidden)
                        this.OptionsDockContent.Show(this.dockPanel);
                    this.OptionsDockContent.Activate();
                }
            }
        }
示例#12
0
 public override void init(ConfigurationUtility utility, ConfigFile theParent)
 {
     base.init(utility, theParent);
     if (languages == null)
     {
         languages = new Language[0];
     }
     if (styleclasses == null)
     {
         styleclasses = new StyleClass[0];
     }
     if (keywordclass == null)
     {
         keywordclass = new KeywordClass[0];
     }
     if (globals == null)
     {
         globals = new Value[0];
     }
     for (int i2 = 0; i2 < languages.Length; i2++)
     {
         languages[i2].init(utility, _parent);
     }
     for (int k = 0; k < styleclasses.Length; k++)
     {
         styleclasses[k].init(utility, _parent);
     }
     for (int j = 0; j < keywordclass.Length; j++)
     {
         keywordclass[j].init(utility, _parent);
     }
     for (int i1 = 0; i1 < globals.Length; i1++)
     {
         globals[i1].init(utility, _parent);
     }
 }