Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     var cache = new CacheManager<string>("PigeonCms.HelloWord");
     if (cache.IsEmpty(this.BaseModule.Id.ToString()))
     {
         LitOutput = "This is an HelloWord module.<br />"
         + "Theese are the params you set for the module; <br />"
         + "your name: " + this.YourName + "<br />"
         + "gender: " + this.Gender + "<br />"
         + "age: " + this.Age.ToString() + "<br />";
         cache.Insert(this.BaseModule.Id.ToString(), LitOutput);
     }
     else
     {
         LitOutput = cache.GetValue(this.BaseModule.Id.ToString());
     }
 }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var obj1 = new PigeonCms.Placeholder();
        var cache = new CacheManager<PigeonCms.Placeholder>("PigeonCms.Placeholder");
        if (cache.IsEmpty(this.Name))
        {
            obj1 = new PlaceholdersManager().GetByName(this.Name);
            cache.Insert(this.Name, obj1);
        }
        else
        {
            obj1 = cache.GetValue(this.Name);
        }

        LitContent.Text = "";
        if (obj1.Visible)
        {
            LitContent.Text = obj1.Content;
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var sp1 = new StaticPage();
        var cache = new CacheManager<StaticPage>("PigeonCms.StaticPage", this.CacheDuration);
        if (cache.IsEmpty(this.PageName))
        {
            if (!StaticPagesManager.ExistPage(this.PageName))
                this.PageName = StaticPagesManager.DEFAULT_PAGE_NAME;
            sp1 = new StaticPagesManager().GetStaticPageByName(this.PageName);
            cache.Insert(this.PageName, sp1);
        }
        else
        {
            sp1 = cache.GetValue(this.PageName);
        }

        if (sp1.ShowPageTitle) LitPageTitle.Text = sp1.PageTitle + "<br />";
        LitPageContent.Text = "";
        if (!sp1.IsPageContentTranslated)
        {
            //LitPageContent.Text += "<span class='textNote'>" + Resources.PublicLabels.LblTextNotTranslated + "</span><br />";
        }
        LitPageContent.Text += sp1.PageContentParsed;
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CACHE_KEY = "Rows_Items";
        CachedList = new CacheManager<List<Item>>("AQ.CacheSample");
        List<Item> list;

        if (!Page.IsPostBack)
        {

        }

        if (CachedList.IsEmpty(CACHE_KEY))
        {
            LitRes.Text = "data from db";
            list = getList();
            CachedList.Insert(CACHE_KEY, list);
        }
        else
        {
            LitRes.Text = "data from cache";
            list = CachedList.GetValue(CACHE_KEY);
        }
        LitRows = renderRows(list);
    }