本文整理汇总了C#中IValue.GetRawValue方法的典型用法代码示例。如果您正苦于以下问题:C# IValue.GetRawValue方法的具体用法?C# IValue.GetRawValue怎么用?C# IValue.GetRawValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IValue
的用法示例。
在下文中一共展示了IValue.GetRawValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Equals
public bool Equals(IValue other)
{
if(other.DataType == this.DataType)
{
var otherVal = other.GetRawValue() as TypeTypeValue;
return otherVal._instance.ID == this._instance.ID;
}
else
{
return false;
}
}
示例2: GetTypeDescriptorFor
public TypeDescriptor GetTypeDescriptorFor(IValue typeTypeValue)
{
if (typeTypeValue.DataType != DataType.Type)
throw RuntimeException.InvalidArgumentType();
var ttVal = typeTypeValue.GetRawValue() as TypeTypeValue;
System.Diagnostics.Debug.Assert(ttVal != null, "value must be of type TypeTypeValue");
return ttVal.Value;
}
示例3: Equals
public virtual bool Equals(IValue other)
{
return other.GetRawValue() == this;
}
示例4: Delete
public void Delete(IValue Column)
{
Column = Column.GetRawValue();
_columns.Remove(GetColumnByIIndex(Column));
}
示例5: Equals
public bool Equals(IValue other)
{
return other.GetRawValue() == Instance;
}
示例6: IsValueFilled
public bool IsValueFilled(IValue value)
{
if (value.DataType == DataType.Undefined)
return false;
else if (value.DataType == DataType.Boolean)
return true;
else if (value.DataType == DataType.String)
return !String.IsNullOrWhiteSpace(value.AsString());
else if (value.DataType == DataType.Number)
return value.AsNumber() != 0;
else if (value.DataType == DataType.Date)
{
var emptyDate = new DateTime(1, 1, 1, 0, 0, 0);
return value.AsDate() != emptyDate;
}
else if (value.GetRawValue() is ICollectionContext)
{
var col = value.GetRawValue() as ICollectionContext;
return col.Count() != 0;
}
else
return true;
}
示例7: Equals
public bool Equals(IValue other)
{
GuidWrapper otherUuid = other.GetRawValue() as GuidWrapper;
if (otherUuid == null)
return false;
else
return _value.Equals(otherUuid._value);
}
示例8: CompareTo
public int CompareTo(IValue other)
{
GuidWrapper otherUuid = other.GetRawValue() as GuidWrapper;
if (otherUuid == null)
throw RuntimeException.ComparisonNotSupportedException();
return _value.CompareTo(otherUuid._value);
}
示例9: GetEncoding
public static Encoding GetEncoding(IValue encoding)
{
if (encoding.DataType == DataType.String)
return Encoding.GetEncoding(encoding.AsString());
else
{
if (encoding.DataType != DataType.GenericValue)
throw RuntimeException.InvalidArgumentType();
var encValue = encoding.GetRawValue() as SelfAwareEnumValue<TextEncodingEnum>;
if (encValue == null)
throw RuntimeException.InvalidArgumentType();
var encodingEnum = GlobalsManager.GetEnum<TextEncodingEnum>();
Encoding enc;
if (encValue == encodingEnum.Ansi)
enc = Encoding.GetEncoding(1251);
else if (encValue == encodingEnum.Oem)
enc = Encoding.GetEncoding(866);
else if (encValue == encodingEnum.Utf16)
enc = new UnicodeEncoding(false, true);
else if (encValue == encodingEnum.Utf8)
enc = new UTF8Encoding(true);
else if (encValue == encodingEnum.Utf8NoBOM)
enc = new UTF8Encoding(false);
else if (encValue == encodingEnum.System)
enc = Encoding.Default;
else
throw RuntimeException.InvalidArgumentValue();
return enc;
}
}