示例#1
0
 protected virtual void OnSourceContentChanged(ContentChangedEventArgs e)
 {
     if (SourceContentChanged != null)
     {
         SourceContentChanged(this, e);
     }
 }
示例#2
0
        // ***********************************************************************

        // ***********************************************************************
        // Fetches and stores the content
        public void GetContent()
        {
            // Controls must be recreated after content change
            ChildControlsCreated = false;

            string[] result = Regex.Split(SourceContent, @"\[page\]", RegexOptions.IgnoreCase);
            TotalPages = result.Length;

            bool isValidPage = (CurrentPageIndex >= 0 && CurrentPageIndex <= TotalPages - 1);
            // Prepares event data
            ContentChangedEventArgs es = new ContentChangedEventArgs();

            if (isValidPage)
            {
                es.Content = result[CurrentPageIndex];
            }
            else
            {
                es.Content = "";
            }

            // Fires the content changed event
            OnSourceContentChanged(es);
        }
示例#3
0
 protected virtual void OnSourceContentChanged(ContentChangedEventArgs e)
 {
     if (SourceContentChanged != null)
         SourceContentChanged(this, e);
 }
示例#4
0
        // ***********************************************************************

        // ***********************************************************************
        // Fetches and stores the content
        public void GetContent()
        {
            // Controls must be recreated after content change 
            ChildControlsCreated = false;

            string[] result = Regex.Split(SourceContent, @"\[page\]", RegexOptions.IgnoreCase);
            TotalPages = result.Length;

            bool isValidPage = (CurrentPageIndex >= 0 && CurrentPageIndex <= TotalPages - 1);
            // Prepares event data
            ContentChangedEventArgs es = new ContentChangedEventArgs();
            if (isValidPage) es.Content = result[CurrentPageIndex];
            else es.Content = "";

            // Fires the content changed event
            OnSourceContentChanged(es);
        }