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

C# BaseType类代码示例

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

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



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

示例1: ReferenceType

 public ReferenceType(BaseType value)
     : base(false)
 {
     referencedValue = value;
     value.Changed += new EventHandler<ValueChangedEventArgs>(value_Changed);
     DoAllocation();
 }
开发者ID:hunpody,项目名称:psimulex,代码行数:7,代码来源:ReferenceType.cs


示例2: IsNumeric

 /// <summary>
 /// Returns true if the value is numerical.
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public static bool IsNumeric(BaseType value)
 {
     TypeEnum type = value.Type;
     return type == TypeEnum.Decimal ||
            type == TypeEnum.Float ||
            type == TypeEnum.Integer;
 }
开发者ID:hunpody,项目名称:psimulex,代码行数:12,代码来源:TypeHierarchy.cs


示例3: Insert

 public override void Insert(BaseType value)
 {
     if (!Contains(value))
     {
         base.Insert(value);
     }
 }
开发者ID:hunpody,项目名称:psimulex,代码行数:7,代码来源:Set.cs


示例4: Promote

 protected BaseType Promote(BaseType a, BaseType b)
 {
     if (a == BaseType.Double || b == BaseType.Double)
         return BaseType.Double;
     if (a == BaseType.Float || b == BaseType.Float)
         return BaseType.Float;
     if (a == BaseType.ULong || b == BaseType.ULong)
         return BaseType.ULong;
     int aSize = Types.GetBaseTypeSize(a);
     int bSize = Types.GetBaseTypeSize(b);
     if (Types.IsUnsigned(a) && Types.IsSigned(b))
     {
         if (aSize < bSize)
             return b;
         else
             Types.GetIntegralTypeBySize(Math.Max(aSize, bSize), false);
     }
     if (Types.IsSigned(a) && Types.IsUnsigned(b))
     {
         if (bSize < aSize)
             return a;
         else
             return Types.GetIntegralTypeBySize(Math.Max(aSize, bSize), false);
     }
     else
     {
         bool isSigned = Types.IsSigned(a);
         return Types.GetIntegralTypeBySize(Math.Max(aSize, bSize), isSigned);
     }
 } 
开发者ID:GregoryComer,项目名称:CSubCompiler,代码行数:30,代码来源:BinaryOperatorNode.cs


示例5: Because_of

        protected override void Because_of()
        {
            var baseType = new BaseType();
            var baseTypeDto = new BaseTypeDto();

            Mapper.Map(baseType, baseTypeDto);
        }
开发者ID:AutoMapper,项目名称:AutoMapper,代码行数:7,代码来源:PreserveReferencesSameDestination.cs


示例6: Main

    public static void Main()
    {
        test_is();

        DerivedType derivedObj = new DerivedType();
        BaseType baseObj1 = new BaseType();
        BaseType baseObj2 = derivedObj;

        DerivedType derivedObj2 = baseObj2 as DerivedType;
        if( derivedObj2 != null ) {
            Console.WriteLine( "Conversion Succeeded" );
        } else {
            Console.WriteLine( "Conversion Failed" );
        }

        derivedObj2 = baseObj1 as DerivedType;
        if( derivedObj2 != null ) {
            Console.WriteLine( "Conversion Succeeded" );
        } else {
            Console.WriteLine( "Conversion Failed" );
        }

        BaseType baseObj3 = derivedObj as BaseType;
        if( baseObj3 != null ) {
            Console.WriteLine( "Conversion Succeeded" );
        } else {
            Console.WriteLine( "Conversion Failed" );
        }

        System.Console.WriteLine("Press any key to continue...");
        System.Console.ReadKey();
    }
开发者ID:dbremner,项目名称:hycs,代码行数:32,代码来源:operator.cs


