public static bool SaveConfig <T>(T t) where T : class, new() { ConfigFileAttribute attribute = AttributeHelper.GetConfigAttribute <ConfigFileAttribute>(typeof(T)); if (attribute == null) { ConfigThrowHelper.ThrowConfigException( R.ConfigError_NoConfigAttribute, typeof(T).FullName, typeof(ConfigFileAttribute).FullName); } ConfigSettings configSettings = FrameworkConfig.GetConfig <ConfigSettings>(); string configFilePath = string.Empty; switch (attribute.ConfigPathType) { case ConfigPathType.FullPhysicalPath: configFilePath = attribute.FileName; break; case ConfigPathType.ServerPath: configFilePath = HttpContext.Current.Server.MapPath(attribute.FileName); break; default: configFilePath = configSettings.GetConfigFilePath <T>(); break; } XmlConfigGetParameter getParameter = new XmlConfigGetParameter(configFilePath, attribute.IncludeSubdirectories); return(ObjectXmlSerializer.SaveXmlToFlie <T>(getParameter.FilePaths, t)); }
/// <summary> /// /// </summary> /// <param name="getParameter"></param> /// <param name="restartAppDomainOnChange"></param> public XmlConfigChangedEventArgs(XmlConfigGetParameter getParameter, bool restartAppDomainOnChange) : base(getParameter, restartAppDomainOnChange) { }
/// <summary> /// /// </summary> /// <param name="getParameter"></param> public XmlConfigChangedEventArgs(XmlConfigGetParameter getParameter) : base(getParameter) { }