本文整理汇总了C#中TypeBase类的典型用法代码示例。如果您正苦于以下问题:C# TypeBase类的具体用法?C# TypeBase怎么用?C# TypeBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeBase类属于命名空间,在下文中一共展示了TypeBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromDbValue
internal static WebFile FromDbValue(WebFile file, string content, TypeBase type)
{
/*if (url == null) return null;
var u = url.AsUri();
var file =
type == TypeBase.WebImage ? WebImage.FromUrl(u) :
type == TypeBase.WebAudio ? WebAudio.FromUrl(u) :
type == TypeBase.WebVideo ? WebVideo.FromUrl(u) :
WebFile.FromUrl(u);
*/
if (content != null)
{
var serializer = new JsonSerializer();
serializer.AddAwdeeConverters();
using (var sr = new StringReader(content))
using (var jr = Utils.CreateJsonReader(sr))
{
serializer.Deserialize(jr, type.NativeType);
}
}
return file;
}
示例2: RegisterFrameResource
public RegisterFrameResource(Frame frame, TypeBase type, Register register)
: base(frame, type)
{
Register = register;
if (type is PointerType)
{
_type = OperandValueType.Dword;
}
else
{
var typePrim = type as PrimitiveType;
if (typePrim == null)
throw new ArgumentException("Type must be a primitive.", nameof(type));
switch (typePrim.Type)
{
case Primitive.Int:
_type = OperandValueType.Dword;
break;
case Primitive.Short:
_type = OperandValueType.Word;
break;
case Primitive.Char:
_type = OperandValueType.Byte;
break;
default:
throw new NotSupportedException();
}
}
}
示例3: IsAssignableTo
public override bool IsAssignableTo(TypeBase other, int depth = 0, bool checkConst = true)
{
if (!base.IsAssignableTo(other, depth, checkConst))
return false;
return other is BoolType;
}
示例4: SymmetricClosureService
internal SymmetricClosureService(TypeBase source)
{
Source = source;
AllFeatures = source
.SymmetricFeatureClosure()
.ToArray();
}
示例5: Equals
public override bool Equals(TypeBase other)
{
if (!base.Equals(other))
return false;
return other is BoolType;
}
示例6: CreateFunctionInstance
int CreateFunctionInstance(TypeBase args, FunctionSyntax syntax, CompoundView compoundView)
{
var index = _list.Count;
var f = new FunctionType(index, syntax, compoundView, args);
_list.Add(f);
return index;
}
示例7: Equals
public override bool Equals(TypeBase other)
{
if (!base.Equals(other))
return false;
return IsConstant == other.IsConstant && other is PointerType;
}
示例8: Value
internal Value(Func<Category, Result> function, TypeBase source)
: base(_nextObjectId++)
{
Function = function;
Source = source;
Tracer.Assert(Source != null);
}
示例9: ArrayType
public ArrayType(TypeBase innerType, int count, bool constant = false)
: base(innerType, constant)
{
if (count <= 0)
throw new ArgumentOutOfRangeException(nameof(count));
Count = count;
}
示例10: TypeModifier
protected TypeModifier(TypeBase innerType, bool constant = false)
: base(constant)
{
if (innerType == null)
throw new ArgumentNullException(nameof(innerType));
InnerType = innerType;
}
示例11: Function
internal Function(ContextBase parent, TypeBase argsType, TypeBase valueType = null)
: base(parent)
{
_order = CodeArgs.NextOrder++;
ArgsType = argsType;
ValueType = valueType;
StopByObjectIds();
}
示例12: Conversion
internal Conversion(Func<Category, Result> function, TypeBase source)
: base(_nextObjectId++)
{
Function = function;
Source = source;
Tracer.Assert(Source != null);
StopByObjectIds();
}
示例13: Result
internal Result Result(Category category, Result leftResult, TypeBase right)
{
var rightResult = right
.Conversion(category.Typed, IndexType)
.AutomaticDereferencedAlignedResult();
return Result(category, leftResult + rightResult);
}
示例14: Create
public static SearchResult Create(IImplementation feature, TypeBase definingItem)
{
var searchResult = feature as SearchResult;
if(searchResult == null)
return new SearchResult(feature, definingItem);
var source = searchResult.Source;
Tracer.Assert(source == definingItem);
return searchResult;
}
示例15: IsAssignableTo
public override bool IsAssignableTo(TypeBase other, int depth = 0, bool checkConst = true)
{
if (!base.IsAssignableTo(other, depth, checkConst))
return false;
if (depth > 0 && other is AnyType)
return true;
return Equals(other);
}