• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Orientation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DrawOrthogonal

 /// <summary>Draws a snapped orthogonal line.</summary>
 internal static void DrawOrthogonal(DrawingContext dc, Orientation orientation, Pen pen, double q, double p0, double p1) {
    if (orientation == Orientation.Horizontal) {
       DrawHorizontal(dc, pen, q, p0, p1);
    } else {
       DrawVertical(dc, pen, q, p0, p1);
    }
 }
开发者ID:borkaborka,项目名称:gmit,代码行数:8,代码来源:ChartUtil.cs


示例2: GradientStackPanel

 /// <summary>
 /// Creates new gradient stack panel
 /// </summary>
 /// <param name="orientation">Stack orientation</param>
 /// <param name="startColor">Gradient start color</param>
 /// <param name="endColor">Gradient stop color</param>
 public GradientStackPanel(Orientation orientation, Color startColor, Color endColor)
     : base(orientation)
 {
     this.startColor = startColor;
     this.endColor = endColor;
     this.solidBrush = new SolidColorBrush(ColorUtility.ColorFromRGB(164, 164, 164));
 }
开发者ID:PavelBansky,项目名称:microframework,代码行数:13,代码来源:GradientStackPanel.cs


示例3: LoopItemsPanel

        /// <summary>
        /// Ctor
        /// </summary>
        public LoopItemsPanel()
        {
            orientation = Orientation.Vertical;
            this.ManipulationMode = this.Orientation == Orientation.Vertical
                ? (ManipulationModes.TranslateY | ManipulationModes.TranslateInertia)
                : (ManipulationModes.TranslateX | ManipulationModes.TranslateInertia);
            this.IsHitTestVisible = true;
            this.ManipulationDelta += OnManipulationDelta;
            this.ManipulationCompleted += OnManipulationCompleted;
            this.Tapped += OnTapped;
            this.Loaded += OnLoaded;

            this.internalSlider = new Slider
            {
                SmallChange = 0.0000000001,
                Minimum = double.MinValue,
                Maximum = double.MaxValue,
                StepFrequency = 0.0000000001,
                Orientation = this.Orientation
            };
            internalSlider.ValueChanged += OnOffsetChanged;

            this.CreateStoryboard();
            this.LayoutUpdated += OnLayoutUpdated;
        }
开发者ID:artemvalieiev,项目名称:LoopPickerSelector,代码行数:28,代码来源:LoopItemsPanel.cs


示例4: Position

 public Position(int positionX, int positionY, Orientation orientation)
     : this()
 {
     PositionX = positionX;
     PositionY = positionY;
     Orientation = orientation;
 }
开发者ID:acazsouza,项目名称:marsrovers,代码行数:7,代码来源:Position.cs


示例5: GridLabel

 public GridLabel(string text, double location, Orientation orientation, Brush brush=null) {
   Text = text;
   Location = location;
   Orientation = orientation;
   Brush = brush ?? _defaultBrush;
   IsFloating = false;
 }
开发者ID:jrc60752,项目名称:iRacingAdminSync,代码行数:7,代码来源:GridLabel.cs


示例6: DrawAquaPill

        public static void DrawAquaPill(Graphics g, RectangleF drawRectF, Color drawColor, Orientation orientation)
        {
            var colorBlend = new ColorBlend();

            var color1 = OpacityMix(Color.White, SoftLightMix(drawColor, Color.Black, 100), 40);
            var color2 = OpacityMix(Color.White, SoftLightMix(drawColor, CreateColorFromRgb(64, 64, 64), 100), 20);
            var color3 = SoftLightMix(drawColor, CreateColorFromRgb(128, 128, 128), 100);
            var color4 = SoftLightMix(drawColor, CreateColorFromRgb(192, 192, 192), 100);
            var color5 = OverlayMix(SoftLightMix(drawColor, Color.White, 100), Color.White, 75);

            //
            colorBlend.Colors = new[] { color1, color2, color3, color4, color5 };
            colorBlend.Positions = new[] { 0, 0.25f, 0.5f, 0.75f, 1 };
            var gradientBrush = orientation == Orientation.Horizontal ? new LinearGradientBrush(new Point((int)drawRectF.Left, (int)drawRectF.Top - 1), new Point((int)drawRectF.Left, (int)drawRectF.Top + (int)drawRectF.Height + 1), color1, color5) :
                new LinearGradientBrush(new Point((int)drawRectF.Left - 1, (int)drawRectF.Top), new Point((int)drawRectF.Left + (int)drawRectF.Width + 1, (int)drawRectF.Top), color1, color5);
            gradientBrush.InterpolationColors = colorBlend;
            FillPill(gradientBrush, drawRectF, g);

            //
            color2 = Color.White;
            colorBlend.Colors = new[] { color2, color3, color4, color5 };
            colorBlend.Positions = new[] { 0, 0.5f, 0.75f, 1 };
            gradientBrush = orientation == Orientation.Horizontal ? new LinearGradientBrush(new Point((int)drawRectF.Left + 1, (int)drawRectF.Top), new Point((int)drawRectF.Left + 1, (int)drawRectF.Top + (int)drawRectF.Height - 1), color2, color5) :
                                                                    new LinearGradientBrush(new Point((int)drawRectF.Left, (int)drawRectF.Top + 1), new Point((int)drawRectF.Left + (int)drawRectF.Width - 1, (int)drawRectF.Top + 1), color2, color5);
            gradientBrush.InterpolationColors = colorBlend;
            FillPill(gradientBrush, RectangleF.Inflate(drawRectF, -3, -3), g);
        }
