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


C# Point.set_X方法代码示例

本文整理汇总了C#中Point.set_X方法的典型用法代码示例。如果您正苦于以下问题:C# Point.set_X方法的具体用法?C# Point.set_X怎么用?C# Point.set_X使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Point的用法示例。


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

示例1: CalcNonStraightCenter

 public Point CalcNonStraightCenter(Point pTo)
 {
     Point point = new Point();
     point.set_X(base.PointCore.get_X() + (Math.Sign((double) (pTo.get_X() - base.PointCore.get_X())) * 6));
     point.set_Y(base.PointCore.get_Y() + (Math.Sign((double) (pTo.get_Y() - base.PointCore.get_Y())) * 6));
     return point;
 }
开发者ID:belsoft,项目名称:traingraph,代码行数:7,代码来源:PointSimple.cs

示例2: CalcCenter

 public Point CalcCenter(Point pTo)
 {
     Point point = new Point();
     point.set_X(this.PointCore.get_X() + (((int) (pTo.get_X() - this.PointCore.get_X())) >> 1));
     point.set_Y(this.PointCore.get_Y() + (((int) (pTo.get_Y() - this.PointCore.get_Y())) >> 1));
     return point;
 }
开发者ID:belsoft,项目名称:traingraph,代码行数:7,代码来源:PointSwitchBase.cs

示例3: OpenForecastFloatPopup


//.........这里部分代码省略.........
             if (!(zone == "城六区"))
             {
                 if (zone == "西北部")
                 {
                     if (this.LastSelectedFive != this.NorthWest)
                     {
                         if (this.LastSelectedFive != null)
                         {
                             this.LastSelectedFive.Fill = this.LastSelectedFiveBrush;
                         }
                         this.LastSelectedFive = this.NorthWest;
                         this.LastSelectedFiveBrush = this.brFive;
                     }
                     this.NorthWest.Fill = new SolidColorBrush(Colors.get_Red());
                     point = this.map.LocationToViewportPoint(this.NorthWestText.Location);
                 }
                 else if (zone == "东北部")
                 {
                     if (this.LastSelectedFive != this.NorthEast)
                     {
                         if (this.LastSelectedFive != null)
                         {
                             this.LastSelectedFive.Fill = this.LastSelectedFiveBrush;
                         }
                         this.LastSelectedFive = this.NorthEast;
                         this.LastSelectedFiveBrush = this.brFive;
                     }
                     this.NorthEast.Fill = new SolidColorBrush(Colors.get_Red());
                     point = this.map.LocationToViewportPoint(this.NorthEastText.Location);
                 }
                 else if (zone == "东南部")
                 {
                     if (this.LastSelectedFive != this.SouthEast)
                     {
                         if (this.LastSelectedFive != null)
                         {
                             this.LastSelectedFive.Fill = this.LastSelectedFiveBrush;
                         }
                         this.LastSelectedFive = this.SouthEast;
                         this.LastSelectedFiveBrush = this.brFive;
                     }
                     this.SouthEast.Fill = new SolidColorBrush(Colors.get_Red());
                     point = this.map.LocationToViewportPoint(this.SouthEastText.Location);
                 }
                 else if (zone == "西南部")
                 {
                     if (this.LastSelectedFive != this.SouthWest)
                     {
                         if (this.LastSelectedFive != null)
                         {
                             this.LastSelectedFive.Fill = this.LastSelectedFiveBrush;
                         }
                         this.LastSelectedFive = this.SouthWest;
                         this.LastSelectedFiveBrush = this.brFive;
                     }
                     this.SouthWest.Fill = new SolidColorBrush(Colors.get_Red());
                     point = this.map.LocationToViewportPoint(this.SouthWestText.Location);
                 }
             }
             else
             {
                 if (this.LastSelectedFive != this.CityCenter)
                 {
                     if (this.LastSelectedFive != null)
                     {
                         this.LastSelectedFive.Fill = this.LastSelectedFiveBrush;
                     }
                     this.LastSelectedFive = this.CityCenter;
                     this.LastSelectedFiveBrush = this.brFive;
                 }
                 this.CityCenter.Fill = new SolidColorBrush(Colors.get_Red());
                 point = this.map.LocationToViewportPoint(this.CityCenterText.Location);
             }
         }
     }
     this.ForecastBorder.set_DataContext(this.airDataContext.CurrentZoneForecast);
     double popupWidth = 315.0;
     double popupHeight = 254.0;
     string isNight = this.airDataContext.CurrentZoneForecast.IsNight;
     if (isNight != null)
     {
         if (!(isNight == "0"))
         {
             if (isNight == "1")
             {
                 popupHeight = 462.0;
             }
         }
         else
         {
             popupHeight = 254.0;
         }
     }
     this.FloatForecastPopup.set_Width(popupWidth);
     this.FloatForecastPopup.set_Height(popupHeight);
     point.set_X(point.get_X() * this.mapScale);
     point.set_Y(point.get_Y() * this.mapScale);
     this.SetPopupOffset(point, this.airDataContext.CurrentZoneForecast.Zone, popupWidth, popupHeight, ref this.FloatForecastPopup);
     this.FloatForecastPopup.Open(point, new Rect(10.0, 10.0, this.map.get_ActualWidth() - 10.0, this.map.get_ActualHeight() - 10.0));
 }
