Exemple #1
0
        public static Module Deserialize(string moduleName, string moduleData)
        {
            //moduleData = moduleData;//.Trim();
            Module module = null;

            try
            {
                module = Provider.CreateModule(moduleName);
                try
                {
                    CinarSerialization.Deserialize(module, moduleData);
                }
                catch
                {
                    module.TopHtml = Provider.GetResource("Error while deserializing the module. This may be because module changed or database charset problem");
                }
            }
            catch
            {
                module = new StaticHtml();
                try
                {
                    CinarSerialization.Deserialize(module, moduleData);
                }
                catch
                {
                }

                ((StaticHtml)module).InnerHtml = "<font color=red>Hata</font><br/><br/>" + moduleName + " isimli bu modül bulunamadı, bu modül türü silinmiş olabilir." + ((StaticHtml)module).InnerHtml;
                if (Provider.DevelopmentMode)
                {
                    module.BottomHtml += "<br/><br/><b>Developer'a not:</b> Serialization geçersiz:";
                    module.BottomHtml += "<br/><br/>" + WebUtility.HtmlEncode(moduleData);
                }
            }
            return(module);
        }
Exemple #2
0
        public static Module Deserialize(string moduleName, string moduleData)
        {
            //moduleData = moduleData;//.Trim();
            Module module = null;
            try
            {
                module = Provider.CreateModule(moduleName);
                try
                {
                    CinarSerialization.Deserialize(module, moduleData);
                }
                catch
                {
                    module.TopHtml = Provider.GetResource("Error while deserializing the module. This may be because module changed or database charset problem");
                }
            }
            catch
            {
                module = new StaticHtml();
                try
                {
                    CinarSerialization.Deserialize(module, moduleData);
                }
                catch
                {
                }

                ((StaticHtml)module).InnerHtml = "<font color=red>Hata</font><br/><br/>" + moduleName + " isimli bu modül bulunamadı, bu modül türü silinmiş olabilir." + ((StaticHtml)module).InnerHtml;
                if (Provider.DevelopmentMode)
                {
                    module.BottomHtml += "<br/><br/><b>Developer'a not:</b> Serialization geçersiz:";
                    module.BottomHtml += "<br/><br/>" + WebUtility.HtmlEncode(moduleData);
                }
            }
            return module;
        }