示例7: GetAuthorizerScripts

        public static MvcHtmlString GetAuthorizerScripts(this HtmlHelper helper, BaseType libraryBase, CommonResources includedResources)
        {
            UrlHelper Urls = new UrlHelper(helper.ViewContext.RequestContext);
            List<TagBuilder> LibrarySupportingElements = new List<TagBuilder>();

            TagBuilder OpenIdLibrary = new TagBuilder("script");
            OpenIdLibrary.Attributes.Add(new KeyValuePair<string,string>( "type", "text/javascript"));

            switch(libraryBase)
            {
                case BaseType.Jquery:
                    OpenIdLibrary.Attributes.Add(new KeyValuePair<string, string>("src", Urls.RouteUrl("AuthorizationResources", new {resourceType = "Scripts", resourceName = "openid-jquery.js"})));
                    TagBuilder LanguageFile = new TagBuilder("script");
                    LanguageFile.Attributes.Add(new KeyValuePair<string, string>("type", "text/javascript"));
                    LanguageFile.Attributes.Add(new KeyValuePair<string, string>("src", Urls.RouteUrl("AuthorizationResources", new { resourceType = "Scripts", resourceName = "openid-en.js" })));

                    LibrarySupportingElements.Add(LanguageFile);
                    break;
                default:
                    throw new InvalidOperationException();
            }

            string RawResult = OpenIdLibrary.ToString(TagRenderMode.Normal);
            LibrarySupportingElements.ForEach(Lib => RawResult += Lib.ToString(TagRenderMode.Normal));
            return MvcHtmlString.Create(RawResult);
        }
开发者ID:CoderNumber1,项目名称:Laziton,代码行数:26,代码来源:ResourceExtensions.cs


示例8: Can_create_with_complex_type

 public void Can_create_with_complex_type()
 {
     var Complex = new BaseType();
     var a = Immutable.Build<HazAComplexType>(new {Complex});
     Assert.IsNotNull(a.Complex);
     Assert.AreSame(Complex,a.Complex);
 }
开发者ID:sdether,项目名称:ImMutie,代码行数:7,代码来源:TImmutable.cs


示例9: NetObject

 public NetObject(string ip, string dns, string name, BaseType type, int position)
 {
     _ip = ip;
     _dns = dns;
     _name = name;
     _type = type;
     _position = position;
 }
开发者ID:Shahdee,项目名称:testAD,代码行数:8,代码来源:Server.cs


示例10: NetObject

 public NetObject(string ip, string dns, string name, BaseType type, int position, ConditionType state, int threadId)
 {
     _ip = ip;
         _dns = dns;
         _name = name;
         _type = type;
         _position = position;
         _state = state;
         _threadId = threadId;
 }
开发者ID:Shahdee,项目名称:serverAdmin,代码行数:10,代码来源:NetObject.cs


示例11: Convert

 /// <summary>
 /// Converts a basetype value to the given type.
 /// </summary>
 /// <param name="value"></param>
 /// <param name="targetType"></param>
 /// <returns></returns>
 public static BaseType Convert(BaseType value, TypeIdentifier targetType)
 {
     if (targetType.TypeEnum == TypeEnum.Undefined || targetType == value.Type)
     {
         return value;
     }
     var target = CreateValue(targetType);
     target.Assign(value);
     return target;
 }
开发者ID:hunpody,项目名称:psimulex,代码行数:16,代码来源:ValueFactory.cs


示例12: IsScalar

 /// <summary>
 /// Returns true if the value is a type of scalar.
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public static bool IsScalar(BaseType value)
 {
     TypeEnum type = value.Type;
     return type == TypeEnum.Boolean ||
         type == TypeEnum.Character ||
         type == TypeEnum.Decimal ||
         type == TypeEnum.Float ||
         type == TypeEnum.Integer ||
         type == TypeEnum.String;
 }
开发者ID:hunpody,项目名称:psimulex,代码行数:15,代码来源:TypeHierarchy.cs


示例13: Create

 public static QueryExec Create(BaseType baseType)
 {
     switch (baseType)
     {
         case BaseType.PDA:
             return new QueryExecPDA();
         case BaseType.Oracle:
             return new QueryExecOracle();
     }
     throw new ArgumentException("Base not implemented");
 }
开发者ID:radtek,项目名称:pdaexport,代码行数:11,代码来源:QueryExec.cs


示例14: IsContainer

 /// <summary>
 /// Returns true if the value is a type of scalar.
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public static bool IsContainer(BaseType value)
 {
     TypeEnum type = value.Type;
     return type == TypeEnum.Array ||
            type == TypeEnum.LinkedList ||
            type == TypeEnum.List ||
            type == TypeEnum.Matrix ||
            type == TypeEnum.PriorityQueue ||
            type == TypeEnum.Queue ||
            type == TypeEnum.Set ||
            type == TypeEnum.Stack;
 }
