コード例 #1
0
ファイル: Field.cs プロジェクト: lidonghao1116/ProjectManager
        internal Field(XmlElement fieldElement)
        {
            XmlHelper h = new XmlHelper(fieldElement);

            this.Source = fieldElement.GetAttribute("Source");
            this.Target = fieldElement.GetAttribute("Target");
            this.InputConverter = ConverterType.Parse(fieldElement.GetAttribute("InputConverter"));
            this.OutputConverter = ConverterType.Parse(fieldElement.GetAttribute("OutputConverter"));
            this.Quote = h.TryGetBoolean("@Quote", true);
            this.Mandatory = h.TryGetBoolean("@Mandatory", false);
            this.Alias = fieldElement.GetAttribute("Alias");
            this.Required = h.TryGetBoolean("@Required", false);
            this.AutoNumber = h.TryGetBoolean("@AutoNumber", false);

            SourceType sType = SourceType.Request;
            if (!Enum.TryParse<SourceType>(fieldElement.GetAttribute("SourceType"), true, out sType))
                sType = SourceType.Request;
            this.SourceType = sType;

            IOType iType = IOType.Element;
            if (!Enum.TryParse<IOType>(fieldElement.GetAttribute("InputType"), true, out iType))
                iType = IOType.Element;
            this.InputType = iType;

            IOType oType = IOType.Element;
            if (!Enum.TryParse<IOType>(fieldElement.GetAttribute("OutputType"), true, out oType))
                oType = IOType.Element;
            this.OutputType = oType;

        }
コード例 #2
0
 internal bool Equals(ConverterType other)
 {
     if (other.ToString().Equals(Converter, StringComparison.CurrentCultureIgnoreCase))
         return true;
     return false;
 }