public static void Prompt_Click(object data) { if (data is PromptText) { PromptText castedObject = data as PromptText; editor_pg.SelectedObject = castedObject; } else if (data is PromptMultiline) { PromptMultiline castedObject = data as PromptMultiline; editor_pg.SelectedObject = castedObject; } else if (data is PromptDate) { PromptDate castedObject = data as PromptDate; editor_pg.SelectedObject = castedObject; } else if (data is PromptCheckbox) { PromptCheckbox castedObject = data as PromptCheckbox; editor_pg.SelectedObject = castedObject; } else if (data is PromptUserDefined) { PromptUserDefined castedObject = data as PromptUserDefined; editor_pg.SelectedObject = castedObject; } else { AbstractPrompt castedObject = data as AbstractPrompt; editor_pg.SelectedObject = castedObject; } }
public static AbstractPrompt Parse(XmlElement anXmlElement) { PromptDate tPrompt = (PromptDate)AbstractPrompt.Factory.CreateInstance(typeof(PromptDate)); parsePromptChildren(tPrompt, anXmlElement); return(tPrompt); }
public override AbstractPrompt Clone() { PromptDate tNewCheckbox = (PromptDate)AbstractPrompt.Factory.CreateInstance(this.GetType()); tNewCheckbox.Name = "CopyOf" + this.Name; tNewCheckbox.Description = this.Description; tNewCheckbox.Label = this.Label; tNewCheckbox.DateFormat = this.DateFormat; return(tNewCheckbox); }
private static void parsePromptChildren(PromptDate aPrompt, XmlNode aPromptNode) { foreach (XmlNode tPromptNode in aPromptNode.ChildNodes) { if (tPromptNode.Name == "label") { aPrompt.Label = tPromptNode.InnerText; } else if (tPromptNode.Name == "type") { aPrompt.DateFormat = getOptionalAttribute(tPromptNode, "dateFormat", "yyyy-MM-dd"); } } }
public static void parsePromptAttributes(PromptDate aPrompt, XmlNode aPromptNode) { { aPrompt.DateFormat = getOptionalAttribute(aPromptNode, "dateFormat", "yyyy-MM-dd"); } }