开发者ID:hunpody,项目名称:psimulex,代码行数:17,代码来源:TypeHierarchy.cs


示例15: Base

        public Base(int playerNum, int teamNum, BaseType baseType, Tile tile)
        {
            PlayerNum = playerNum;
            TeamNum = teamNum;
            this.Scale = 2.75f;
            this.Tile = tile;
            this.Position = tile.Position;

            this.model = ScreenManager.Game.Content.Load<Model>("Objects\\Base\\oilRig");
            SetupModel(Position);
            SetupCamera();
        }
开发者ID:holtkampw,项目名称:UH-Sample-XNA-Project,代码行数:12,代码来源:Base.cs


示例16: GunEmplacement

 public GunEmplacement(VL.TrackType trackType, VL.GunType gunType, Vector2 positionOffset, float radius, float depthOffset, BaseType baseType, Monster srcMonster)
 {
     this.gunType = gunType;
     this.trackType = trackType;
     this.positionOffset = positionOffset;
     this.radius = radius;
     this.baseRadius = .75f * radius;
     this.depthOffset = depthOffset;
     this.baseType = baseType;
     this.gunLine = srcMonster.position.direction;
     this.gunNormal = Vector3.Cross(gunLine, srcMonster.position.normal);
     this.position = srcMonster.position;
 }
开发者ID:kevincos,项目名称:Vexed,代码行数:13,代码来源:GunEmplacement.cs


示例17: Push

 /// <summary>
 /// Pushes the value converted to the given type.
 /// </summary>
 /// <param name="value"></param>
 /// <param name="type"></param>
 public Push(object value, TypeEnum type)
 {
     AccessMode = ValueAccessModes.Constant;
     this.type = type;
     if (type == TypeEnum.Undefined)
     {
         this.value = ValueFactory.Create(value);
     }
     else
     {
         this.value = ValueFactory.CreateValue(type);
         BaseType param = ValueFactory.Create(value);
         this.value.Assign(param);
     }
 }
开发者ID:hunpody,项目名称:psimulex,代码行数:20,代码来源:Push.cs


示例18: ScalarGraphics

        public ScalarGraphics(BaseType value)
            : base()
        {
            this.value = value;
            label = new Label();
            label.VerticalContentAlignment = VerticalAlignment.Center;
            label.HorizontalContentAlignment = HorizontalAlignment.Center;
            label.IsHitTestVisible = true;
            Content = label;
            value.Changed += value_Changed;

            this.MouseUp += new MouseButtonEventHandler(ScalarGraphics_MouseUp);

            currentMode = Mode.Display;

            Update();
        }
开发者ID:hunpody,项目名称:psimulex,代码行数:17,代码来源:ScalarGraphics.cs


示例19: Produce

        public static GraphicsElement Produce(BaseType value)
        {
            if (value == null)
                return new ScalarGraphics(new VapeTeam.Psimulex.Core.Types.String("NULL"));
            switch (value.Type.TypeEnum)
            {
                case TypeEnum.Integer:
             					return new ScalarGraphics(value);
                case TypeEnum.Array:
                    return new ArrayGraphics(value.ToArray());
                case TypeEnum.Tree:
                    return new TreeGraphics(value.ToTree());
                case TypeEnum.BinaryTree:
                    return new TreeGraphics(value.ToBinaryTree());

                default:
                    if (TypeHierarchy.IsContainer(value))
                    {
                        return new ArrayGraphics(value as AbstractCollection);
                    }
                    return new ScalarGraphics(value);
            }
        }
开发者ID:hunpody,项目名称:psimulex,代码行数:23,代码来源:GraphicsElementFactory.cs


示例20: ItemType

 //for item db purposes
 public ItemType(BaseType baseItemType, int subItemType, EquipSlot equipSlot)
 {
     this.itemBaseType = baseItemType;
     this.subItemType = subItemType;
     this.itemSlot = equipSlot;
 }
开发者ID:scienide00,项目名称:MayaRoguelike,代码行数:7,代码来源:ItemType.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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