コード例 #1
0
 public static void EnableTraceLog()
 {
     if (StartupConfig.GetValue("EnableNetworkTraceLog") == "true")
     {
         var d = new DebugLogTraceListener
         {
             logToConsole = StartupConfig.GetValue("NetworkTraceLogToConsole") == "true"
         };
         Trace.Listeners.Add(d);
         Application.quitting += () => d.logStream.Dispose();
     }
 }
コード例 #2
0
ファイル: Config.cs プロジェクト: electroball09/configuration
    static void Initialize()
    {
        string requestedControllerType = StartupConfig.GetValue(STARTUP_CONFIG_CONTROLLER_TYPE_KEY);

        if (!string.IsNullOrEmpty(requestedControllerType))
        {
            Type cfgControllerType = Type.GetType(requestedControllerType);
            cfgController = InitializeSpecifiedControllerType(cfgControllerType);
        }
        else
        {
            Debug.Log("No requested controller type specified, initializing with default (" + DEFAULT_CONTROLLER_TYPE.Name + ")");
            cfgController = InitializeSpecifiedControllerType(DEFAULT_CONTROLLER_TYPE);
        }

        localConfig = GetController <IniConfigurationController>().GetConfiguration(LOCAL_CONFIG_PATH, DEFAULT_CONFIG_NAME);
        localConfig.ReadFile();
        persistentConfig = GetController <IniConfigurationController>().GetConfiguration(PERSISTENT_CONFIG_PATH, DEFAULT_CONFIG_NAME);
        persistentConfig.ReadFile();
    }