开发者ID:reward-hunters,项目名称:PrintAhead,代码行数:27,代码来源:TrackBarDrawingHelper.cs


示例7: GameBase

        public GameBase(Orientation orientation)
            : base()
        {
            _instance = this;

            GraphicsDeviceManager graphics = new GraphicsDeviceManager(this);

            if (orientation == Orientation.Portrait)
            {
                graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.PortraitDown;
            }
            else
            {
                graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
            }

            graphics.IsFullScreen = true;

            Content.RootDirectory = "Content";

            GlobalTimerController.ClearInstance();
            TouchProcessor.ClearInstance();

            _scenes = new Dictionary<Type, Scene>();
            _currentScene = null;
            _tombstoneFileName = DefaultTombstoneFileName;
            _sceneTransitionCrossFadeTextureName = "";

            PurchaseManager = new External_APIS.iOS.InAppPurchaseManager();
        }
开发者ID:Ben-P-Leda,项目名称:Bopscotch-IOS,代码行数:30,代码来源:GameBase.cs


示例8: Menu

        public Menu(Device device, Point location, Orientation orientation, params MenuItem[] items)
        {
            Log.Trace("Menu()");
            this.Device = device;
            Items = new List <MenuItem>(items);
            Location = location;
            Orientation = orientation;
            ForeColor = Color.White;
            SelectedForeColor = Color.Red;
            Font = new Font ("Arial", 12, FontStyle.Bold);
            ItemPadding = 15;

            DrawingFont = new SharpDX.Direct3D9.Font (device, Font);

            IncrementMenuKey = new Key (Keys.OemCloseBrackets);
            DecrementMenuKey = new Key (Keys.OemOpenBrackets);
            IncrementValueKey = new Key (Keys.PageUp);
            DecrementValueKey = new Key (Keys.PageDown);
            ResetToZeroKey = new Key (Keys.End);

            IncrementMenuKey.OnJustPressed += (sender, args) => { SelectedIndex = (SelectedIndex + 1).Clamp(SelectedIndex, Items.Count - 1); };
            DecrementMenuKey.OnJustPressed += (sender, args) => { SelectedIndex = (SelectedIndex - 1).Clamp(0, SelectedIndex); };
            IncrementValueKey.OnHold += (sender, args) => Items[SelectedIndex].IncrementValue(2);
            DecrementValueKey.OnHold += (sender, args) => Items[SelectedIndex].DecrementValue(2);
            ResetToZeroKey.OnJustPressed += (sender, args) => { Items[SelectedIndex].Value = 0; };
        }
开发者ID:jasonpang,项目名称:Starcraft2Hook,代码行数:26,代码来源:Menu.cs


示例9: NavigatorOutlook

        /// <summary>
        /// Initialize a new instance of the NavigatorOutlook class.
        /// </summary>
        /// <param name="navigator">Reference to owning navigator instance.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public NavigatorOutlook(KryptonNavigator navigator,
                                NeedPaintHandler needPaint)
        {
            Debug.Assert(navigator != null);

            // Remember back reference
            _navigator = navigator;

            // Store the provided paint notification delegate
            NeedPaint = needPaint;

            // Create compound objects
            _full = new NavigatorOutlookFull(navigator, needPaint);
            _mini = new NavigatorOutlookMini(navigator, needPaint);

            // Default values
            _checkButtonStyle = ButtonStyle.NavigatorStack;
            _overflowButtonStyle = ButtonStyle.NavigatorOverflow;
            _borderEdgeStyle = PaletteBorderStyle.ControlClient;
            _orientation = Orientation.Vertical;
            _itemOrientation = ButtonOrientation.Auto;
            _headerSecondaryVisible = InheritBool.False;
            _textMoreButtons = _defaultMoreButtons;
            _textFewerButtons = _defaultFewerButtons;
            _textAddRemoveButtons = _defaultAddRemoveButtons;
            _showDropDownButton = true;
        }
