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

C# TypeBase类代码示例

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

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



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


示例16: GetClrType

        private Type GetClrType(TypeBase t)
        {
            var clrType = m_typeTable.Get(t);
            if (clrType != null)
            {
                return clrType;
            }

            CodeClassType ccType = t as CodeClassType;

            if (ccType != null)
            {
                Type baseClass = typeof(Object);

                if (ccType.BaseType != null)
                {
                    baseClass = GetClrType(ccType.BaseType);
                }

                clrType = m_module.DefineType(t.Name, TypeAttributes.Class | TypeAttributes.BeforeFieldInit, baseClass);

                m_typeTable.Set(t, clrType);
                return clrType;
            }

            ArrayType aType = t as ArrayType;
            if (aType != null)
            {
                var elementType = GetClrType(aType.ElementType);

                clrType = elementType.MakeArrayType();
                m_typeTable.Set(t, clrType);

                return clrType;
            }

            PrimaryType pType = t as PrimaryType;

            switch (pType.Name)
            {
                case "int":
                    clrType = typeof(int);
                    break;
                case "bool":
                    clrType = typeof(bool);
                    break;
                default:
                    Debug.Assert(false, "unknown primary type");
                    break;
            }

            m_typeTable.Set(t, clrType);
            return clrType;

        }
开发者ID:destinyclown,项目名称:VBF,代码行数:55,代码来源:EmitTranslator.cs


示例17: IsAssignableTo

        public override bool IsAssignableTo(TypeBase other, int depth = 0, bool checkConst = true)
        {
            if (!base.IsAssignableTo(other, depth, checkConst))
                return false;

            var otherMod = other as TypeModifier;
            if (otherMod == null)
                return false;

            return InnerType.IsAssignableTo(otherMod.InnerType, depth + 1);
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:11,代码来源:TypeModifier.cs


示例18: Equals

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

            var otherMod = other as TypeModifier;
            if (otherMod == null)
                return false;

            return InnerType.Equals(otherMod.InnerType);
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:11,代码来源:TypeModifier.cs


示例19: Equals

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

            var otherArray = other as ArrayType;
            if (otherArray == null)
                return false;

            return IsConstant == other.IsConstant && Count == otherArray.Count;
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:11,代码来源:ArrayType.cs


示例20: IsAssignableTo

        public override bool IsAssignableTo(TypeBase other, int depth = 0, bool checkConst = true)
        {
            if (!base.IsAssignableTo(other, depth, checkConst))
                return false;

            if (other is PointerType)
                return true;

            var otherArray = other as ArrayType;
            return Count >= otherArray?.Count;
        }
开发者ID:Rohansi,项目名称:LoonyC,代码行数:11,代码来源:ArrayType.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TypeBuilder类代码示例发布时间:2022-05-24
下一篇:
C# TypeAttributes类代码示例发布时间: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