コード例 #1
0
 /// <summary>
 /// CreateChildControls is fired on the Init event, and creates the
 /// custom Response Filter for the page.
 /// </summary>
 protected override void CreateChildControls()
 {
     if (BaseList == null)
     {
         BaseList = (Page.Site != null && Page.Site.DesignMode)?
                    (new FilterList()):(new FilterList(Page));
     }
     foreach (FilterTags F in BaseList.Values)
     {
         AddFilter(F);
     }
     ChildControlsCreated = true;
     //Page.Response.Filter = new HtmlFilter(Page.Response.Filter, new FilterEvent(DoFilter));
 }
コード例 #2
0
 /// <summary>
 /// For filters that generate a control from a source file, this checks to
 /// see if the files exists first.  This checks all the filters for the tag
 /// </summary>
 /// <returns>True if there is at least one filter for the tag with a valid source</returns>
 public bool CheckSources()
 {
     if (Content != null)
     {
         Content.Source = FilterList.CheckFile(Content.Source);
         if (Content.Source.Length == 0)
         {
             Content = null;
         }
     }
     if (Replace != null)
     {
         Replace.Source = FilterList.CheckFile(Replace.Source);
         if (Replace.Source.Length == 0)
         {
             Replace = null;
         }
     }
     return(Content != null || Replace != null || Attributes.Count > 0);
 }