开发者ID:ComponentFactory,项目名称:Krypton,代码行数:32,代码来源:NavigatorOutlook.cs


示例10: Start

    // Use this for initialization
    protected virtual void Start()
    {
        if (transform.rotation.Equals(Quaternion.identity))
        {
            orientation = Orientation.Vertical;
            transform.position = new Vector3(
                ((int)Mathf.Round(transform.position.x / Values.blockSize)) * Values.blockSize,
                ((int)Mathf.Round((transform.position.y - Values.halfBlock) / Values.blockSize)) * Values.blockSize + Values.halfBlock,
                transform.position.z);

            if ((int)transform.rotation.eulerAngles.z % 180 != 0)
                transform.eulerAngles = new Vector3(0, 0, 0);
        }
        else
        {
            orientation = Orientation.Horizontal;
            transform.position = new Vector3(
                ((int)Mathf.Round((transform.position.x - Values.halfBlock) / Values.blockSize)) * Values.blockSize + Values.halfBlock,
                ((int)Mathf.Round(transform.position.y / Values.blockSize)) * Values.blockSize,
                transform.position.z);

            if ((int)(transform.rotation.eulerAngles.z + 90) % 180 != 0)
                transform.eulerAngles = new Vector3(0, 0, 90);
        }
    }
开发者ID:GameMakersUnion,项目名称:CubeRollersDeluxe,代码行数:26,代码来源:Wall.cs


示例11: CalculateNewEmptyArea

        private static CustomBoxView CalculateNewEmptyArea(CustomBoxView currentEmptyArea, Orientation orientation, double rowToAllRatio)
        {
            CustomBoxView newEmptyArea = new CustomBoxView();

            if (orientation == Orientation.Horizontal)
            {
                double size = Math.Round(currentEmptyArea.HeightRequest * rowToAllRatio);
                if (currentEmptyArea.HeightRequest > size)
                {
                    newEmptyArea.MyX = currentEmptyArea.MyX;
                    newEmptyArea.MyY = currentEmptyArea.MyY + size;

                    newEmptyArea.WidthRequest = currentEmptyArea.WidthRequest;
                    newEmptyArea.HeightRequest = currentEmptyArea.HeightRequest - size;
                }
            }
            else
            {
                double size = Math.Round(currentEmptyArea.WidthRequest * rowToAllRatio);
                if (currentEmptyArea.WidthRequest > size)
                {
                    newEmptyArea.MyX = currentEmptyArea.MyX + size;
                    newEmptyArea.MyY = currentEmptyArea.MyY;

                    newEmptyArea.WidthRequest = currentEmptyArea.WidthRequest - size;
                    newEmptyArea.HeightRequest = currentEmptyArea.HeightRequest;
                }
            }

            return newEmptyArea;
        }
开发者ID:LordOfSmiles,项目名称:MatrixBuilderTest,代码行数:31,代码来源:TelerikAlgorithm.cs


示例12: ProgressBar

 public ProgressBar(Orientation orientation)
 {
     Orientation = orientation;
     Background = new SolidColorBrush(Colors.DarkGray);
     Foreground = new SolidColorBrush(Colors.White);
     Value = 0;
 }
开发者ID:KonstantinKolesnik,项目名称:MFE,代码行数:7,代码来源:ProgressBar.cs


