本文整理汇总了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();
}
示例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;
}
示例3: Insert
public override void Insert(BaseType value)
{
if (!Contains(value))
{
base.Insert(value);
}
}
示例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);
}
}
示例5: Because_of
protected override void Because_of()
{
var baseType = new BaseType();
var baseTypeDto = new BaseTypeDto();
Mapper.Map(baseType, baseTypeDto);
}
示例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();
}
示例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);
}
示例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);
}
示例9: NetObject
public NetObject(string ip, string dns, string name, BaseType type, int position)
{
_ip = ip;
_dns = dns;
_name = name;
_type = type;
_position = position;
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例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();
}