public static LangageContainer GetLanguagesContent(string content)
 {
     if (!String.IsNullOrEmpty(content))
     {
         return(LangageContainer.Deserialize(content));
     }
     return(new LangageContainer());
 }
        protected string SetLocalizedProperty(LangageContainer container, string content, string value)
        {
            container = LocalizationHelper.GetLanguagesContent(content);
            var lang = container.GetOrInsertLanguage();

            if (this.Page != null && this.Page.IsPostBack)
            {
                container.UpdateLanguage(lang.LanguageCode, value);
                return LangageContainer.Serialize(container);
            }
            return content;
        }
 protected string GetLocalizedProperty(LangageContainer container, string content)
 {
     if (container != null)
     {
         return container.GetOrInsertLanguage().EncodedLanguageContent;
     }
     else
     {
         container = LocalizationHelper.GetLanguagesContent(content);
         return container.GetOrInsertLanguage().EncodedLanguageContent;
     }
 }
        protected string SetLocalizedProperty(LangageContainer container, string content, string value)
        {
            container = LocalizationHelper.GetLanguagesContent(content);
            var lang = container.GetOrInsertLanguage();

            if (this.Page != null && this.Page.IsPostBack)
            {
                container.UpdateLanguage(lang.LanguageCode, value);
                return LangageContainer.Serialize(container);
            }
            return content;
        }
 protected string GetLocalizedProperty(LangageContainer container, string content)
 {
     if (container != null)
     {
         return container.GetOrInsertLanguage().EncodedLanguageContent;
     }
     else
     {
         container = LocalizationHelper.GetLanguagesContent(content);
         return container.GetOrInsertLanguage().EncodedLanguageContent;
     }
 }
        internal static string Serialize(LangageContainer container)
        {
            var serializer = GetSerializer();
            MemoryStream stream = new MemoryStream();
            serializer.Serialize(stream, container);
            stream.Position = 0;

            var sr = new StreamReader(stream);
            var str = sr.ReadToEnd();

            stream.Dispose();
            return str;
        }
Exemple #7
0
        internal static string Serialize(LangageContainer container)
        {
            var          serializer = GetSerializer();
            MemoryStream stream     = new MemoryStream();

            serializer.Serialize(stream, container);
            stream.Position = 0;

            var sr  = new StreamReader(stream);
            var str = sr.ReadToEnd();

            stream.Dispose();
            return(str);
        }