示例13: DrawAquaPillSingleLayer

		/// <summary>
		/// 
		/// </summary>
		/// <param name="g"></param>
		/// <param name="drawRectF"></param>
		/// <param name="drawColor"></param>
		/// <param name="orientation"></param>
		public static void DrawAquaPillSingleLayer(Graphics g, RectangleF drawRectF, Color drawColor, Orientation orientation, BrushStyle brushStyle)
		{
		    if (brushStyle == BrushStyle.LinearGradient)
		    {
		        var colorBlend = new ColorBlend();
		        var color1 = drawColor;
                var color2 = ControlPaint.Light(color1);
                var color3 = ControlPaint.Light(color2);
                var color4 = ControlPaint.Light(color3);

		        colorBlend.Colors = new[] {color1, color2, color3, color4};
		        colorBlend.Positions = new[] {0, 0.25f, 0.65f, 1};

		        var gradientBrush = orientation == Orientation.Horizontal
		                                                ? new LinearGradientBrush(
		                                                      new Point((int) drawRectF.Left, (int) drawRectF.Top),
		                                                      new Point((int) drawRectF.Left,
		                                                                (int) drawRectF.Top + (int) drawRectF.Height), color1,
		                                                      color4)
		                                                : new LinearGradientBrush(
		                                                      new Point((int) drawRectF.Left, (int) drawRectF.Top),
		                                                      new Point((int) drawRectF.Left + (int) drawRectF.Width,
		                                                                (int) drawRectF.Top), color1, color4);
		        gradientBrush.InterpolationColors = colorBlend;

		        FillPill(gradientBrush, drawRectF, g);
		    }
		    else
		    {
                FillPill(new SolidBrush(drawColor), drawRectF, g);
		    }
		}
开发者ID:paolosalvatori,项目名称:servicefabriceventhubdemo,代码行数:39,代码来源:CustomStyleHelper.cs


示例14: getEntrance

 private Vector3 getEntrance(Orientation orientation, int y, Vector3 towerLocation)
 {
     if(orientation == Orientation.East)       { return towerLocation + new Vector3(xMax - 1, y, zMax / 2); }
     else if(orientation == Orientation.North) { return towerLocation + new Vector3(xMax / 2, y, zMax - 1); }
     else if(orientation == Orientation.South) { return towerLocation + new Vector3(xMax / 2, y, 0);        }
     else                                      { return towerLocation + new Vector3(0, y, zMax / 2);        }
 }
开发者ID:RenaudWasTaken,项目名称:SkyLands,代码行数:7,代码来源:MediumTower.cs


示例15: DrawAquaPill

        /// <summary>
        /// 
        /// </summary>
        /// <param name="g"></param>
        /// <param name="drawRectF"></param>
        /// <param name="drawColor"></param>
        /// <param name="orientation"></param>
        public static void DrawAquaPill(Graphics g, RectangleF drawRectF, Color drawColor, Orientation orientation)
        {
            System.Drawing.Drawing2D.LinearGradientBrush gradientBrush;
            System.Drawing.Drawing2D.ColorBlend colorBlend = new System.Drawing.Drawing2D.ColorBlend();

            var color1 = ColorHelper.OpacityMix(Color.White, ColorHelper.SoftLightMix(drawColor, Color.Black, 100), 40);
            var color2 = ColorHelper.OpacityMix(Color.White, ColorHelper.SoftLightMix(drawColor, ColorHelper.CreateColorFromRGB(64, 64, 64), 100), 20);
            var color3 = ColorHelper.SoftLightMix(drawColor, ColorHelper.CreateColorFromRGB(128, 128, 128), 100);
            var color4 = ColorHelper.SoftLightMix(drawColor, ColorHelper.CreateColorFromRGB(192, 192, 192), 100);
            var color5 = ColorHelper.OverlayMix(ColorHelper.SoftLightMix(drawColor, Color.White, 100), Color.White, 75);

            //
            colorBlend.Colors = new Color[] { color1, color2, color3, color4, color5 };
            colorBlend.Positions = new float[] { 0, 0.25f, 0.5f, 0.75f, 1 };
            if (orientation == Orientation.Horizontal)
                gradientBrush = new System.Drawing.Drawing2D.LinearGradientBrush(new Point((int)drawRectF.Left, (int)drawRectF.Top - 1), new Point((int)drawRectF.Left, (int)drawRectF.Top + (int)drawRectF.Height + 1), color1, color5);
            else
                gradientBrush = new System.Drawing.Drawing2D.LinearGradientBrush(new Point((int)drawRectF.Left - 1, (int)drawRectF.Top), new Point((int)drawRectF.Left + (int)drawRectF.Width + 1, (int)drawRectF.Top), color1, color5);
            gradientBrush.InterpolationColors = colorBlend;
            FillPill(gradientBrush, drawRectF, g);

            //
            color2 = Color.White;
            colorBlend.Colors = new Color[] { color2, color3, color4, color5 };
            colorBlend.Positions = new float[] { 0, 0.5f, 0.75f, 1 };
            if (orientation == Orientation.Horizontal)
                gradientBrush = new System.Drawing.Drawing2D.LinearGradientBrush(new Point((int)drawRectF.Left + 1, (int)drawRectF.Top), new Point((int)drawRectF.Left + 1, (int)drawRectF.Top + (int)drawRectF.Height - 1), color2, color5);
            else
                gradientBrush = new System.Drawing.Drawing2D.LinearGradientBrush(new Point((int)drawRectF.Left, (int)drawRectF.Top + 1), new Point((int)drawRectF.Left + (int)drawRectF.Width - 1, (int)drawRectF.Top + 1), color2, color5);
            gradientBrush.InterpolationColors = colorBlend;
            FillPill(gradientBrush, RectangleF.Inflate(drawRectF, -3, -3), g);
        }
