本文整理汇总了C#中ValueType类的典型用法代码示例。如果您正苦于以下问题:C# ValueType类的具体用法?C# ValueType怎么用?C# ValueType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueType类属于命名空间,在下文中一共展示了ValueType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ChangeProperties
static void ChangeProperties(ValueType instance)
{
instance.Number = 29;
instance.String = "twentynine";
Console.WriteLine("value in method: {0} {1}", instance.Number, instance.String);
}
开发者ID:TeamnetGroup,项目名称:csharp1,代码行数:7,代码来源:Program.cs
示例2: PatternValidation
/// <summary>
///
/// </summary>
/// <remarks></remarks>
/// <seealso cref=""/>
/// <param name="name"></param>
/// <param name="dataType"></param>
/// <param name="pattern"></param>
public PatternValidation(string name, string dataType, string pattern)
{
this.appliedTo = ValueType.All;
this.name = name;
this.dataType = dataType;
this.pattern = pattern;
}
开发者ID:BEXIS2,项目名称:Core,代码行数:15,代码来源:PatternValidation.cs
示例3: RemoveFlag
/// <summary>
/// 移除flag中指定的vt特性
/// </summary>
public static void RemoveFlag(ref int flag, ValueType vt)
{
if (CheckFlag(flag, vt))
{
flag &= ~(1 << (int)vt);
}
}
开发者ID:zeronely,项目名称:View,代码行数:10,代码来源:EnumUtil.cs
示例4: Option
public Option(string name, ValueType valueType, string description, string example) : this(name, valueType)
{
Name = name;
ValueType = valueType;
Description = description;
Example = example;
}
开发者ID:GianLorenzetto,项目名称:LineCommander,代码行数:7,代码来源:Option.cs
示例5: DomainValidation
/// <summary>
///
/// </summary>
/// <remarks></remarks>
/// <seealso cref=""/>
/// <param name="name"></param>
/// <param name="dataType"></param>
/// <param name="checkList"></param>
public DomainValidation(string name, string dataType, List<string> checkList)
{
this.appliedTo = ValueType.All;
this.name = name;
this.dataType = dataType;
this.checkList = checkList;
}
开发者ID:BEXIS2,项目名称:Core,代码行数:15,代码来源:DomainValidation.cs
示例6: AddIndexRuleConstraints
internal static void AddIndexRuleConstraints(ConstraintBuilder constraintBuilder, ValueType stringType)
{
constraintBuilder
.AssertAll<ValueField>(vf => (!vf.HasIndexAttribute && !vf.HasMaxLengthAttribute)
^ (vf.HasIndexAttribute && vf.Type != stringType)
^ (vf.HasIndexAttribute && vf.HasMaxLengthAttribute))
.AssertAll<ValueField>(vf => !(vf.HasKeyAttribute && vf.HasIndexAttribute));
}
开发者ID:RicardoNiepel,项目名称:Z3.ObjectTheorem,代码行数:8,代码来源:EFConstraints.cs
示例7: Test2
public static int Test2()
{
ValueType vt = new ValueType(2);
int i = vt.GetValue();
return i;
}
开发者ID:Zahovay,项目名称:MOSA-Project,代码行数:8,代码来源:ValueTypeTests.cs
示例8: CssMediaFeature
private CssMediaFeature(string aName, RangeType aRangeType, ValueType aValueType, int[] aKeywordTable, string aMetric)
{
mName = aName;
mRangeType = aRangeType;
mValueType = aValueType;
mKeywordTable = aKeywordTable;
mMetric = aMetric;
}
开发者ID:rexwhitten,项目名称:CsCss,代码行数:8,代码来源:CssMediaFeature.cs
示例9: CastFunction
public CastFunction(ValueType type)
: base(Fixity.Prefix, 1)
{
CastType = type;
Signature.InputSignature.Clear();
Signature.InputSignature.Add(ValueType.BlankIdentifier);
Signature.OutputSignature = ValueType.BlankIdentifier;
}
开发者ID:LukaHorvat,项目名称:Hype,代码行数:8,代码来源:CastFunction.cs
示例10: ValueCorrectionViewModel
public ValueCorrectionViewModel(ValueType type)
{
if (type == ValueType.Integer)
_format = "0";
else if (type == ValueType.Percent)
_format = "P2";
else
_format = "0.00";
}
开发者ID:Vhaerlein,项目名称:swtor.playground,代码行数:9,代码来源:ValueCorrectionViewModel.cs
示例11: FunctionType
public FunctionType(Fixity fixity, int numArguments = 2)
: base("FunctionType")
{
Fixity = fixity;
InputSignature = new List<ValueType>();
if (fixity != Hype.Fixity.Prefix && numArguments != 2) throw new Exception("Infix functions can only take 2 arguments.");
for (int i = 0; i < numArguments; ++i)
{
InputSignature.Add(ValueType.Uncertain);
}
OutputSignature = ValueType.Uncertain;
}
开发者ID:LukaHorvat,项目名称:Hype,代码行数:14,代码来源:FunctionType.cs
示例12: GetName
private static string GetName(ValueType type)
{
var index = (int)type;
var names = new string[] {
"Null",
"Boolean",
"Integer",
"UInteger",
"Number",
"String",
"Array",
"Object",
};
return (index >= 0 && index < names.Length) ? names[index] : "Unknown";
}
开发者ID:WBasti,项目名称:CoherentUIMobileOpenSource,代码行数:15,代码来源:Exceptions.cs
示例13: attr
/// <summary>Assigns all needed attributes to the tag</summary>
/// <returns>This instance downcasted to base class</returns>
public virtual IndexedTag attr(
string id = null,
string name = null,
string value = null,
ValueType? valuetype = null,
MimeType type = null
)
{
Id = id;
Name = name;
Value = value;
ValueType = valuetype;
Type = type;
return this;
}
开发者ID:bzure,项目名称:BSA.Net,代码行数:18,代码来源:TagParam.cs
示例14: Main
static void Main(string[] args)
{
var referenceInstance = new ReferenceType();
referenceInstance.Number = 1;
referenceInstance.String = "one";
ChangeProperties(referenceInstance);
Console.WriteLine("reference: {0} {1}", referenceInstance.Number, referenceInstance.String);
var valueInstance = new ValueType();
valueInstance.Number = 1;
valueInstance.String = "one";
ChangeProperties(valueInstance);
Console.WriteLine("value: {0} {1}", valueInstance.Number, valueInstance.String);
}
开发者ID:TeamnetGroup,项目名称:csharp1,代码行数:16,代码来源:Program.cs
示例15: ConstNode
internal ConstNode(DataTable table, ValueType type, object constant, bool fParseQuotes) : base(table)
{
switch (type)
{
case ValueType.Null:
_val = DBNull.Value;
break;
case ValueType.Numeric:
_val = SmallestNumeric(constant);
break;
case ValueType.Decimal:
_val = SmallestDecimal(constant);
break;
case ValueType.Float:
_val = Convert.ToDouble(constant, NumberFormatInfo.InvariantInfo);
break;
case ValueType.Bool:
_val = Convert.ToBoolean(constant, CultureInfo.InvariantCulture);
break;
case ValueType.Str:
if (fParseQuotes)
{
// replace '' with one '
_val = ((string)constant).Replace("''", "'");
}
else
{
_val = (string)constant;
}
break;
case ValueType.Date:
_val = DateTime.Parse((string)constant, CultureInfo.InvariantCulture);
break;
case ValueType.Object:
_val = constant;
break;
default:
Debug.Assert(false, "NYI");
goto case ValueType.Object;
}
}
开发者ID:dotnet,项目名称:corefx,代码行数:47,代码来源:ConstNode.cs
示例16: AddDatabaseGeneratedRuleConstraints
internal static void AddDatabaseGeneratedRuleConstraints(
ConstraintBuilder constraintBuilder, ValueType stringType, ValueType numberType, ValueType guidType)
{
constraintBuilder
.AssertAll<ValueField>(f => (!f.IsPrimaryKey && f.DatabaseGeneratedAttribute == DatabaseGeneratedAttribute.None)
^
(
f.IsPrimaryKey
&&
(
(f.Type == stringType && f.DatabaseGeneratedAttribute == DatabaseGeneratedAttribute.Computed)
^ (f.Type == numberType && f.DatabaseGeneratedAttribute != DatabaseGeneratedAttribute.Computed)
^ (f.Type == guidType && f.DatabaseGeneratedAttribute != DatabaseGeneratedAttribute.Identity)
)
)
);
}
开发者ID:RicardoNiepel,项目名称:Z3.ObjectTheorem,代码行数:17,代码来源:EFConstraints.cs
示例17: Value
public Value(Value value)
{
Type = value.Type;
switch (Type) {
case ValueType.String:
Str = value.Str;
break;
case ValueType.Number:
Number = value.Number;
break;
case ValueType.Object:
if (value.Obj != null)
Obj = new Object(value.Obj);
break;
case ValueType.Array:
Array = new Array(value.Array);
break;
case ValueType.Boolean:
Boolean = value.Boolean;
break;
}
}
开发者ID:Notulp,项目名称:Pluton.Patcher,代码行数:22,代码来源:Value.cs
示例18: VisitConditionalExpr
public void VisitConditionalExpr(bool condition, object thenValue, object elseValue, ValueType expected)
{
var target = new TypeCheckingVisitor();
var conditionExpression = new ConstantExpr(condition);
var thenExpression = new ConstantExpr(thenValue);
var elseExpression = new ConstantExpr(elseValue);
var expr = new ConditionalExpr(conditionExpression, thenExpression, elseExpression);
var actual = target.Visit(expr, scope);
Assert.AreEqual(expected, actual);
}
开发者ID:PeterBassett,项目名称:Parser,代码行数:14,代码来源:TypeCheckingVisitorTest.cs
示例19: VisitBooleanNotExpr
public void VisitBooleanNotExpr(bool a, ValueType expected)
{
var target = new TypeCheckingVisitor();
var aExpression = new ConstantExpr(a);
var expr = new NotExpr(aExpression);
var actual = target.Visit(expr, scope);
Assert.AreEqual(expected, actual);
}
开发者ID:PeterBassett,项目名称:Parser,代码行数:11,代码来源:TypeCheckingVisitorTest.cs
示例20: RetrieveValue
public void RetrieveValue()
{
Key = oldKey;
if (PlayerPrefs.GetString(Key, UNIQUE_STRING) != UNIQUE_STRING)
{
Type = ValueType.String;
value = PlayerPrefs.GetString(Key);
}
else if (PlayerPrefs.GetInt(Key, UNIQUE_INT) != UNIQUE_INT)
{
Type = ValueType.Integer;
value = PlayerPrefs.GetInt(Key);
}
else if (PlayerPrefs.GetFloat(Key, UNIQUE_FLOAT) != UNIQUE_FLOAT)
{
Type = ValueType.Float;
value = PlayerPrefs.GetFloat(Key);
}
oldKey = Key;
//Don't mark the first set Value as changed
HasChanged = false;
}
开发者ID:kinifi,项目名称:LE_IM,代码行数:25,代码来源:APPWindow.cs
注:本文中的ValueType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论