예제 #1
0
        public static KO2Config loadO2Config(string pathToO2ConfigFile, bool createFileIfDoesntExit)
        {
            if (false == File.Exists(pathToO2ConfigFile))
            {
                if (createFileIfDoesntExit)
                {
                    return(createO2ConfigFile(pathToO2ConfigFile));
                }
                else
                {
                    return(null);
                }
            }

            var kO2Config = (KO2Config)O2Kernel_Serialize.getDeSerializedObjectFromXmlFile(pathToO2ConfigFile, typeof(KO2Config));

            if (kO2Config != null)
            {
                applyO2ConfigDependeciesInjection(kO2Config);
                return(kO2Config);
            }
            DI.log.error("in loadO2Config, could not load KO2Config file: {0}", pathToO2ConfigFile);
            return(null);
        }
예제 #2
0
 private static void saveO2ConfigFile(KO2Config o2ConfigFileToSave, string path)
 {
     O2Kernel_Serialize.createSerializedXmlFileFromObject(o2ConfigFileToSave, path, null);
 }