예제 #1
0
        public override string ToString()
        {
            var horizontalPositionName = HorizontalPosition.ToString().Replace("P_", "");
            var verticalPositionName   = VerticalPosition.ToString().Replace("P_", "");

            return($"{horizontalPositionName}{verticalPositionName}");
        }
예제 #2
0
        public void AddItem(ILayoutable item, HorizontalPosition horizontalPosition, VerticalPosition verticalPosition, LayoutOrigin layoutFrom = LayoutOrigin.Center)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            var position = new OverallPosition
            {
                HorizontalPosition = horizontalPosition,
                VerticalPosition   = verticalPosition,
                LayoutOrigin       = layoutFrom
            };

            _items.Add(item, position);
            item.Alpha = _alpha;
            item.AttachTo(_backgroundSprite, true);
            item.RelativeZ    = 0.1f;
            item.ParentLayout = this;

            if (item.OnAddedToLayout != null)
            {
                item.OnAddedToLayout(this);
            }

            PositionItem(item, horizontalPosition, verticalPosition, layoutFrom);

            // When the size changes, make sure to reposition the item so it's still in the same spot
            item.OnSizeChangeHandler = new LayoutableEvent(delegate(ILayoutable sender) { PositionItem(item, horizontalPosition, verticalPosition, layoutFrom); });
        }
예제 #3
0
        /// <summary>
        /// Add a new custom watermark.
        /// </summary>
        /// <param name="identifier">The identifier you want to give the custom watermark. It is important that this identifier is unique.</param>
        /// <param name="path">The absolute path of the watermark on your server. For instance C:/watermark/1.png</param>
        /// <param name="xpos">The horizontal position you want the screenshot to appear at</param>
        /// <param name="ypos">The vertical position you want the screenshot to appear at</param>
        /// <returns>Returns true if the watermark was successfully set.</returns>
        public bool AddWaterMark(string identifier, string path, HorizontalPosition xpos, VerticalPosition ypos)
        {
            if (!File.Exists(path))
            {
                throw new GrabzItException("File: " + path + " does not exist", ErrorCode.FileNonExistantPath);
            }

            string sig = Encrypt(string.Format("{0}|{1}|{2}|{3}", ApplicationSecret, identifier, (int)xpos, (int)ypos));

            string url = "http://grabz.it/services/addwatermark.ashx";

            NameValueCollection nvc = new NameValueCollection();

            nvc.Add("key", ApplicationKey);
            nvc.Add("identifier", identifier);
            nvc.Add("xpos", ((int)xpos).ToString());
            nvc.Add("ypos", ((int)ypos).ToString());
            nvc.Add("sig", sig);

            string result = HttpUploadFile(url, path, "watermark", "image/jpeg", nvc);

            GenericResult webResult = DeserializeResult <GenericResult>(result);

            CheckForException(webResult);

            return(Convert.ToBoolean(webResult.Result));
        }
예제 #4
0
 public TargetCubeData(TargetCubeData t)
 {
     this.Id = t.Id;
     this.horizontalPosition = t.horizontalPosition;
     this.vecticalPosition   = t.vecticalPosition;
     this.orientation        = t.orientation;
     this.cubeColor          = t.cubeColor;
 }
예제 #5
0
        private static void VerifyRelativeContentPosition(HorizontalPosition horizontalPosition, VerticalPosition verticalPosition, FrameworkElement content, double minimumTargetOffset, FrameworkElement target)
        {
            var contentScreenBounds = content.GetOnScreenBounds();
            var contentCenter       = contentScreenBounds.GetCenter();
            var targetScreenBounds  = target.GetOnScreenBounds();
            var targetCenter        = targetScreenBounds.GetCenter();

            Assert.IsTrue(targetCenter.X > minimumTargetOffset);
            Assert.IsTrue(targetCenter.Y > minimumTargetOffset);
            switch (horizontalPosition)
            {
            case HorizontalPosition.BeyondLeft:
                NumberAssert.LessOrEqual(contentScreenBounds.Right, targetScreenBounds.Left);
                break;

            case HorizontalPosition.LeftFlush:
                Assert.AreEqual(targetScreenBounds.Left, contentScreenBounds.Left, delta: 2);
                break;

            case HorizontalPosition.Center:
                Assert.AreEqual(targetCenter.X, contentCenter.X, delta: 2);
                break;

            case HorizontalPosition.RightFlush:
                Assert.AreEqual(targetScreenBounds.Right, contentScreenBounds.Right, delta: 2);
                break;

            case HorizontalPosition.BeyondRight:
                NumberAssert.GreaterOrEqual(contentScreenBounds.Left, targetScreenBounds.Right);
                break;
            }

            switch (verticalPosition)
            {
            case VerticalPosition.BeyondTop:
                NumberAssert.LessOrEqual(contentScreenBounds.Bottom, targetScreenBounds.Top);
                break;

            case VerticalPosition.TopFlush:
                Assert.AreEqual(targetScreenBounds.Top, contentScreenBounds.Top, delta: 2);
                break;

            case VerticalPosition.Center:
                Assert.AreEqual(targetCenter.Y, contentCenter.Y, delta: 2);
                break;

            case VerticalPosition.BottomFlush:
                Assert.AreEqual(targetScreenBounds.Bottom, contentScreenBounds.Bottom, delta: 2);
                break;

            case VerticalPosition.BeyondBottom:
                NumberAssert.GreaterOrEqual(contentScreenBounds.Top, targetScreenBounds.Bottom);
                break;
            }
        }
예제 #6
0
        /// <summary>
        /// This sample shows how to work with shape groups.
        /// </summary>
        /// <remarks>
        /// Details: https://sautinsoft.com/products/document/help/net/developer-guide/shape-groups.php
        /// </remarks>
        public static void ShapeGroups()
        {
            string pictPath     = @"..\..\image1.jpg";
            string documentPath = @"ShapeGroups.docx";

            // Let's create a document.
            DocumentCore dc = new DocumentCore();

            // Create floating layout.
            HorizontalPosition hp = new HorizontalPosition(HorizontalPositionType.Center, HorizontalPositionAnchor.Page);
            VerticalPosition   vp = new VerticalPosition(5f, LengthUnit.Centimeter, VerticalPositionAnchor.TopMargin);
            FloatingLayout     fl = new FloatingLayout(hp, vp, new Size(300, 300));

            // Create group.
            ShapeGroup group = new ShapeGroup(dc, fl);

            // Specify the size dimensions of the child extents rectangle.
            group.ChildSize = new Size(100, 100);

            // Create a child shape#1 (inside group) with preset geometry.
            // Specify shape's size and offset relative to group's ChildSize (100x100).
            Shape shape1 = new Shape(dc, new GroupLayout(new Point(0, 0), new Size(50, 50)));

            // Specify outline and fill.
            shape1.Outline.Fill.SetSolid(new Color("#358CCB"));
            shape1.Outline.Width = 2;
            shape1.Fill.SetSolid(Color.Orange);

            // Shape will be rectangle.
            shape1.Geometry.SetPreset(Figure.Rectangle);

            // Create picture and add it into the group.
            Picture picture = new Picture(dc, Layout.Group(new Point(50, 50), new Size(50, 50)), pictPath);

            // Specify picture fill mode.
            picture.ImageData.FillMode = PictureFillMode.Stretch;

            // Add shape and picture into our group.
            group.ChildShapes.Add(shape1);
            group.ChildShapes.Add(picture);

            // Add our group into the document.
            dc.Content.End.Insert(group.Content);

            // Save our document into DOCX format.
            dc.Save(documentPath);

            // Open the result for demonstration purposes.
            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(documentPath)
            {
                UseShellExecute = true
            });
        }
 public static IEnumerable <Note> DownUp(
     float time,
     Hand hand,
     HorizontalPosition horizontalPosition,
     VerticalPosition verticalPosition)
 {
     return(new []
     {
         new Note(time, hand, CutDirection.Down, horizontalPosition, verticalPosition),
         new Note(time + 0.5f, hand, CutDirection.Up, horizontalPosition, verticalPosition)
     });
 }
 public NotePosition ToPositionEnum(HorizontalPosition horizontalPosition, VerticalPosition verticalPosition)
 {
     if (horizontalPosition == HorizontalPosition.CenterLeft && verticalPosition == VerticalPosition.Bottom)
     {
         return(NotePosition.BottomCenterLeft);
     }
     if (horizontalPosition == HorizontalPosition.CenterLeft && verticalPosition == VerticalPosition.Middle)
     {
         return(NotePosition.MiddleCenterLeft);
     }
     if (horizontalPosition == HorizontalPosition.CenterLeft && verticalPosition == VerticalPosition.Top)
     {
         return(NotePosition.TopCenterLeft);
     }
     if (horizontalPosition == HorizontalPosition.CenterRight && verticalPosition == VerticalPosition.Bottom)
     {
         return(NotePosition.BottomCenterRight);
     }
     if (horizontalPosition == HorizontalPosition.CenterRight && verticalPosition == VerticalPosition.Middle)
     {
         return(NotePosition.BottomCenterRight);
     }
     if (horizontalPosition == HorizontalPosition.CenterRight && verticalPosition == VerticalPosition.Top)
     {
         return(NotePosition.BottomCenterRight);
     }
     if (horizontalPosition == HorizontalPosition.Left && verticalPosition == VerticalPosition.Bottom)
     {
         return(NotePosition.BottomLeft);
     }
     if (horizontalPosition == HorizontalPosition.Left && verticalPosition == VerticalPosition.Middle)
     {
         return(NotePosition.MiddleLeft);
     }
     if (horizontalPosition == HorizontalPosition.Left && verticalPosition == VerticalPosition.Top)
     {
         return(NotePosition.TopLeft);
     }
     if (horizontalPosition == HorizontalPosition.Right && verticalPosition == VerticalPosition.Bottom)
     {
         return(NotePosition.BottomRight);
     }
     if (horizontalPosition == HorizontalPosition.Right && verticalPosition == VerticalPosition.Middle)
     {
         return(NotePosition.MiddleRight);
     }
     if (horizontalPosition == HorizontalPosition.Right && verticalPosition == VerticalPosition.Top)
     {
         return(NotePosition.TopRight);
     }
     throw new ArgumentOutOfRangeException();
 }
예제 #9
0
파일: Note.cs 프로젝트: FrogTravel/bsmap
 public Note(
     float time,
     Hand hand,
     CutDirection cutDirection,
     HorizontalPosition horizontalPosition,
     VerticalPosition verticalPosition)
 {
     Time               = time;
     Hand               = hand;
     CutDirection       = cutDirection;
     HorizontalPosition = horizontalPosition;
     VerticalPosition   = verticalPosition;
 }
 public static IEnumerable <Note> DoubleDownUp(
     float time,
     HorizontalPosition leftHorizontalPosition,
     VerticalPosition verticalPosition)
 {
     if (leftHorizontalPosition == HorizontalPosition.Right)
     {
         throw new ArgumentOutOfRangeException(nameof(leftHorizontalPosition));
     }
     return(DownUp(time, Hand.Left, leftHorizontalPosition, verticalPosition)
            .Concat(DownUp(time, Hand.Right, leftHorizontalPosition + 1, verticalPosition))
            .OrderBy(x => x.Time));
 }
 public static IEnumerable <Note> LeftRight(
     float time,
     HorizontalPosition leftHorizontalPosition,
     VerticalPosition verticalPosition)
 {
     if (leftHorizontalPosition == HorizontalPosition.Right)
     {
         throw new ArgumentOutOfRangeException(nameof(leftHorizontalPosition));
     }
     return(new[]
     {
         new Note(time, Hand.Left, CutDirection.Down, leftHorizontalPosition, verticalPosition),
         new Note(time + 0.5f, Hand.Right, CutDirection.Down, leftHorizontalPosition + 1, verticalPosition)
     });
 }
 public static IEnumerable <Note> ReversedDouble(
     float time,
     CutDirection cutDirection,
     HorizontalPosition leftHorizontalPosition,
     VerticalPosition verticalPosition)
 {
     if (leftHorizontalPosition == HorizontalPosition.Left)
     {
         throw new ArgumentOutOfRangeException(nameof(leftHorizontalPosition));
     }
     return(new[]
     {
         new Note(time, Hand.Left, cutDirection, leftHorizontalPosition, verticalPosition),
         new Note(time, Hand.Right, cutDirection, leftHorizontalPosition - 1, verticalPosition)
     });
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         hashCode = hashCode * 59 + HorizontalPosition.GetHashCode();
         hashCode = hashCode * 59 + VerticalPosition.GetHashCode();
         hashCode = hashCode * 59 + Size.GetHashCode();
         hashCode = hashCode * 59 + IndentFromEdges.GetHashCode();
         hashCode = hashCode * 59 + AbsolutePositionLeft.GetHashCode();
         hashCode = hashCode * 59 + AbsolutePositionTop.GetHashCode();
         hashCode = hashCode * 59 + AbsoluteWidth.GetHashCode();
         hashCode = hashCode * 59 + AbsoluteHeight.GetHashCode();
         return(hashCode);
     }
 }
예제 #14
0
    public void OnKey(KeyCode keyCode)
    {
        RegisterKey(keyCode);
        switch (keyCode)
        {
        case KeyCode.A: {
            if (!m_jumping)
            {
                if (m_position == HorizontalPosition.RIGHT)
                {
                    m_position = HorizontalPosition.MIDDLE;
                }
                else if (m_position == HorizontalPosition.MIDDLE)
                {
                    m_position = HorizontalPosition.LEFT;
                }
                MovePlayerToHorizontalPosition();
            }
        }
        break;

        case KeyCode.D: {
            if (!m_jumping)
            {
                if (m_position == HorizontalPosition.LEFT)
                {
                    m_position = HorizontalPosition.MIDDLE;
                }
                else if (m_position == HorizontalPosition.MIDDLE)
                {
                    m_position = HorizontalPosition.RIGHT;
                }
                MovePlayerToHorizontalPosition();
            }
        }
        break;

        case KeyCode.Space: {
            if (!m_jumping)
            {
                m_jumping = true;
                m_rb.AddForce(new Vector3(0, 35, 0), ForceMode.Impulse);
            }
            break;
        }
        }
    }
예제 #15
0
        public async Task Check_Placement_All_MenuFlyout(
            FlyoutPlacementMode placementMode,
            HorizontalPosition horizontalPosition,
            VerticalPosition verticalPosition)
        {
            var flyout = CreateBasicMenuFlyout();

            flyout.Placement = placementMode;

            const double MarginValue = 97;
            const int    TargetWidth = 88;
            var          target      = new Border
            {
                Margin = new Thickness(MarginValue),
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Top,
                Width      = TargetWidth,
                Height     = 23,
                Background = new SolidColorBrush(Colors.Red)
            };

            TestServices.WindowHelper.WindowContent = target;

            await TestServices.WindowHelper.WaitForLoaded(target);

            await TestServices.WindowHelper.WaitFor(() => target.ActualWidth == TargetWidth);             // For some reason target is initially stretched on iOS

            try
            {
                FlyoutBase.SetAttachedFlyout(target, flyout);
                FlyoutBase.ShowAttachedFlyout(target);

                var presenter = flyout.Presenter;

                await TestServices.WindowHelper.WaitForLoaded(presenter);

                var content = presenter.FindFirstChild <ScrollViewer>();

                VerifyRelativeContentPosition(horizontalPosition, verticalPosition, content, MarginValue, target);
            }
            finally
            {
                flyout.Hide();
            }
        }
예제 #16
0
        public async Task Check_Placement_All_WithPosition(
            FlyoutPlacementMode placementMode,
            HorizontalPosition horizontalPosition,
            VerticalPosition verticalPosition)
        {
            var(flyout, content) = CreateFlyout();
            var position = new Windows.Foundation.Point(50, 50);
            var options  = new FlyoutShowOptions
            {
                Placement = placementMode,
                Position  = position,
            };

            const double MarginValue = 97;
            const int    TargetWidth = 88;
            var          target      = new Border
            {
                Margin = new Thickness(MarginValue),
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment   = VerticalAlignment.Top,
                Width      = TargetWidth,
                Height     = 23,
                Background = new SolidColorBrush(Colors.Red)
            };

            TestServices.WindowHelper.WindowContent = target;

            await TestServices.WindowHelper.WaitForLoaded(target);

            await TestServices.WindowHelper.WaitFor(() => target.ActualWidth == TargetWidth);             // For some reason target is initially stretched on iOS

            try
            {
                flyout.ShowAt(target, options);

                await TestServices.WindowHelper.WaitForLoaded(content);

                VerifyRelativeContentPosition(position, horizontalPosition, verticalPosition, content, MarginValue, target);
            }
            finally
            {
                flyout.Hide();
            }
        }
        public static IEnumerable <Note> BlueRedStacked(
            float time,
            HorizontalPosition horizontalPosition,
            VerticalPosition lowVerticalPosition)
        {
            if (lowVerticalPosition == VerticalPosition.Top)
            {
                throw new ArgumentOutOfRangeException(nameof(lowVerticalPosition));
            }
            var cutDirection = horizontalPosition.InSet(HorizontalPosition.Left, HorizontalPosition.CenterLeft)
                ? CutDirection.Left
                : CutDirection.Right;

            return(new[]
            {
                new Note(time, Hand.Left, cutDirection, horizontalPosition, lowVerticalPosition),
                new Note(time, Hand.Right, cutDirection, horizontalPosition, lowVerticalPosition + 1)
            });
        }
        /// <summary>
        /// Returns true if DrawableContentLayoutParameters instances are equal
        /// </summary>
        /// <param name="input">Instance of DrawableContentLayoutParameters to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DrawableContentLayoutParameters input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     HorizontalPosition == input.HorizontalPosition ||
                     HorizontalPosition.Equals(input.HorizontalPosition)
                     ) &&
                 (
                     VerticalPosition == input.VerticalPosition ||
                     VerticalPosition.Equals(input.VerticalPosition)
                 ) &&
                 (
                     Size == input.Size ||
                     Size.Equals(input.Size)
                 ) &&
                 (
                     IndentFromEdges == input.IndentFromEdges ||
                     IndentFromEdges.Equals(input.IndentFromEdges)
                 ) &&
                 (
                     AbsolutePositionLeft == input.AbsolutePositionLeft ||
                     AbsolutePositionLeft.Equals(input.AbsolutePositionLeft)
                 ) &&
                 (
                     AbsolutePositionTop == input.AbsolutePositionTop ||
                     AbsolutePositionTop.Equals(input.AbsolutePositionTop)
                 ) &&
                 (
                     AbsoluteWidth == input.AbsoluteWidth ||
                     AbsoluteWidth.Equals(input.AbsoluteWidth)
                 ) &&
                 (
                     AbsoluteHeight == input.AbsoluteHeight ||
                     AbsoluteHeight.Equals(input.AbsoluteHeight)
                 ));
        }
예제 #19
0
    internal static string smethod_7(HorizontalPosition A_0)
    {
        int num = 1;

        switch (A_0)
        {
        case HorizontalPosition.Left:
            return(BookmarkStart.b("䬦䰨䴪夬", num));

        case HorizontalPosition.Center:
            return(BookmarkStart.b("䐦䰨䔪夬䨮䌰", num));

        case HorizontalPosition.Right:
            return(BookmarkStart.b("唦䀨䰪䔬嬮", num));

        case HorizontalPosition.Inside:
            return(BookmarkStart.b("並䜨堪䐬䬮吰", num));

        case HorizontalPosition.Outside:
            return(BookmarkStart.b("䠦尨弪帬䘮唰嘲", num));
        }
        return("");
    }
 public override int GetHashCode()
 {
     return(HorizontalPosition.GetHashCode() + VerticalPosition.GetHashCode());
 }
예제 #21
0
 public static GameState Move(this GameState gameState, HorizontalPosition hp, VerticalPosition vp)
 {
     return(TicTacToe.makeMove(gameState, new CellPosition(hp, vp)));
 }
예제 #22
0
        private static void VerifyRelativeContentPosition(Windows.Foundation.Point position, HorizontalPosition horizontalPosition, VerticalPosition verticalPosition, FrameworkElement content, double minimumTargetOffset, FrameworkElement target)
        {
            var contentScreenBounds = content.GetOnScreenBounds();

#if __ANDROID__
            if (FeatureConfiguration.Popup.UseNativePopup)
            {
                // Adjust for status bar height, which is omitted from TransformToVisual() for elements inside of a native popup.
                var rootViewBounds = ((FrameworkElement)Window.Current.Content).GetOnScreenBounds();
                contentScreenBounds.Y += rootViewBounds.Y;
            }
#endif
            var contentCenter      = contentScreenBounds.GetCenter();
            var targetScreenBounds = target.GetOnScreenBounds();
            var targetCenter       = targetScreenBounds.GetCenter();
            var anchorPoint        = new Windows.Foundation.Point(targetScreenBounds.X + position.X, targetScreenBounds.Y + position.Y);

            Assert.IsTrue(targetCenter.X > minimumTargetOffset);
            Assert.IsTrue(targetCenter.Y > minimumTargetOffset);
            switch (horizontalPosition)
            {
            case HorizontalPosition.BeyondLeft:
                NumberAssert.GreaterOrEqual(anchorPoint.X, contentScreenBounds.Right);
                break;

            case HorizontalPosition.LeftFlush:
                Assert.AreEqual(anchorPoint.X, contentScreenBounds.Left, delta: 2);
                break;

            case HorizontalPosition.Center:
                Assert.AreEqual(anchorPoint.X, contentCenter.X, delta: 2);
                break;

            case HorizontalPosition.RightFlush:
                Assert.AreEqual(anchorPoint.X, contentScreenBounds.Right, delta: 2);
                break;

            case HorizontalPosition.BeyondRight:
                NumberAssert.LessOrEqual(anchorPoint.X, contentScreenBounds.Left);
                break;
            }

            switch (verticalPosition)
            {
            case VerticalPosition.BeyondTop:
                NumberAssert.GreaterOrEqual(anchorPoint.Y, contentScreenBounds.Bottom);
                break;

            case VerticalPosition.TopFlush:
                Assert.AreEqual(anchorPoint.Y, contentScreenBounds.Top, delta: 2);
                break;

            case VerticalPosition.Center:
                Assert.AreEqual(anchorPoint.Y, contentCenter.Y, delta: 2);
                break;

            case VerticalPosition.BottomFlush:
                Assert.AreEqual(anchorPoint.Y, contentScreenBounds.Bottom, delta: 2);
                break;

            case VerticalPosition.BeyondBottom:
                NumberAssert.LessOrEqual(anchorPoint.Y, contentScreenBounds.Top);
                break;
            }
        }
예제 #23
0
        /// <summary>
        /// This method creates a pie chart.
        /// </summary>
        /// <param name="dc">Document</param>
        /// <param name="chartLayout">Chart layout</param>
        /// <param name="data">Chart data</param>
        /// <param name="addLabels">Add labels or not</param>
        /// <param name="labelSign">Label sign</param>
        /// <param name="addLegend">Add legend</param>
        /// <remarks>
        /// This method is made specially with open source code. You may change anything you want:<br />
        /// Chart colors, size, position, font name and font size, position of labels (inside or outside the chart), legend position.<br />
        /// If you need any assistance, feel free to email us: [email protected].<br />
        /// </remarks>
        public static void AddPieChart(DocumentCore dc, FloatingLayout chartLayout, Dictionary <string, double> data, bool addLabels = true, string labelSign = null, bool addLegend = true)
        {
            // Assume that our chart can have 10 pies maximally.
            // And we'll use these colors order by order.
            // You may change the colors and their quantity.
            List <string> colors = new List <string>()
            {
                "#70AD47", // light green
                "#4472C4", // blue
                "#FFC000", // yellow
                "#A5A5A5", // grey
                "#ED7D31", // orange
                "#5B9BD5", // light blue
                "#44546A", // blue and grey
                "#C00000", // red
                "#00B050", // green
                "#9933FF"  // purple
            };
            // 1. To create a circle chart, assume that the sum of all values are 100%
            // and calculate the percent for the each value.
            // Translate all data to perce
            double        amount      = data.Values.Sum();
            List <double> percentages = new List <double>();

            foreach (double v in data.Values)
            {
                percentages.Add(v * 100 / amount);
            }

            // 2. Translate the percentage value of the each pie into degrees.
            // The whole circle is 360 degrees.
            int           pies       = data.Values.Count;
            List <double> pieDegrees = new List <double>();

            foreach (double p in percentages)
            {
                pieDegrees.Add(p * 360 / 100);
            }

            // 3. Translate degrees to the "Pie" measurement.
            List <double> pieMeasure = new List <double>();

            // Add the start position.
            pieMeasure.Add(0);
            double currentAngle = 0;

            foreach (double pd in pieDegrees)
            {
                currentAngle += pd;
                pieMeasure.Add(480 * currentAngle / 360);
            }

            // 4. Create the pies.
            Shape originalShape = new Shape(dc, chartLayout);

            for (int i = 0; i < pies; i++)
            {
                Shape shpPie = originalShape.Clone(true);
                shpPie.Outline.Fill.SetSolid(Color.White);
                shpPie.Outline.Width = 0.5;
                shpPie.Fill.SetSolid(new Color(colors[i]));

                shpPie.Geometry.SetPreset(Figure.Pie);
                shpPie.Geometry.AdjustValues["adj1"] = 45000 * pieMeasure[i];
                shpPie.Geometry.AdjustValues["adj2"] = 45000 * pieMeasure[i + 1];

                dc.Content.End.Insert(shpPie.Content);
            }

            // 5. Add labels
            if (addLabels)
            {
                // 0.5 ... 1.2 (inside/outside the circle).
                double multiplier = 0.8;
                double radius     = chartLayout.Size.Width / 2 * multiplier;
                currentAngle = 0;
                double labelW = 35;
                double labelH = 20;

                for (int i = 0; i < pieDegrees.Count; i++)
                {
                    currentAngle += pieDegrees[i];
                    double middleAngleDegrees = 360 - (currentAngle - pieDegrees[i] / 2);
                    double middleAngleRad     = middleAngleDegrees * (Math.PI / 180);

                    // Calculate the (x, y) on the circle.
                    double x = radius * Math.Cos(middleAngleRad);
                    double y = radius * Math.Sin(middleAngleRad);

                    // Correct the position depending of the label size;
                    x -= labelW / 2;
                    y += labelH / 2;

                    HorizontalPosition centerH = new HorizontalPosition(chartLayout.HorizontalPosition.Value + chartLayout.Size.Width / 2, LengthUnit.Point, HorizontalPositionAnchor.LeftMargin);
                    VerticalPosition   centerV = new VerticalPosition(chartLayout.VerticalPosition.Value + chartLayout.Size.Height / 2, LengthUnit.Point, VerticalPositionAnchor.TopMargin);

                    HorizontalPosition labelX = new HorizontalPosition(centerH.Value + x, LengthUnit.Point, HorizontalPositionAnchor.LeftMargin);
                    VerticalPosition   labelY = new VerticalPosition(centerV.Value - y, LengthUnit.Point, VerticalPositionAnchor.TopMargin);

                    FloatingLayout labelLayout = new FloatingLayout(labelX, labelY, new Size(labelW, labelH));
                    Shape          shpLabel    = new Shape(dc, labelLayout);
                    shpLabel.Outline.Fill.SetEmpty();
                    shpLabel.Text.Blocks.Content.Start.Insert($"{data.Values.ElementAt(i)}{labelSign}",
                                                              new CharacterFormat()
                    {
                        FontName = "Arial",
                        Size     = 10,
                        //FontColor = new Color("#333333")
                        FontColor = new Color("#FFFFFF")
                    });
                    (shpLabel.Text.Blocks[0] as Paragraph).ParagraphFormat.Alignment = HorizontalAlignment.Center;
                    dc.Content.End.Insert(shpLabel.Content);
                }

                // 6. Add Legend
                if (addLegend)
                {
                    double             legendTopMargin  = LengthUnitConverter.Convert(5, LengthUnit.Millimeter, LengthUnit.Point);
                    double             legendLeftMargin = LengthUnitConverter.Convert(-10, LengthUnit.Millimeter, LengthUnit.Point);
                    HorizontalPosition legendX          = new HorizontalPosition(chartLayout.HorizontalPosition.Value + legendLeftMargin, LengthUnit.Point, HorizontalPositionAnchor.LeftMargin);
                    VerticalPosition   legendY          = new VerticalPosition(chartLayout.VerticalPosition.Value + chartLayout.Size.Height + legendTopMargin, LengthUnit.Point, VerticalPositionAnchor.TopMargin);
                    double             legendW          = chartLayout.Size.Width * 2;
                    double             legendH          = 20;

                    FloatingLayout legendLayout = new FloatingLayout(legendX, legendY, new Size(legendW, legendH));
                    Shape          shpLegend    = new Shape(dc, legendLayout);
                    shpLegend.Outline.Fill.SetEmpty();

                    Paragraph pLegend = new Paragraph(dc);
                    pLegend.ParagraphFormat.Alignment = HorizontalAlignment.Left;

                    for (int i = 0; i < data.Count; i++)
                    {
                        string legendItem = data.Keys.ElementAt(i);

                        // 183 - circle, "Symbol"
                        // 167 - square, "Wingdings"

                        Run marker = new Run(dc, (char)167, new CharacterFormat()
                        {
                            FontColor = new Color(colors[i]),
                            FontName  = "Wingdings"
                        });
                        pLegend.Content.End.Insert(marker.Content);
                        pLegend.Content.End.Insert($" {legendItem}   ", new CharacterFormat());
                    }


                    shpLegend.Text.Blocks.Add(pLegend);
                    dc.Content.End.Insert(shpLegend.Content);
                }
            }
        }
        /// <summary>
        /// Creates A Button With A Lot Of Customization And Returns The GameObject Of The Button Made. | Created By Plague | Discord Server: http://Krewella.co.uk/Discord
        ///     <para>
        ///     As You Type Arguments Within This Method You Will See What Each Argument Does Here.
        ///     </para>
        ///
        ///     <example>
        ///     Here Is An Example Of How To Use This:
        ///         <code>
        ///         ButtonAPI.CreateButton(ButtonAPI.ButtonType.Toggle, "Toggle Pickups", "Toggles All Pickups In The Current Instance.", ButtonAPI.HorizontalPosition.FirstButtonPos,      ButtonAPI.VerticalPosition.TopButton, null, delegate (bool a)
        ///            {
        ///                //Do Something Here
        ///            }, Color.white, Color.magenta, null, false, false, true);
        ///         </code>
        ///     </example>
        /// </summary>
        /// <param name="ButtonType">
        /// The Type Of Button You Wish To Create.
        /// </param>
        /// <param name="Text">
        /// The Main Text In The Button
        /// </param>
        /// <param name="ToolTip">
        /// The Text That Appears At The Top Of The Menu When You Hover Over The Button.
        /// </param>
        /// <param name="X">
        /// The Horizontal Position Of The Button.
        /// </param>
        /// <param name="Y">
        /// The Vertical Position Of The Button.
        /// </param>
        /// <param name="Parent">
        /// The Transform Of The GameObject You Wish To Put Your Button In (You Can Set This As Just "null" For The Main ShortcutMenu).
        /// </param>
        /// <param name="ButtonListener">
        /// What You Want The Button To Do When You Click It - Must Be delegate(bool nameofboolhere) {  }.
        /// </param>
        /// <param name="ToggledOffTextColour">
        /// The Colour You Want The Main Text Of The Button You Defined Earlier To Change Into If This Button Is Toggled Off.
        /// </param>
        /// <param name="ToggledOnTextColour">
        /// The Colour You Want The Main Text Of The Button You Defined Earlier To Change Into If This Button Is Toggled On.
        /// </param>
        /// <param name="BorderColour">
        /// The Colour You Want The Border Of The Button To Be (You Can Set This As Just "null" For The Default Colour That The ShortcutMenu Currently Is!).
        /// </param>
        /// <param name="FullSizeButton">
        /// If You Want This Button To Be A Full Size Normal Button, Or Half Sized (False) - Default Is Half Sized.
        /// </param>
        /// <param name="BottomHalf">
        /// If You Want This Button To Be On The Bottom Half Of The VericalPosition You Chose Or The Top - Default Is Bottom Half.
        /// </param>
        /// <param name="HalfHorizontally">
        /// If You Want This Button To Have It's Size Cut In Half Horizontally.
        /// </param>
        /// <param name="CurrentToggleState">
        /// The Toggle State You Want The Button To Be On Creation.
        /// </param>
        /// <param name="SpriteForButton">
        /// The Image Sprite You Want To Apply To The Button.
        /// </param>
        /// <param name="ChangeColourOnClick">
        /// Only Set This To False If You Are Setting The Button's Text Colour In The ButtonListener - Or The Toggling Will Break!
        /// </param>
        internal static GameObject CreateButton(ButtonType ButtonType, string Text, string ToolTip, HorizontalPosition X,
                                                VerticalPosition Y, Transform Parent, Action <bool> ButtonListener, Color ToggledOffTextColour,
                                                Color ToggledOnTextColour, Color?BorderColour, bool FullSizeButton = false, bool BottomHalf = true,
                                                bool HalfHorizontally    = false, bool CurrentToggleState = false, Sprite SpriteForButton = null,
                                                bool ChangeColourOnClick = true)
        {
            //Prevent Weird Bugs Due To A Invalid Parent - Set It To The Main QuickMenu
            if (Parent == null)
            {
                Parent = ShortcutMenuTransform;
            }

            //Get The Transform Of The Settings Button - Which We Are Going To Use As Our Template
            Transform transform = UnityEngine.Object
                                  .Instantiate(GameObject.Find("/UserInterface/QuickMenu").GetComponent <QuickMenu>().transform.Find("ShortcutMenu/SettingsButton").gameObject)
                                  .transform;

            //Button Position Calculation
            float num =
                (GameObject.Find("/UserInterface/QuickMenu").GetComponent <QuickMenu>().transform.Find("UserInteractMenu/ForceLogoutButton").localPosition.x -
                 GameObject.Find("/UserInterface/QuickMenu").GetComponent <QuickMenu>().transform.Find("UserInteractMenu/BanButton").localPosition.x) / 3.9f;

            //Change Internal Names & Sanitize Them
            transform.name           = "PlagueButton_" + Text.Replace(" ", "_".Replace(",", "_").Replace(":", "_"));
            transform.transform.name = "PlagueButton_" + Text.Replace(" ", "_".Replace(",", "_").Replace(":", "_"));

            //Define Position To Place This Button In The Parent, Appended To Later
            if (BottomHalf || FullSizeButton)
            {
                if (Parent == UserInteractMenuTransform)
                {
                    transform.localPosition = new Vector3(transform.localPosition.x + num * (float)X,
                                                          transform.localPosition.y + num * ((float)Y - 2.95f), transform.localPosition.z);
                }
                else
                {
                    transform.localPosition = new Vector3(transform.localPosition.x + num * (float)X,
                                                          transform.localPosition.y + num * ((float)Y - 1.95f), transform.localPosition.z);
                }
            }
            else
            {
                if (Parent == UserInteractMenuTransform)
                {
                    transform.localPosition = new Vector3(transform.localPosition.x + num * (float)X,
                                                          transform.localPosition.y + num * ((float)Y - 2.45f), transform.localPosition.z);
                }
                else
                {
                    transform.localPosition = new Vector3(transform.localPosition.x + num * (float)X,
                                                          transform.localPosition.y + num * ((float)Y - 1.45f), transform.localPosition.z);
                }
            }

            //Define Where To Put This Button
            transform.SetParent(Parent, worldPositionStays: false);

            //Set Text, Tooltip & Colours
            transform.GetComponentInChildren <Text>().supportRichText    = true;
            transform.GetComponentInChildren <Text>().text               = Text;
            transform.GetComponentInChildren <UiTooltip>().text          = ToolTip;
            transform.GetComponentInChildren <UiTooltip>().alternateText = ToolTip;

            if (CurrentToggleState && ButtonType != ButtonAPI.ButtonType.Default)
            {
                transform.GetComponentInChildren <Text>().color = ToggledOnTextColour;
            }
            else
            {
                transform.GetComponentInChildren <Text>().color = ToggledOffTextColour;
            }

            //Set The Button's Border Colour
            if (BorderColour != null)
            {
                transform.GetComponentInChildren <Image>().color = (Color)BorderColour;
            }

            //Size Scaling & Repositioning
            if (!FullSizeButton)
            {
                transform.localPosition +=
                    new Vector3(0f, transform.GetComponent <RectTransform>().sizeDelta.y / 5f, 0f);
                transform.localPosition -=
                    new Vector3(0f, transform.GetComponent <RectTransform>().sizeDelta.y / 2f, 0f);
                transform.GetComponent <RectTransform>().sizeDelta = new Vector2(
                    transform.GetComponent <RectTransform>().sizeDelta.x,
                    transform.GetComponent <RectTransform>().sizeDelta.y / 2f);
            }
            else
            {
                transform.localPosition -= new Vector3(0f, 20f, 0f);
            }

            if (HalfHorizontally)
            {
                transform.GetComponent <RectTransform>().sizeDelta = new Vector2(
                    transform.GetComponent <RectTransform>().sizeDelta.x / 2f,
                    transform.GetComponent <RectTransform>().sizeDelta.y);
            }

            if (SpriteForButton != null)
            {
                transform.GetComponentInChildren <Image>().sprite = SpriteForButton;
            }

            //Remove Any Previous Events
            transform.GetComponent <Button>().onClick = new Button.ButtonClickedEvent();

            //Listener Redirection - To Get Around AddListener Not Passing A State Bool Due To Being A onClick Event
            transform.GetComponent <Button>().onClick.AddListener(new Action(() =>
            {
                if (ButtonType == ButtonType.Toggle)
                {
                    ButtonListener?.Invoke(transform.GetComponentInChildren <Text>().color != ToggledOnTextColour);
                }
                else
                {
                    ButtonListener?.Invoke(true);
                }
            }));

            if (ButtonType == ButtonType.Toggle)
            {
                //Set The Text Colour To The Toggle State, ToggledOnTextColour Being Toggled On
                transform.GetComponent <Button>().onClick.AddListener(new Action(() =>
                {
                    if (transform.GetComponentInChildren <Text>().color == ToggledOnTextColour)
                    {
                        transform.GetComponentInChildren <Text>().color = ToggledOffTextColour;
                    }
                    else
                    {
                        transform.GetComponentInChildren <Text>().color = ToggledOnTextColour;
                    }
                }));
            }

            ButtonsFromThisMod.Add(transform.gameObject);

            //Return The GameObject For Handling It Elsewhere
            return(transform.gameObject);
        }
예제 #25
0
파일: TalentItem.cs 프로젝트: say1981/Rawr
 public int CompareTo(TalentItem other)
 {
     return((HorizontalPosition.ToString() + " x " + VerticalPosition.ToString()).CompareTo(other.HorizontalPosition.ToString() + " x " + other.VerticalPosition.ToString()));
 }
예제 #26
0
        public override ILayoutable GenerateILayoutable(string contentManagerName, Dictionary <string, ILayoutable> namedControls, Dictionary <string, BitmapFont> namedFonts)
        {
            var layout = UiControlManager.Instance.CreateControl <FrbUi.Layouts.SimpleLayout>();

            SetBaseILayoutableProperties(layout, namedControls);
            layout.FullScreen = _isFullScreen ?? false;

            foreach (var child in _children)
            {
                var item = child.Item.GenerateILayoutable(contentManagerName, namedControls, namedFonts);
                HorizontalPosition horizontalPosition;
                VerticalPosition   verticalPosition;
                LayoutOrigin       origin;

                // Figure out the origin
                switch (child.OriginValue)
                {
                case SimpleLayoutXmlChild.LayoutOrigin.TopLeft:
                    origin = LayoutOrigin.TopLeft;
                    break;

                case SimpleLayoutXmlChild.LayoutOrigin.TopRight:
                    origin = LayoutOrigin.TopRight;
                    break;

                case SimpleLayoutXmlChild.LayoutOrigin.BottomLeft:
                    origin = LayoutOrigin.BottomLeft;
                    break;

                case SimpleLayoutXmlChild.LayoutOrigin.BottomRight:
                    origin = LayoutOrigin.BottomRight;
                    break;

                case SimpleLayoutXmlChild.LayoutOrigin.BottomCenter:
                    origin = LayoutOrigin.BottomCenter;
                    break;

                case SimpleLayoutXmlChild.LayoutOrigin.TopCenter:
                    origin = LayoutOrigin.TopCenter;
                    break;

                case SimpleLayoutXmlChild.LayoutOrigin.Center:
                default:
                    origin = LayoutOrigin.Center;
                    break;
                }

                // Figure out horizontal position
                if (child.HorizontalPercentFromCenterValueSpecified)
                {
                    horizontalPosition = HorizontalPosition.PercentFromCenter(child.HorizontalPercentFromCenterValue);
                }
                else if (child.HorizontalPercentFromLeftValueSpecified)
                {
                    horizontalPosition = HorizontalPosition.PercentFromLeft(child.HorizontalPercentFromLeftValue);
                }
                else if (child.HorizontalPercentFromRightValueSpecified)
                {
                    horizontalPosition = HorizontalPosition.PercentFromRight(child.HorizontalPercentFromRightValue);
                }
                else if (child.HorizontalOffsetFromCenterValueSpecified)
                {
                    horizontalPosition = HorizontalPosition.OffsetFromCenter(child.HorizontalOffsetFromCenterValue);
                }
                else if (child.HorizontalOffsetFromLeftValueSpecified)
                {
                    horizontalPosition = HorizontalPosition.OffsetFromLeft(child.HorizontalOffsetFromLeftValue);
                }
                else if (child.HorizontalOffsetFromRightValueSpecified)
                {
                    horizontalPosition = HorizontalPosition.OffsetFromRight(child.HorizontalOffsetFromRightValue);
                }
                else
                {
                    horizontalPosition = HorizontalPosition.OffsetFromLeft(0);
                }

                // Figure out vertical position
                if (child.VerticalPercentFromCenterValueSpecified)
                {
                    verticalPosition = VerticalPosition.PercentFromCenter(child.VerticalPercentFromCenterValue);
                }
                else if (child.VerticalPercentFromTopValueSpecified)
                {
                    verticalPosition = VerticalPosition.PercentFromTop(child.VerticalPercentFromTopValue);
                }
                else if (child.VerticalPercentFromBottomValueSpecified)
                {
                    verticalPosition = VerticalPosition.PercentFromBottom(child.VerticalPercentFromBottomValue);
                }
                else if (child.VerticalOffsetFromCenterValueSpecified)
                {
                    verticalPosition = VerticalPosition.OffsetFromCenter(child.VerticalOffsetFromCenterValue);
                }
                else if (child.VerticalOffsetFromTopValueSpecified)
                {
                    verticalPosition = VerticalPosition.OffsetFromTop(child.VerticalOffsetFromTopValue);
                }
                else if (child.VerticalOffsetFromBottomValueSpecified)
                {
                    verticalPosition = VerticalPosition.OffsetFromBottom(child.VerticalOffsetFromBottomValue);
                }
                else
                {
                    verticalPosition = VerticalPosition.OffsetFromTop(0);
                }

                layout.AddItem(item, horizontalPosition, verticalPosition, origin);
            }

            return(layout);
        }
예제 #27
0
        private void PositionItem(ILayoutable item, HorizontalPosition horizontalPosition, VerticalPosition verticalPosition, LayoutOrigin layoutFrom)
        {
            // Make sure this is still the item's parent
            if (item.Parent != _backgroundSprite)
            {
                if (_items.ContainsKey(item))
                {
                    _items.Remove(item);
                }

                return;
            }

            // Position the item correctly
            float posX;
            float posY;

            // Figure out starting horizontal and vertical coordinates
            if (horizontalPosition.Alignment == HorizontalPosition.PositionAlignment.Left)
            {
                posX = 0 - ScaleX;
            }
            else if (horizontalPosition.Alignment == HorizontalPosition.PositionAlignment.Right)
            {
                posX = ScaleX;
            }
            else
            {
                posX = 0;
            }

            if (verticalPosition.Alignment == VerticalPosition.PositionAlignment.Top)
            {
                posY = ScaleY;
            }
            else if (verticalPosition.Alignment == VerticalPosition.PositionAlignment.Bottom)
            {
                posY = 0 - ScaleY;
            }
            else
            {
                posY = 0;
            }

            // Calculate offsets
            if (horizontalPosition.OffsetIsPercentage)
            {
                var total = ScaleX * 2;
                posX += (horizontalPosition.Offset * total);
            }
            else
            {
                posX += horizontalPosition.Offset;
            }

            if (verticalPosition.OffsetIsPercentage)
            {
                var total = ScaleY * 2;
                posY += (verticalPosition.Offset * total);
            }
            else
            {
                posY += verticalPosition.Offset;
            }

            // Adjust for the specified layout origin
            switch (layoutFrom)
            {
            case LayoutOrigin.TopLeft:
            {
                posX += item.ScaleX;
                posY -= item.ScaleY;
                break;
            }

            case LayoutOrigin.TopRight:
            {
                posX -= item.ScaleX;
                posY -= item.ScaleY;
                break;
            }

            case LayoutOrigin.BottomLeft:
            {
                posX += item.ScaleX;
                posY += item.ScaleY;
                break;
            }

            case LayoutOrigin.BottomRight:
            {
                posX -= item.ScaleX;
                posY += item.ScaleY;
                break;
            }

            case LayoutOrigin.BottomCenter:
            {
                posY += item.ScaleY;
                break;
            }

            case LayoutOrigin.TopCenter:
            {
                posY -= item.ScaleY;
                break;
            }

            case LayoutOrigin.Center:
            default:
            {
                // PosX and PosY remain at center
                break;
            }
            }

            // Set the item's position to the calculated spot
            item.RelativeX = posX;
            item.RelativeY = posY;
        }
예제 #28
0
        public static Textbox SetTextBoxPosition(Textbox tb, FontPackage fontPackage, Rectangle viewportBounds, VerticalPosition verticalPosition, float verticalDistance, HorizontalPosition horizontalPosition, float horizontalDistance)
        {
            RectangleF textBoxRectangle = fontPackage.Font.GetStringRectangle(tb.Value);

            float xPosition = 0f;

            if (horizontalPosition.Equals(HorizontalPosition.Centered))
            {
                xPosition = viewportBounds.Width / 2f - (textBoxRectangle.Width / 2f);
            }

            if (horizontalPosition.Equals(HorizontalPosition.Left))
            {
                xPosition = 0f + viewportBounds.Width * horizontalDistance;
            }

            if (horizontalPosition.Equals(HorizontalPosition.Right))
            {
                xPosition = viewportBounds.Width - (textBoxRectangle.Width) - viewportBounds.Width * horizontalDistance;
            }


            float yPosition = viewportBounds.Height * 0.25f;

            tb.Location = new Vector2(xPosition, yPosition);


            textBoxRectangle.Position = new Point2(tb.Location.X, tb.Location.Y);
            tb.BoundingBox            = textBoxRectangle;

            return(tb);
        }
예제 #29
0
 public static GameState Move(this GameState gameState, HorizontalPosition hp, VerticalPosition vp)
 {
     return TicTacToe.makeMove(gameState, new CellPosition(hp, vp));
 }
예제 #30
0
        // Creates an Paragraph instance and adds its children.
        public static Paragraph GenerateParagraph()
        {
            Paragraph paragraph1 = new Paragraph()
            {
                RsidParagraphAddition = "009B2C1D", RsidRunAdditionDefault = "00B96314", ParagraphId = "0B39323B", TextId = "7F2F315D"
            };
            BookmarkStart bookmarkStart1 = new BookmarkStart()
            {
                Name = "_GoBack", Id = "0"
            };

            Run run1 = new Run();

            RunProperties runProperties1 = new RunProperties();
            NoProof       noProof1       = new NoProof();

            runProperties1.Append(noProof1);

            Drawing drawing1 = new Drawing();

            Anchor anchor1 = new Anchor()
            {
                DistanceFromTop = (UInt32Value)0U, DistanceFromBottom = (UInt32Value)0U, DistanceFromLeft = (UInt32Value)114300U, DistanceFromRight = (UInt32Value)114300U, SimplePos = false, RelativeHeight = (UInt32Value)251659264U, BehindDoc = true, Locked = false, LayoutInCell = true, AllowOverlap = true, EditId = "3E042748", AnchorId = "3A391EBB"
            };
            SimplePosition simplePosition1 = new SimplePosition()
            {
                X = 0L, Y = 0L
            };

            HorizontalPosition horizontalPosition1 = new HorizontalPosition()
            {
                RelativeFrom = HorizontalRelativePositionValues.Column
            };
            PositionOffset positionOffset1 = new PositionOffset();

            positionOffset1.Text = "4435475";

            horizontalPosition1.Append(positionOffset1);

            VerticalPosition verticalPosition1 = new VerticalPosition()
            {
                RelativeFrom = VerticalRelativePositionValues.Paragraph
            };
            PositionOffset positionOffset2 = new PositionOffset();

            positionOffset2.Text = "306171";

            verticalPosition1.Append(positionOffset2);
            Extent extent1 = new Extent()
            {
                Cx = 1187454L, Cy = 1486814L
            };
            EffectExtent effectExtent1 = new EffectExtent()
            {
                LeftEdge = 0L, TopEdge = 0L, RightEdge = 0L, BottomEdge = 0L
            };
            WrapNone      wrapNone1      = new WrapNone();
            DocProperties docProperties1 = new DocProperties()
            {
                Id = (UInt32Value)30U, Name = "Picture 30"
            };

            NonVisualGraphicFrameDrawingProperties nonVisualGraphicFrameDrawingProperties1 = new NonVisualGraphicFrameDrawingProperties();

            A.GraphicFrameLocks graphicFrameLocks1 = new A.GraphicFrameLocks()
            {
                NoChangeAspect = true
            };
            graphicFrameLocks1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");

            nonVisualGraphicFrameDrawingProperties1.Append(graphicFrameLocks1);

            A.Graphic graphic1 = new A.Graphic();
            graphic1.AddNamespaceDeclaration("a", "http://schemas.openxmlformats.org/drawingml/2006/main");

            A.GraphicData graphicData1 = new A.GraphicData()
            {
                Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture"
            };

            Pic.Picture picture1 = new Pic.Picture();
            picture1.AddNamespaceDeclaration("pic", "http://schemas.openxmlformats.org/drawingml/2006/picture");

            Pic.NonVisualPictureProperties nonVisualPictureProperties1 = new Pic.NonVisualPictureProperties();
            Pic.NonVisualDrawingProperties nonVisualDrawingProperties1 = new Pic.NonVisualDrawingProperties()
            {
                Id = (UInt32Value)30U, Name = "aZanriba.jfif"
            };
            Pic.NonVisualPictureDrawingProperties nonVisualPictureDrawingProperties1 = new Pic.NonVisualPictureDrawingProperties();

            nonVisualPictureProperties1.Append(nonVisualDrawingProperties1);
            nonVisualPictureProperties1.Append(nonVisualPictureDrawingProperties1);

            Pic.BlipFill blipFill1 = new Pic.BlipFill()
            {
                RotateWithShape = true
            };

            A.Blip blip1 = new A.Blip()
            {
                Embed = "rId30"
            };

            A.BlipExtensionList blipExtensionList1 = new A.BlipExtensionList();

            A.BlipExtension blipExtension1 = new A.BlipExtension()
            {
                Uri = "{28A0092B-C50C-407E-A947-70E740481C1C}"
            };

            A14.UseLocalDpi useLocalDpi1 = new A14.UseLocalDpi()
            {
                Val = false
            };
            useLocalDpi1.AddNamespaceDeclaration("a14", "http://schemas.microsoft.com/office/drawing/2010/main");

            blipExtension1.Append(useLocalDpi1);

            blipExtensionList1.Append(blipExtension1);

            blip1.Append(blipExtensionList1);
            A.SourceRectangle sourceRectangle1 = new A.SourceRectangle()
            {
                Left = 13333, Right = 7334
            };
            A.Stretch stretch1 = new A.Stretch();

            blipFill1.Append(blip1);
            blipFill1.Append(sourceRectangle1);
            blipFill1.Append(stretch1);

            Pic.ShapeProperties shapeProperties1 = new Pic.ShapeProperties()
            {
                BlackWhiteMode = A.BlackWhiteModeValues.Auto
            };

            A.Transform2D transform2D1 = new A.Transform2D();
            A.Offset      offset1      = new A.Offset()
            {
                X = 0L, Y = 0L
            };
            A.Extents extents1 = new A.Extents()
            {
                Cx = 1187454L, Cy = 1486814L
            };

            transform2D1.Append(offset1);
            transform2D1.Append(extents1);

            A.PresetGeometry presetGeometry1 = new A.PresetGeometry()
            {
                Preset = A.ShapeTypeValues.Rectangle
            };
            A.AdjustValueList adjustValueList1 = new A.AdjustValueList();

            presetGeometry1.Append(adjustValueList1);

            A.Outline outline1 = new A.Outline();
            A.NoFill  noFill1  = new A.NoFill();

            outline1.Append(noFill1);

            A.ShapePropertiesExtensionList shapePropertiesExtensionList1 = new A.ShapePropertiesExtensionList();

            A.ShapePropertiesExtension shapePropertiesExtension1 = new A.ShapePropertiesExtension()
            {
                Uri = "{53640926-AAD7-44D8-BBD7-CCE9431645EC}"
            };

            A14.ShadowObscured shadowObscured1 = new A14.ShadowObscured();
            shadowObscured1.AddNamespaceDeclaration("a14", "http://schemas.microsoft.com/office/drawing/2010/main");

            shapePropertiesExtension1.Append(shadowObscured1);

            shapePropertiesExtensionList1.Append(shapePropertiesExtension1);

            shapeProperties1.Append(transform2D1);
            shapeProperties1.Append(presetGeometry1);
            shapeProperties1.Append(outline1);
            shapeProperties1.Append(shapePropertiesExtensionList1);

            picture1.Append(nonVisualPictureProperties1);
            picture1.Append(blipFill1);
            picture1.Append(shapeProperties1);

            graphicData1.Append(picture1);

            graphic1.Append(graphicData1);

            Wp14.RelativeWidth relativeWidth1 = new Wp14.RelativeWidth()
            {
                ObjectId = Wp14.SizeRelativeHorizontallyValues.Page
            };
            Wp14.PercentageWidth percentageWidth1 = new Wp14.PercentageWidth();
            percentageWidth1.Text = "0";

            relativeWidth1.Append(percentageWidth1);

            Wp14.RelativeHeight relativeHeight1 = new Wp14.RelativeHeight()
            {
                RelativeFrom = Wp14.SizeRelativeVerticallyValues.Page
            };
            Wp14.PercentageHeight percentageHeight1 = new Wp14.PercentageHeight();
            percentageHeight1.Text = "0";

            relativeHeight1.Append(percentageHeight1);

            anchor1.Append(simplePosition1);
            anchor1.Append(horizontalPosition1);
            anchor1.Append(verticalPosition1);
            anchor1.Append(extent1);
            anchor1.Append(effectExtent1);
            anchor1.Append(wrapNone1);
            anchor1.Append(docProperties1);
            anchor1.Append(nonVisualGraphicFrameDrawingProperties1);
            anchor1.Append(graphic1);
            anchor1.Append(relativeWidth1);
            anchor1.Append(relativeHeight1);

            drawing1.Append(anchor1);

            run1.Append(runProperties1);
            run1.Append(drawing1);
            BookmarkEnd bookmarkEnd1 = new BookmarkEnd()
            {
                Id = "0"
            };

            Run run2 = new Run();

            RunProperties runProperties2 = new RunProperties();
            FontSize      fontSize1      = new FontSize()
            {
                Val = "22"
            };
            FontSizeComplexScript fontSizeComplexScript1 = new FontSizeComplexScript()
            {
                Val = "22"
            };

            runProperties2.Append(fontSize1);
            runProperties2.Append(fontSizeComplexScript1);
            Break break1 = new Break()
            {
                Type = BreakValues.TextWrapping, Clear = BreakTextRestartLocationValues.All
            };

            run2.Append(runProperties2);
            run2.Append(break1);

            Run run3 = new Run()
            {
                RsidRunAddition = "009E39C2"
            };

            RunProperties runProperties3 = new RunProperties();
            FontSize      fontSize2      = new FontSize()
            {
                Val = "22"
            };
            FontSizeComplexScript fontSizeComplexScript2 = new FontSizeComplexScript()
            {
                Val = "22"
            };

            runProperties3.Append(fontSize2);
            runProperties3.Append(fontSizeComplexScript2);
            Text text1 = new Text()
            {
                Space = SpaceProcessingModeValues.Preserve
            };

            text1.Text = "  ";

            run3.Append(runProperties3);
            run3.Append(text1);

            paragraph1.Append(bookmarkStart1);
            paragraph1.Append(run1);
            paragraph1.Append(bookmarkEnd1);
            paragraph1.Append(run2);
            paragraph1.Append(run3);
            return(paragraph1);
        }
예제 #31
0
        // 24.03.2005 - jorn : removed ColumnType to avoid resetting of all data. This  might have affects elsewhere :|
        internal virtual void CopyFrom(Column column)
        {
            if (column == this)
                return;
            m_Grid = column.m_Grid;
            m_TreeIndentText = column.m_TreeIndentText;
            m_TreeLevel = column.m_TreeLevel;
            m_Columnname = column.m_Columnname;
            m_ColumnType = column.m_ColumnType;
            m_Title = column.m_Title;
            m_HeaderText = column.m_HeaderText;
            m_IsInDataSource = column.m_IsInDataSource;
            DisplayIndex = column.DisplayIndex;
            m_MaxSize = column.m_MaxSize;
            m_MinSize = column.m_MinSize;
            m_AllowEmpty = column.m_AllowEmpty;
            m_NullText = column.m_NullText;
             m_DbDefaultValue = column.m_DbDefaultValue;
            m_HyperLinkColumn = column.m_HyperLinkColumn;
            m_Visibility = column.m_Visibility;
            m_Primarykey = column.m_Primarykey;
            m_Identity = column.m_Identity;
            m_AllowUpdate = column.m_AllowUpdate;
            m_Table = column.m_Table;
            m_Required = column.m_Required;
            m_WidthEditableColumn = column.m_WidthEditableColumn;
            m_WidthColumnTitle = column.m_WidthColumnTitle;
            m_WidthColumnHeaderTitle = column.m_WidthColumnHeaderTitle;
            m_HeightEditableColumn = column.m_HeightEditableColumn;
            m_EditAlign = column.m_EditAlign;
            m_EditVAlign = column.m_EditVAlign;
            m_EditAlignTitle = column.m_EditAlignTitle;
            m_GridAlign = column.m_GridAlign;
            m_GridVAlign = column.m_GridVAlign;
            m_SaveValueToViewState = column.m_SaveValueToViewState;
            m_Searchable = column.m_Searchable;
            m_Sortable = column.m_Sortable;
            m_Groupable = column.m_Groupable;
            m_UseAllRows = column.m_UseAllRows;
            m_AllowEdit = column.m_AllowEdit;
            m_HtmlEncode = column.m_HtmlEncode;
            m_DataSourceId = column.m_DataSourceId;
            m_DataSourcePrimaryKeys = column.m_DataSourcePrimaryKeys;
            m_LoadColumnDataSourceData = column.m_LoadColumnDataSourceData;
            m_FilterByColumn = column.m_FilterByColumn;
            m_EnableFilterByColumn = column.m_EnableFilterByColumn;
            m_Cssclass = column.m_Cssclass;
            m_CssclassTitle = column.m_CssclassTitle;

            m_Rowspan = column.m_Rowspan;
            m_NonBreaking = column.m_NonBreaking;
            m_AutoPostback = column.m_AutoPostback;
            m_ForcePostBack = column.m_ForcePostBack;

            m_NewRowInDetail = column.m_NewRowInDetail;
            m_NewRowInGrid = column.m_NewRowInGrid;

            m_PreDetailText = column.m_PreDetailText;
            m_PreGridText = column.m_PreGridText;
            m_PostDetailText = column.m_PostDetailText;
            m_PostGridText = column.m_PostGridText;
            m_HideDetailTitle = column.m_HideDetailTitle;
            TextTruncate = column.TextTruncate;
            UniqueValueRequired = column.UniqueValueRequired;
            m_Attributes = column.m_Attributes;
            m_MaskedInput = column.m_MaskedInput;
            m_DisableMaskedInput = column.m_DisableMaskedInput;

            m_TypeCode = column.m_TypeCode;
            Tag = column.Tag;

            SystemMessageStyle = column.SystemMessageStyle;
            SystemMessage = column.SystemMessage;
            ConfirmMessage = column.ConfirmMessage;
            ValidExpression = column.ValidExpression;
            m_HideIfEmpty = column.m_HideIfEmpty;
            IsCreatedByWebGrid = column.IsCreatedByWebGrid;
            m_AllowEditInGrid = column.m_AllowEditInGrid;
            m_GridModeEditTransparent = column.m_GridModeEditTransparent;
            m_TooltipEditTitle = column.m_TooltipEditTitle;
            m_TooltipGridHeaderTitle = column.m_TooltipGridHeaderTitle;
            m_ToolTipInput = column.m_ToolTipInput;
            m_DefaultDataSourceId = column.m_DefaultDataSourceId;
            m_defaultValue = column.m_defaultValue;
              /*  m_GridViewTemplate = column.m_GridViewTemplate;
            m_GridViewTemplateCache = column.m_GridViewTemplateCache;
            m_DetailViewTemplate = column.m_DetailViewTemplate;
            m_DetailViewTemplateCache = column.m_DetailViewTemplateCache;*/
        }
예제 #32
0
 internal void method_75(HorizontalPosition A_0)
 {
     base[8] = (short)A_0;
 }