开发者ID:guazipi,项目名称:bjAirPollution,代码行数:101,代码来源:MainPage.cs

示例4: PointData2Point

 private Point PointData2Point(PointData pd1, Rectangle rc)
 {
     Point point = new Point();
     point.set_X(this.Position2PointX(pd1.Position, rc));
     point.set_Y(this.DateTime2PointY(pd1.DateTime, rc));
     return point;
 }
开发者ID:belsoft,项目名称:traingraph,代码行数:7,代码来源:TrainGraphControl.cs

示例5: DrawCurve

 private void DrawCurve(TrainCurveData c, Rectangle rc, List<Line> rectangles, int startIndex)
 {
     if ((c != null) && (c.Points != null))
     {
         PointData data;
         PointData data2;
         int num = 0;
         int num2 = -1;
         Line item = new Line();
         Color color = Colors.get_Black();
         double widthRequires = 0.0;
         if (c.Points.Count > 0)
         {
             widthRequires = this.DrawCurveTitle(rc, c.Points[0], c.Points[0], c.Caption, false);
         }
         for (int i = startIndex; i < (c.Points.Count - 1); i++)
         {
             data = c.Points[i];
             data2 = c.Points[i + 1];
             if (!c.Regular)
             {
                 TimeSpan span = (TimeSpan) (data.DateTime - data2.DateTime);
                 if (this.IsGap((double) (data.Position - data2.Position), span.TotalMinutes))
                 {
                     c.CaptionHasDrawn = false;
                     c.CaptionStartIndex = i + 1;
                     continue;
                 }
             }
             color = _SilverlightHelper.ConvertToColor(data2.Color);
             Line line2 = new Line();
             line2.set_X1(this.Position2PointX(data.Position, rc));
             line2.set_Y1(this.DateTime2PointY(data.DateTime, rc));
             line2.set_X2(this.Position2PointX(data2.Position, rc));
             line2.set_Y2(this.DateTime2PointY(data2.DateTime, rc));
             line2.set_Width(1251.0);
             line2.set_Height(this.CanvasRoot_ActualHeight);
             line2.set_StrokeThickness(2.0);
             line2.set_Stroke(new SolidColorBrush(color));
             this.CanvasRoot.get_Children().Add(line2);
             if (c.Regular && (c.Caption.Length > 0))
             {
                 if (!this.HasInsersection(rectangles, line2))
                 {
                     int num5 = data2.Position - data.Position;
                     if (num5 > num)
                     {
                         num = num5;
                         num2 = i;
                         item = this.LineClone(line2);
                     }
                 }
             }
             else if (!c.CaptionHasDrawn)
             {
                 int num6;
                 int num7;
                 int num8;
                 bool flag;
                 if (this.GetGoodPointsForTitle(c, c.CaptionStartIndex, rc, widthRequires, out num6, out num7, out num8, out flag))
                 {
                     c.CaptionHasDrawn = true;
                     this.DrawCurveTitle(rc, c.Points[num6], c.Points[num7], c.Caption, true);
                 }
                 else if (flag)
                 {
                     c.CaptionStartIndex = num8;
                 }
             }
         }
         if ((c.Regular && (c.Caption.Length > 0)) && (num2 != -1))
         {
             data = c.Points[num2];
             data2 = c.Points[num2 + 1];
             color = _SilverlightHelper.ConvertToColor(data2.Color);
             if (rectangles != null)
             {
                 rectangles.Add(item);
             }
             Point point = new Point();
             Point point2 = new Point();
             point.set_X(this.Position2PointX(data.Position, rc));
             point.set_Y(this.DateTime2PointY(data.DateTime, rc));
             point2.set_X(this.Position2PointX(data2.Position, rc));
             point2.set_Y(this.DateTime2PointY(data2.DateTime, rc));
             double rotationAngle = _SilverlightHelper.GetRotationAngle(point, point2);
             double num10 = point2.get_X() - point.get_X();
             TextBlock block = new TextBlock();
             block.SetValue(Canvas.TopProperty, point.get_Y() + 5.0);
             block.SetValue(Canvas.LeftProperty, point.get_X());
             block.SetValue(FrameworkElement.WidthProperty, num10);
             block.SetValue(FrameworkElement.HeightProperty, 50.0);
             block.set_Width(num10);
             block.set_Text(c.Caption);
             block.set_FontSize(17.0);
             block.set_FontFamily(new FontFamily("Arial"));
             block.set_Foreground(new SolidColorBrush(color));
             block.set_FontStyle(FontStyles.get_Normal());
             block.set_FontWeight(FontWeights.get_Bold());
             RotateTransform transform = new RotateTransform();
//.........这里部分代码省略.........
开发者ID:belsoft,项目名称:traingraph,代码行数:101,代码来源:TrainGraphControl.cs


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