Пример #1
0
        public override AbstractPrompt Clone()
        {
            PromptNumber tNewNumberPrompt = (PromptNumber)AbstractPrompt.Factory.CreateInstance(this.GetType());

            tNewNumberPrompt.Name             = "CopyOf" + this.Name;
            tNewNumberPrompt.Description      = this.Description;
            tNewNumberPrompt.Label            = this.Label;
            tNewNumberPrompt.Length           = this.Length;
            tNewNumberPrompt.DecimalPositions = this.DecimalPositions;
            tNewNumberPrompt.DefaultValue     = this.DefaultValue;
            return(tNewNumberPrompt);
        }
Пример #2
0
            private static void parsePromptChildren(PromptNumber aPrompt, XmlNode aPromptNode)
            {
                foreach (XmlNode tPromptNode in aPromptNode.ChildNodes)
                {
                    if (tPromptNode.Name == "label")
                    {
                        aPrompt.Label = tPromptNode.InnerText;
                    }
                    else if (tPromptNode.Name == "type")
                    {
                        int tLength = -1;
                        if (Int32.TryParse(getOptionalAttribute(tPromptNode, "maxLength", tLength.ToString()), out tLength))
                        {
                            if (tLength == -1)
                            {
                                aPrompt.Length = "";
                            }
                            else
                            {
                                aPrompt.Length = tLength.ToString();
                            }
                        }
                        ;

                        int tDecimalPositions = -1;
                        if (Int32.TryParse(getOptionalAttribute(tPromptNode, "decimalPositions", tDecimalPositions.ToString()), out tDecimalPositions))
                        {
                            if (tDecimalPositions == -1)
                            {
                                aPrompt.DecimalPositions = "";
                            }
                            else
                            {
                                aPrompt.DecimalPositions = tDecimalPositions.ToString();
                            }
                        }
                        ;

                        aPrompt.DefaultValue = getOptionalAttribute(tPromptNode, "defaultValue", "");
                    }
                }
            }