internal LocalPolicyCatalogueCache(LocalPolicyCatalogueCache existing)
		{
			m_content = existing.m_content;
			foreach (LocalPolicyLanguageTableCache existingLang in existing.Languages)
			{
				LocalPolicyLanguageTableCache newLang = new LocalPolicyLanguageTableCache(existingLang);
                newLang.ObjectModified += new ObjectModifiedEventHandler(OnObjectModified);
                
				m_languages.Add(newLang);
			}
		}
		internal LocalCompiledPolicySetCache(LocalCompiledPolicySetCache existing)
		{
			m_target = existing.m_target;
			m_channel = existing.m_channel;
			m_content = existing.m_content;
			m_objects = existing.m_objects;

			foreach (LocalPolicyLanguageTableCache existingLang in existing.Languages)
			{
				LocalPolicyLanguageTableCache newLang = new LocalPolicyLanguageTableCache(existingLang);
                newLang.ObjectModified += new ObjectModifiedEventHandler(OnObjectModified);

				m_languages.Add(newLang);
			}
		}
		public IPolicyLanguageTableCache NewLanguage(string language, string content, bool defaultlanguagage)
		{
            ValidateChanges();

            foreach (IPolicyLanguageTableCache languageTableCache in m_languages)
            {
                if (language == languageTableCache.Language.Code)
                {
                    languageTableCache.Content = content;
                    return languageTableCache;
                }
            }

			LocalPolicyLanguageTableCache lpl = new LocalPolicyLanguageTableCache(language, content, defaultlanguagage);
            lpl.ObjectModified += new ObjectModifiedEventHandler(OnObjectModified);

			m_languages.Add(lpl);
			return lpl;
		}
        internal void LoadLanguages(XmlNodeList languages)
        {
            foreach (XmlNode language in languages)
            {
                string lang_name = language.Attributes.GetNamedItem("name").Value;
                bool lang_default = language.Attributes.GetNamedItem("default").Value == "true";
                string lang_content = language.SelectSingleNode("Content").InnerXml;

                LocalPolicyLanguageTableCache lang = new LocalPolicyLanguageTableCache(lang_name, lang_content, lang_default);
                lang.ObjectModified += new ObjectModifiedEventHandler(OnObjectModified);

                try 
				{ 
					lang.ID = Convert.ToInt64(language.Attributes.GetNamedItem("id").Value, System.Globalization.CultureInfo.InvariantCulture); 
				}
				catch(Exception ex)
				{
					Logger.LogError("Unable to retrieve id from local policy file");
					Logger.LogError(ex);
				}

                m_languages.Add(lang);
            }
        }
예제 #5
0
 public IPolicyLanguageTableCache NewLanguage(string language, string content, bool defaultlanguage)
 {
     LocalPolicyLanguageTableCache lpl = new LocalPolicyLanguageTableCache(language, content, defaultlanguage);
     m_Languages.Add(lpl);
     return lpl;
 }
		internal LocalPolicyLanguageTableCache(LocalPolicyLanguageTableCache existing)
		{
			m_content = existing.m_content;
			m_language = new LocalPolicyLanguageCache(existing.m_language);
		}