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


C# TypeBase类代码示例

本文整理汇总了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;
        }
开发者ID:antiufo,项目名称:Shaman.Http,代码行数:25,代码来源:WebFile.cs

示例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();
                }
            }
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:31,代码来源:FrameResource.cs

示例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;
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:7,代码来源:BoolType.cs

示例4: SymmetricClosureService

 internal SymmetricClosureService(TypeBase source)
 {
     Source = source;
     AllFeatures = source
         .SymmetricFeatureClosure()
         .ToArray();
 }
开发者ID:hahoyer,项目名称:reni.cs,代码行数:7,代码来源:SymmetricClosureService.cs

示例5: Equals

        public override bool Equals(TypeBase other)
        {
            if (!base.Equals(other))
                return false;

            return other is BoolType;
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:7,代码来源:BoolType.cs

示例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;
 }
开发者ID:hahoyer,项目名称:reni.cs,代码行数:7,代码来源:FunctionList.cs

示例7: Equals

        public override bool Equals(TypeBase other)
        {
            if (!base.Equals(other))
                return false;

            return IsConstant == other.IsConstant && other is PointerType;
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:7,代码来源:PointerType.cs

示例8: Value

 internal Value(Func<Category, Result> function, TypeBase source)
     : base(_nextObjectId++)
 {
     Function = function;
     Source = source;
     Tracer.Assert(Source != null);
 }
开发者ID:hahoyer,项目名称:reni.cs,代码行数:7,代码来源:Simple.cs

示例9: ArrayType

        public ArrayType(TypeBase innerType, int count, bool constant = false)
            : base(innerType, constant)
        {
            if (count <= 0)
                throw new ArgumentOutOfRangeException(nameof(count));

            Count = count;
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:8,代码来源:ArrayType.cs

示例10: TypeModifier

        protected TypeModifier(TypeBase innerType, bool constant = false)
            : base(constant)
        {
            if (innerType == null)
                throw new ArgumentNullException(nameof(innerType));

            InnerType = innerType;
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:8,代码来源:TypeModifier.cs

示例11: Function

 internal Function(ContextBase parent, TypeBase argsType, TypeBase valueType = null)
     : base(parent)
 {
     _order = CodeArgs.NextOrder++;
     ArgsType = argsType;
     ValueType = valueType;
     StopByObjectIds();
 }
开发者ID:hahoyer,项目名称:reni.cs,代码行数:8,代码来源:Function.cs

示例12: Conversion

 internal Conversion(Func<Category, Result> function, TypeBase source)
     : base(_nextObjectId++)
 {
     Function = function;
     Source = source;
     Tracer.Assert(Source != null);
     StopByObjectIds();
 }
开发者ID:hahoyer,项目名称:reni.cs,代码行数:8,代码来源:Conversion.cs

示例13: Result

        internal Result Result(Category category, Result leftResult, TypeBase right)
        {
            var rightResult = right
                .Conversion(category.Typed, IndexType)
                .AutomaticDereferencedAlignedResult();

            return Result(category, leftResult + rightResult);
        }
开发者ID:hahoyer,项目名称:reni.cs,代码行数:8,代码来源:RepeaterAccessType.cs

示例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;
 }
开发者ID:hahoyer,项目名称:reni.cs,代码行数:9,代码来源:SearchResult.cs

示例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);
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:10,代码来源:NamedType.cs


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