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


C# BaseType类代码示例

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


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


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