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


C# Pad类代码示例

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


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

示例1: Paint

 public override void Paint(Pad pad, double minX, double maxX, double minY, double maxY)
 {
     base.Paint(pad, minX, maxX, minY, maxY);
     if (string.IsNullOrWhiteSpace(Text))
         return;
     var size = pad.Graphics.MeasureString(Text, TextFont);
     var w = size.Width;
     var h = size.Height;
     var clientX = pad.ClientX(X);
     var clientY = pad.ClientY(Y);
     var point = PointF.Empty;
     switch (TextPosition)
     {
         case ETextPosition.RightTop:
             point = new PointF(clientX + TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.LeftTop:
             point = new PointF(clientX - w - TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.CentreTop:
             point = new PointF(clientX - w/2 - TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.RightBottom:
             point = new PointF(clientX + TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
         case ETextPosition.LeftBottom:
             point = new PointF(clientX - w - TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
         case ETextPosition.CentreBottom:
             point = new PointF(clientX - w/2 - TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
     }
     pad.Graphics.DrawString(Text, TextFont, new SolidBrush(TextColor), point.X, point.Y);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:34,代码来源:TLabel.cs

示例2: PadProperyForm

 public PadProperyForm(object obj, Pad pad)
 {
     InitializeComponent();
     this.obj = obj;
     this.pad = pad;
     Text = string.Format("{0}  properties", obj.GetType().Name);
 }
开发者ID:28427328,项目名称:SQCharts,代码行数:7,代码来源:PadProperyForm.cs

示例3: BackgroundIntoBitmapIfNeeded

 private void BackgroundIntoBitmapIfNeeded(Pad pad, Bitmap bm)
 {
     if (this.Look != EChartLook.SurfaceOnly)
         return;
     var g = Graphics.FromImage(bm);
     TView.View(pad).PaintAxes(g, pad, 0, 0, this.H);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:7,代码来源:TFunction.cs

示例4: TLegend

 public TLegend(Pad pad)
 {
     Pad = pad;
     BorderEnabled = true;
     BorderColor = Color.Black;
     BackColor = Color.LightYellow;
     Items = new ArrayList();
 }
开发者ID:28427328,项目名称:SQCharts,代码行数:8,代码来源:TLegend.cs

示例5: LineView

 public LineView(DrawingLine line, Pad pad)
 {
     this.line = line;
     this.pad = pad;
     this.toolTipEnabled = true;
     this.toolTipFormat = "{0} {1} {2} - {3:F6}";
     this.chartFirstDate = new DateTime(Math.Min(line.X1.Ticks, line.X2.Ticks));
     this.chartLastDate = new DateTime(Math.Max(line.X1.Ticks, line.X2.Ticks));
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:9,代码来源:LineView.cs

示例6: TestFuncAssigning

  public void TestFuncAssigning() {
    Pad src = new Pad ("src", PadDirection.Src);
    src.GetCapsFunction = new PadGetCapsFunction (PadGetCapsStub);

    Caps caps = src.Caps;

    Assert.IsNotNull (caps, "Ooops, returned caps is null");
    Assert.IsFalse (caps.IsEmpty == true, "Ooops, returned caps are empty");
    Assert.AreEqual ("video/x-raw-yuv", caps.ToString ());
  }
开发者ID:jwzl,项目名称:ossbuild,代码行数:10,代码来源:PadTest.cs

示例7: GetRightStick

 //What is the value of the right analog stick
 public static Vector2 GetRightStick(Pad pad, int player)
 {
     switch(pad) {
         case Pad.XB:
             return new Vector2(Input.GetAxis(FormatAxis("XB","RS","X",player)), (Input.GetAxis(FormatAxis("XB","RS","Y",player)) * -1));
         case Pad.PS:
             return new Vector2(Input.GetAxis(FormatAxis("PS","RS","X",player)), (Input.GetAxis(FormatAxis("PS","RS","Y",player)) * -1));
     }
     return Vector2.zero;
 }
开发者ID:newgrounds,项目名称:PointCounterpoint,代码行数:11,代码来源:GamePad.cs

示例8: ReleaseButton

 //Return the input for the game's catch
 public static bool ReleaseButton(Pad pad, int player)
 {
     //Debug.Log("Catch Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKeyUp(FormatJoystick(player,17));//xbox B button
         case Pad.PS:
             return Input.GetKeyUp(FormatJoystick(player,8));//PS L2 button
     }
     return false;
 }
开发者ID:newgrounds,项目名称:PointCounterpoint,代码行数:12,代码来源:GamePad.cs

示例9: LeftButton

 //Return the input for left on the dpad
 public static bool LeftButton(Pad pad, int player)
 {
     //Debug.Log("Left Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKey(FormatJoystick(player,7));//xbox D AXIS
         case Pad.PS:
             return Input.GetKey(FormatJoystick(player,7));//PS left button
     }
     return false;
 }
开发者ID:newgrounds,项目名称:PointCounterpoint,代码行数:12,代码来源:GamePad.cs

示例10: JumpButton

 //Return the input for the game's jump button
 public static bool JumpButton(Pad pad, int player)
 {
     //Debug.Log("Jump Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKey(FormatJoystick(player,16));//xbox A button
         case Pad.PS:
             //Debug.Log("Get Button X is " + Input.GetButton("A_1"));
             return Input.GetKey(FormatJoystick(player,14));
     }
     return false;
 }
开发者ID:newgrounds,项目名称:PointCounterpoint,代码行数:13,代码来源:GamePad.cs

示例11: PadAddElement

    public PadAddElement () : base () {
      Pad pad = new Pad ("source", PadDirection.Src);
      CollectionAssert.IsEmpty (Pads);

      AddPad (pad);
      Assert.AreEqual (pad, GetStaticPad ("source"));
      CollectionAssert.Contains (Pads, pad);

      RemovePad (pad);
      Assert.IsNull (GetStaticPad ("source"));
      CollectionAssert.IsEmpty (Pads);
    }
开发者ID:jwzl,项目名称:ossbuild,代码行数:12,代码来源:ElementTest.cs

示例12: TestPlainCreation

  public void TestPlainCreation() {
    Pad src = new Pad ("src", PadDirection.Src);
    Pad sink = new Pad ("sink", PadDirection.Sink);

    Assert.IsNotNull (src);
    Assert.IsNotNull (sink);

    Assert.IsFalse (src.Handle == IntPtr.Zero, "Ooops, src pad has null handle");
    Assert.IsFalse (sink.Handle == IntPtr.Zero, "Ooops, sink pad has null handle");

    Assert.AreEqual (PadDirection.Src, src.Direction);
    Assert.AreEqual (PadDirection.Sink, sink.Direction);
  }
开发者ID:jwzl,项目名称:ossbuild,代码行数:13,代码来源:PadTest.cs

示例13: GetPadRangeY

 public override PadRange GetPadRangeY(object obj, Pad pad)
 {
     var ts = obj as TimeSeries;
     if (ts == null || ts.Count == 0)
         return null;
     var dt1 = new DateTime((long)pad.XMin);
     var dt2 = new DateTime((long)pad.XMax);
     var min = ts.GetMin(dt1, dt2);
     min = double.IsNaN(min) ? 0 : min;
     var max = ts.GetMax(dt1, dt2);
     max = double.IsNaN(max) ? 0 : min;
     return new PadRange(min, max);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:13,代码来源:TimeSeriesViewer.cs

示例14: TTitle

 public TTitle(Pad pad, string text = "")
 {
     this.pad = pad;
     Text = Text;
     Items = new ArrayList();
     ItemsEnabled = false;
     Font = new Font("Arial", 8f);
     Color = Color.Black;
     Position = ETitlePosition.Left;
     Strategy = ETitleStrategy.Smart;
     X = 0;
     Y = 0;
 }
开发者ID:28427328,项目名称:SQCharts,代码行数:13,代码来源:TTitle.cs

示例15: GetPadRangeY

 public override PadRange GetPadRangeY(object obj, Pad pad)
 {
     var ts = obj as TickSeries;
     if (ts == null || ts.Count == 0)
         return null;
     var dt1 = new DateTime((long) pad.XMin);
     var dt2 = new DateTime((long) pad.XMax);
     var min = ts.GetMin(dt1, dt2);
     var minPx = min?.Price ?? 0;
     var max = ts.GetMax(dt1, dt2);
     var maxPx = max?.Price ?? 0;
     return new PadRange(minPx, maxPx);
 }
开发者ID:fastquant,项目名称:fastquant.dll,代码行数:13,代码来源:TickSeriesViewer.cs


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