public override DataSet Clone() { NSurveyDataSource source = (NSurveyDataSource)base.Clone(); source.InitVars(); return(source); }
/// <summary> /// Binds dropdownlist with the xml answers loaded /// from the publisher xml file value /// </summary> private void BindDropDownList(NSurveyDataSource xmlAnswers) { this._xmlAnswerDropDownList.DataSource = xmlAnswers; this._xmlAnswerDropDownList.DataMember = "XmlAnswer"; this._xmlAnswerDropDownList.DataValueField = "AnswerValue"; this._xmlAnswerDropDownList.DataTextField = "AnswerDescription"; this._xmlAnswerDropDownList.EnableViewState = false; this._xmlAnswerDropDownList.DataBind(); }
/// <summary> /// Implemented from the abstract method of the parent class /// Is called to generate the "layout" and to place the child /// controls (eg:dropdownlist) in the tree /// </summary> /// <param name="xmlAnswers">the xml items loaded from the xml datasource file</param> protected override void GenerateXmlControl(NSurveyDataSource xmlAnswers) { if (this.ShowAnswerText) { if ((this.ImageUrl != null) && (this.ImageUrl.Length != 0)) { Image child = new Image(); child.ImageUrl = this.ImageUrl; child.ImageAlign = ImageAlign.Middle; child.ToolTip = this.Text; this.Controls.Add(child); this.Controls.Add(new LiteralControl("<br />")); } else if ((this.Text != null) && (this.Text.Length != 0)) { //JJ this.Controls.Add(new LiteralControl(string.Format("{0}<br />", this.Text))); Label label = new Label(); label.Text = string.Format("{0}", this.Text); label.CssClass = "AnswerTextRender"; this.Controls.Add(label); if (this.Mandatory) { this.Controls.Add(new LiteralControl("<div style='color:red; display:inline-flex;'> * </div>")); } this.Controls.Add(new LiteralControl("<br />")); } } this._xmlAnswerDropDownList = new DropDownList(); if (xmlAnswers != null) { this._xmlAnswerDropDownList.DataSource = xmlAnswers; this._xmlAnswerDropDownList.DataMember = "XmlAnswer"; this._xmlAnswerDropDownList.DataValueField = "AnswerValue"; this._xmlAnswerDropDownList.DataTextField = "AnswerDescription"; this._xmlAnswerDropDownList.EnableViewState = false; this._xmlAnswerDropDownList.DataBind(); if ((this.DefaultText != null) && (this._xmlAnswerDropDownList.Items.FindByValue(this.DefaultText) != null)) { this._xmlAnswerDropDownList.SelectedValue = this.DefaultText; } if (this.HasSubscribers) { this._xmlAnswerDropDownList.AutoPostBack = true; } } this.Controls.Add(this._xmlAnswerDropDownList); this.OnAnswerPublisherCreated(new AnswerItemEventArgs(this.GetUserAnswers())); }
/// <summary> /// Returns the default language neutral Xml file /// </summary> /// <returns></returns> protected virtual NSurveyDataSource GetNeutralXml(string filePath) { if (this._context.Cache[this.FileName] == null) { if (!File.Exists(filePath)) { return null; } NSurveyDataSource source = new NSurveyDataSource(); source.ReadXml(filePath); CacheDependency dependencies = new CacheDependency(filePath); this._context.Cache.Insert(this.FileName, source, dependencies); } return (NSurveyDataSource) this._context.Cache[this.FileName]; }
/// <summary> /// Returns the localized Xml file /// </summary> /// <returns></returns> protected virtual NSurveyDataSource GetLocalizedXml(string filePath) { if (this._context.Cache[this.FileName + CultureInfo.CurrentUICulture.TwoLetterISOLanguageName] == null) { if (!File.Exists(filePath)) { return null; } NSurveyDataSource source = new NSurveyDataSource(); source.ReadXml(filePath); CacheDependency dependencies = new CacheDependency(filePath); this._context.Cache.Insert(this.FileName + CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, source, dependencies); } return (NSurveyDataSource) this._context.Cache[this.FileName + CultureInfo.CurrentUICulture.TwoLetterISOLanguageName]; }
protected abstract void GenerateXmlControl(NSurveyDataSource xmlAnswers);
public XmlDataSourceRowChangeEvent(NSurveyDataSource.XmlDataSourceRow row, DataRowAction action) { this.eventRow = row; this.eventAction = action; }
public void RemoveXmlDataSourceRow(NSurveyDataSource.XmlDataSourceRow row) { base.Rows.Remove(row); }
public void AddXmlDataSourceRow(NSurveyDataSource.XmlDataSourceRow row) { base.Rows.Add(row); }
public NSurveyDataSource.XmlAnswersRow AddXmlAnswersRow(NSurveyDataSource.XmlDataSourceRow parentXmlDataSourceRowByXmlDataSource_XmlAnswers) { NSurveyDataSource.XmlAnswersRow row = (NSurveyDataSource.XmlAnswersRow) base.NewRow(); object[] objArray = new object[2]; objArray[1] = parentXmlDataSourceRowByXmlDataSource_XmlAnswers[1]; row.ItemArray = objArray; base.Rows.Add(row); return row; }
public NSurveyDataSource.XmlAnswerRow AddXmlAnswerRow(string AnswerValue, string AnswerDescription, NSurveyDataSource.XmlAnswersRow parentXmlAnswersRowByXmlAnswers_XmlAnswer) { NSurveyDataSource.XmlAnswerRow row = (NSurveyDataSource.XmlAnswerRow) base.NewRow(); row.ItemArray = new object[] { AnswerValue, AnswerDescription, parentXmlAnswersRowByXmlAnswers_XmlAnswer[0] }; base.Rows.Add(row); return row; }