开发者ID:jn84,项目名称:FOS-SaveEditor,代码行数:39,代码来源:DrawMACStyleHelper.cs


示例16: DrawSeparator

        /// <summary>
        /// Perform drawing of a separator glyph.
        /// </summary>
        /// <param name="context">Render context.</param>
        /// <param name="displayRect">Display area available for drawing.</param>
        /// <param name="paletteBack">Background palette details.</param>
        /// <param name="paletteBorder">Border palette details.</param>
        /// <param name="orientation">Visual orientation of the content.</param>
        /// <param name="state">State associated with rendering.</param>
        /// <param name="canMove">Can the separator be moved.</param>
        public override void DrawSeparator(RenderContext context,
                                           Rectangle displayRect,
                                           IPaletteBack paletteBack,
                                           IPaletteBorder paletteBorder,
                                           Orientation orientation,
                                           PaletteState state,
                                           bool canMove)
        {
            // Let base class perform standard processing
            base.DrawSeparator(context,
                               displayRect,
                               paletteBack,
                               paletteBorder,
                               orientation,
                               state,
                               canMove);

            // If we are drawing the background then draw grab handles on top
            if (paletteBack.GetBackDraw(state) == InheritBool.True)
            {
                // Only draw grab handle if the user can move the separator
                if (canMove)
                    DrawGrabHandleGlyph(context, displayRect, orientation, state);
            }
        }
开发者ID:Cocotteseb,项目名称:Krypton,代码行数:35,代码来源:RenderProfessional.cs


示例17: ChangeWindowSize

		private void ChangeWindowSize(Orientation type, System.Windows.Window window)
		{
			if (type == Orientation.Horizontal)
			{
				if (window != null && this.Mode != Orientation.Horizontal)
				{
					if (window.WindowState == System.Windows.WindowState.Normal)
					{
						Settings.Current.VerticalSize = new System.Windows.Point(window.Width, window.Height);
					}

					window.Height = Settings.Current.HorizontalSize.Y;
					window.Width = Settings.Current.HorizontalSize.X;
				}
			}
			else
			{
				if (window != null && this.Mode != Orientation.Vertical)
				{
					if (window.WindowState == System.Windows.WindowState.Normal)
					{
						Settings.Current.HorizontalSize = new System.Windows.Point(window.Width, window.Height);
					}

					window.Height = Settings.Current.VerticalSize.Y;
					window.Width = Settings.Current.VerticalSize.X;
				}
			}
		}
开发者ID:22v2,项目名称:KanColleViewer,代码行数:29,代码来源:WindowOrientaionMode.cs


示例18: Rover

 public Rover(int xCoordinate, int yCoordinate, Orientation orientation, Plateau plateau)
 {
     XCoordinate = xCoordinate;
     YCoordinate = yCoordinate;
     Orientation = orientation;
     Plateau = plateau;
 }
开发者ID:RogerioCoimbra,项目名称:RogerioCoimbra.MarsRovers,代码行数:7,代码来源:Rover.cs


示例19: FlipTest

        public static void FlipTest(TexImage image, ITexLibrary library, Orientation orientation)
        {
            library.Execute(image, new FlippingRequest(orientation));

            Assert.IsTrue(TestTools.ComputeSHA1(image.Data, image.DataSize).Equals(TestTools.GetInstance().Checksum["FlipTest_" + orientation + "_" + image.Name]));
            //Console.WriteLine("FlipTest_" + orientation + "_" + image.Name + "." + TestTools.ComputeSHA1(image.Data, image.DataSize));
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:7,代码来源:TexLibraryTest.cs


示例20: Separator

 public Separator()
 {
     SetStyle(ControlStyles.ResizeRedraw, true);
     m_orientation = Orientation.Horizontal;
     m_alignment = ContentAlignment.MiddleCenter;
     OnResize(EventArgs.Empty);
 }
开发者ID:bobsummerwill,项目名称:ZXMAK2,代码行数:7,代码来源:Separator.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# OrientationChangedEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# Organization_mst类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap