コード例 #1
0
ファイル: Program.cs プロジェクト: JefftownGH/InventorConfig
        private static void LoadConfig(Options options)
        {
            ShowLoadBanner();

            ConfigFile configFile = new ConfigFile();

            configFile.GetLoadConfigFile(options.path);

            if (configFile.FilePath is null)
            {
                ShowNoValidConfigFileError();
                return;
            }

            //modify the Inventor config
            try
            {
                ConfigEngine configEngine = new ConfigEngine();
                configEngine.LoadConfig(configFile.FilePath, options.test);

                if (options.test)
                {
                    ShowTest();
                }
                else
                {
                    ShowComplete();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                //throw new SystemException(e.Message, e);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: gigios/Test
        private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            string strLogFolder = null;

            try
            {
                ConfigEngine config = new ConfigEngine();
                strLogFolder = config.AppConfigFolder;
                config.Log.Error(e.Exception.ToString(), "UnhandledException");
            }
            catch (Exception ex)
            {
                strLogFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\AutoVer\\";
                try
                {
                    if (!System.IO.Directory.Exists(strLogFolder))
                    {
                        System.IO.Directory.CreateDirectory(strLogFolder);
                    }
                }
                catch
                {
                }
            }
            if ((_frmErrorReporter == null) || !_frmErrorReporter.Visible)
            {
                _frmErrorReporter = new ErrorReporter(strLogFolder);
            }
            _frmErrorReporter.ErrorException = e.Exception;
            _frmErrorReporter.Show();
            _frmErrorReporter.Activate();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: JefftownGH/InventorConfig
        private static void WriteConfig(Options options)
        {
            ShowReadBanner();

            ConfigFile configFile = new ConfigFile();

            configFile.GetWriteConfigFile(options.output);

            if (configFile.FilePath is null)
            {
                ShowNoValidConfigFileError();
                return;
            }

            //modify the Inventor config
            try
            {
                ConfigEngine configEngine = new ConfigEngine();
                configEngine.WriteConfig(configFile.FilePath);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                //throw new SystemException(e.Message, e);
            }
        }
コード例 #4
0
        public void LoadActions()
        {
            try
            {
                if (this.engineManager == null || this.engineManager.IsDisposed)
                {
                    this.engineManager = new EngineManager(this);
                }

                this.engineManager.Clear();
                this.engineManager.Add(YuiCssEngine            = new YuiCssEngine());
                this.engineManager.Add(YuiJsEngine             = new YuiJsEngine());
                this.engineManager.Add(DeanEdwardsPackerEngine = new DeanEdwardsPackerEngine());
                this.engineManager.Add(ClosureCompilerEngine   = new ClosureCompilerEngine());
                this.engineManager.Add(LessEngine         = new LessEngine());
                this.engineManager.Add(MsJsEngine         = new MsJsEngine());
                this.engineManager.Add(MsCssEngine        = new MsCssEngine());
                this.engineManager.Add(ConfigEngine       = new ConfigEngine());
                this.engineManager.Add(ViewEngine         = new ViewEngine());
                this.engineManager.Add(T4Engine           = new T4Engine());
                this.engineManager.Add(CoffeeScriptEngine = new CoffeeScriptEngine());
                this.engineManager.Add(UglifyEngine       = new UglifyEngine());
                this.engineManager.Add(JSHintEngine       = new JSHintEngine());
                this.engineManager.Add(CSSLintEngine      = new CSSLintEngine());
                this.engineManager.Add(TypeScriptEngine   = new TypeScriptEngine());
                this.engineManager.Add(SassEngine         = new SassEngine());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #5
0
        public static void Initialize()
        {
            Console.WriteLine("Redirect Server Core Initialization");
            Console.WriteLine("-----------------------------------");

            #region Configuration Engine Initialization

            m_ConfigEngine = new ConfigEngine(CoreAssembly);
            Console.WriteLine();

            #endregion

            ConfigFile    ServerConfig        = m_ConfigEngine.LoadFile(Path.Combine(m_ConfigEngine.DataPath, "ServerConfiguration.xml"));
            ConfigElement ServerConfigElement = ServerConfig["config", "RedirectServer"];

            #region Script Engine Initialization

            ConfigElement[] PackageElements = ServerConfigElement.GetSubElements("packages");
            string[]        PathList        = new string[PackageElements.Length];

            for (int i = 0; i <= PackageElements.Length - 1; i++)
            {
                PathList[i] = PackageElements[i].GetString("packages_Column");
            }

            m_ScriptEngine = new ScriptEngine(m_ConfigEngine, PathList);

            Console.WriteLine();

            #endregion
            #region .NET Remoting Initialization

            Console.WriteLine("* Redirect Server .NET remoting service has been configured:\n");

            ConfigElement[] RemotingElements = ServerConfigElement.GetSubElements("remoting");
            if (RemotingElements.Length != 1)
            {
                //We must have a remoting configuration (and only one), so throw an exception here.
            }

            string RemotingName = RemotingElements[0].GetString("name");
            ushort RemotingPort = RemotingElements[0].GetUInt16("port");

            RemotingServer RemoteInterface = new RemotingServer(RemotingName, RemotingPort);
            RemoteInterface.RegisterType(RemotingName, typeof(RemoteRedirectServer));
            RemoteInterface.Enabled = true;

            Console.WriteLine("  Service Name: {0}\n  Service Port: {1}", RemotingName, RemotingPort);
            Console.WriteLine();

            #endregion

            ushort Port = ServerConfigElement.GetUInt16("port");
            m_Server = new RedirectServerListener(Port);
        }
コード例 #6
0
        /// <summary>
        /// process directory to config engine
        /// </summary>
        /// <param name="directoryPath">Directory full path</param>
        static void ConfigDirectory(string directoryPath)
        {
            var configEngine = new ConfigEngine();
            var settings     = new Settings(directoryPath);

            foreach (string filename in Directory.GetFiles(directoryPath, "*" + settings.ChirpConfigFile, SearchOption.TopDirectoryOnly))
            {
                try
                {
                    System.Console.WriteLine(string.Format("ConfigEngine -- {0}", filename));
                    configEngine.Run(filename, null);
                }
                catch (System.IO.FileNotFoundException)
                {
                    System.Console.WriteLine(string.Format("File not found in config file={0}", filename));
                }
            }
        }
コード例 #7
0
        private void IndexDependencies()
        {
            try {
                foreach (Project project in this.App.Solution.Projects)
                {
                    var projectItems = project.ProjectItems.ProcessFolderProjectItemsRecursively();
                    if (projectItems != null)
                    {
                        var configs = projectItems
                                      .Where(x => ConfigEngine.Handles(x.Name) > 0 || LessEngine.Handles(x.Name) > 0);

                        foreach (ProjectItem config in configs)
                        {
                            ConfigEngine.ReloadFileDependencies(config);
                        }
                    }
                }
            } catch (Exception e) {
                this.OutputWindowWriteText(e.ToString());
            }
        }