Esempio n. 1
0
        static BaseParser()
        {
            verbose = LoggingUtil.GetLogLevel(typeof(BaseParser)) == LoggingUtil.LogLevel.VERBOSE;

            // Create the precendence map
            if (precedence.Count == 0)
            {
                for (int i = 0; i < PRECENDENCE_CONSTS.Length; i++)
                {
                    foreach (string token in PRECENDENCE_CONSTS[i])
                    {
                        precedence[token] = i;
                    }
                }
            }

            // Register each type of expression parser
            foreach (Type subclass in ContractConfigurator.GetAllTypes <IExpressionParserRegistrer>())
            {
                if (subclass.IsClass && !subclass.IsAbstract)
                {
                    IExpressionParserRegistrer r = Activator.CreateInstance(subclass) as IExpressionParserRegistrer;
                    var method = subclass.GetMethod("RegisterExpressionParsers");
                    method.Invoke(r, new object[] { });
                }
            }
        }
Esempio n. 2
0
 private void SetupToolbar()
 {
     if (launcherButton == null && LoggingUtil.GetLogLevel(typeof(CutSceneConfigurator)) == LoggingUtil.LogLevel.DEBUG)
     {
         ApplicationLauncher.AppScenes visibleScenes = ApplicationLauncher.AppScenes.FLIGHT;
         launcherButton = ApplicationLauncher.Instance.AddModApplication(ToggleWindow, ToggleWindow, null, null, null, null,
                                                                         visibleScenes, toolbarIcon);
     }
 }