• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DataType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GetWriteCmd

        public string GetWriteCmd(int address, string data,DataType dtype)
        {
            int bytes = 0;
            string sWriteData = Utils.CreatePLCWriteData(data, out bytes, dtype);

            return CreateCmd(address, bytes, sWriteData);
        }
开发者ID:Klutzdon,项目名称:PBIMSN,代码行数:7,代码来源:Command.cs


示例17: DataModel

 public DataModel(string name, string caption, DataType type)
 {
     this.Name = name;
     this.Caption = string.IsNullOrEmpty(caption) ? name: caption;
     this.Type = type;
     Config = new Config();
 }
开发者ID:jdash-net,项目名称:In-Memory-Analytics,代码行数:7,代码来源:DataModel.cs


示例18: DatatypeQuery

        //---------------------------------------------------------------------
        public static void DatatypeQuery(OleDbConnection dbcon, CodeGenerator cg)
        {
            cg.DataTypeList.Clear();
            OleDbCommand cmd = new OleDbCommand("SELECT * FROM DataTypes", dbcon);
            OleDbDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                DataType curDatatype = new DataType();

                curDatatype.ID = Convert.ToInt32(dr["ID"].ToString());
                curDatatype.DataTypeName = dr["DataTypeName"].ToString();
                curDatatype.CType = dr["CType"].ToString();
                curDatatype.CTypeDef = dr["CTypeDef"].ToString();

                curDatatype.CSType = dr["CSType"].ToString();
                curDatatype.CSTypeDef = dr["CSTypeDef"].ToString();

                curDatatype.VBType = dr["VBType"].ToString();
                curDatatype.VBTypeDef = dr["VBTypeDef"].ToString();

                curDatatype.PythonType = dr["PythonType"].ToString();
                curDatatype.PythonTypeDef = dr["PythonTypeDef"].ToString();

                cg.DataTypeList.Add(curDatatype);
            }

            dr.Close();
        }
开发者ID:kevinflueckiger,项目名称:Application-SDK,代码行数:30,代码来源:DBReader.cs


示例19: DataTypeAttribute

        /// <summary>
        ///     Constructor that accepts a data type enumeration
        /// </summary>
        /// <param name="dataType">The <see cref="DataType" /> enum value indicating the type to apply.</param>
        public DataTypeAttribute(DataType dataType)
        {
            DataType = dataType;

            // Set some DisplayFormat for a few specific data types
            switch (dataType)
            {
                case DataType.Date:
                    DisplayFormat = new DisplayFormatAttribute();
                    DisplayFormat.DataFormatString = "{0:d}";
                    DisplayFormat.ApplyFormatInEditMode = true;
                    break;
                case DataType.Time:
                    DisplayFormat = new DisplayFormatAttribute();
                    DisplayFormat.DataFormatString = "{0:t}";
                    DisplayFormat.ApplyFormatInEditMode = true;
                    break;
                case DataType.Currency:
                    DisplayFormat = new DisplayFormatAttribute();
                    DisplayFormat.DataFormatString = "{0:C}";

                    // Don't set ApplyFormatInEditMode for currencies because the currency
                    // symbol can't be parsed
                    break;
            }
        }
开发者ID:Rayislandstyle,项目名称:corefx,代码行数:30,代码来源:DataTypeAttribute.cs


示例20: Normalize

        public DataType Normalize(DataType type)
        {
            if (type is TypeVariable)
                return NormalizeVariable((TypeVariable)type);

            return NormalizeNamedType((NamedType)type);
        }
开发者ID:plioi,项目名称:rook,代码行数:7,代码来源:TypeUnifier.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataTypes类代码示例发布时间:2022-05-24
下一篇:
C# DataTemplate类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap