Exemple #1
0
 public void Flip(OrientationType flip_type)
 {
     if (!gimp_image_flip(ID, flip_type))
     {
         throw new GimpSharpException();
     }
 }
Exemple #2
0
 internal Anchor2d(Vec2 position, Orientation2d orientation, OrientationType orientationType, Entity2d parent)
 {
     Position        = position;
     Orientation     = orientation;
     OrientationType = orientationType;
     Parent          = parent;
 }
            //----------------------------------------------------------------------/
            // Methods: Constructor
            //----------------------------------------------------------------------/
            public GUISplitter(EditorWindow window, OrientationType type)
            {
                this.Window      = window;
                this.Orientation = type;

                switch (this.Orientation)
                {
                case OrientationType.Horizontal:
                    BeginControlGroupFunction   = GUILayout.BeginHorizontal;
                    EndControlGroupFunction     = GUILayout.EndHorizontal;
                    DefaultScaleControlFunction = GUILayout.Width;
                    MinScaleControlFunction     = GUILayout.MinWidth;
                    MaxScaleControlFunction     = GUILayout.MaxWidth;
                    //ExpandControlFunction = GUILayout.ExpandHeight;
                    CursorType = MouseCursor.ResizeHorizontal;
                    break;

                case OrientationType.Vertical:
                    BeginControlGroupFunction   = GUILayout.BeginVertical;
                    EndControlGroupFunction     = GUILayout.EndVertical;
                    DefaultScaleControlFunction = GUILayout.Height;
                    MinScaleControlFunction     = GUILayout.MinHeight;
                    MaxScaleControlFunction     = GUILayout.MaxHeight;
                    //ExpandControlFunction = GUILayout.ExpandWidth;
                    CursorType = MouseCursor.ResizeVertical;
                    break;
                }
            }
Exemple #4
0
 public Orientation(double f0_, double f1_, double f2_, double f3_, double b0_, double b1_, double b2_, double b3_, double startAngleFactor_,OrientationType type_)
 {
     _matForward = new double[4] { f0_, f1_, f2_, f3_ };
     _matBackward = new double[4] { b0_, b1_, b2_, b3_ };
     _startAngleFactor = startAngleFactor_;
     _type = type_;
 }
        /// <summary> Adds points for a fillet.  The start and end point for the fillet are not added -
        /// the caller must Add them if required.
        ///
        /// </summary>
        /// <param name="direction">is -1 for a CW angle, 1 for a CCW angle
        /// </param>
        private void AddFillet(Coordinate p, double startAngle, double endAngle,
                               OrientationType direction, double distance)
        {
            int directionFactor = (direction ==
                                   OrientationType.Clockwise) ? -1 : 1;

            double totalAngle = Math.Abs(startAngle - endAngle);

            int nSegs = (int)(totalAngle / filletAngleQuantum + 0.5);

            if (nSegs < 1)
            {
                return;                 // no segments because angle is less than increment - nothing to do!
            }
            double initAngle, currAngleInc;

            // choose angle increment so that each segment has equal length
            initAngle    = 0.0;
            currAngleInc = totalAngle / nSegs;

            double     currAngle = initAngle;
            Coordinate pt        = new Coordinate();

            while (currAngle < totalAngle)
            {
                double angle = startAngle + directionFactor * currAngle;
                pt.X = p.X + distance * Math.Cos(angle);
                pt.Y = p.Y + distance * Math.Sin(angle);
                AddPoint(pt);
                currAngle += currAngleInc;
            }
        }
Exemple #6
0
        private GameField GetRandomFreePosition(ShipType shipType, OrientationType orientation)
        {
            int retriesCount = 0;
            var shipSize     = GetShipSize(shipType);

            var maxShipXPosition = orientation == OrientationType.Horizontal
                ? _gridSize - shipSize + 1 : _gridSize + 1;
            var maxShipYPosition = orientation == OrientationType.Vertical
               ? _gridSize - shipSize + 1 : _gridSize + 1;
            var gameField = new GameField(1, 1);

            do
            {
                if (retriesCount >= _maxRetriesCount)
                {
                    throw new ArgumentException($"Could not find free space for {shipType}");
                }

                gameField.X = _random.Next(1, maxShipXPosition);
                gameField.Y = _random.Next(1, maxShipYPosition);

                retriesCount++;
            }while (AreFieldsOccupied(gameField, shipSize, orientation));

            return(gameField);
        }
