本文整理汇总了C#中Value类的典型用法代码示例。如果您正苦于以下问题:C# Value类的具体用法?C# Value怎么用?C# Value使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Value类属于命名空间,在下文中一共展示了Value类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Card
public Card(Suit suit, Value value)
{
this.value = value;
this.suit = suit;
this.name = GetName();
this.owner = null;
}
开发者ID:AKorshunov87,项目名称:SimplePoker,代码行数:7,代码来源:Card.cs
示例2: Apply
public override void Apply(ComputedStyle style,Value value){
// Get the border:
BorderProperty border=GetBorder(style);
if(value!=null && value.Type==ValueType.Text){
if(value.Text=="transparent"){
// Currently assume the default colour (black):
// (Use #00000000 instead)
value=null;
}
}
// Apply the base colour:
border.BaseColour=value;
// Reset the border colour:
border.ResetColour();
// Tell it a colour changed:
border.ColourChanged();
}
开发者ID:KMarshland,项目名称:ChildrensHospitalApp,代码行数:26,代码来源:borderColor.cs
示例3: Apply
public override void Apply(ComputedStyle style,Value value){
// E.g. relative, fixed.
if(style.SetupTransform(value)){
if(value==null){
style.Transform.OriginPosition=PositionType.Relative;
}else{
if(value.Text=="fixed"){
style.Transform.OriginPosition=PositionType.Fixed;
}else if(value.Text=="absolute"){
style.Transform.OriginPosition=PositionType.Absolute;
}else{
style.Transform.OriginPosition=PositionType.Relative;
}
}
}
style.RequestTransform();
}
开发者ID:KMarshland,项目名称:ChildrensHospitalApp,代码行数:31,代码来源:transformOriginPosition.cs
示例4: Add
public Value Add(Value val1, Value val2)
{
HeapValue heapVal1 = (HeapValue) val1;
HeapValue heapVal2 = (HeapValue) val2;
return new HeapValue(_content, heapVal1.size + heapVal2.size);
}
开发者ID:Stromausfall,项目名称:Patterns,代码行数:7,代码来源:HeapAddOperation.cs
示例5: Load
private static bool Load(BinaryReader reader, out Value value)
{
List<KeyValuePair<Value, Value>> array;
Value arrayKey;
Value arrayValue;
int count;
ValueContent type;
type = (ValueContent)reader.ReadInt32 ();
switch (type)
{
case ValueContent.Boolean:
value = reader.ReadBoolean () ? BooleanValue.True : BooleanValue.False;
break;
case ValueContent.Map:
count = reader.ReadInt32 ();
array = new List<KeyValuePair<Value, Value>> (count);
while (count-- > 0)
{
if (!ValueAccessor.Load (reader, out arrayKey) || !ValueAccessor.Load (reader, out arrayValue))
{
value = null;
return false;
}
array.Add (new KeyValuePair<Value, Value> (arrayKey, arrayValue));
}
value = array;
break;
case ValueContent.Number:
value = reader.ReadDecimal ();
break;
case ValueContent.String:
value = reader.ReadString ();
break;
case ValueContent.Void:
value = VoidValue.Instance;
break;
default:
value = null;
return false;
}
return true;
}
开发者ID:r3c,项目名称:cottle,代码行数:60,代码来源:ValueAccessor.cs
示例6: MoveTouch
public void MoveTouch(int id, float x, float y)
{
moveValues[0] = new Value(id, MovieID);
moveValues[1] = new Value(x / Screen.width, MovieID);
moveValues[2] = new Value(1 - y / Screen.height, MovieID);
Invoke("root.Scaleform_moveTouch", moveValues, 3);
}
开发者ID:NormLi,项目名称:TouchScript,代码行数:7,代码来源:ScaleformMovie.cs
示例7: Nils
public void Nils()
{
var val = new Value();
Assert.IsTrue( val.IsNil );
Assert.IsFalse( val.ToBool() );
Assert.AreEqual( LValueType.Nil, val.ValueType );
val.Set( true );
Assert.IsFalse( val.IsNil );
val.Set( Value.Nil );
Assert.IsTrue( val.IsNil );
val = new Value();
Assert.IsTrue( val.IsNil );
val = Value.Nil;
Assert.IsTrue( val.IsNil );
val.Set( true );
Assert.IsFalse( val.IsNil );
val.SetNil();
Assert.IsTrue( val.IsNil );
}
开发者ID:henchmeninteractive,项目名称:HenchLua,代码行数:25,代码来源:ValueTests.cs
示例8: Apply
public override void Apply(ComputedStyle style,Value value){
// The new overlay colour:
Color overlay=Color.white;
if(value!=null){
overlay=value.ToColor();
}
// Apply it:
style.ColorOverlay=overlay;
// Special case here - everything needs to be told!
if(style.BGImage!=null){
style.BGImage.SetOverlayColour(overlay);
}
if(style.BGColour!=null){
style.BGColour.SetOverlayColour(overlay);
}
if(style.Border!=null){
style.Border.SetOverlayColour(overlay);
}
if(style.Text!=null){
style.Text.SetOverlayColour(overlay);
}
}
开发者ID:KMarshland,项目名称:ChildrensHospitalApp,代码行数:31,代码来源:colorOverlay.cs
示例9: Invoke
public Value Invoke(Value objectVar, List<Value> parameters)
{
if (parameters.Count == parameterNames.Count)
{
// create new scope for the method call
var methodScope = new Scope();
methodScope.Define("this");
methodScope.Assign("this", objectVar);
for (int i = 0; i < parameterNames.Count; i++)
{
methodScope.Define(parameterNames[i]);
methodScope.Assign(parameterNames[i], parameters[i]);
}
var nodeStream = new CommonTreeNodeStream(functionBody);
// Create a tree walker to evaluate this method's code block
var walker = new SGLTreeWalker(nodeStream, methodScope);
Value returnValue = null;
// Ok, executing the function then
returnValue = walker.main().Evaluate();
// we shouldn't check the return type
/*if (!returnValue.GetVarType().Equals(this.returnType))
{
throw new Exception("The method doesn't return the expected return type (" + returnValue.ToString() + " is not from type " + this.returnType + ")");
}*/
return returnValue;
}
throw new CompilerException(definedLine, 318, name, parameterNames.Count.ToString(), parameters.Count.ToString());
}
开发者ID:brianex,项目名称:osu-sgl,代码行数:35,代码来源:UserFunction.cs
示例10: Apply
public override void Apply(ComputedStyle style,Value value){
// Get the border:
BorderProperty border=GetBorder(style);
if(value==null){
// No corners:
border.Corners=null;
}else{
// Apply top left:
border.SetCorner(RoundCornerPosition.TopLeft,value.GetPX(0));
// Apply top right:
border.SetCorner(RoundCornerPosition.TopRight,value.GetPX(1));
// Apply bottom right:
border.SetCorner(RoundCornerPosition.BottomLeft,value.GetPX(2));
// Apply bottom left:
border.SetCorner(RoundCornerPosition.BottomRight,value.GetPX(3));
}
// Request a layout:
border.RequestLayout();
}
开发者ID:KMarshland,项目名称:ChildrensHospitalApp,代码行数:28,代码来源:borderRadius.cs
示例11: AmbiguousDataContainer
public AmbiguousDataContainer(Value value, string name)
{
this.value = value;
this.entityOrComponentName = name;
value.AddHandler<ScopeChanged>(OnScopeChanged);
}
开发者ID:kinectitude,项目名称:kinectitude,代码行数:7,代码来源:AmbiguousDataContainer.cs
示例12: ExtractBody
/// <summary>Retrieve the body off the argument</summary>
internal static List<DelimiterList> ExtractBody(Value arg)
{
Map map = arg.AsMap;
if (map == null || !map.ContainsKey(keyBody))
return null;
return map[keyBody].AsLine;
}
开发者ID:loki3,项目名称:loki-pl1,代码行数:8,代码来源:ValueFunction.cs
示例13: Cell
/// <summary>
/// Internal constructor, must only be called by Sheet.CreateCell
/// </summary>
public Cell (Sheet sheet, int col, int row)
{
Sheet = sheet;
Col = col;
Row = row;
val = DefaultValue;
}
开发者ID:emtees,项目名称:old-code,代码行数:10,代码来源:Cell.cs
示例14: GeglBWProcessor
protected GeglBWProcessor(Gegl.Node _gegl)
: base()
{
gegl = _gegl;
SList children = gegl.Children;
load = mixer = contrast = tint = null;
foreach (Node c in children) {
string op = c.Operation;
if (op == "load")
load = c;
else if (op == "mono-mixer")
mixer = c;
else if (op == "contrast-curve")
contrast = c;
else if (op == "tint")
tint = c;
}
if (load == null || mixer == null || contrast == null || tint == null)
throw new ApplicationException("not all nodes found");
Value val = new Value(Gegl.Curve.GType);
contrastCurve = (GLib.Object)contrast.GetProperty("curve", ref val) as Gegl.Curve;
}
开发者ID:schani,项目名称:bwprocessor,代码行数:26,代码来源:GeglBWProcessor.cs
示例15: ThisDataContainer
public ThisDataContainer(Value value)
{
this.value = value;
Entity = value.Entity;
value.AddHandler<ScopeChanged>(OnScopeChanged);
}
开发者ID:kinectitude,项目名称:kinectitude,代码行数:7,代码来源:ThisDataContainer.cs
示例16: Render
public bool Render(IStore store, TextWriter output, out Value result)
{
bool halt;
foreach (KeyValuePair<IEvaluator, INode> branch in this.branches)
{
if (branch.Key.Evaluate (store, output).AsBoolean)
{
store.Enter ();
halt = branch.Value.Render (store, output, out result);
store.Leave ();
return halt;
}
}
if (this.fallback != null)
{
store.Enter ();
halt = this.fallback.Render (store, output, out result);
store.Leave ();
return halt;
}
result = VoidValue.Instance;
return false;
}
开发者ID:r3c,项目名称:cottle,代码行数:33,代码来源:IfNode.cs
示例17: Operate
protected override Value Operate(Value value1, Value value2)
{
if (value1.Type == ValType.Integer && value2.Type == ValType.Integer)
{
// 5 / 4; => Integer (1)
if (value2.IntValue == 0)
{
// division by 0
throw new CompilerException(-1, 205);
}
return new Value(value1.IntValue/value2.IntValue, ValType.Integer);
}
else if (value1.TypeEquals(ValType.Double) && value2.TypeEquals(ValType.Double))
{
// 1.423 / 2; => Float
if (value2.DoubleValue == 0)
{
// division by 0
throw new CompilerException(-1, 205);
}
return new Value(value1.DoubleValue/value2.DoubleValue, ValType.Double);
}
else
{
throw new CompilerException(Line, 202, "/", value1.TypeString, value2.TypeString);
}
}
开发者ID:brianex,项目名称:osu-sgl,代码行数:28,代码来源:DivNode.cs
示例18: Apply
public override void Apply(ComputedStyle style,Value value){
// Get the border:
BorderProperty border=GetBorder(style);
if(value==null){
border.WidthTop=border.WidthLeft=0;
border.WidthRight=border.WidthBottom=0;
}else{
border.WidthTop=value.GetPX(0);
border.WidthRight=value.GetPX(1);
border.WidthBottom=value.GetPX(2);
border.WidthLeft=value.GetPX(3);
}
// Does the border have any corners? If so, we need to update them:
if(border.Corners!=null){
border.Corners.Recompute();
}
// Request a layout:
border.RequestLayout();
// Set the styles size:
style.SetSize();
}
开发者ID:KMarshland,项目名称:ChildrensHospitalApp,代码行数:26,代码来源:borderWidth.cs
示例19: WhenCardIsConstructedWithShortNotation
public void WhenCardIsConstructedWithShortNotation(string shortNotation, Value expectedValue, Suit expectedSuit)
{
var card = new Card(shortNotation);
Assert.That(card.Value, Is.EqualTo(expectedValue));
Assert.That(card.Suit, Is.EqualTo(expectedSuit));
}
开发者ID:lordjeb,项目名称:kata-pokerhands,代码行数:7,代码来源:CardTests.cs
示例20: Card
public Card(int input)
{
integerValue = input;
int tempValue = input % 13;
int tempSuit = input / 13;
switch (tempValue)
{
case 0: value = Value.ACE; break;
case 1: value = Value.TWO; break;
case 2: value = Value.THREE; break;
case 3: value = Value.FOUR; break;
case 4: value = Value.FIVE; break;
case 5: value = Value.SIX; break;
case 6: value = Value.SEVEN; break;
case 7: value = Value.EIGHT; break;
case 8: value = Value.NINE; break;
case 9: value = Value.TEN; break;
case 10: value = Value.JACK; break;
case 11: value = Value.QUEEN; break;
case 12: value = Value.KING; break;
}
switch (tempSuit)
{
case 0: suit = Suit.SPADES; break;
case 1: suit = Suit.HEARTS; break;
case 2: suit = Suit.DIAMONDS; break;
case 3: suit = Suit.CLUBS; break;
}
}
开发者ID:Camzace,项目名称:ZacesCasino,代码行数:31,代码来源:Card.cs
注:本文中的Value类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论