當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。