internal void CopyBase(WebSettingItem WebConfig) { _root = WebConfig.Root; _port = WebConfig.Port; _theme = WebConfig.Theme; _themePath = WebConfig.ThemePath; _compatible = WebConfig.Compatible; _encoding = WebConfig.Encoding; _sessionOutTime = WebConfig.SessionOutTime; _encryptKey = WebConfig.EncryptKey; _encryptIV = WebConfig.EncryptIV; _debugMode = WebConfig.DebugMode; _userKeyCookieName = WebConfig.UserKeyCookieName; _xsltDir = WebConfig.XsltDir; _pageDir = WebConfig.PageDir; _includeDir = WebConfig.IncludeDir; _cacheDir = WebConfig.CacheDir; _cssDir = WebConfig.CssDir; _scriptDir = WebConfig.ScriptDir; _cssPath = WebConfig.CssPath; _scriptPath = WebConfig.ScriptPath; CopyConfig(WebConfig); CopyTranslate(WebConfig); CreateFolders(); }
private void CopyTranslate(WebSettingItem WebConfig) { foreach (string _key in WebConfig.Config.Keys) { if (string.IsNullOrEmpty(_config[_key])) { _config[_key] = WebConfig.Config[_key]; } } }
private static void Init() { _instances = new Dictionary <string, WebSettingItem>(); System.Xml.XmlDocument _document = new System.Xml.XmlDocument(); List <string> _tempConfigNameList = new List <string>(); _document.Load(Xy.Tools.IO.File.foundConfigurationFile("Web", Xy.AppSetting.FILE_EXT)); System.Xml.XmlNodeList _webSettings = _document.GetElementsByTagName("WebSetting"); for (int i = 0; i < _webSettings.Count; i++) { System.Xml.XmlNode _item = _webSettings[i]; WebSettingItem _ws = new WebSettingItem(_item); if (string.Compare(_ws.Name, DEFAULTWEBSETTINGNAME, true) == 0) { WebSettingItem _defaultWS = InitDefaultConfig(); _ws.CopyBase(_defaultWS); _ws.Init(_item); _instances.Add(_ws.Name, _ws); _defaultItem = _ws; break; } } if (_defaultItem == null) { _defaultItem = InitDefaultConfig(); } _tempConfigNameList.Add(DEFAULTWEBSETTINGNAME); for (int i = 0; i < _webSettings.Count; i++) { System.Xml.XmlNode _item = _webSettings[i]; WebSettingItem _ws = new WebSettingItem(_item); if (string.Compare(_ws.Name, DEFAULTWEBSETTINGNAME, true) != 0) { _ws.CopyBase(_ws.Inherit); _ws.Init(_item); _instances.Add(_ws.Name, _ws); _tempConfigNameList.Add(_ws.Name); } } _configNameList = _tempConfigNameList.ToArray(); }
private static WebSettingItem InitDefaultConfig() { WebSettingItem _default; System.Xml.XmlDocument _document = new System.Xml.XmlDocument(); //<SiteUrl>self</SiteUrl> _document.LoadXml(@"<WebSettingCollection> <WebSetting> <Compatible>False</Compatible> <Theme>default</Theme> <Encoding>UTF-8</Encoding> <SessionOutTime>30</SessionOutTime> <EncryptKey>THISISXYFRAMEENCRYPTKEY</EncryptKey> <EncryptIV>VITPYRCNEEMARYXSISIHT</EncryptIV> <XySessionId>XyFrameSessionId</XySessionId> <DebugMode>False</DebugMode> </WebSetting> </WebSettingCollection>"); System.Xml.XmlNode _node = _document.GetElementsByTagName("WebSetting")[0]; _default = new WebSettingItem(_node); _default.Init(_node); return(_default); }
private void CopyTranslate(WebSettingItem WebConfig) { foreach (string _key in WebConfig.Config.Keys) { if (string.IsNullOrEmpty(_config[_key])) _config[_key] = WebConfig.Config[_key]; } }