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


C# Value类代码示例

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


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


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