当前位置: 首页>>代码示例>>C#>>正文


C# DataType类代码示例

本文整理汇总了C#中DataType的典型用法代码示例。如果您正苦于以下问题:C# DataType类的具体用法?C# DataType怎么用?C# DataType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DataType类属于命名空间,在下文中一共展示了DataType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataTypeValidator

        public DataTypeValidator(DataType dataType, object data)
        {
            m_dataType = dataType;
            m_data = data;

            SetActualDataType();
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:DataTypeValidator.cs

示例2: PyBuildValueFormatParser

        public PyBuildValueFormatParser(
            Program program,
            Address addrInstr,
            string format,
            IServiceProvider services)
        {
            this.ArgumentTypes = new List<DataType>();
            this.format = format;
            var platform = program.Platform;
            this.pointerSize = platform.PointerType.Size;

            var wordSize = platform.Architecture.WordWidth.Size;
            var longSize = platform.GetByteSizeFromCBasicType(
                CBasicType.Long);
            var longLongSize = platform.GetByteSizeFromCBasicType(
                CBasicType.LongLong);
            var doubleSize = platform.GetByteSizeFromCBasicType(
                CBasicType.Double);

            dtInt = Integer(wordSize);
            dtUInt = UInteger(wordSize);
            dtLong = Integer(longSize);
            dtULong = UInteger(longSize);
            dtLongLong = Integer(longLongSize);
            dtULongLong = UInteger(longLongSize);
            dtDouble = Real(doubleSize);
            ptrChar = Ptr(PrimitiveType.Char);
            ptrVoid = Ptr(VoidType.Instance);

            dtPySize = UInteger(pointerSize);
            ptrPyObject = Ptr(Ref("PyObject"));
            ptrPyUnicode = Ptr(Ref("Py_UNICODE"));
            ptrPyComplex = Ptr(Ref("Py_complex"));
            ptrPyConverter = Ptr(new CodeType());
        }
开发者ID:relaxar,项目名称:reko,代码行数:35,代码来源:PyBuildValueFormatParser.cs

示例3: DataTypeGraphModel

 public DataTypeGraphModel(IViewModelDependencies appCtx, IZetboxContext dataCtx, DiagramViewModel parent,
     DataType obj)
     : base(appCtx, dataCtx, parent, obj)
 {
     this._diagMdl = parent;
     this.DataType = obj;
 }
开发者ID:daszat,项目名称:zetbox,代码行数:7,代码来源:DataTypeViewModels.cs

示例4: Unify

        public IEnumerable<string> Unify(DataType a, DataType b)
        {
            a = Normalize(a);
            b = Normalize(b);

            if (a is TypeVariable)
            {
                var variableA = (TypeVariable)a;

                if (b.Contains(variableA))
                {
                    if (a != b)
                        return Error(a, b);

                    return success;
                }

                substitutions[variableA] = b;
                return success;
            }

            if (b is TypeVariable)
                return Unify(b, a);

            if (a.Name != b.Name)
                return Error(a, b);

            if (a.GenericArguments.Count() != b.GenericArguments.Count())
                return Error(a, b);

            return PairwiseUnify(a.GenericArguments, b.GenericArguments);
        }
开发者ID:plioi,项目名称:rook,代码行数:32,代码来源:TypeUnifier.cs

示例5: DataTypeAttribute

        public DataTypeAttribute(DataType dataType)
        {
            this.DataType = dataType;
            this.InitializeDefaultErrorMessage();
            switch (this.DataType)
            {
                case DataType.Boolean:
                    this.UsesCustomValidation = true;
                    break;

                case DataType.Alphabetic:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = AlphabeticMatcher.ToString();
                    break;

                case DataType.AlphaNumeric:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = AlphaNumericMatcher.ToString();
                    break;

                case DataType.PhoneNumber:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = PhoneNumberMatcher.ToString();
                    break;

                case DataType.ZipCode:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = ZipCodeMatcher.ToString();
                    break;

                case DataType.EmailAddress:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = EmailMatcher.ToString();
                    break;

                case DataType.IpAddress:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = IpAddressMatcher.ToString();
                    break;

                case DataType.Url:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = UrlCodeMatcher.ToString();
                    break;

                case DataType.CreditCard:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = CreditCardMatcher.ToString();
                    break;

                case DataType.CreditCardLuhn:
                    this.UsesCustomValidation = true;
                    break;

                case DataType.SocialSecurityNumber:
                    this.UsesRegularExpression = true;
                    this.CurrentRegularExpression = SocialSecurityMatcher.ToString();
                    break;
            }
        }
开发者ID:njmube,项目名称:Nemo,代码行数:60,代码来源:DataTypeAttribute.cs

示例6: DataTypeInfo

        /// <summary>
        /// Initializes a new instance of the <see cref="DataTypeInfo" /> class.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <param name="rules">The rules.</param>
        /// <exception cref="NotSupportedException"></exception>
        public DataTypeInfo(DataType type, IEnumerable<RuleMap> rules)
        {
            switch (type)
            {
                case DataType.Text:
                    Description = "Text";
                    break;
                case DataType.Number:
                    Description = "Number";
                    break;
                case DataType.Date:
                    Description = "Date";
                    break;
                case DataType.Group:
                    Description = "Group";
                    break;
                case DataType.Transform:
                    Description = "Transform";
                    break;
                default:
                    //this stops any undefined data type being added
                    throw new NotSupportedException();
            }

            DataType = type;
            RuleTypes =
                rules.Select(
                    arg =>
                        new RuleTypeInfo(type, arg))
                    .ToList();
        }
开发者ID:tuvoksg1,项目名称:RulesEngine,代码行数:37,代码来源:DataTypeInfo.cs

示例7: Ident

 public Ident(string name, IdentType identType, DataType dataType, AstNode node)
 {
     Name = name;
     IdentType = identType;
     DataType = dataType;
     Node = node;
 }
开发者ID:chursin-andrey,项目名称:CCompiler,代码行数:7,代码来源:SemanticChecker.cs

示例8: Update

       public  void Update(int fieldId, DataType type)
        {
            var types = type.FieldSettingTypes.Where(t => t.Section == Section).ToArray(); 
           for (var i = 0; i < types.Count(); i++)
            {
                var value = string.Empty;
                var t = types[i].SystemType;
                if (t == "Boolean")
                {
                    var cb = Repeater1.Controls[i].FindControl("Checkbox") as CheckBox;
                    if (cb != null) value = cb.Checked.ToString(CultureInfo.InvariantCulture);
                }
                else
                {
                    var tb = Repeater1.Controls[i].FindControl("Textbox") as TextBox;
                    if (tb != null) value = tb.Text;
                }

                if (t == "Int")
                {
                    value = value.AsInt().ToString(CultureInfo.InvariantCulture);
                }

                var key = types[i].Key;
                if (types[i].VerifySetting (value))
                FieldSettingsController.UpdateFieldSetting(key, value, fieldId);
            }

        }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:29,代码来源:FieldSettings.ascx.cs

示例9: DataLoadException

 /// <summary>
 /// Creates a new instance of the <see cref="DataLoadException"/> class.
 /// </summary>
 /// <param name="inner">The inner exception.</param>
 /// <param name="jsonData">The data that the serializer was trying to load.</param>
 /// <param name="targetType">The target type.</param>
 public DataLoadException(Exception inner, string jsonData, Type targetType, DataType dataType)
     : base("An exception occurred trying to read data into an internal format. Please check that the input data is correct.", inner)
 {
     Data.Add("Target type", targetType.Name);
     Data.Add("Data type", dataType.ToString());
     Data.Add("Data", jsonData);
 }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:13,代码来源:DataLoadException.cs

示例10: Show

 public void Show(DataType selectedType)
 {
     TypeName = selectedType.Name;
     SelectedType = selectedType;
     Repeater1.DataSource = selectedType.FieldSettingTypes.Where(t=>t.Section==Section);
     Repeater1.DataBind();
 }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:7,代码来源:FieldSettings.ascx.cs

示例11: BindData

 public void BindData(int fieldId,DataTable  settingsTable, DataType type)
 {
     
     if (!IsPostBack)
     {
         var types = type.FieldSettingTypes.Where(t => t.Section == Section).ToArray();
         for (var i = 0; i < types.Count(); i++)
         {
             var key = types[i].Key;
             var value = settingsTable.GetFieldSetting(key, fieldId);
             if (!string.IsNullOrEmpty(value))
             {
                 var t = type.FieldSettingTypes.ElementAt(i).SystemType;
                 if (t == "Boolean")
                 {
                     var cb = Repeater1.Controls[i].FindControl("Checkbox") as CheckBox;
                     if (cb != null) cb.Checked = value.AsBoolean();
                 }
                 else
                 {
                     var tb = Repeater1.Controls[i].FindControl("Textbox") as TextBox;
                     if (tb != null) tb.Text = value;
                 }
             }
            
         }
     }
 }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:28,代码来源:FieldSettings.ascx.cs

示例12: DefaultMethods

        public DefaultMethods(Arebis.CodeGeneration.IGenerationHost _host, IZetboxContext ctx, DataType dt)
            : base(_host)
        {
			this.ctx = ctx;
			this.dt = dt;

        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:DefaultMethods.Designer.cs

示例13: Event

 public Event(Controller controller, DataType type, string name, string modifier)
     : base(controller)
 {
     Name = name;
     DataType = type;
     _Modifiers.Add(modifier);
 }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:7,代码来源:Event.cs

示例14: Input

 public Input(string name, DataType type= DataType.Text, bool isOptional=false)
 {
     Id = Guid.NewGuid().ToString();
     Name = name;
     Type = type;
     IsOptional = isOptional;
 }
开发者ID:nickpirrottina,项目名称:MyNetSensors,代码行数:7,代码来源:Input.cs

示例15: DatabaseFunctionParameter

 /// <summary>
 /// Initializes a new instance of the DatabaseFunctionParameter class with given name, type and mode.
 /// </summary>
 /// <param name="name">Parameter name</param>
 /// <param name="type">Parameter type</param>
 /// <param name="mode">Parameter mode.</param>
 public DatabaseFunctionParameter(string name, DataType type, DatabaseParameterMode mode)
 {
     this.Name = name;
     this.ParameterType = type;
     this.Mode = mode;
     this.Annotations = new List<Annotation>();
 }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:13,代码来源:DatabaseFunctionParameter.cs


注:本文中的DataType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。