public static OPSConfig GetConfig(string configFile) { FileStream fis = File.OpenRead(configFile); XMLArchiverIn archiverIn = new XMLArchiverIn(fis, "root"); archiverIn.Add(OPSObjectFactory.GetInstance()); OPSConfig newConfig = null; newConfig = (OPSConfig)archiverIn.Inout("ops_config", newConfig); fis.Close(); return(newConfig); }
public static OPSConfig GetConfig(string configFile) { try { FileStream fis = File.OpenRead(configFile); XMLArchiverIn archiverIn = new XMLArchiverIn(fis, "root"); archiverIn.Add(OPSObjectFactory.GetInstance()); OPSConfig newConfig = null; newConfig = (OPSConfig)archiverIn.Inout("ops_config", newConfig); fis.Close(); return(newConfig); } catch (FileNotFoundException) { Logger.ExceptionLogger.LogMessage("OPSConfig::GetConfig(), File NOT found: " + configFile); return(null); } }
/// <summary> /// /// </summary> /// <param name="buf"></param> /// <param name="factory"></param> public OPSArchiverIn(ReadByteBuffer buf, OPSObjectFactory factory) { compositeFactory = factory; readBuf = buf; }
/// /// <param name="buf"></param> public OPSArchiverIn(ReadByteBuffer buf) { compositeFactory = OPSObjectFactory.GetInstance(); readBuf = buf; }