Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
            public static AbstractPrompt Parse(XmlElement anXmlElement)
            {
                PromptCheckbox tPrompt = (PromptCheckbox)AbstractPrompt.Factory.CreateInstance(typeof(PromptCheckbox));

                parsePromptChildren(tPrompt, anXmlElement);

                return(tPrompt);
            }
Exemplo n.º 3
0
        public override AbstractPrompt Clone()
        {
            PromptCheckbox tNewCheckbox = (PromptCheckbox)AbstractPrompt.Factory.CreateInstance(this.GetType());

            tNewCheckbox.Name           = "CopyOf" + this.Name;
            tNewCheckbox.Description    = this.Description;
            tNewCheckbox.Label          = this.Label;
            tNewCheckbox.CheckedValue   = this.CheckedValue;
            tNewCheckbox.UncheckedValue = this.UncheckedValue;
            tNewCheckbox.DefaultValue   = this.DefaultValue;
            return(tNewCheckbox);
        }
Exemplo n.º 4
0
 private static void parsePromptChildren(PromptCheckbox aPrompt, XmlNode aPromptNode)
 {
     foreach (XmlNode tPromptNode in aPromptNode.ChildNodes)
     {
         if (tPromptNode.Name == "label")
         {
             aPrompt.Label = tPromptNode.InnerText;
         }
         else if (tPromptNode.Name == "type")
         {
             aPrompt.CheckedValue   = getOptionalAttribute(tPromptNode, "checkedValue", "");
             aPrompt.UncheckedValue = getOptionalAttribute(tPromptNode, "uncheckedValue", "");
             aPrompt.DefaultValue   = getOptionalAttribute(tPromptNode, "defaultValue", "");
         }
     }
 }