Beispiel #1
0
 /// <summary>
 /// Trigger event when a publisher has been created, usually
 /// at the end of a CreateChildControl call. This call is
 /// mandatory to catch Answer items that have set default values
 /// </summary>
 public void PublisherCreation(object sender, AnswerItemEventArgs e)
 {
     if (((e != null) && (e.PostedAnswers != null)) && (e.PostedAnswers.Count > 0))
     {
         string str = e.PostedAnswers[0].FieldText.ToLower() + ".xml";
         if (this.XmlFileName == null)
         {
             this.XmlFileName = str;
             if (base.ChildControlsCreated)
             {
                 this.GenerateDropDownList();
             }
         }
         else if ((this.XmlFileName != str) && !base.ChildControlsCreated)
         {
             string str2 = (((AnswerItem)sender).DefaultText == null) ? null : (((AnswerItem)sender).DefaultText.ToLower() + ".xml");
             if (((str2 == null) || (str2.Length == 0)) || (this.XmlFileName == str2))
             {
                 this.XmlFileName = str;
                 this.GenerateDropDownList();
                 base.ChildControlsCreated = true;
             }
         }
     }
 }
 /// <summary>
 /// Post an event to notify subscribers that the publisher
 /// has been created with its child controls tree and properties
 /// </summary>
 protected virtual void OnAnswerPublisherCreated(AnswerItemEventArgs e)
 {
     if (this.AnswerPublisherCreated != null)
     {
         this.AnswerPublisherCreated(this, e);
     }
 }
 /// <summary>
 /// Post an event to notify subscribers that answers has been published
 /// </summary>
 protected virtual void OnAnswerPublished(AnswerItemEventArgs e)
 {
     if (this.AnswerPublished != null)
     {
         this.AnswerPublished(this, e);
     }
 }
 public bool LoadPostData(string postDataKey, NameValueCollection postCollection)
 {
     this.EnsureChildControls();
     PostedAnswerDataCollection postedAnswerData = this.GetPostedAnswerData();
     if (postedAnswerData != null)
     {
         AnswerItemEventArgs e = new AnswerItemEventArgs(postedAnswerData);
         this.OnAnswerPost(e);
     }
     return false;
 }
        public bool LoadPostData(string postDataKey, NameValueCollection postCollection)
        {
            this.EnsureChildControls();
            PostedAnswerDataCollection postedAnswerData = this.GetPostedAnswerData();

            if (postedAnswerData != null)
            {
                AnswerItemEventArgs e = new AnswerItemEventArgs(postedAnswerData);
                this.OnAnswerPost(e);
            }
            return(false);
        }
Beispiel #6
0
 /// <summary>
 /// Gets the answer send by the publisher and use
 /// them as the source name of the xml file to load
 /// </summary>
 public void ProcessPublishedAnswers(object sender, AnswerItemEventArgs e)
 {
     if (((e != null) && (e.PostedAnswers != null)) && (e.PostedAnswers.Count > 0))
     {
         string str = e.PostedAnswers[0].FieldText.ToLower() + ".xml";
         if (this.XmlFileName != str)
         {
             this.XmlFileName = str;
             this.GenerateDropDownList();
             base.ChildControlsCreated = true;
             PostedAnswerDataCollection answerValues = this.GetAnswerValues();
             this.OnAnswerPublished(new AnswerItemEventArgs(answerValues));
         }
     }
     else
     {
         this.XmlFileName            = string.Empty;
         this._xmlAnswerDropDownList = null;
         this.Controls.Clear();
         this.OnAnswerPublished(new AnswerItemEventArgs(null));
     }
 }
 /// <summary>
 /// Event to trigger if answers have been posted
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnAnswerPost(AnswerItemEventArgs e)
 {
     base.RaiseBubbleEvent(this, e);
 }
 /// <summary>
 /// Trigger event when a publisher has been created, usually 
 /// at the end of a CreateChildControl call. This call is 
 /// mandatory to catch Answer items that have set default values 
 /// </summary>
 public void PublisherCreation(object sender, AnswerItemEventArgs e)
 {
     if (((e != null) && (e.PostedAnswers != null)) && (e.PostedAnswers.Count > 0))
     {
         string str = e.PostedAnswers[0].FieldText.ToLower() + ".xml";
         if (this.XmlFileName == null)
         {
             this.XmlFileName = str;
             if (base.ChildControlsCreated)
             {
                 this.GenerateDropDownList();
             }
         }
         else if ((this.XmlFileName != str) && !base.ChildControlsCreated)
         {
             string str2 = (((AnswerItem) sender).DefaultText == null) ? null : (((AnswerItem) sender).DefaultText.ToLower() + ".xml");
             if (((str2 == null) || (str2.Length == 0)) || (this.XmlFileName == str2))
             {
                 this.XmlFileName = str;
                 this.GenerateDropDownList();
                 base.ChildControlsCreated = true;
             }
         }
     }
 }
 /// <summary>
 /// Gets the answer send by the publisher and use
 /// them as the source name of the xml file to load
 /// </summary>
 public void ProcessPublishedAnswers(object sender, AnswerItemEventArgs e)
 {
     if (((e != null) && (e.PostedAnswers != null)) && (e.PostedAnswers.Count > 0))
     {
         string str = e.PostedAnswers[0].FieldText.ToLower() + ".xml";
         if (this.XmlFileName != str)
         {
             this.XmlFileName = str;
             this.GenerateDropDownList();
             base.ChildControlsCreated = true;
             PostedAnswerDataCollection answerValues = this.GetAnswerValues();
             this.OnAnswerPublished(new AnswerItemEventArgs(answerValues));
         }
     }
     else
     {
         this.XmlFileName = string.Empty;
         this._xmlAnswerDropDownList = null;
         this.Controls.Clear();
         this.OnAnswerPublished(new AnswerItemEventArgs(null));
     }
 }
 /// <summary>
 /// Event to trigger if answers have been posted
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnAnswerPost(AnswerItemEventArgs e)
 {
     base.RaiseBubbleEvent(this, e);
 }