Exemple #7
0
        public int VerifySliderVertical(String windowName, String objName)
        {
            AutomationElement childHandle;

            try
            {
                childHandle = GetObjectHandle(windowName, objName);
                OrientationType orientationType = (OrientationType)
                                                  childHandle.GetCurrentPropertyValue(
                    AutomationElement.OrientationProperty);
                if (orientationType == OrientationType.Vertical)
                {
                    return(1);
                }
            }
            catch (Exception ex)
            {
                LogMessage(ex);
            }
            finally
            {
                childHandle = null;
            }
            return(0);
        }
        public static void SetOrientationForPdfCreator(OrientationType orientType)
        {
            string keyName  = "HKEY_CURRENT_USER\\Software\\pdfforge\\PDFCreator\\Settings\\ConversionProfiles\\0\\PdfSettings";
            string keyTitle = "PageOrientation";
            string text     = Enum.GetName(typeof(OrientationType), orientType);
            string check    = "";

            try
            {
                check = Microsoft.Win32.Registry.GetValue(keyName, keyTitle, "default") as string;
                if (check == null || check == "default" || string.IsNullOrEmpty(check))
                {
                    return;
                }
                else
                {
                    if (check != text)
                    {
                        Microsoft.Win32.Registry.SetValue(keyName, keyTitle, text);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                string msg = "Не удалось настроить PDFCreator! Если это первый запуск - попробуйте отправить на PDFCreator любой другой документ, например, из Word. После этого запустите печать еще раз.";
                msg += "Устанавливаемое значение ключа реестра: " + text + ", значение ключа реестра: " + check + ". ";
                msg  = msg + "Текст ошибки: " + ex.Message;
                MessageBox msgbox = new MessageBox(msg);
                msgbox.ShowDialog();
                throw new Exception(msg);
            }
        }
Exemple #9
0
 public void Flip(OrientationType flipType, double axis)
 {
     if (!gimp_vectors_stroke_flip(_vectorsID, _strokeID, flipType, axis))
     {
         throw new GimpSharpException();
     }
 }
        public static float calculateRotation(OrientationType orientation)
        {
            float rotation = 0;

            switch (orientation)
            {
            case OrientationType.right:
                rotation = (float)(Math.PI / 2);
                break;

            case OrientationType.left:
                rotation = (float)(Math.PI / -2);
                break;

            case OrientationType.down:
                rotation = (float)(Math.PI);
                break;

            case OrientationType.up:
                rotation = 0;
                break;
            }

            return(rotation);
        }
        public static Vector2 calculateLocation(OrientationType orientation)
        {
            Vector2 vector = new Vector2();

            switch (orientation)
            {
            case OrientationType.up:
                vector = new Vector2(0, -1);
                break;

            case OrientationType.down:
                vector = new Vector2(0, 1);
                break;

            case OrientationType.left:
                vector = new Vector2(-1, 0);
                break;

            case OrientationType.right:
                vector = new Vector2(1, 0);
                break;
            }

            return(vector);
        }
Exemple #12
0
        private void CreateSpriteStanding()
        {
            _orientationType = OrientationType.Standing;
            var spriteSheet = new SpriteSheet(ContentPaths.Entities.Furniture.interior_furniture, 32);

            List <Point> frames = new List <Point>
            {
                new Point(0, 1),
                new Point(2, 1),
                new Point(1, 1),
                new Point(2, 1)
            };

            var lampAnimation = Library.CreateAnimation(spriteSheet, frames, "LampAnimation");

            lampAnimation.Loops = true;

            var sprite = AddChild(new AnimatedSprite(Manager, "sprite", Matrix.Identity)
            {
                LightsWithVoxels = false,
                OrientationType  = AnimatedSprite.OrientMode.YAxis,
            }) as AnimatedSprite;

            sprite.AddAnimation(lampAnimation);
            sprite.AnimPlayer.Play(lampAnimation);
            sprite.SetFlag(Flag.ShouldSerialize, false);

            // This is a hack to make the animation update at least once even when the object is created inactive by the craftbuilder.
            sprite.AnimPlayer.Update(new DwarfTime(), false);
        }
Exemple #13
0
        public OrientationType GetOrientation()
        {
            if (_orientation != OrientationType.Undefined)
            {
                return(_orientation);
            }

            try
            {
                var ori = Run($"-g Exif.Image.Orientation -Pkv \"{_path}\"", "\\s");

                if (ori?.ContainsKey("Exif.Image.Orientation") == true)
                {
                    _orientation = (OrientationType)int.Parse(ori["Exif.Image.Orientation"]);
                }
                else
                {
                    _orientation = OrientationType.TopLeft;
                }
            }
            catch (Exception)
            {
                _orientation = OrientationType.TopLeft;
            }

            return(_orientation);
        }
Exemple #14
0
 public Orientation()
 {
     _matForward = new double[4];
     _matBackward = new double[4];
     _startAngleFactor = 0;
     _type = OrientationType.PointyTop;
 }
Exemple #15
0
        public void Should_BuildShip_WithGivenCriteria(ShipType shipType, OrientationType orientation, int x, int y)
        {
            // Arrange
            var expectedShipSize  = GetExpectedShipSize(shipType);
            var expectedLastField = GetExpectedLastField(orientation, x, y, expectedShipSize);

            // Act
            var ship = new ShipBuilder(shipType)
                       .OnPosition(x, y)
                       .WithOrientation(orientation)
                       .Build();

            // Assert
            ship.Should().NotBeNull();
            ship.Should().BeOfType(GetExpectedType(shipType));

            ship.ShipType.Should().Be(shipType);
            ship.Size.Should().Be(expectedShipSize);
            ship.StartField.X.Should().Be(x);
            ship.StartField.Y.Should().Be(y);

            ship.Orientation.Should().Be(orientation);
            ship.Fields.Should().HaveCount(expectedShipSize);
            ship.Fields.First().Should().Be(ship.StartField);
            ship.Fields.First().X.Should().Be(x);
            ship.Fields.First().Y.Should().Be(y);
            ship.Fields.Last().Should().Be(expectedLastField);
        }
Exemple #16
0
        //Returns an orientation facing the snake, giving the food a predatory movement
        private void attackOrientation(SnakeType snake, FoodType food)
        {
            switch (snake.Orientation)
            {
            case OrientationType.up:
            case OrientationType.down:
                if (snake.Vector.X < food.Vector.X)
                {
                    orientation = OrientationType.left;
                }
                else
                {
                    orientation = OrientationType.right;
                }
                break;

            case OrientationType.left:
            case OrientationType.right:
                if (snake.Vector.Y < food.Vector.Y)
                {
                    orientation = OrientationType.up;
                }
                else
                {
                    orientation = OrientationType.down;
                }
                break;
            }
        }
        /// <param name="p">base point of curve
        /// </param>
        /// <param name="p0">start point of fillet curve
        /// </param>
        /// <param name="p1">endpoint of fillet curve
        /// </param>
        private void AddFillet(Coordinate p, Coordinate p0, Coordinate p1,
                               OrientationType direction, double distance)
        {
            double dx0        = p0.X - p.X;
            double dy0        = p0.Y - p.Y;
            double startAngle = Math.Atan2(dy0, dx0);
            double dx1        = p1.X - p.X;
            double dy1        = p1.Y - p.Y;
            double endAngle   = Math.Atan2(dy1, dx1);

            if (direction == OrientationType.Clockwise)
            {
                if (startAngle <= endAngle)
                {
                    startAngle += 2.0 * Math.PI;
                }
            }
            else
            {
                // direction == COUNTERCLOCKWISE
                if (startAngle >= endAngle)
                {
                    startAngle -= 2.0 * Math.PI;
                }
            }

            AddPoint(p0);
            AddFillet(p, startAngle, endAngle, direction, distance);
            AddPoint(p1);
        }
Exemple #18
0
        private void ChangeWindowSize(OrientationType type, System.Windows.Window window)
        {
            if (type.Equals(OrientationType.Horizontal))
            {
                if (window != null && !this._Current.Equals(OrientationType.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._Current.Equals(OrientationType.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;
                }
            }
        }
Exemple #19
0
        //Returns an orientation to move the mouse away from a wall and into the center of the level
        private void directionalOrientation(FoodType food)
        {
            switch (orientation)
            {
            case OrientationType.up:
                if (food.Vector.Y < 4)
                {
                    orientation = OrientationType.down;
                }
                break;

            case OrientationType.down:
                if (food.Vector.Y > 28)
                {
                    orientation = OrientationType.up;
                }
                break;

            case OrientationType.left:
                if (food.Vector.X < 4)
                {
                    orientation = OrientationType.right;
                }
                break;

            case OrientationType.right:
                if (food.Vector.X > 20)
                {
                    orientation = OrientationType.left;
                }
                break;
            }
        }
        public void TestShouldThrowExceptionIfFallsOffPlateau(OrientationType orientationType)
        {
            Tractor tractor = new Tractor();
            Invoker invoker = new Invoker();

            invoker.SetCommand(new MoveTurnCommand(tractor));
            while (tractor.OrientationType != orientationType)
            {
                invoker.ExecuteCommand();
            }

            try
            {
                int moveCount = Consts.FieldHeight > Consts.FieldWidth ? Consts.FieldHeight : Consts.FieldWidth;
                moveCount++;

                invoker.SetCommand(new MoveForwardsCommand(tractor));

                for (int i = 0; i < moveCount; i++)
                {
                    invoker.ExecuteCommand();
                }
            }
            catch (UnitInDitchException exc)
            {
                return;
            }

            Assert.Fail("Tractor is expected to fall off the plateau");
        }
Exemple #21
0
        public void Should_GetProperFields_WhenExpanding(OrientationType orientation, int size)
        {
            // Arrange
            var startField        = new GameField(2, 3);
            var expectedLastField = new GameField(
                orientation == OrientationType.Horizontal ? startField.X + size - 1 : startField.X,
                orientation == OrientationType.Horizontal ? startField.Y : startField.Y + size - 1);

            // Act
            var result = startField.Expand(orientation, size);

            // Assert
            using var scope = new AssertionScope();
            result.Should().NotBeNull();
            result.Should().HaveCount(size);

            result.First().Should().Be(startField);
            result.Last().Should().Be(expectedLastField);

            if (orientation == OrientationType.Horizontal)
            {
                result.All(f => f.Y == startField.Y).Should().BeTrue();
            }

            if (orientation == OrientationType.Vertical)
            {
                result.All(f => f.X == startField.X).Should().BeTrue();
            }
        }
Exemple #22
0
 public ConnectionSettings(ConnectionType type, OrientationType orientation, GUIStyle style, Action <ConnectionPoint> onClick)
 {
     Type        = type;
     Orientation = orientation;
     Style       = style;
     OnClick     = onClick;
 }
        private void ConvertJpeg(string jpeg)
        {
            try
            {
                using (IMagickImage magickImage = new MagickImage(jpeg))
                {
                    OrientationType orientation = magickImage.Orientation;
                    MagickGeometry  geometry    = h1080;
                    geometry.IgnoreAspectRatio = false;
                    if (magickImage.Orientation == OrientationType.LeftBotom)
                    {
                        magickImage.Rotate(-90.0);
                    }
                    magickImage.Resize(geometry);
                    IMagickImage result = null;
                    result = FillImage(magickImage);

                    FileInfo original  = new FileInfo(jpeg);
                    string   filename  = String.Format("{0}_{1,2:00}.JPG", original.Name.Substring(0, (original.Name.LastIndexOf("."))), 0);
                    FileInfo converted = new FileInfo(pictDir.FullName + "\\" + filename);
                    result.Write(converted);
                    FadeImage(pictDir, result, original);
                    result.Dispose();

                    ToMpeg(converted);
                }
            }
            catch (ImageMagick.MagickCorruptImageErrorException imgErrorException)
            {
                Console.Error.WriteLineAsync(imgErrorException.Message);
            }
        }
Exemple #24
0
        public SplitContainer(IRawElementProviderSimple provider) : base(provider)
        {
            Role = Atk.Role.SplitPane;
            rangeValueProvider = (IRangeValueProvider)provider.GetPatternProvider(RangeValuePatternIdentifiers.Pattern.Id);
            object o = provider.GetPropertyValue(AutomationElementIdentifiers.OrientationProperty.Id);

            if (o is OrientationType)
            {
                orientation = (OrientationType)o;
            }
            else
            {
                IDockProvider dockProvider = (IDockProvider)provider.GetPatternProvider(DockPatternIdentifiers.Pattern.Id);
                if (dockProvider != null)
                {
                    orientation = (dockProvider.DockPosition == DockPosition.Top || dockProvider.DockPosition == DockPosition.Bottom)?
                                  OrientationType.Horizontal:
                                  OrientationType.Vertical;
                }
                else
                {
                    Log.Warn("SplitContainer: Couldn't get orientation for splitter.  Does not support DockProvider.");
                    orientation = OrientationType.Horizontal;
                }
            }
        }
Exemple #25
0
        //returns the vertices for a circle with a user-defined segment angle and orientation centred around the origin
        public static VertexPositionColor[] GetWireframeCircle(int segmentAngleInDegrees, out PrimitiveType primitiveType, out int primitiveCount,
                                                               OrientationType orientationType)
        {
            primitiveType  = PrimitiveType.LineStrip;
            primitiveCount = 360 / segmentAngleInDegrees;

            VertexPositionColor[] vertices = new VertexPositionColor[primitiveCount + 1];

            Vector3 position       = Vector3.Zero;
            float   angleInRadians = MathHelper.ToRadians(segmentAngleInDegrees);

            for (int i = 0; i <= primitiveCount; i++)
            {
                if (orientationType == OrientationType.XYAxis)
                {
                    position.X = (float)(Math.Cos(i * angleInRadians));
                    position.Y = (float)(Math.Sin(i * angleInRadians));
                }
                else if (orientationType == OrientationType.XZAxis)
                {
                    position.X = (float)(Math.Cos(i * angleInRadians));
                    position.Z = (float)(Math.Sin(i * angleInRadians));
                }
                else
                {
                    position.Y = (float)(Math.Cos(i * angleInRadians));
                    position.Z = (float)(Math.Sin(i * angleInRadians));
                }

                vertices[i] = new VertexPositionColor(position, Color.White);
            }
            return(vertices);
        }
        private void  FindRightmostEdgeAtVertex()
        {
            /// <summary> The rightmost point is an interior vertex, so it has a segment on either side of it.
            /// If these segments are both above or below the rightmost point, we need to
            /// determine their relative orientation to decide which is rightmost.
            /// </summary>
            ICoordinateList pts = minDe.Edge.Coordinates;

            Debug.Assert(minIndex > 0 && minIndex < pts.Count, "rightmost point expected to be interior vertex of edge");
            Coordinate      pPrev       = pts[minIndex - 1];
            Coordinate      pNext       = pts[minIndex + 1];
            OrientationType orientation = CGAlgorithms.ComputeOrientation(minCoord, pNext, pPrev);
            bool            usePrev     = false;

            // both segments are below min point
            if (pPrev.Y < minCoord.Y && pNext.Y < minCoord.Y &&
                orientation == OrientationType.CounterClockwise)
            {
                usePrev = true;
            }
            else if (pPrev.Y > minCoord.Y && pNext.Y > minCoord.Y &&
                     orientation == OrientationType.Clockwise)
            {
                usePrev = true;
            }
            // if both segments are on the same side, do nothing - either is safe
            // to select as a rightmost segment
            if (usePrev)
            {
                minIndex = minIndex - 1;
            }
        }
 public RegionContainer(int x, int y, int w, int h, OrientationType orientation)
 {
     X           = x;
     Y           = y;
     Width       = w;
     Height      = h;
     Orientation = orientation;
 }
                /** ctor */
                public DisplayModule(PortDefinition port, OrientationType orientation)
                {
                    if (CTRE.Util.Contains(port.types, kModulePortType))
                    {
                        status = StatusCodes.OK;
                        _port  = port;

                        Port8Definition portDef = (Port8Definition)port;

                        if (portDef.Pin3 != Cpu.Pin.GPIO_NONE)
                        {
                            _outReset = new OutputPort(portDef.Pin3, false);
                        }

                        if (portDef.Pin4 != Cpu.Pin.GPIO_NONE)
                        {
                            _outBackLght = new OutputPort(portDef.Pin4, true);
                        }

                        _outRs = new OutputPort(portDef.Pin5, false);

                        /* alloc the working arrays */
                        _cache_1B     = new byte[1];
                        _cache_2W     = new ushort[2];
                        _cache_manyBs = new byte[1024];
                        _cache_manyWs = new ushort[1024];

                        SPI.Configuration spiConfiguration = new SPI.Configuration(portDef.Pin6, false, 0, 0, false, true, 12000, SPI.SPI_module.SPI4);
                        _spi = new Microsoft.SPOT.Hardware.SPI(spiConfiguration);

                        /* reset pulse if pin is available */
                        if (_outReset != null)
                        {
                            _outReset.Write(false);
                            Thread.Sleep(150);
                            _outReset.Write(true);
                        }
                        /* setup registers */
                        ConfigureDisplay();

                        /* fixup orientation */
                        _orientation = orientation;
                        ApplytOrientation();

                        /* empty screen */
                        ClearScreen();

                        /* start rendering thread */
                        var th = new Thread(RenderThread);
                        th.Priority = ThreadPriority.Lowest;
                        th.Start();
                    }
                    else
                    {
                        status = StatusCodes.PORT_MODULE_TYPE_MISMATCH;
                        Reporting.SetError(status);
                    }
                }
Exemple #29
0
        public LinearContainerBlock(OrientationType orientation)
            : base()
        {
            InitControl(orientation);

            this.MyControl.Box.Borders.SetAll(0);

            Children.KeyDown += Children_KeyDown;
        }
 public PLPivotFieldType()
 {
     _pivotItem = new List<PivotItemType>();
     _subtotalFormat = new PLPivotFieldTypeSubtotalFormat();
     _detailFormat = new PLPivotFieldTypeDetailFormat();
     _dataType = DataTypeType.String;
     _orientation = OrientationType.Hidden;
     _currentPage = "All";
     _groupedWidth = 50;
 }
        public static IEnumerable <GameField> Expand(this GameField field, OrientationType orientation, int size)
        {
            var fields = Enumerable.Range(orientation == OrientationType.Horizontal ? field.X : field.Y, size)
                         .Select(point => new GameField(
                                     orientation == OrientationType.Horizontal ? point : field.X,
                                     orientation == OrientationType.Horizontal ? field.Y : point))
                         .ToList();

            return(fields);
        }
Exemple #32
0
 private void ChangeWindowSize(OrientationType type)
 {
     try
     {
         ChangeWindowSize(type, System.Windows.Application.Current.MainWindow);
     }
     catch
     {
     }
 }
 //*************************************************************************************************
 /// <summary>
 /// iPhoneX以降のセーフエリア シミュレーション
 /// </summary>
 //*************************************************************************************************
 public void SimulateAtEditor()
 {
     if (simulateType == SimulateType.None)
     {
         return;
     }
     orientationType = isPortrait ? OrientationType.Portrait : OrientationType.Landscape;
     safeArea        = getSimulationSafeArea(simulateType);
     screenSize      = getSimulationResolution(simulateType);
     Apply();
 }
Exemple #34
0
		public SplitContainer (IRawElementProviderSimple provider) : base (provider)
		{
			Role = Atk.Role.SplitPane;
			rangeValueProvider = (IRangeValueProvider)provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id);
			object o = provider.GetPropertyValue (AutomationElementIdentifiers.OrientationProperty.Id);
			if (o is OrientationType)
				orientation = (OrientationType)o;
			else {
				IDockProvider dockProvider = (IDockProvider)provider.GetPatternProvider (DockPatternIdentifiers.Pattern.Id);
				if (dockProvider != null) {
					orientation = (dockProvider.DockPosition == DockPosition.Top || dockProvider.DockPosition == DockPosition.Bottom)?
						OrientationType.Horizontal:
						OrientationType.Vertical;
				} else {
					Log.Warn ("SplitContainer: Couldn't get orientation for splitter.  Does not support DockProvider.");
					orientation = OrientationType.Horizontal;
				}
			}
		}
 //constructors
 public ElementPoint(float x, float y)
 {
     this.x = x;
     this.y = y;
     this.orientation = OrientationType.north;
 }
 private void ChangeWindowSize(OrientationType type)
 {
     try
     {
         ChangeWindowSize(type, System.Windows.Application.Current.MainWindow);
     }
     catch
     {
     }
 }
 public ElementPoint(float x, float y, OrientationType orientation)
 {
     this.x = x;
     this.y = y;
     this.orientation = orientation;
 }
        static extern bool gimp_image_flip(Int32 image_ID,
				       OrientationType flip_type);
 public CubeFieldType()
 {
     this.orientationField = OrientationType.Hidden;
 }
 public CubeFieldType()
 {
     _groupLevel = new List<CubeFieldTypeGroupLevel>();
     _memberProperty = new List<MemberPropertyType>();
     _orientation = OrientationType.Hidden;
 }
Exemple #41
0
 public LinearLayout(OrientationType orientation, AlignmentType alignment)
 {
     Orientation = orientation;
     Alignment = alignment;
 }
Exemple #42
0
 static extern Int32 gimp_drawable_transform_shear(Int32 drawable_ID,
     OrientationType shear_type,
     double magnitude,
     TransformDirection transform_direction,
     InterpolationType interpolation,
     bool supersample,
     int recursion_level,
     bool clip_result);
Exemple #43
0
 static extern Int32 gimp_drawable_transform_shear_default(Int32 drawable_ID,
     OrientationType shear_type,
     double magnitude,
     bool interpolate,
     TransformResize clip_result);
        static extern bool gimp_vectors_stroke_flip(Int32 vectors_ID,
						int stroke_id,
						OrientationType flip_type,
						double axis);
Exemple #45
0
 static extern Int32 gimp_drawable_transform_flip_simple(Int32 drawable_ID,
     OrientationType flip_type,
     bool auto_center,
     double axis,
     bool clip_result);
 public void Flip(OrientationType flipType, double axis)
 {
     if (!gimp_vectors_stroke_flip(_vectorsID, _strokeID, flipType, axis))
     {
       throw new GimpSharpException();
     }
 }
Exemple #47
0
 public ScrollPatternAxis(ScrollPattern scrollPattern, OrientationType orientation) {
     this.scrollPattern = scrollPattern;
     this.orientation = orientation;
 }
 public PTLineItemsType()
 {
     this.orientationField = OrientationType.Hidden;
 }
Exemple #49
0
        public ScrollAxis GetScrollAxis(OrientationType orientation) {
        	return (ScrollAxis)STAHelper.Invoke(
        		delegate() {
		            if(!scrollAxes.ContainsKey(orientation)) {
		                object pattern;
		                if(AutomationElement.TryGetCurrentPattern(ScrollPattern.Pattern, out pattern)) {
		                    scrollAxes[orientation] = new ScrollPatternAxis((ScrollPattern)pattern, orientation);
		                } else if(ControlType == ControlType.ScrollBar) {
		                	if(orientation == (OrientationType)this[AutomationElement.OrientationProperty])
		                        scrollAxes[orientation] = new ScrollBarAxis(AutomationElement);
		                    else
		                        throw new ArgumentException("Cannot get "+orientation+" scroll-axis for a scrollbar that is not "+orientation);
		                } else if (ControlType == ControlType.Pane && Class == "ScrollBar") {
		                    scrollAxes[orientation] = new PaneScrollAxis(AutomationElement);
		                } else {
		                    Condition scrollBarCondition = 
		                        new AndCondition(
		                            new PropertyCondition2(AutomationElement.OrientationProperty, orientation),
		                            new PropertyCondition2(AutomationElement.ControlTypeProperty, ControlType.ScrollBar)
		                        );
		                    Condition scrollPaneCondition =
		                        new AndCondition(
		                            new PropertyCondition2(AutomationElement.ControlTypeProperty, ControlType.Pane),
		                            new PropertyCondition2(AutomationElement.ClassNameProperty, "ScrollBar")
		                        );
		                    Condition scrollPatternCondition = new PropertyCondition2(AutomationElement.IsScrollPatternAvailableProperty, true);
		                    Condition condition = new OrCondition(scrollBarCondition, scrollPaneCondition, scrollPatternCondition);
		                    List<AutomationElement> matches = Twin.View.Search.FindAll(AutomationElement, TreeScope.Descendants, 1 ,condition, (int)AutomationElement.GetCurrentPropertyValue(AutomationElement.ProcessIdProperty));
		                    for(int i=0; i<matches.Count; i++) {
		                        if(matches[i].GetCurrentPropertyValue(AutomationElement.ControlTypeProperty) != ControlType.Pane)
		                            continue;
		                        if((bool)matches[i].GetCurrentPropertyValue(AutomationElement.IsScrollPatternAvailableProperty))
		                        	continue;
		                        Rect bounds = (Rect)matches[i].GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty);
		                        if(orientation == OrientationType.Horizontal && bounds.Height > bounds.Width)
		                            matches.RemoveAt(i--);
		                        if(orientation == OrientationType.Vertical && bounds.Width > bounds.Height)
		                            matches.RemoveAt(i--);
		                    }
		                    if (matches.Count == 0)
		                        return null;
		                    if (matches.Count > 1)
		                        throw new ArgumentException("Scrollable Axis for element ambiguous");
		                    return Element.Create(matches[0], processId).GetScrollAxis(orientation);
		                }
		            }
		            return scrollAxes[orientation];
        		}
        	);
        }
Exemple #50
0
 // gimpdrawabletransform
 public Drawable TransformFlipSimple(OrientationType flip_type,
     bool auto_center, double axis,
     bool clip_result)
 {
     return new Drawable(gimp_drawable_transform_flip_simple(ID, flip_type,
                           auto_center,
                           axis,
                           clip_result));
 }
Exemple #51
0
		public ScrollBar (IRawElementProviderSimple provider) : base (provider)
		{
			Role = Atk.Role.ScrollBar;
			rangeValueProvider = (IRangeValueProvider)provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id);
			orientation = (OrientationType)provider.GetPropertyValue (AutomationElementIdentifiers.OrientationProperty.Id);
		}
Exemple #52
0
 public Drawable TransformShear(OrientationType shear_type,
     double magnitude,
     TransformDirection transform_direction,
     InterpolationType interpolation,
     bool supersample,
     int recursion_level,
     bool clip_result)
 {
     return new Drawable(gimp_drawable_transform_shear
       (ID, shear_type, magnitude, transform_direction,
        interpolation, supersample, recursion_level,
        clip_result));
 }
Exemple #53
0
        public LinearLayout(
			OrientationType orientation,
			AlignmentType alignment,
			int xSpacing,
			int ySpacing)
        {
            XSpacing = xSpacing;
            YSpacing = ySpacing;
            Orientation = orientation;
            Alignment = alignment;
        }
Exemple #54
0
 public Drawable TransformShear(OrientationType shear_type,
     double magnitude,
     bool interpolate,
     TransformResize clip_result)
 {
     return new Drawable(gimp_drawable_transform_shear_default
       (ID, shear_type, magnitude, interpolate,
        clip_result));
 }
 public void Flip(OrientationType flip_type)
 {
     if (!gimp_image_flip(ID, flip_type))
     {
       throw new GimpSharpException();
     }
 }
 protected override void InitControl(OrientationType orientation)
 {
     MyRootControl = new TreeViewRootControl(this);
     MyRootControl.LinearLayoutStrategy.Orientation = orientation;
 }
Exemple #57
0
 public LinearLayout(OrientationType orientation)
 {
     Orientation = orientation;
 }
 public PTLineItemsType()
 {
     _pTLineItem = new List<PTLineItemType>();
     _orientation = OrientationType.Hidden;
 }
 public PLPivotFieldType()
 {
     this.dataTypeField = DataTypeType.String;
     this.orientationField = OrientationType.Hidden;
     this.currentPageField = "All";
     this.groupedWidthField = 50;
 }
        private void ChangeWindowSize(OrientationType type, System.Windows.Window window)
        {
            if (type.Equals(OrientationType.Horizontal))
            {
                if (window != null && !this._Current.Equals(OrientationType.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._Current.Equals(OrientationType.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;
                }
            }
        }