Ejemplo n.º 1
0
 /// <summary>
 /// Merge this object with a source object using ambient object pattern merging rule
 /// </summary>
 public void Merge(Fill source)
 {
     if (mPaintAssigned == false) mPaint = source.mPaint;
     if (mOpacityAssigned == false) mOpacity = source.mOpacity;
     if (mFillingRuleAssigned == false) mFillingRule = source.mFillingRule;
     if (mTransformMatrixAssigned == false) mTransformMatrix = source.mTransformMatrix;
 }
Ejemplo n.º 2
0
        public Card(CardColor color, Shape shape, Fill fill, int count)
        {
            #region validation
            if (color == CardColor.Other)
            {
                throw new InvalidCardException("color", color);
            }
            if (shape == Shape.Other)
            {
                throw new InvalidCardException("shape", shape);
            }
            if (fill == Fill.Other)
            {
                throw new InvalidCardException("fill", fill);
            }
            if (count > 3 || count < 1)
            {
                throw new InvalidCardException("count", count);
            }
            #endregion validation

            this.Color = color;
            this.Shape = shape;
            this.Fill = fill;
            this.Count = count;
        }
 private static Fill CreateGrayFill()
 {
     var fill = new Fill();
     var patternFill = new PatternFill();
     patternFill.PatternType = PatternValues.Gray125;
     fill.PatternFill = patternFill;
     return fill;
 }
Ejemplo n.º 4
0
        public FillFeature(OverlayPlugin plugin, XmlNode node)
            : base(plugin, node)
        {
            mFill = GetEnum<Fill>(node, Fill.Full, LogManager.GetLogger("UnrealOverlay"), "Fill");

            mController = Manager.Frame.Output as UnrealController;
            if (mController == null)
                throw new Exception("Cannot use FillFeature, UnrealController is not the controller.");
        }
 private static Fill CreateColoredFill()
 {
     var fill = new Fill();
     var patternFill = new PatternFill();
     patternFill.PatternType = PatternValues.Solid;
     patternFill.ForegroundColor = new ForegroundColor();
     patternFill.BackgroundColor = new BackgroundColor();
     fill.PatternFill = patternFill;
     return fill;
 }
Ejemplo n.º 6
0
	public Vector3			projectionValue;	///< If projectionAxis is set to Instance, this is the value that will be used to project UV coordinates.
#endregion

#region INITIALIZATION

	public pb_UV()
	{
		projectionAxis = ProjectionAxis.AUTO;
		useWorldSpace = false;
		justify = Justify.None;
		flipU = false;
		flipV = false;
		swapUV = false;
		fill = Fill.Tile;
		scale = new Vector2(1f, 1f);
		offset = new Vector2(0f, 0f);
		rotation = 0f;
	}
Ejemplo n.º 7
0
	public pb_UV(pb_UV uvs)
	{
		projectionAxis = uvs.projectionAxis;
		useWorldSpace = uvs.useWorldSpace;
		flipU = uvs.flipU;
		flipV = uvs.flipV;
		swapUV = uvs.swapUV;
		fill = uvs.fill;
		scale = uvs.scale;
		offset = uvs.offset;
		rotation = uvs.rotation;
		justify = uvs.justify;
	}
Ejemplo n.º 8
0
        /// <summary>
        /// Create a new instance with same properties as this instance (shadow copy)
        /// <para>Notes: the cloned object will no longer be ambient object</para>
        /// </summary>
        public Fill Clone()
        {
            Fill result = new Fill();

            //deliberately assign using properties so that the properties
            //will no longer be ambient
            result.Paint = this.mPaint;
            result.Opacity = this.mOpacity;
            result.FillingRule = this.mFillingRule;
            result.TransformMatrix = this.mTransformMatrix;

            return result;
        }
Ejemplo n.º 9
0
	// The pb_SerializedMesh constructor is used to deserialize values. 
	public pb_UV(SerializationInfo info, StreamingContext context)
	{
		this.useWorldSpace			= (bool)		info.GetValue("useWorldSpace", 	typeof(bool));
		this.flipU					= (bool)		info.GetValue("flipU", 			typeof(bool));
		this.flipV					= (bool)		info.GetValue("flipV", 			typeof(bool));
		this.swapUV					= (bool)		info.GetValue("swapUV", 		typeof(bool));
		this.fill					= (Fill)		info.GetValue("fill", 			typeof(Fill));
		this.scale					= (Vector2) 	info.GetValue("scale", 			typeof(Vector2));
		this.offset					= (Vector2) 	info.GetValue("offset", 		typeof(Vector2));
		this.rotation				= (float)		info.GetValue("rotation", 		typeof(float));
		this.justify				= (Justify)		info.GetValue("justify", 		typeof(Justify));
		this.localPivot				= (Vector2)		info.GetValue("localPivot", 	typeof(Vector2));
		this.localSize				= (Vector2)		info.GetValue("localSize", 		typeof(Vector2));
	}
Ejemplo n.º 10
0
        public static void Distinct(ref DataTable dt)
        {
            // ForGroup By

            dt.Columns.Add("spid", typeof(string));

            List<Fill> iF = new List<Fill>();

            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                DataRow dr = dt.Rows[i];
                if (dt.Rows[i]["spid"].ToString() == "")
                {
                    dt.Rows[i]["spid"] = i + 1;
                    Fill f = new Fill();
                    f.spid = dt.Rows[i]["spid"].ToString();
                    iF.Add(f);
                }
                else
                    continue;
                for (int j = i; j < dt.Rows.Count; ++j)
                {
                    DataRow dr1 = dt.Rows[j];
                    if (dr["ProductId"].ToString() == dr1["ProductId"].ToString()
                        && dr["QuantityPack"].ToString() == dr1["QuantityPack"].ToString()
                        && dr["TotalQuantity"].ToString() == dr1["TotalQuantity"].ToString()
                        && dr["TotalWeight"].ToString() == dr1["TotalWeight"].ToString())
                    {
                        int count = iF.Where(q => q.spid == dr["spid"].ToString()).Count();
                        int quantityPk = Convert.ToInt32(dr["QuantityPack"]);
                        quantityPk = quantityPk == 0 ? 1:quantityPk;
                        if (count <= quantityPk)
                        {
                            dt.Rows[j]["spid"] = dr["spid"];
                            Fill f = new Fill();
                            f.spid = dr["spid"].ToString();
                            iF.Add(f);
                        }
                        else
                        {
                            dt.Rows[j]["spid"] = "0";
                        }
                    }
                }
            }

            dt = dt.Select("spid <> '0'").CopyToDataTable();
        }
Ejemplo n.º 11
0
        public RectangleShape(SVG svg, XmlNode node)
            : base(svg, node)
        {
            this.X = XmlUtil.AttrValue(node, "x", 0);
            this.Y = XmlUtil.AttrValue(node, "y", 0);
            this.Width = XmlUtil.AttrValue(node, "width", 0);
            this.Height = XmlUtil.AttrValue(node, "height", 0);
            this.RX = XmlUtil.AttrValue(node, "rx", 0);
            this.RY = XmlUtil.AttrValue(node, "ry", 0);

            if (DefaultFill == null)
            {
                DefaultFill = new Fill(svg);
                DefaultFill.Color = svg.PaintServers.Parse("black");
            }
        }
Ejemplo n.º 12
0
        public PolygonShape(SVG svg, XmlNode node)
            : base(svg, node)
        {
            if (DefaultFill == null)
            {
                DefaultFill = new Fill(svg);
                DefaultFill.Color = svg.PaintServers.Parse("black");
            }

            string points = XmlUtil.AttrValue(node, SVGTags.sPoints, string.Empty);
            ShapeUtil.StringSplitter split = new ShapeUtil.StringSplitter(points);
            List<Point> list = new List<Point>();
            while (split.More)
            {
                list.Add(split.ReadNextPoint());
            }
            this.Points = list.ToArray();
        }
 private UInt32Value GetFillPatternId(System.Drawing.Color color)
 {
     //TODO: enhance it
     if (!fillPatterns.ContainsKey(color))
     {
         var newindex = connection.Stylesheet.Fills.Count();
         connection.Stylesheet.Fills.Count = (UInt32Value)(uint)newindex + 1;
         fillPatterns.Add(color, (UInt32Value)(uint)newindex);
         var fill = new Fill(new PatternFill()
         {
             PatternType = PatternValues.Solid,
             BackgroundColor = new BackgroundColor() { Indexed = (UInt32Value)64U },
             ForegroundColor = new ForegroundColor() { Rgb = new HexBinaryValue(System.Drawing.ColorTranslator.ToHtml(color).Replace("#", "")) }
         });
         connection.Stylesheet.Fills.Append(fill);
         connection.DeferredSubmitStyle();
     }
     return fillPatterns[color];
 }
Ejemplo n.º 14
0
        public List<Card> GenerateCards()
        {
            List<Card> cards = new List<Card>();
            CardColor[] validColors = new CardColor[] { CardColor.Green, CardColor.Purple, CardColor.Red };
            Fill[] validFills = new Fill[] { Fill.Dashed, Fill.Open, Fill.Solid };
            Shape[] validShapes = new Shape[] { Shape.Diamond, Shape.Oval, Shape.Squiggle };
            int[] validCounts = new int[] { 1, 2, 3 };

            foreach (CardColor color in validColors)
            {
                foreach (Fill fill in validFills)
                {
                    foreach (Shape shape in validShapes)
                    {
                        foreach(int i in validCounts)
                        {
                            cards.Add(new Card(color, shape, fill, i));
                        }
                    }
                }
            }

            return cards;
        }
Ejemplo n.º 15
0
            // Generates content of workbookStylesPart1.
            private void GenerateWorkbookStylesPart1Content(WorkbookStylesPart workbookStylesPart1)
            {
                Stylesheet stylesheet1 = new Stylesheet()
                {
                    MCAttributes = new MarkupCompatibilityAttributes()
                    {
                        Ignorable = "x14ac"
                    }
                };

                stylesheet1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
                stylesheet1.AddNamespaceDeclaration("x14ac", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");

                Fonts fonts1 = new Fonts()
                {
                    Count = (UInt32Value)1U, KnownFonts = true
                };

                Font     font1     = new Font();
                FontSize fontSize1 = new FontSize()
                {
                    Val = 11D
                };
                Color color1 = new Color()
                {
                    Theme = (UInt32Value)1U
                };
                FontName fontName1 = new FontName()
                {
                    Val = "Calibri"
                };
                FontFamilyNumbering fontFamilyNumbering1 = new FontFamilyNumbering()
                {
                    Val = 2
                };
                FontScheme fontScheme1 = new FontScheme()
                {
                    Val = FontSchemeValues.Minor
                };

                font1.Append(fontSize1);
                font1.Append(color1);
                font1.Append(fontName1);
                font1.Append(fontFamilyNumbering1);
                font1.Append(fontScheme1);

                fonts1.Append(font1);

                Fills fills1 = new Fills()
                {
                    Count = (UInt32Value)2U
                };

                Fill        fill1        = new Fill();
                PatternFill patternFill1 = new PatternFill()
                {
                    PatternType = PatternValues.None
                };

                fill1.Append(patternFill1);

                Fill        fill2        = new Fill();
                PatternFill patternFill2 = new PatternFill()
                {
                    PatternType = PatternValues.Gray125
                };

                fill2.Append(patternFill2);

                fills1.Append(fill1);
                fills1.Append(fill2);

                Borders borders1 = new Borders()
                {
                    Count = (UInt32Value)1U
                };

                Border         border1         = new Border();
                LeftBorder     leftBorder1     = new LeftBorder();
                RightBorder    rightBorder1    = new RightBorder();
                TopBorder      topBorder1      = new TopBorder();
                BottomBorder   bottomBorder1   = new BottomBorder();
                DiagonalBorder diagonalBorder1 = new DiagonalBorder();

                border1.Append(leftBorder1);
                border1.Append(rightBorder1);
                border1.Append(topBorder1);
                border1.Append(bottomBorder1);
                border1.Append(diagonalBorder1);

                borders1.Append(border1);

                CellStyleFormats cellStyleFormats1 = new CellStyleFormats()
                {
                    Count = (UInt32Value)1U
                };
                CellFormat cellFormat1 = new CellFormat()
                {
                    NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U
                };

                cellStyleFormats1.Append(cellFormat1);

                CellFormats cellFormats1 = new CellFormats()
                {
                    Count = (UInt32Value)1U
                };
                CellFormat cellFormat2 = new CellFormat()
                {
                    NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
                };

                cellFormats1.Append(cellFormat2);

                CellStyles cellStyles1 = new CellStyles()
                {
                    Count = (UInt32Value)1U
                };
                CellStyle cellStyle1 = new CellStyle()
                {
                    Name = "Normal", FormatId = (UInt32Value)0U, BuiltinId = (UInt32Value)0U
                };

                cellStyles1.Append(cellStyle1);
                DifferentialFormats differentialFormats1 = new DifferentialFormats()
                {
                    Count = (UInt32Value)0U
                };
                TableStyles tableStyles1 = new TableStyles()
                {
                    Count = (UInt32Value)0U, DefaultTableStyle = "TableStyleMedium2", DefaultPivotStyle = "PivotStyleLight16"
                };

                stylesheet1.Append(fonts1);
                stylesheet1.Append(fills1);
                stylesheet1.Append(borders1);
                stylesheet1.Append(cellStyleFormats1);
                stylesheet1.Append(cellFormats1);
                stylesheet1.Append(cellStyles1);
                stylesheet1.Append(differentialFormats1);
                stylesheet1.Append(tableStyles1);

                workbookStylesPart1.Stylesheet = stylesheet1;
            }
Ejemplo n.º 16
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Values != null)
         {
             hashCode = hashCode * 59 + Values.GetHashCode();
         }
         if (Format != null)
         {
             hashCode = hashCode * 59 + Format.GetHashCode();
         }
         if (Prefix != null)
         {
             hashCode = hashCode * 59 + Prefix.GetHashCode();
         }
         if (PrefixArray != null)
         {
             hashCode = hashCode * 59 + PrefixArray.GetHashCode();
         }
         if (Suffix != null)
         {
             hashCode = hashCode * 59 + Suffix.GetHashCode();
         }
         if (SuffixArray != null)
         {
             hashCode = hashCode * 59 + SuffixArray.GetHashCode();
         }
         if (Height != null)
         {
             hashCode = hashCode * 59 + Height.GetHashCode();
         }
         if (Align != null)
         {
             hashCode = hashCode * 59 + Align.GetHashCode();
         }
         if (AlignArray != null)
         {
             hashCode = hashCode * 59 + AlignArray.GetHashCode();
         }
         if (Line != null)
         {
             hashCode = hashCode * 59 + Line.GetHashCode();
         }
         if (Fill != null)
         {
             hashCode = hashCode * 59 + Fill.GetHashCode();
         }
         if (Font != null)
         {
             hashCode = hashCode * 59 + Font.GetHashCode();
         }
         if (ValuesSrc != null)
         {
             hashCode = hashCode * 59 + ValuesSrc.GetHashCode();
         }
         if (FormatSrc != null)
         {
             hashCode = hashCode * 59 + FormatSrc.GetHashCode();
         }
         if (PrefixSrc != null)
         {
             hashCode = hashCode * 59 + PrefixSrc.GetHashCode();
         }
         if (SuffixSrc != null)
         {
             hashCode = hashCode * 59 + SuffixSrc.GetHashCode();
         }
         if (AlignSrc != null)
         {
             hashCode = hashCode * 59 + AlignSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 17
0
 public void VRModeOff()
 {
     Background.GetComponent <Image> ().sprite = OffSprite;
     Fill.GetComponent <Image> ().sprite       = OffSpriteGazed;
 }
Ejemplo n.º 18
0
        public override void Measure(
            CartesianChart <TDrawingContext> chart, IAxis <TDrawingContext> secondaryAxis, IAxis <TDrawingContext> primaryAxis)
        {
            var drawLocation   = chart.DrawMaringLocation;
            var drawMarginSize = chart.DrawMarginSize;
            var secondaryScale = new Scaler(
                drawLocation, drawMarginSize, secondaryAxis.Orientation, secondaryAxis.DataBounds, secondaryAxis.IsInverted);
            var primaryScale = new Scaler(
                drawLocation, drawMarginSize, primaryAxis.Orientation, primaryAxis.DataBounds, primaryAxis.IsInverted);

            float uw  = secondaryScale.ToPixels(1f) - secondaryScale.ToPixels(0f);
            float uwm = 0.5f * uw;
            float sw  = Stroke?.StrokeThickness ?? 0;
            float p   = primaryScale.ToPixels(pivot);

            var   pos   = chart.SeriesContext.GetStackedColumnPostion(this);
            var   count = chart.SeriesContext.GetStackedColumnSeriesCount();
            float cp    = 0f;

            if (count > 1)
            {
                uw  = uw / count;
                uwm = 0.5f * uw;
                cp  = (pos - count / 2f) * uw + uwm;
            }

            if (uw > MaxBarWidth)
            {
                uw  = unchecked ((float)MaxBarWidth);
                uwm = uw / 2f;
            }

            var actualZIndex = ZIndex == 0 ? ((ISeries)this).SeriesId : ZIndex;

            if (Fill != null)
            {
                Fill.ZIndex = actualZIndex + 0.1;
                chart.Canvas.AddDrawableTask(Fill);
            }
            if (Stroke != null)
            {
                Stroke.ZIndex = actualZIndex + 0.2;
                chart.Canvas.AddDrawableTask(Stroke);
            }
            if (DataLabelsDrawableTask != null)
            {
                DataLabelsDrawableTask.ZIndex = actualZIndex + 0.3;
                chart.Canvas.AddDrawableTask(DataLabelsDrawableTask);
            }
            var dls = unchecked ((float)DataLabelsSize);

            var stacker = chart.SeriesContext.GetStackPosition(this, GetStackGroup());

            if (stacker == null)
            {
                throw new NullReferenceException("Unexpected null stacker");
            }

            foreach (var point in Fetch(chart))
            {
                var visual    = point.Context.Visual as TVisual;
                var secondary = secondaryScale.ToPixels(point.SecondaryValue);

                if (point.IsNull)
                {
                    if (visual != null)
                    {
                        visual.X                 = secondary - uwm + cp;
                        visual.Y                 = p;
                        visual.Width             = uw;
                        visual.Height            = 0;
                        visual.RemoveOnCompleted = true;
                        point.Context.Visual     = null;
                    }
                    continue;
                }

                if (visual == null)
                {
                    var r = new TVisual
                    {
                        X      = secondary - uwm + cp,
                        Y      = p,
                        Width  = uw,
                        Height = 0
                    };

                    visual = r;
                    point.Context.Visual = visual;
                    OnPointCreated(point);
                    r.CompleteAllTransitions();

                    if (Fill != null)
                    {
                        Fill.AddGeometyToPaintTask(r);
                    }
                    if (Stroke != null)
                    {
                        Stroke.AddGeometyToPaintTask(r);
                    }
                }

                var sizedGeometry = visual;

                var sy       = stacker.GetStack(point);
                var primaryI = primaryScale.ToPixels(sy.Start);
                var primaryJ = primaryScale.ToPixels(sy.End);
                var x        = secondary - uwm + cp;

                sizedGeometry.X                 = x;
                sizedGeometry.Y                 = primaryJ;
                sizedGeometry.Width             = uw;
                sizedGeometry.Height            = primaryI - primaryJ;
                sizedGeometry.RemoveOnCompleted = false;

                point.Context.HoverArea = new RectangleHoverArea().SetDimensions(secondary - uwm + cp, primaryJ, uw, primaryI - primaryJ);

                OnPointMeasured(point);
                chart.MeasuredDrawables.Add(sizedGeometry);

                if (DataLabelsDrawableTask != null)
                {
                    var label = point.Context.Label as TLabel;

                    if (label == null)
                    {
                        var l = new TLabel {
                            X = secondary - uwm + cp, Y = p
                        };

                        l.TransitionateProperties(nameof(l.X), nameof(l.Y))
                        .WithAnimation(a =>
                                       a.WithDuration(chart.AnimationsSpeed)
                                       .WithEasingFunction(chart.EasingFunction));

                        l.CompleteAllTransitions();
                        label = l;
                        point.Context.Label = label;
                        DataLabelsDrawableTask.AddGeometyToPaintTask(l);
                    }

                    label.Text     = DataLabelFormatter(point);
                    label.TextSize = dls;
                    label.Padding  = DataLabelsPadding;
                    var labelPosition = GetLabelPosition(
                        x, primaryJ, uw, primaryI - primaryJ, label.Measure(DataLabelsDrawableTask), DataLabelsPosition,
                        SeriesProperties, point.PrimaryValue > Pivot);
                    label.X = labelPosition.X;
                    label.Y = labelPosition.Y;

                    chart.MeasuredDrawables.Add(label);
                }
            }
        }
Ejemplo n.º 19
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="reader"></param>
 public override void Deserialize(FRReader reader)
 {
     base.Deserialize(reader);
     Fill.Deserialize(reader, "Fill");
 }
Ejemplo n.º 20
0
        private void OpenFill_button_Click(object sender, EventArgs e)
        {
            Fill f = new Fill();

            f.Show();
        }
Ejemplo n.º 21
0
 /// <summary>
 /// Performs a finalization after the report is finished.
 /// </summary>
 /// <remarks>
 /// This method is used by the report engine, do not call it directly.
 /// </remarks>
 public virtual void FinalizeComponent()
 {
     Fill.FinalizeComponent();
 }
Ejemplo n.º 22
0
        public bool Equals([AllowNull] ScatterCarpet other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (ShowLegend == other.ShowLegend && ShowLegend != null && other.ShowLegend != null && ShowLegend.Equals(other.ShowLegend)) &&
                   (LegendGroup == other.LegendGroup && LegendGroup != null && other.LegendGroup != null && LegendGroup.Equals(other.LegendGroup)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (SelectedPoints == other.SelectedPoints && SelectedPoints != null && other.SelectedPoints != null && SelectedPoints.Equals(other.SelectedPoints)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Carpet == other.Carpet && Carpet != null && other.Carpet != null && Carpet.Equals(other.Carpet)) &&
                   (Equals(A, other.A) || A != null && other.A != null && A.SequenceEqual(other.A)) &&
                   (Equals(B, other.B) || B != null && other.B != null && B.SequenceEqual(other.B)) &&
                   (Mode == other.Mode && Mode != null && other.Mode != null && Mode.Equals(other.Mode)) &&
                   (Text == other.Text && Text != null && other.Text != null && Text.Equals(other.Text)) &&
                   (Equals(TextArray, other.TextArray) || TextArray != null && other.TextArray != null && TextArray.SequenceEqual(other.TextArray)) &&
                   (TextTemplate == other.TextTemplate && TextTemplate != null && other.TextTemplate != null && TextTemplate.Equals(other.TextTemplate)) &&
                   (Equals(TextTemplateArray, other.TextTemplateArray) || TextTemplateArray != null && other.TextTemplateArray != null && TextTemplateArray.SequenceEqual(other.TextTemplateArray)) &&
                   (HoverText == other.HoverText && HoverText != null && other.HoverText != null && HoverText.Equals(other.HoverText)) &&
                   (Equals(HoverTextArray, other.HoverTextArray) || HoverTextArray != null && other.HoverTextArray != null && HoverTextArray.SequenceEqual(other.HoverTextArray)) &&
                   (Line == other.Line && Line != null && other.Line != null && Line.Equals(other.Line)) &&
                   (ConnectGaps == other.ConnectGaps && ConnectGaps != null && other.ConnectGaps != null && ConnectGaps.Equals(other.ConnectGaps)) &&
                   (Fill == other.Fill && Fill != null && other.Fill != null && Fill.Equals(other.Fill)) &&
                   (FillColor == other.FillColor && FillColor != null && other.FillColor != null && FillColor.Equals(other.FillColor)) &&
                   (Marker == other.Marker && Marker != null && other.Marker != null && Marker.Equals(other.Marker)) &&
                   (TextFont == other.TextFont && TextFont != null && other.TextFont != null && TextFont.Equals(other.TextFont)) &&
                   (TextPosition == other.TextPosition && TextPosition != null && other.TextPosition != null && TextPosition.Equals(other.TextPosition)) &&
                   (Equals(TextPositionArray, other.TextPositionArray) || TextPositionArray != null && other.TextPositionArray != null && TextPositionArray.SequenceEqual(other.TextPositionArray)) &&
                   (Selected == other.Selected && Selected != null && other.Selected != null && Selected.Equals(other.Selected)) &&
                   (Unselected == other.Unselected && Unselected != null && other.Unselected != null && Unselected.Equals(other.Unselected)) &&
                   (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) &&
                   (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) &&
                   (HoverOn == other.HoverOn && HoverOn != null && other.HoverOn != null && HoverOn.Equals(other.HoverOn)) &&
                   (HoverTemplate == other.HoverTemplate && HoverTemplate != null && other.HoverTemplate != null && HoverTemplate.Equals(other.HoverTemplate)) &&
                   (Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                    HoverTemplateArray != null && other.HoverTemplateArray != null && HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)) &&
                   (XAxis == other.XAxis && XAxis != null && other.XAxis != null && XAxis.Equals(other.XAxis)) &&
                   (YAxis == other.YAxis && YAxis != null && other.YAxis != null && YAxis.Equals(other.YAxis)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (ASrc == other.ASrc && ASrc != null && other.ASrc != null && ASrc.Equals(other.ASrc)) &&
                   (BSrc == other.BSrc && BSrc != null && other.BSrc != null && BSrc.Equals(other.BSrc)) &&
                   (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)) &&
                   (TextTemplateSrc == other.TextTemplateSrc && TextTemplateSrc != null && other.TextTemplateSrc != null && TextTemplateSrc.Equals(other.TextTemplateSrc)) &&
                   (HoverTextSrc == other.HoverTextSrc && HoverTextSrc != null && other.HoverTextSrc != null && HoverTextSrc.Equals(other.HoverTextSrc)) &&
                   (TextPositionSrc == other.TextPositionSrc && TextPositionSrc != null && other.TextPositionSrc != null && TextPositionSrc.Equals(other.TextPositionSrc)) &&
                   (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) &&
                   (HoverTemplateSrc == other.HoverTemplateSrc && HoverTemplateSrc != null && other.HoverTemplateSrc != null && HoverTemplateSrc.Equals(other.HoverTemplateSrc)));
        }
Ejemplo n.º 23
0
        private int GetIdFill(eStyleClass styleClass, eStyleProperty styleProperty, object value)
        {
            ExcelFillXml fill = Fill.Copy();

            switch (styleProperty)
            {
            case eStyleProperty.PatternType:
                if (fill is ExcelGradientFillXml)
                {
                    fill = new ExcelFillXml(NameSpaceManager);
                }
                fill.PatternType = (ExcelFillStyle)value;
                break;

            case eStyleProperty.Color:
            case eStyleProperty.Tint:
            case eStyleProperty.IndexedColor:
            case eStyleProperty.AutoColor:
                if (fill is ExcelGradientFillXml)
                {
                    fill = new ExcelFillXml(NameSpaceManager);
                }
                if (fill.PatternType == ExcelFillStyle.None)
                {
                    throw (new ArgumentException("Can't set color when patterntype is not set."));
                }
                ExcelColorXml destColor;
                if (styleClass == eStyleClass.FillPatternColor)
                {
                    destColor = fill.PatternColor;
                }
                else
                {
                    destColor = fill.BackgroundColor;
                }

                if (styleProperty == eStyleProperty.Color)
                {
                    destColor.Rgb = value.ToString();
                }
                else if (styleProperty == eStyleProperty.Tint)
                {
                    destColor.Tint = (decimal)value;
                }
                else if (styleProperty == eStyleProperty.IndexedColor)
                {
                    destColor.Indexed = (int)value;
                }
                else
                {
                    destColor.Auto = (bool)value;
                }

                break;

            default:
                throw (new ArgumentException("Invalid class/property for class Fill."));
            }
            int    subId;
            string id = fill.Id;

            subId = _styles.Fills.FindIndexByID(id);
            if (subId == int.MinValue)
            {
                return(_styles.Fills.Add(id, fill));
            }
            return(subId);
        }
Ejemplo n.º 24
0
        private int GetIdGradientFill(eStyleClass styleClass, eStyleProperty styleProperty, object value)
        {
            ExcelGradientFillXml fill;

            if (Fill is ExcelGradientFillXml)
            {
                fill = (ExcelGradientFillXml)Fill.Copy();
            }
            else
            {
                fill = new ExcelGradientFillXml(Fill.NameSpaceManager);
                fill.GradientColor1.SetColor(Color.White);
                fill.GradientColor2.SetColor(Color.FromArgb(79, 129, 189));
                fill.Type   = ExcelFillGradientType.Linear;
                fill.Degree = 90;
                fill.Top    = double.NaN;
                fill.Bottom = double.NaN;
                fill.Left   = double.NaN;
                fill.Right  = double.NaN;
            }

            switch (styleProperty)
            {
            case eStyleProperty.GradientType:
                fill.Type = (ExcelFillGradientType)value;
                break;

            case eStyleProperty.GradientDegree:
                fill.Degree = (double)value;
                break;

            case eStyleProperty.GradientTop:
                fill.Top = (double)value;
                break;

            case eStyleProperty.GradientBottom:
                fill.Bottom = (double)value;
                break;

            case eStyleProperty.GradientLeft:
                fill.Left = (double)value;
                break;

            case eStyleProperty.GradientRight:
                fill.Right = (double)value;
                break;

            case eStyleProperty.Color:
            case eStyleProperty.Tint:
            case eStyleProperty.IndexedColor:
            case eStyleProperty.AutoColor:
                ExcelColorXml destColor;

                if (styleClass == eStyleClass.FillGradientColor1)
                {
                    destColor = fill.GradientColor1;
                }
                else
                {
                    destColor = fill.GradientColor2;
                }

                if (styleProperty == eStyleProperty.Color)
                {
                    destColor.Rgb = value.ToString();
                }
                else if (styleProperty == eStyleProperty.Tint)
                {
                    destColor.Tint = (decimal)value;
                }
                else if (styleProperty == eStyleProperty.IndexedColor)
                {
                    destColor.Indexed = (int)value;
                }
                else
                {
                    destColor.Auto = (bool)value;
                }
                break;

            default:
                throw (new ArgumentException("Invalid class/property for class Fill."));
            }
            int    subId;
            string id = fill.Id;

            subId = _styles.Fills.FindIndexByID(id);
            if (subId == int.MinValue)
            {
                return(_styles.Fills.Add(id, fill));
            }
            return(subId);
        }
Ejemplo n.º 25
0
        /// <inheritdoc cref="ChartElement{TDrawingContext}.Measure(Chart{TDrawingContext})"/>
        public override void Measure(Chart <TDrawingContext> chart)
        {
            var cartesianChart = (CartesianChart <TDrawingContext>)chart;
            var primaryAxis    = cartesianChart.YAxes[ScalesYAt];
            var secondaryAxis  = cartesianChart.XAxes[ScalesXAt];

            var drawLocation           = cartesianChart.DrawMarginLocation;
            var drawMarginSize         = cartesianChart.DrawMarginSize;
            var secondaryScale         = new Scaler(drawLocation, drawMarginSize, primaryAxis);
            var previousSecondaryScale =
                primaryAxis.PreviousDataBounds is null ? null : new Scaler(drawLocation, drawMarginSize, primaryAxis);
            var primaryScale = new Scaler(drawLocation, drawMarginSize, secondaryAxis);

            var uw  = secondaryScale.MeasureInPixels(secondaryAxis.UnitWidth); //secondaryScale.ToPixels(1f) - secondaryScale.ToPixels(0f);
            var uwm = 0.5f * uw;
            var sw  = Stroke?.StrokeThickness ?? 0;
            var p   = primaryScale.ToPixels(pivot);

            var pos   = cartesianChart.SeriesContext.GetStackedColumnPostion(this);
            var count = cartesianChart.SeriesContext.GetStackedColumnSeriesCount();
            var cp    = 0f;

            if (count > 1)
            {
                uw /= count;
                uwm = 0.5f * uw;
                cp  = (pos - count / 2f) * uw + uwm;
            }

            if (uw > MaxBarWidth)
            {
                uw  = (float)MaxBarWidth;
                uwm = uw / 2f;
            }

            var actualZIndex = ZIndex == 0 ? ((ISeries)this).SeriesId : ZIndex;

            if (Fill is not null)
            {
                Fill.ZIndex = actualZIndex + 0.1;
                Fill.SetClipRectangle(cartesianChart.Canvas, new LvcRectangle(drawLocation, drawMarginSize));
                cartesianChart.Canvas.AddDrawableTask(Fill);
            }
            if (Stroke is not null)
            {
                Stroke.ZIndex = actualZIndex + 0.2;
                Stroke.SetClipRectangle(cartesianChart.Canvas, new LvcRectangle(drawLocation, drawMarginSize));
                cartesianChart.Canvas.AddDrawableTask(Stroke);
            }
            if (DataLabelsPaint is not null)
            {
                DataLabelsPaint.ZIndex = actualZIndex + 0.3;
                DataLabelsPaint.SetClipRectangle(cartesianChart.Canvas, new LvcRectangle(drawLocation, drawMarginSize));
                cartesianChart.Canvas.AddDrawableTask(DataLabelsPaint);
            }
            var dls            = (float)DataLabelsSize;
            var toDeletePoints = new HashSet <ChartPoint>(everFetched);

            var stacker = cartesianChart.SeriesContext.GetStackPosition(this, GetStackGroup());

            if (stacker is null)
            {
                throw new NullReferenceException("Unexpected null stacker");
            }

            var rx = (float)Rx;
            var ry = (float)Ry;

            foreach (var point in Fetch(cartesianChart))
            {
                var visual    = point.Context.Visual as TVisual;
                var secondary = secondaryScale.ToPixels(point.SecondaryValue);

                if (point.IsNull)
                {
                    if (visual is not null)
                    {
                        visual.X                 = p;
                        visual.Y                 = secondary - uwm + cp;
                        visual.Width             = 0;
                        visual.Height            = uw;
                        visual.RemoveOnCompleted = true;
                        point.Context.Visual     = null;
                    }
                    continue;
                }

                if (visual is null)
                {
                    var yi = secondary - uwm + cp;
                    if (previousSecondaryScale is not null)
                    {
                        yi = previousSecondaryScale.ToPixels(point.SecondaryValue) - uwm + cp;
                    }

                    var r = new TVisual
                    {
                        X      = p,
                        Y      = yi,
                        Width  = 0,
                        Height = uw,
                        Rx     = rx,
                        Ry     = ry
                    };

                    visual = r;
                    point.Context.Visual = visual;
                    OnPointCreated(point);

                    _ = everFetched.Add(point);
                }

                if (Fill is not null)
                {
                    Fill.AddGeometryToPaintTask(cartesianChart.Canvas, visual);
                }
                if (Stroke is not null)
                {
                    Stroke.AddGeometryToPaintTask(cartesianChart.Canvas, visual);
                }

                var sizedGeometry = visual;

                var sy       = stacker.GetStack(point);
                var primaryI = primaryScale.ToPixels(sy.Start);
                var primaryJ = primaryScale.ToPixels(sy.End);
                var y        = secondary - uwm + cp;

                sizedGeometry.X                 = primaryJ;
                sizedGeometry.Y                 = y;
                sizedGeometry.Width             = primaryI - primaryJ;
                sizedGeometry.Height            = uw;
                sizedGeometry.Rx                = rx;
                sizedGeometry.Ry                = ry;
                sizedGeometry.RemoveOnCompleted = false;

                point.Context.HoverArea = new RectangleHoverArea().SetDimensions(secondary - uwm + cp, primaryJ, uw, primaryI - primaryJ);

                OnPointMeasured(point);
                _ = toDeletePoints.Remove(point);

                if (DataLabelsPaint is not null)
                {
                    var label = (TLabel?)point.Context.Label;

                    if (label is null)
                    {
                        var l = new TLabel {
                            X = secondary - uwm + cp, Y = p
                        };

                        _ = l.TransitionateProperties(nameof(l.X), nameof(l.Y))
                            .WithAnimation(animation =>
                                           animation
                                           .WithDuration(AnimationsSpeed ?? cartesianChart.AnimationsSpeed)
                                           .WithEasingFunction(EasingFunction ?? cartesianChart.EasingFunction));

                        l.CompleteAllTransitions();
                        label = l;
                        point.Context.Label = label;
                    }

                    DataLabelsPaint.AddGeometryToPaintTask(cartesianChart.Canvas, label);
                    label.Text     = DataLabelsFormatter(new TypedChartPoint <TModel, TVisual, TLabel, TDrawingContext>(point));
                    label.TextSize = dls;
                    label.Padding  = DataLabelsPadding;
                    var labelPosition = GetLabelPosition(
                        primaryJ, y, primaryI - primaryJ, uw, label.Measure(DataLabelsPaint), DataLabelsPosition, SeriesProperties, point.PrimaryValue > Pivot);
                    label.X = labelPosition.X;
                    label.Y = labelPosition.Y;
                }
            }

            foreach (var point in toDeletePoints)
            {
                if (point.Context.Chart != cartesianChart.View)
                {
                    continue;
                }
                SoftDeleteOrDisposePoint(point, primaryScale, secondaryScale);
                _ = everFetched.Remove(point);
            }
        }
Ejemplo n.º 26
0
 public System.Drawing.Brush GetGdiPlusFillBrush(double?opacity = null)
 {
     return(Fill.AsGdiBrush(opacity));
 }
Ejemplo n.º 27
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Type != null)
                {
                    hashCode = hashCode * 59 + Type.GetHashCode();
                }

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (ShowLegend != null)
                {
                    hashCode = hashCode * 59 + ShowLegend.GetHashCode();
                }

                if (LegendGroup != null)
                {
                    hashCode = hashCode * 59 + LegendGroup.GetHashCode();
                }

                if (Opacity != null)
                {
                    hashCode = hashCode * 59 + Opacity.GetHashCode();
                }

                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }

                if (UId != null)
                {
                    hashCode = hashCode * 59 + UId.GetHashCode();
                }

                if (Ids != null)
                {
                    hashCode = hashCode * 59 + Ids.GetHashCode();
                }

                if (CustomData != null)
                {
                    hashCode = hashCode * 59 + CustomData.GetHashCode();
                }

                if (Meta != null)
                {
                    hashCode = hashCode * 59 + Meta.GetHashCode();
                }

                if (MetaArray != null)
                {
                    hashCode = hashCode * 59 + MetaArray.GetHashCode();
                }

                if (SelectedPoints != null)
                {
                    hashCode = hashCode * 59 + SelectedPoints.GetHashCode();
                }

                if (HoverLabel != null)
                {
                    hashCode = hashCode * 59 + HoverLabel.GetHashCode();
                }

                if (Stream != null)
                {
                    hashCode = hashCode * 59 + Stream.GetHashCode();
                }

                if (Transforms != null)
                {
                    hashCode = hashCode * 59 + Transforms.GetHashCode();
                }

                if (UiRevision != null)
                {
                    hashCode = hashCode * 59 + UiRevision.GetHashCode();
                }

                if (Carpet != null)
                {
                    hashCode = hashCode * 59 + Carpet.GetHashCode();
                }

                if (A != null)
                {
                    hashCode = hashCode * 59 + A.GetHashCode();
                }

                if (B != null)
                {
                    hashCode = hashCode * 59 + B.GetHashCode();
                }

                if (Mode != null)
                {
                    hashCode = hashCode * 59 + Mode.GetHashCode();
                }

                if (Text != null)
                {
                    hashCode = hashCode * 59 + Text.GetHashCode();
                }

                if (TextArray != null)
                {
                    hashCode = hashCode * 59 + TextArray.GetHashCode();
                }

                if (TextTemplate != null)
                {
                    hashCode = hashCode * 59 + TextTemplate.GetHashCode();
                }

                if (TextTemplateArray != null)
                {
                    hashCode = hashCode * 59 + TextTemplateArray.GetHashCode();
                }

                if (HoverText != null)
                {
                    hashCode = hashCode * 59 + HoverText.GetHashCode();
                }

                if (HoverTextArray != null)
                {
                    hashCode = hashCode * 59 + HoverTextArray.GetHashCode();
                }

                if (Line != null)
                {
                    hashCode = hashCode * 59 + Line.GetHashCode();
                }

                if (ConnectGaps != null)
                {
                    hashCode = hashCode * 59 + ConnectGaps.GetHashCode();
                }

                if (Fill != null)
                {
                    hashCode = hashCode * 59 + Fill.GetHashCode();
                }

                if (FillColor != null)
                {
                    hashCode = hashCode * 59 + FillColor.GetHashCode();
                }

                if (Marker != null)
                {
                    hashCode = hashCode * 59 + Marker.GetHashCode();
                }

                if (TextFont != null)
                {
                    hashCode = hashCode * 59 + TextFont.GetHashCode();
                }

                if (TextPosition != null)
                {
                    hashCode = hashCode * 59 + TextPosition.GetHashCode();
                }

                if (TextPositionArray != null)
                {
                    hashCode = hashCode * 59 + TextPositionArray.GetHashCode();
                }

                if (Selected != null)
                {
                    hashCode = hashCode * 59 + Selected.GetHashCode();
                }

                if (Unselected != null)
                {
                    hashCode = hashCode * 59 + Unselected.GetHashCode();
                }

                if (HoverInfo != null)
                {
                    hashCode = hashCode * 59 + HoverInfo.GetHashCode();
                }

                if (HoverInfoArray != null)
                {
                    hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
                }

                if (HoverOn != null)
                {
                    hashCode = hashCode * 59 + HoverOn.GetHashCode();
                }

                if (HoverTemplate != null)
                {
                    hashCode = hashCode * 59 + HoverTemplate.GetHashCode();
                }

                if (HoverTemplateArray != null)
                {
                    hashCode = hashCode * 59 + HoverTemplateArray.GetHashCode();
                }

                if (XAxis != null)
                {
                    hashCode = hashCode * 59 + XAxis.GetHashCode();
                }

                if (YAxis != null)
                {
                    hashCode = hashCode * 59 + YAxis.GetHashCode();
                }

                if (IdsSrc != null)
                {
                    hashCode = hashCode * 59 + IdsSrc.GetHashCode();
                }

                if (CustomDataSrc != null)
                {
                    hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
                }

                if (MetaSrc != null)
                {
                    hashCode = hashCode * 59 + MetaSrc.GetHashCode();
                }

                if (ASrc != null)
                {
                    hashCode = hashCode * 59 + ASrc.GetHashCode();
                }

                if (BSrc != null)
                {
                    hashCode = hashCode * 59 + BSrc.GetHashCode();
                }

                if (TextSrc != null)
                {
                    hashCode = hashCode * 59 + TextSrc.GetHashCode();
                }

                if (TextTemplateSrc != null)
                {
                    hashCode = hashCode * 59 + TextTemplateSrc.GetHashCode();
                }

                if (HoverTextSrc != null)
                {
                    hashCode = hashCode * 59 + HoverTextSrc.GetHashCode();
                }

                if (TextPositionSrc != null)
                {
                    hashCode = hashCode * 59 + TextPositionSrc.GetHashCode();
                }

                if (HoverInfoSrc != null)
                {
                    hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
                }

                if (HoverTemplateSrc != null)
                {
                    hashCode = hashCode * 59 + HoverTemplateSrc.GetHashCode();
                }

                return(hashCode);
            }
        }
Ejemplo n.º 28
0
        private static void GenerateWorkbookStylesPartContent(WorkbookStylesPart workbookStylesPart1)
        {
            Stylesheet stylesheet1 = new Stylesheet()
            {
                MCAttributes = new MarkupCompatibilityAttributes()
                {
                    Ignorable = "x14ac x16r2 xr"
                }
            };

            stylesheet1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            stylesheet1.AddNamespaceDeclaration("x14ac", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");
            stylesheet1.AddNamespaceDeclaration("x16r2", "http://schemas.microsoft.com/office/spreadsheetml/2015/02/main");
            stylesheet1.AddNamespaceDeclaration("xr", "http://schemas.microsoft.com/office/spreadsheetml/2014/revision");

            Fonts fonts1 = new Fonts()
            {
                Count = (UInt32Value)1U, KnownFonts = true
            };

            Font     font1     = new Font();
            FontSize fontSize1 = new FontSize()
            {
                Val = 11D
            };
            Color color1 = new Color()
            {
                Theme = (UInt32Value)1U
            };
            FontName fontName1 = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering fontFamilyNumbering1 = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme fontScheme1 = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            font1.Append(fontSize1);
            font1.Append(color1);
            font1.Append(fontName1);
            font1.Append(fontFamilyNumbering1);
            font1.Append(fontScheme1);

            fonts1.Append(font1);

            Fills fills1 = new Fills()
            {
                Count = (UInt32Value)2U
            };

            Fill        fill1        = new Fill();
            PatternFill patternFill1 = new PatternFill()
            {
                PatternType = PatternValues.None
            };

            fill1.Append(patternFill1);

            Fill        fill2        = new Fill();
            PatternFill patternFill2 = new PatternFill()
            {
                PatternType = PatternValues.Gray125
            };

            fill2.Append(patternFill2);

            fills1.Append(fill1);
            fills1.Append(fill2);

            Borders borders1 = new Borders()
            {
                Count = (UInt32Value)1U
            };

            Border         border1         = new Border();
            LeftBorder     leftBorder1     = new LeftBorder();
            RightBorder    rightBorder1    = new RightBorder();
            TopBorder      topBorder1      = new TopBorder();
            BottomBorder   bottomBorder1   = new BottomBorder();
            DiagonalBorder diagonalBorder1 = new DiagonalBorder();

            border1.Append(leftBorder1);
            border1.Append(rightBorder1);
            border1.Append(topBorder1);
            border1.Append(bottomBorder1);
            border1.Append(diagonalBorder1);

            borders1.Append(border1);

            CellStyleFormats cellStyleFormats1 = new CellStyleFormats()
            {
                Count = (UInt32Value)1U
            };
            CellFormat cellFormat1 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U
            };

            cellStyleFormats1.Append(cellFormat1);

            CellFormats cellFormats1 = new CellFormats()
            {
                Count = (UInt32Value)2U
            };
            CellFormat cellFormat2 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            CellFormat cellFormat3 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)14U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true
            };

            cellFormats1.Append(cellFormat2);
            cellFormats1.Append(cellFormat3);

            CellStyles cellStyles1 = new CellStyles()
            {
                Count = (UInt32Value)1U
            };
            CellStyle cellStyle1 = new CellStyle()
            {
                Name = "Normal", FormatId = (UInt32Value)0U, BuiltinId = (UInt32Value)0U
            };

            cellStyles1.Append(cellStyle1);
            DifferentialFormats differentialFormats1 = new DifferentialFormats()
            {
                Count = (UInt32Value)0U
            };
            TableStyles tableStyles1 = new TableStyles()
            {
                Count = (UInt32Value)0U, DefaultTableStyle = "TableStyleMedium2", DefaultPivotStyle = "PivotStyleLight16"
            };

            StylesheetExtensionList stylesheetExtensionList1 = new StylesheetExtensionList();

            StylesheetExtension stylesheetExtension1 = new StylesheetExtension()
            {
                Uri = "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}"
            };

            stylesheetExtension1.AddNamespaceDeclaration("x14", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");

            StylesheetExtension stylesheetExtension2 = new StylesheetExtension()
            {
                Uri = "{9260A510-F301-46a8-8635-F512D64BE5F5}"
            };

            stylesheetExtension2.AddNamespaceDeclaration("x15", "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main");

            OpenXmlUnknownElement openXmlUnknownElement4 = OpenXmlUnknownElement.CreateOpenXmlUnknownElement("<x15:timelineStyles defaultTimelineStyle=\"TimeSlicerStyleLight1\" xmlns:x15=\"http://schemas.microsoft.com/office/spreadsheetml/2010/11/main\" />");

            stylesheetExtension2.Append(openXmlUnknownElement4);

            stylesheetExtensionList1.Append(stylesheetExtension1);
            stylesheetExtensionList1.Append(stylesheetExtension2);

            stylesheet1.Append(fonts1);
            stylesheet1.Append(fills1);
            stylesheet1.Append(borders1);
            stylesheet1.Append(cellStyleFormats1);
            stylesheet1.Append(cellFormats1);
            stylesheet1.Append(cellStyles1);
            stylesheet1.Append(differentialFormats1);
            stylesheet1.Append(tableStyles1);
            stylesheet1.Append(stylesheetExtensionList1);

            workbookStylesPart1.Stylesheet = stylesheet1;
        }
Ejemplo n.º 29
0
        private static Stylesheet CreateStylesheet()
        {
            Stylesheet ss = new Stylesheet();

            Fonts fts = new Fonts();

            DocumentFormat.OpenXml.Spreadsheet.Font ft = new DocumentFormat.OpenXml.Spreadsheet.Font();
            FontName ftn = new FontName();

            ftn.Val = "Calibri";
            FontSize ftsz = new FontSize();

            ftsz.Val    = 11;
            ft.FontName = ftn;
            ft.FontSize = ftsz;
            fts.Append(ft);
            fts.Count = (uint)fts.ChildElements.Count;

            Fills       fills = new Fills();
            Fill        fill;
            PatternFill patternFill;

            fill                    = new Fill();
            patternFill             = new PatternFill();
            patternFill.PatternType = PatternValues.None;
            fill.PatternFill        = patternFill;
            fills.Append(fill);
            fill                    = new Fill();
            patternFill             = new PatternFill();
            patternFill.PatternType = PatternValues.Gray125;
            fill.PatternFill        = patternFill;
            fills.Append(fill);
            fills.Count = (uint)fills.ChildElements.Count;

            Borders borders = new Borders();
            Border  border  = new Border();

            border.LeftBorder     = new LeftBorder();
            border.RightBorder    = new RightBorder();
            border.TopBorder      = new TopBorder();
            border.BottomBorder   = new BottomBorder();
            border.DiagonalBorder = new DiagonalBorder();
            borders.Append(border);
            borders.Count = (uint)borders.ChildElements.Count;

            CellStyleFormats csfs = new CellStyleFormats();
            CellFormat       cf   = new CellFormat();

            cf.NumberFormatId = 0;
            cf.FontId         = 0;
            cf.FillId         = 0;
            cf.BorderId       = 0;
            csfs.Append(cf);
            csfs.Count = (uint)csfs.ChildElements.Count;

            uint             iExcelIndex = 164;
            NumberingFormats nfs         = new NumberingFormats();
            CellFormats      cfs         = new CellFormats();

            cf = new CellFormat();
            cf.NumberFormatId = 0;
            cf.FontId         = 0;
            cf.FillId         = 0;
            cf.BorderId       = 0;
            cf.FormatId       = 0;
            cfs.Append(cf);

            NumberingFormat nf;

            nf = new NumberingFormat();
            nf.NumberFormatId = iExcelIndex++;
            nf.FormatCode     = "dd/mm/yyyy hh:mm:ss";
            nfs.Append(nf);
            cf = new CellFormat();
            cf.NumberFormatId    = nf.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = true;
            cfs.Append(cf);

            nf = new NumberingFormat();
            nf.NumberFormatId = iExcelIndex++;
            nf.FormatCode     = "#,##0.0000";
            nfs.Append(nf);
            cf = new CellFormat();
            cf.NumberFormatId    = nf.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = true;
            cfs.Append(cf);

            // #,##0.00 is also Excel style index 4
            nf = new NumberingFormat();
            nf.NumberFormatId = iExcelIndex++;
            nf.FormatCode     = "#,##0.00";
            nfs.Append(nf);
            cf = new CellFormat();
            cf.NumberFormatId    = nf.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = true;
            cfs.Append(cf);

            // @ is also Excel style index 49
            nf = new NumberingFormat();
            nf.NumberFormatId = iExcelIndex++;
            nf.FormatCode     = "@";
            nfs.Append(nf);
            cf = new CellFormat();
            cf.NumberFormatId    = nf.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = true;
            cfs.Append(cf);

            nfs.Count = (uint)nfs.ChildElements.Count;
            cfs.Count = (uint)cfs.ChildElements.Count;

            CellStyles css = new CellStyles();
            CellStyle  cs  = new CellStyle();

            cs.Name      = "Normal";
            cs.FormatId  = 0;
            cs.BuiltinId = 0;
            css.Append(cs);
            css.Count = (uint)css.ChildElements.Count;

            DifferentialFormats dfs = new DifferentialFormats();

            dfs.Count = 0;

            TableStyles tss = new TableStyles();

            tss.Count             = 0;
            tss.DefaultTableStyle = "TableStyleMedium9";
            tss.DefaultPivotStyle = "PivotStyleLight16";

            ss.Append(nfs);
            ss.Append(fts);
            ss.Append(fills);
            ss.Append(borders);
            ss.Append(csfs);
            ss.Append(cfs);
            ss.Append(css);
            ss.Append(dfs);

            return(ss);
        }
Ejemplo n.º 30
0
        public List <ICommand> MakeReassemblyTrace(TModel srcModel, TModel tgtModel)
        {
            Fill doFill = new Fill();

            doFill.Diff.Dy = -1;

            Void doVoid = new Void();

            doVoid.Diff.Dy = -1;

            var result = new List <ICommand>();

            result.Add(new Flip());

            var current          = new TCoord();
            var dumpCureTraverse = new TDumpCubeTraverse(srcModel, tgtModel);

            TState          state = new TState(srcModel);
            List <ICommand> ss    = new List <ICommand>();

            var iteration = 0;

            while ((iteration == 0) || !current.IsAtStart())
            {
                var next = dumpCureTraverse.Next();

                if (srcModel[next] > 0)
                {
                    Void curVoid = new Void();
                    curVoid.Diff = dumpCureTraverse.GetDirection();
                    result.Add(curVoid);

                    {
                        if (ss.Count == 0)
                        {
                            ss.Add(curVoid);
                        }
                        else
                        {
                            ss[0] = curVoid;
                        }
                        ss.Add(curVoid);
                        TCommandsReader cr = new TCommandsReader(ss);
                        state.Step(cr);
                    }
                }

                var move = new StraightMove();
                move.Diff = dumpCureTraverse.GetDirection();
                result.Add(move);

                {
                    if (ss.Count == 0)
                    {
                        ss.Add(move);
                    }
                    else
                    {
                        ss[0] = move;
                    }

                    TCommandsReader cr = new TCommandsReader(ss);
                    state.Step(cr);
                }

                if ((next.Y > 0) && (tgtModel[next.X, next.Y - 1, next.Z] > 0) && state.Matrix[next.X, next.Y - 1, next.Z] == 0)
                {
                    result.Add(doFill);
                    {
                        if (ss.Count == 0)
                        {
                            ss.Add(doFill);
                        }
                        else
                        {
                            ss[0] = doFill;
                        }
                        TCommandsReader cr = new TCommandsReader(ss);
                        state.Step(cr);
                    }
                }
                if ((next.Y > 0) && (tgtModel[next.X, next.Y - 1, next.Z] == 0) && state.Matrix[next.X, next.Y - 1, next.Z] > 0)
                {
                    result.Add(doVoid);
                    {
                        if (ss.Count == 0)
                        {
                            ss.Add(doVoid);
                        }
                        else
                        {
                            ss[0] = doVoid;
                        }

                        TCommandsReader cr = new TCommandsReader(ss);
                        state.Step(cr);
                    }
                }

                current = next;
                ++iteration;
            }

            result.Add(new Flip());
            result.Add(new Halt());

            return(result);
        }
Ejemplo n.º 31
0
        /// <inheritdoc />
        public bool Equals([AllowNull] ScatterPolarGl other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     ShowLegend == other.ShowLegend ||
                     ShowLegend != null &&
                     ShowLegend.Equals(other.ShowLegend)
                 ) &&
                 (
                     LegendGroup == other.LegendGroup ||
                     LegendGroup != null &&
                     LegendGroup.Equals(other.LegendGroup)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     SelectedPoints == other.SelectedPoints ||
                     SelectedPoints != null &&
                     SelectedPoints.Equals(other.SelectedPoints)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Mode == other.Mode ||
                     Mode != null &&
                     Mode.Equals(other.Mode)
                 ) &&
                 (
                     Equals(R, other.R) ||
                     R != null && other.R != null &&
                     R.SequenceEqual(other.R)
                 ) &&
                 (
                     Equals(Theta, other.Theta) ||
                     Theta != null && other.Theta != null &&
                     Theta.SequenceEqual(other.Theta)
                 ) &&
                 (
                     R0 == other.R0 ||
                     R0 != null &&
                     R0.Equals(other.R0)
                 ) &&
                 (
                     Dr == other.Dr ||
                     Dr != null &&
                     Dr.Equals(other.Dr)
                 ) &&
                 (
                     Theta0 == other.Theta0 ||
                     Theta0 != null &&
                     Theta0.Equals(other.Theta0)
                 ) &&
                 (
                     DTheta == other.DTheta ||
                     DTheta != null &&
                     DTheta.Equals(other.DTheta)
                 ) &&
                 (
                     ThetaUnit == other.ThetaUnit ||
                     ThetaUnit != null &&
                     ThetaUnit.Equals(other.ThetaUnit)
                 ) &&
                 (
                     Text == other.Text ||
                     Text != null &&
                     Text.Equals(other.Text)
                 ) &&
                 (
                     Equals(TextArray, other.TextArray) ||
                     TextArray != null && other.TextArray != null &&
                     TextArray.SequenceEqual(other.TextArray)
                 ) &&
                 (
                     TextTemplate == other.TextTemplate ||
                     TextTemplate != null &&
                     TextTemplate.Equals(other.TextTemplate)
                 ) &&
                 (
                     Equals(TextTemplateArray, other.TextTemplateArray) ||
                     TextTemplateArray != null && other.TextTemplateArray != null &&
                     TextTemplateArray.SequenceEqual(other.TextTemplateArray)
                 ) &&
                 (
                     HoverText == other.HoverText ||
                     HoverText != null &&
                     HoverText.Equals(other.HoverText)
                 ) &&
                 (
                     Equals(HoverTextArray, other.HoverTextArray) ||
                     HoverTextArray != null && other.HoverTextArray != null &&
                     HoverTextArray.SequenceEqual(other.HoverTextArray)
                 ) &&
                 (
                     HoverTemplate == other.HoverTemplate ||
                     HoverTemplate != null &&
                     HoverTemplate.Equals(other.HoverTemplate)
                 ) &&
                 (
                     Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                     HoverTemplateArray != null && other.HoverTemplateArray != null &&
                     HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ) &&
                 (
                     ConnectGaps == other.ConnectGaps ||
                     ConnectGaps != null &&
                     ConnectGaps.Equals(other.ConnectGaps)
                 ) &&
                 (
                     Marker == other.Marker ||
                     Marker != null &&
                     Marker.Equals(other.Marker)
                 ) &&
                 (
                     Fill == other.Fill ||
                     Fill != null &&
                     Fill.Equals(other.Fill)
                 ) &&
                 (
                     FillColor == other.FillColor ||
                     FillColor != null &&
                     FillColor.Equals(other.FillColor)
                 ) &&
                 (
                     TextPosition == other.TextPosition ||
                     TextPosition != null &&
                     TextPosition.Equals(other.TextPosition)
                 ) &&
                 (
                     Equals(TextPositionArray, other.TextPositionArray) ||
                     TextPositionArray != null && other.TextPositionArray != null &&
                     TextPositionArray.SequenceEqual(other.TextPositionArray)
                 ) &&
                 (
                     TextFont == other.TextFont ||
                     TextFont != null &&
                     TextFont.Equals(other.TextFont)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     Equals(HoverInfoArray, other.HoverInfoArray) ||
                     HoverInfoArray != null && other.HoverInfoArray != null &&
                     HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                 ) &&
                 (
                     Selected == other.Selected ||
                     Selected != null &&
                     Selected.Equals(other.Selected)
                 ) &&
                 (
                     Unselected == other.Unselected ||
                     Unselected != null &&
                     Unselected.Equals(other.Unselected)
                 ) &&
                 (
                     Subplot == other.Subplot ||
                     Subplot != null &&
                     Subplot.Equals(other.Subplot)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     RSrc == other.RSrc ||
                     RSrc != null &&
                     RSrc.Equals(other.RSrc)
                 ) &&
                 (
                     ThetaSrc == other.ThetaSrc ||
                     ThetaSrc != null &&
                     ThetaSrc.Equals(other.ThetaSrc)
                 ) &&
                 (
                     TextSrc == other.TextSrc ||
                     TextSrc != null &&
                     TextSrc.Equals(other.TextSrc)
                 ) &&
                 (
                     TextTemplateSrc == other.TextTemplateSrc ||
                     TextTemplateSrc != null &&
                     TextTemplateSrc.Equals(other.TextTemplateSrc)
                 ) &&
                 (
                     HoverTextSrc == other.HoverTextSrc ||
                     HoverTextSrc != null &&
                     HoverTextSrc.Equals(other.HoverTextSrc)
                 ) &&
                 (
                     HoverTemplateSrc == other.HoverTemplateSrc ||
                     HoverTemplateSrc != null &&
                     HoverTemplateSrc.Equals(other.HoverTemplateSrc)
                 ) &&
                 (
                     TextPositionSrc == other.TextPositionSrc ||
                     TextPositionSrc != null &&
                     TextPositionSrc.Equals(other.TextPositionSrc)
                 ) &&
                 (
                     HoverInfoSrc == other.HoverInfoSrc ||
                     HoverInfoSrc != null &&
                     HoverInfoSrc.Equals(other.HoverInfoSrc)
                 ));
        }
Ejemplo n.º 32
0
        private Stylesheet CreateStylesheet()
        {
            Stylesheet stylesheet = new Stylesheet();

            stylesheet.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");

            Fonts fontsCollection = new Fonts()
            {
                Count = (UInt32Value)1U, KnownFonts = true
            };

            Font     defaultFont     = new Font();
            FontSize defaultFontSize = new FontSize()
            {
                Val = 11D
            };
            Color defaultFontColor = new Color()
            {
                Theme = (UInt32Value)1U
            };
            FontName defaultFontName = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering defaultFontFamilyNumbering = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme defaultFontScheme = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            defaultFont.Append(defaultFontSize);
            defaultFont.Append(defaultFontColor);
            defaultFont.Append(defaultFontName);
            defaultFont.Append(defaultFontFamilyNumbering);
            defaultFont.Append(defaultFontScheme);

            Font     boldFont     = new Font();
            FontSize boldFontSize = new FontSize()
            {
                Val = 12D
            };
            Color boldFontColor = new Color()
            {
                Theme = (UInt32Value)1U
            };
            FontName boldFontName = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering boldFontFamilyNumbering = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme boldFontScheme = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            boldFont.Append(new Bold());
            boldFont.Append(boldFontSize);
            boldFont.Append(boldFontColor);
            boldFont.Append(boldFontName);
            boldFont.Append(boldFontFamilyNumbering);
            boldFont.Append(boldFontScheme);

            Font     tableHeaderFont     = new Font();
            FontSize tableHeaderFontSize = new FontSize()
            {
                Val = 11D
            };
            Color tableHeaderFontColor = new Color()
            {
                Rgb = new HexBinaryValue("808080")
            };
            FontName tableHeaderFontName = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering tableHeaderFontFamilyNumbering = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme tableHeaderFontScheme = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            tableHeaderFont.Append(new Bold());
            tableHeaderFont.Append(tableHeaderFontSize);
            tableHeaderFont.Append(tableHeaderFontColor);
            tableHeaderFont.Append(tableHeaderFontName);
            tableHeaderFont.Append(tableHeaderFontFamilyNumbering);
            tableHeaderFont.Append(tableHeaderFontScheme);

            fontsCollection.Append(defaultFont, boldFont, tableHeaderFont);

            Fills fills0 = new Fills()
            {
                Count = (UInt32Value)1U
            };

            // FillId = 0
            Fill        fill0        = new Fill();
            PatternFill patternFill1 = new PatternFill()
            {
                PatternType = PatternValues.None
            };

            fill0.Append(patternFill1);

            fills0.Append(fill0);

            Borders borders0 = new Borders()
            {
                Count = (UInt32Value)1U
            };

            Border         border1         = new Border();
            LeftBorder     leftBorder1     = new LeftBorder();
            RightBorder    rightBorder1    = new RightBorder();
            TopBorder      topBorder1      = new TopBorder();
            BottomBorder   bottomBorder1   = new BottomBorder();
            DiagonalBorder diagonalBorder1 = new DiagonalBorder();

            border1.Append(leftBorder1);
            border1.Append(rightBorder1);
            border1.Append(topBorder1);
            border1.Append(bottomBorder1);
            border1.Append(diagonalBorder1);

            borders0.Append(border1);

            Alignment tableHeaderAlignment = new Alignment
            {
                Horizontal = HorizontalAlignmentValues.Left,
                Vertical   = VerticalAlignmentValues.Center,
                WrapText   = false
            };

            CellFormats cellFormatsCollection = new CellFormats()
            {
                Count = (UInt32Value)1U
            };
            CellFormat cellFormatDefault = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            CellFormat cellFormatBold = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };
            CellFormat cellFormatTableHeader = new CellFormat {
                Alignment = tableHeaderAlignment, FontId = (UInt32Value)2U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };

            cellFormatsCollection.Append(cellFormatDefault, cellFormatBold, cellFormatTableHeader);

            stylesheet.Append(fontsCollection);
            stylesheet.Append(fills0);
            stylesheet.Append(borders0);
            stylesheet.Append(cellFormatsCollection);

            return(stylesheet);
        }
Ejemplo n.º 33
0
 public Task FillAsync(string subscriberId, Fill fill)
 {
     return(_broadcastService.BroadcastAsync(subscriberId, fill));
 }
Ejemplo n.º 34
0
 /// <summary>
 /// Initializes the object before running a report.
 /// </summary>
 /// <remarks>
 /// This method is used by the report engine, do not call it directly.
 /// </remarks>
 public virtual void InitializeComponent()
 {
     // update the component's style
     Style = Style;
     Fill.InitializeComponent();
 }
Ejemplo n.º 35
0
        public CustomStylesheet()
        {
            Fonts    fts = new Fonts();
            Font     ft  = new Font();
            FontName ftn = new FontName();

            ftn.Val = StringValue.FromString("Calibri");
            FontSize ftsz = new FontSize();

            ftsz.Val    = DoubleValue.FromDouble(11);
            ft.FontName = ftn;
            ft.FontSize = ftsz;
            fts.Append(ft);

            ft          = new Font();
            ftn         = new FontName();
            ftn.Val     = StringValue.FromString("Palatino Linotype");
            ftsz        = new FontSize();
            ftsz.Val    = DoubleValue.FromDouble(18);
            ft.FontName = ftn;
            ft.FontSize = ftsz;
            fts.Append(ft);

            fts.Count = UInt32Value.FromUInt32((uint)fts.ChildElements.Count);

            Fills       fills = new Fills();
            Fill        fill;
            PatternFill patternFill;

            fill                    = new Fill();
            patternFill             = new PatternFill();
            patternFill.PatternType = PatternValues.None;
            fill.PatternFill        = patternFill;
            fills.Append(fill);

            fill                    = new Fill();
            patternFill             = new PatternFill();
            patternFill.PatternType = PatternValues.Gray125;
            fill.PatternFill        = patternFill;
            fills.Append(fill);

            fill                            = new Fill();
            patternFill                     = new PatternFill();
            patternFill.PatternType         = PatternValues.Solid;
            patternFill.ForegroundColor     = new ForegroundColor();
            patternFill.ForegroundColor.Rgb = HexBinaryValue.FromString("ffff00");
            patternFill.BackgroundColor     = new BackgroundColor();
            patternFill.BackgroundColor.Rgb = patternFill.ForegroundColor.Rgb;
            fill.PatternFill                = patternFill;
            fills.Append(fill);

            fills.Count = UInt32Value.FromUInt32((uint)fills.ChildElements.Count);

            Borders borders = new Borders();
            Border  border  = new Border();

            border.LeftBorder     = new LeftBorder();
            border.RightBorder    = new RightBorder();
            border.TopBorder      = new TopBorder();
            border.BottomBorder   = new BottomBorder();
            border.DiagonalBorder = new DiagonalBorder();
            borders.Append(border);

            //Boarder Index 1
            border                    = new Border();
            border.LeftBorder         = new LeftBorder();
            border.LeftBorder.Style   = BorderStyleValues.Thin;
            border.RightBorder        = new RightBorder();
            border.RightBorder.Style  = BorderStyleValues.Thin;
            border.TopBorder          = new TopBorder();
            border.TopBorder.Style    = BorderStyleValues.Thin;
            border.BottomBorder       = new BottomBorder();
            border.BottomBorder.Style = BorderStyleValues.Thin;
            border.DiagonalBorder     = new DiagonalBorder();
            borders.Append(border);


            //Boarder Index 2
            border                    = new Border();
            border.LeftBorder         = new LeftBorder();
            border.RightBorder        = new RightBorder();
            border.TopBorder          = new TopBorder();
            border.TopBorder.Style    = BorderStyleValues.Thin;
            border.BottomBorder       = new BottomBorder();
            border.BottomBorder.Style = BorderStyleValues.Thin;
            border.DiagonalBorder     = new DiagonalBorder();
            borders.Append(border);


            borders.Count = UInt32Value.FromUInt32((uint)borders.ChildElements.Count);

            CellStyleFormats csfs = new CellStyleFormats();
            CellFormat       cf   = new CellFormat();

            cf.NumberFormatId = 0;
            cf.FontId         = 0;
            cf.FillId         = 0;
            cf.BorderId       = 0;
            csfs.Append(cf);
            csfs.Count = UInt32Value.FromUInt32((uint)csfs.ChildElements.Count);

            uint             iExcelIndex = 164;
            NumberingFormats nfs         = new NumberingFormats();
            CellFormats      cfs         = new CellFormats();

            cf = new CellFormat();
            cf.NumberFormatId = 0;
            cf.FontId         = 0;
            cf.FillId         = 0;
            cf.BorderId       = 0;
            cf.FormatId       = 0;
            cfs.Append(cf);

            NumberingFormat nfDateTime = new NumberingFormat();

            nfDateTime.NumberFormatId = UInt32Value.FromUInt32(iExcelIndex++);
            nfDateTime.FormatCode     = StringValue.FromString("dd/mm/yyyy hh:mm:ss");
            nfs.Append(nfDateTime);

            NumberingFormat nf4decimal = new NumberingFormat();

            nf4decimal.NumberFormatId = UInt32Value.FromUInt32(iExcelIndex++);
            nf4decimal.FormatCode     = StringValue.FromString("#,##0.0000");
            nfs.Append(nf4decimal);

            // #,##0.00 is also Excel style index 4
            NumberingFormat nf2decimal = new NumberingFormat();

            nf2decimal.NumberFormatId = UInt32Value.FromUInt32(iExcelIndex++);
            nf2decimal.FormatCode     = StringValue.FromString("#,##0.00");
            nfs.Append(nf2decimal);

            // @ is also Excel style index 49
            NumberingFormat nfForcedText = new NumberingFormat();

            nfForcedText.NumberFormatId = UInt32Value.FromUInt32(iExcelIndex++);
            nfForcedText.FormatCode     = StringValue.FromString("@");
            nfs.Append(nfForcedText);

            // index 1
            // Format dd/mm/yyyy
            cf = new CellFormat();
            cf.NumberFormatId    = 14;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 2
            // Format #,##0.00
            cf = new CellFormat();
            cf.NumberFormatId    = 4;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 3
            cf = new CellFormat();
            cf.NumberFormatId    = nfDateTime.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 4
            cf = new CellFormat();
            cf.NumberFormatId    = nf4decimal.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 5
            cf = new CellFormat();
            cf.NumberFormatId    = nf2decimal.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 6
            cf = new CellFormat();
            cf.NumberFormatId    = nfForcedText.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 7
            // Header text
            cf = new CellFormat();
            cf.NumberFormatId    = nfForcedText.NumberFormatId;
            cf.FontId            = 1;
            cf.FillId            = 0;
            cf.BorderId          = 0;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 8
            // column text
            cf = new CellFormat();
            cf.NumberFormatId    = nfForcedText.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 0;
            cf.BorderId          = 1;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 9
            // coloured 2 decimal text
            cf = new CellFormat();
            cf.NumberFormatId    = nf2decimal.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 2;
            cf.BorderId          = 2;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);

            // index 10
            // coloured column text
            cf = new CellFormat();
            cf.NumberFormatId    = nfForcedText.NumberFormatId;
            cf.FontId            = 0;
            cf.FillId            = 2;
            cf.BorderId          = 2;
            cf.FormatId          = 0;
            cf.ApplyNumberFormat = BooleanValue.FromBoolean(true);
            cfs.Append(cf);


            nfs.Count = UInt32Value.FromUInt32((uint)nfs.ChildElements.Count);
            cfs.Count = UInt32Value.FromUInt32((uint)cfs.ChildElements.Count);

            this.Append(nfs);
            this.Append(fts);
            this.Append(fills);
            this.Append(borders);
            this.Append(csfs);
            this.Append(cfs);

            CellStyles css = new CellStyles();
            CellStyle  cs  = new CellStyle();

            cs.Name      = StringValue.FromString("Normal");
            cs.FormatId  = 0;
            cs.BuiltinId = 0;
            css.Append(cs);
            css.Count = UInt32Value.FromUInt32((uint)css.ChildElements.Count);
            this.Append(css);

            DifferentialFormats dfs = new DifferentialFormats();

            dfs.Count = 0;
            this.Append(dfs);

            TableStyles tss = new TableStyles();

            tss.Count             = 0;
            tss.DefaultTableStyle = StringValue.FromString("TableStyleMedium9");
            tss.DefaultPivotStyle = StringValue.FromString("PivotStyleLight16");
            this.Append(tss);
        }
Ejemplo n.º 36
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            ReportComponentBase c = writer.DiffObject as ReportComponentBase;

            base.Serialize(writer);

            if (Exportable != c.Exportable)
            {
                writer.WriteBool("Exportable", Exportable);
            }
            if (ExportableExpression != c.ExportableExpression)
            {
                writer.WriteStr("ExportableExpression", ExportableExpression);
            }
            Border.Serialize(writer, "Border", c.Border);
            //if(Fill != c.Fill)
            Fill.Serialize(writer, "Fill", c.Fill);
            if (Cursor != c.Cursor && !Config.WebMode)
            {
                writer.WriteValue("Cursor", Cursor);
            }
            Hyperlink.Serialize(writer, c.Hyperlink);
            if (Bookmark != c.Bookmark)
            {
                writer.WriteStr("Bookmark", Bookmark);
            }
            if (writer.SerializeTo != SerializeTo.Preview)
            {
                if (CanGrow != c.CanGrow)
                {
                    writer.WriteBool("CanGrow", CanGrow);
                }
                if (CanShrink != c.CanShrink)
                {
                    writer.WriteBool("CanShrink", CanShrink);
                }
                if (GrowToBottom != c.GrowToBottom)
                {
                    writer.WriteBool("GrowToBottom", GrowToBottom);
                }
                if (ShiftMode != c.ShiftMode)
                {
                    writer.WriteValue("ShiftMode", ShiftMode);
                }
                if (FlagSerializeStyle && Style != c.Style)
                {
                    writer.WriteStr("Style", Style);
                }
                if (EvenStyle != c.EvenStyle)
                {
                    writer.WriteStr("EvenStyle", EvenStyle);
                }
                if (EvenStylePriority != c.EvenStylePriority)
                {
                    writer.WriteValue("EvenStylePriority", EvenStylePriority);
                }
                if (HoverStyle != c.HoverStyle)
                {
                    writer.WriteStr("HoverStyle", HoverStyle);
                }
                if (PrintOn != c.PrintOn)
                {
                    writer.WriteValue("PrintOn", PrintOn);
                }
                if (BeforePrintEvent != c.BeforePrintEvent)
                {
                    writer.WriteStr("BeforePrintEvent", BeforePrintEvent);
                }
                if (AfterPrintEvent != c.AfterPrintEvent)
                {
                    writer.WriteStr("AfterPrintEvent", AfterPrintEvent);
                }
                if (AfterDataEvent != c.AfterDataEvent)
                {
                    writer.WriteStr("AfterDataEvent", AfterDataEvent);
                }
                if (ClickEvent != c.ClickEvent)
                {
                    writer.WriteStr("ClickEvent", ClickEvent);
                }
                if (MouseMoveEvent != c.MouseMoveEvent)
                {
                    writer.WriteStr("MouseMoveEvent", MouseMoveEvent);
                }
                if (MouseUpEvent != c.MouseUpEvent)
                {
                    writer.WriteStr("MouseUpEvent", MouseUpEvent);
                }
                if (MouseDownEvent != c.MouseDownEvent)
                {
                    writer.WriteStr("MouseDownEvent", MouseDownEvent);
                }
                if (MouseEnterEvent != c.MouseEnterEvent)
                {
                    writer.WriteStr("MouseEnterEvent", MouseEnterEvent);
                }
                if (MouseLeaveEvent != c.MouseLeaveEvent)
                {
                    writer.WriteStr("MouseLeaveEvent", MouseLeaveEvent);
                }
            }
        }
Ejemplo n.º 37
0
 protected override void OnFill(Fill fill)
 {
     // Add fill to group.
     Log(fill, fillGroup);
 }
Ejemplo n.º 38
0
        private List <ConsoleDebuggerActionHook> GetActionHooks(int index, IEnumerable <Keyword> allKeywords)
        {
            var commands = new List <ConsoleDebuggerActionHook>()
            {
                new ConsoleDebuggerActionHook("find (.+)", "find X: use this to test a web element locator", input =>
                {
                    var arg    = ParseArguments(input, 1).First();
                    var script = $@"tagMatches(getExactMatches(""{arg}""));";
                    (Selenium.WebDriver).RunLibraryScript(script);
                    DontDoAnything(index);
                }),
                new ConsoleDebuggerActionHook("click (.+)", "click X: use this to click on element ad-hoc", input =>
                {
                    var arg   = ParseArguments(input, 1).First();
                    var click = new Click(arg);
                    ServiceLocator.Instance.Resolve(click);
                    Command.SelectedKeyword = click;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("isvisible (.+)", "isvisible X: checks visibility of text", input =>
                {
                    var arg       = ParseArguments(input, 1).First();
                    var isVisible = new IsVisible(arg)
                    {
                        Expect = true
                    };
                    ServiceLocator.Instance.Resolve(isVisible);
                    Command.SelectedKeyword = isVisible;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("fill (.+) (.+)", "fill X Y: use this to fill on element ad-hoc", input =>
                {
                    var args = ParseArguments(input, 2);
                    var fill = new Fill(args.First(), args.Last());
                    ServiceLocator.Instance.Resolve(fill);
                    Command.SelectedKeyword = fill;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("show", "show [left|right]: highlights buttons with their sort orders using a screen overlay", input =>
                {
                    var args = ParseArguments(input, 1);
                    var show = new Show(args.First());
                    ServiceLocator.Instance.Resolve(show);
                    Command.SelectedKeyword = show;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("goto (.+)", "goto X: use this to click on element ad-hoc", input =>
                {
                    var arg = ParseArguments(input, 1).First();
                    var go  = new GoToUrl(arg);
                    ServiceLocator.Instance.Resolve(go);
                    Command.SelectedKeyword = go;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("restart", "restart : go back to the beginning of the test", input =>
                {
                    Command.NextIndex = -1;
                    Command.RunStep   = false;
                }),
                new ConsoleDebuggerActionHook("savehtml", "savehtml : save current page source to a new HTML file", input =>
                {
                    var save = new SaveHtml();
                    ServiceLocator.Instance.Resolve(save);
                    Command.SelectedKeyword = save;
                    Command.NextIndex       = Command.NextIndex - 1;
                }),
                new ConsoleDebuggerActionHook("run ([0-9]*)", "run <N>: runs N steps", input =>
                {
                    var args2           = ParseArguments(input, 1);
                    Command.StopOnIndex = Math.Min(allKeywords.Count() - 2, index + 1 + int.Parse(args2.First()));
                    Command.StepThrough = false;
                }),
                new ConsoleDebuggerActionHook("run", "run : Run selected step", input => { Command.StepThrough = false; }),
                new ConsoleDebuggerActionHook("back ([0-9]*)", "back <N>: Return selection N steps back", input =>
                {
                    var args3         = ParseArguments(input, 1);
                    Command.NextIndex = Math.Max(-1, index - 1 - int.Parse(args3.First()));
                    Command.RunStep   = false;
                }),
                new ConsoleDebuggerActionHook("back", "back : Return selection to previous step", input =>
                {
                    Command.NextIndex = Math.Max(-1, index - 2);
                    Command.RunStep   = false;
                }),
                new ConsoleDebuggerActionHook("skip ([0-9]*)", "skip N : Skips N steps", input =>
                {
                    var args4         = ParseArguments(input, 1);
                    Command.NextIndex = Math.Min(allKeywords.Count() - 2, index - 1 + int.Parse(args4.First()));
                    Command.RunStep   = false;
                }),
                new ConsoleDebuggerActionHook("skip", "skip : Skips one step", input => { Command.RunStep = false; }),
                new ConsoleDebuggerActionHook("stop", "stop : Stops the test", input =>
                {
                    Command.Break = true;
                    DontDoAnything(index);
                }),
                new ConsoleDebuggerActionHook("reload", "reload : re-reads all input files", input =>
                {
                    foreach (var dataAccess1 in Data.DataAccesses.OfType <FileObjectAccess>())
                    {
                        dataAccess1.ForceReload();
                    }
                    Command.Reload = true;
                    DontDoAnything(index);
                })
            };

            return(commands);
        }
Ejemplo n.º 39
0
 protected override void OnFill(Fill fill)
 {
     Log(fill, fillGroup);
 }
Ejemplo n.º 40
0
        // Generates content of workbookStyles.
        private void GenerateWorkbookStylesContent(WorkbookStylesPart workbookStyles)
        {
            Stylesheet stylesheet1 = new Stylesheet()
            {
                MCAttributes = new MarkupCompatibilityAttributes()
                {
                    Ignorable = "x14ac"
                }
            };

            stylesheet1.AddNamespaceDeclaration("mc", "http://schemas.openxmlformats.org/markup-compatibility/2006");
            stylesheet1.AddNamespaceDeclaration("x14ac", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");

            NumberingFormats numberingFormats1 = new NumberingFormats()
            {
                Count = (UInt32Value)1U
            };
            NumberingFormat numberingFormat1 = new NumberingFormat()
            {
                NumberFormatId = (UInt32Value)43U, FormatCode = "_(* #,##0.00_);_(* \\(#,##0.00\\);_(* \"-\"??_);_(@_)"
            };

            numberingFormats1.Append(numberingFormat1);

            Fonts fonts1 = new Fonts()
            {
                Count = (UInt32Value)4U, KnownFonts = true
            };

            Font     font1     = new Font();
            FontSize fontSize1 = new FontSize()
            {
                Val = 11D
            };
            Color color1 = new Color()
            {
                Theme = (UInt32Value)1U
            };
            FontName fontName1 = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering fontFamilyNumbering1 = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme fontScheme1 = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            font1.Append(fontSize1);
            font1.Append(color1);
            font1.Append(fontName1);
            font1.Append(fontFamilyNumbering1);
            font1.Append(fontScheme1);

            Font     font2     = new Font();
            Bold     bold1     = new Bold();
            FontSize fontSize2 = new FontSize()
            {
                Val = 11D
            };
            Color color2 = new Color()
            {
                Theme = (UInt32Value)1U
            };
            FontName fontName2 = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering fontFamilyNumbering2 = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme fontScheme2 = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            font2.Append(bold1);
            font2.Append(fontSize2);
            font2.Append(color2);
            font2.Append(fontName2);
            font2.Append(fontFamilyNumbering2);
            font2.Append(fontScheme2);

            Font     font3     = new Font();
            Bold     bold2     = new Bold();
            Italic   italic1   = new Italic();
            FontSize fontSize3 = new FontSize()
            {
                Val = 11D
            };
            Color color3 = new Color()
            {
                Rgb = "FFFF0000"
            };
            FontName fontName3 = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering fontFamilyNumbering3 = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme fontScheme3 = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            font3.Append(bold2);
            font3.Append(italic1);
            font3.Append(fontSize3);
            font3.Append(color3);
            font3.Append(fontName3);
            font3.Append(fontFamilyNumbering3);
            font3.Append(fontScheme3);

            Font     font4     = new Font();
            Italic   italic2   = new Italic();
            FontSize fontSize4 = new FontSize()
            {
                Val = 11D
            };
            Color color4 = new Color()
            {
                Rgb = "FFFF0000"
            };
            FontName fontName4 = new FontName()
            {
                Val = "Calibri"
            };
            FontFamilyNumbering fontFamilyNumbering4 = new FontFamilyNumbering()
            {
                Val = 2
            };
            FontScheme fontScheme4 = new FontScheme()
            {
                Val = FontSchemeValues.Minor
            };

            font4.Append(italic2);
            font4.Append(fontSize4);
            font4.Append(color4);
            font4.Append(fontName4);
            font4.Append(fontFamilyNumbering4);
            font4.Append(fontScheme4);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);

            Fills fills1 = new Fills()
            {
                Count = (UInt32Value)4U
            };

            Fill        fill1        = new Fill();
            PatternFill patternFill1 = new PatternFill()
            {
                PatternType = PatternValues.None
            };

            fill1.Append(patternFill1);

            Fill        fill2        = new Fill();
            PatternFill patternFill2 = new PatternFill()
            {
                PatternType = PatternValues.Gray125
            };

            fill2.Append(patternFill2);

            Fill fill3 = new Fill();

            PatternFill patternFill3 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor1 = new ForegroundColor()
            {
                Theme = (UInt32Value)0U, Tint = -4.9989318521683403E-2D
            };
            BackgroundColor backgroundColor1 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill3.Append(foregroundColor1);
            patternFill3.Append(backgroundColor1);

            fill3.Append(patternFill3);

            Fill fill4 = new Fill();

            PatternFill patternFill4 = new PatternFill()
            {
                PatternType = PatternValues.Solid
            };
            ForegroundColor foregroundColor2 = new ForegroundColor()
            {
                Rgb = "FFFFFFCC"
            };
            BackgroundColor backgroundColor2 = new BackgroundColor()
            {
                Indexed = (UInt32Value)64U
            };

            patternFill4.Append(foregroundColor2);
            patternFill4.Append(backgroundColor2);

            fill4.Append(patternFill4);

            fills1.Append(fill1);
            fills1.Append(fill2);
            fills1.Append(fill3);
            fills1.Append(fill4);

            Borders borders1 = new Borders()
            {
                Count = (UInt32Value)2U
            };

            Border         border1         = new Border();
            LeftBorder     leftBorder1     = new LeftBorder();
            RightBorder    rightBorder1    = new RightBorder();
            TopBorder      topBorder1      = new TopBorder();
            BottomBorder   bottomBorder1   = new BottomBorder();
            DiagonalBorder diagonalBorder1 = new DiagonalBorder();

            border1.Append(leftBorder1);
            border1.Append(rightBorder1);
            border1.Append(topBorder1);
            border1.Append(bottomBorder1);
            border1.Append(diagonalBorder1);

            Border      border2      = new Border();
            LeftBorder  leftBorder2  = new LeftBorder();
            RightBorder rightBorder2 = new RightBorder();

            TopBorder topBorder2 = new TopBorder()
            {
                Style = BorderStyleValues.Thin
            };
            Color color5 = new Color()
            {
                Indexed = (UInt32Value)64U
            };

            topBorder2.Append(color5);
            BottomBorder   bottomBorder2   = new BottomBorder();
            DiagonalBorder diagonalBorder2 = new DiagonalBorder();

            border2.Append(leftBorder2);
            border2.Append(rightBorder2);
            border2.Append(topBorder2);
            border2.Append(bottomBorder2);
            border2.Append(diagonalBorder2);

            borders1.Append(border1);
            borders1.Append(border2);

            CellStyleFormats cellStyleFormats1 = new CellStyleFormats()
            {
                Count = (UInt32Value)1U
            };
            CellFormat cellFormat1 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U
            };

            cellStyleFormats1.Append(cellFormat1);

            CellFormats cellFormats1 = new CellFormats()
            {
                Count = (UInt32Value)16U
            };
            CellFormat cellFormat2 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U
            };

            CellFormat cellFormat3 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment1 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Center
            };

            cellFormat3.Append(alignment1);
            CellFormat cellFormat4 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true
            };

            CellFormat cellFormat5 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment2 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Left
            };

            cellFormat5.Append(alignment2);

            CellFormat cellFormat6 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment3 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Center
            };

            cellFormat6.Append(alignment3);

            CellFormat cellFormat7 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment4 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Center
            };

            cellFormat7.Append(alignment4);

            CellFormat cellFormat8 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment5 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Right
            };

            cellFormat8.Append(alignment5);

            CellFormat cellFormat9 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment6 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Left
            };

            cellFormat9.Append(alignment6);

            CellFormat cellFormat10 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment7 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Center
            };

            cellFormat10.Append(alignment7);

            CellFormat cellFormat11 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment8 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Center
            };

            cellFormat11.Append(alignment8);
            CellFormat cellFormat12 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)43U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true
            };

            CellFormat cellFormat13 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)9U, FontId = (UInt32Value)0U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment9 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Left
            };

            cellFormat13.Append(alignment9);

            CellFormat cellFormat14 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyAlignment = true
            };
            Alignment alignment10 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Center
            };

            cellFormat14.Append(alignment10);

            CellFormat cellFormat15 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)37U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true
            };
            Alignment alignment11 = new Alignment()
            {
                Horizontal = HorizontalAlignmentValues.Center
            };

            cellFormat15.Append(alignment11);
            CellFormat cellFormat16 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)43U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true
            };
            CellFormat cellFormat17 = new CellFormat()
            {
                NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true
            };

            cellFormats1.Append(cellFormat2);
            cellFormats1.Append(cellFormat3);
            cellFormats1.Append(cellFormat4);
            cellFormats1.Append(cellFormat5);
            cellFormats1.Append(cellFormat6);
            cellFormats1.Append(cellFormat7);
            cellFormats1.Append(cellFormat8);
            cellFormats1.Append(cellFormat9);
            cellFormats1.Append(cellFormat10);
            cellFormats1.Append(cellFormat11);
            cellFormats1.Append(cellFormat12);
            cellFormats1.Append(cellFormat13);
            cellFormats1.Append(cellFormat14);
            cellFormats1.Append(cellFormat15);
            cellFormats1.Append(cellFormat16);
            cellFormats1.Append(cellFormat17);

            CellStyles cellStyles1 = new CellStyles()
            {
                Count = (UInt32Value)1U
            };
            CellStyle cellStyle1 = new CellStyle()
            {
                Name = "Normal", FormatId = (UInt32Value)0U, BuiltinId = (UInt32Value)0U
            };

            cellStyles1.Append(cellStyle1);
            DifferentialFormats differentialFormats1 = new DifferentialFormats()
            {
                Count = (UInt32Value)0U
            };
            TableStyles tableStyles1 = new TableStyles()
            {
                Count = (UInt32Value)0U, DefaultTableStyle = "TableStyleMedium2", DefaultPivotStyle = "PivotStyleLight16"
            };

            StylesheetExtensionList stylesheetExtensionList1 = new StylesheetExtensionList();

            StylesheetExtension stylesheetExtension1 = new StylesheetExtension()
            {
                Uri = "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}"
            };

            stylesheetExtension1.AddNamespaceDeclaration("x14", "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
            DocumentFormat.OpenXml.Office2010.Excel.SlicerStyles slicerStyles1 = new DocumentFormat.OpenXml.Office2010.Excel.SlicerStyles()
            {
                DefaultSlicerStyle = "SlicerStyleLight1"
            };

            stylesheetExtension1.Append(slicerStyles1);

            //StylesheetExtension stylesheetExtension2 = new StylesheetExtension(){ Uri = "{9260A510-F301-46a8-8635-F512D64BE5F5}" };
            //stylesheetExtension2.AddNamespaceDeclaration("x15", "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main");
            //X15.TimelineStyles timelineStyles1 = new X15.TimelineStyles(){ DefaultTimelineStyle = "TimeSlicerStyleLight1" };

            //stylesheetExtension2.Append(timelineStyles1);

            stylesheetExtensionList1.Append(stylesheetExtension1);
            //stylesheetExtensionList1.Append(stylesheetExtension2);

            stylesheet1.Append(numberingFormats1);
            stylesheet1.Append(fonts1);
            stylesheet1.Append(fills1);
            stylesheet1.Append(borders1);
            stylesheet1.Append(cellStyleFormats1);
            stylesheet1.Append(cellFormats1);
            stylesheet1.Append(cellStyles1);
            stylesheet1.Append(differentialFormats1);
            stylesheet1.Append(tableStyles1);
            stylesheet1.Append(stylesheetExtensionList1);

            workbookStyles.Stylesheet = stylesheet1;
        }
Ejemplo n.º 41
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Header other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Equals(Values, other.Values) ||
                     Values != null && other.Values != null &&
                     Values.SequenceEqual(other.Values)
                     ) &&
                 (
                     Equals(Format, other.Format) ||
                     Format != null && other.Format != null &&
                     Format.SequenceEqual(other.Format)
                 ) &&
                 (
                     Prefix == other.Prefix ||
                     Prefix != null &&
                     Prefix.Equals(other.Prefix)
                 ) &&
                 (
                     Equals(PrefixArray, other.PrefixArray) ||
                     PrefixArray != null && other.PrefixArray != null &&
                     PrefixArray.SequenceEqual(other.PrefixArray)
                 ) &&
                 (
                     Suffix == other.Suffix ||
                     Suffix != null &&
                     Suffix.Equals(other.Suffix)
                 ) &&
                 (
                     Equals(SuffixArray, other.SuffixArray) ||
                     SuffixArray != null && other.SuffixArray != null &&
                     SuffixArray.SequenceEqual(other.SuffixArray)
                 ) &&
                 (
                     Height == other.Height ||
                     Height != null &&
                     Height.Equals(other.Height)
                 ) &&
                 (
                     Align == other.Align ||
                     Align != null &&
                     Align.Equals(other.Align)
                 ) &&
                 (
                     Equals(AlignArray, other.AlignArray) ||
                     AlignArray != null && other.AlignArray != null &&
                     AlignArray.SequenceEqual(other.AlignArray)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ) &&
                 (
                     Fill == other.Fill ||
                     Fill != null &&
                     Fill.Equals(other.Fill)
                 ) &&
                 (
                     Font == other.Font ||
                     Font != null &&
                     Font.Equals(other.Font)
                 ) &&
                 (
                     ValuesSrc == other.ValuesSrc ||
                     ValuesSrc != null &&
                     ValuesSrc.Equals(other.ValuesSrc)
                 ) &&
                 (
                     FormatSrc == other.FormatSrc ||
                     FormatSrc != null &&
                     FormatSrc.Equals(other.FormatSrc)
                 ) &&
                 (
                     PrefixSrc == other.PrefixSrc ||
                     PrefixSrc != null &&
                     PrefixSrc.Equals(other.PrefixSrc)
                 ) &&
                 (
                     SuffixSrc == other.SuffixSrc ||
                     SuffixSrc != null &&
                     SuffixSrc.Equals(other.SuffixSrc)
                 ) &&
                 (
                     AlignSrc == other.AlignSrc ||
                     AlignSrc != null &&
                     AlignSrc.Equals(other.AlignSrc)
                 ));
        }
Ejemplo n.º 42
0
        private void DrawHorz(FRPaintEventArgs e)
        {
            IGraphics g   = e.Graphics;
            Pen       pen = e.Cache.GetPen(BorderColor, BorderWidth * e.ScaleX, DashStyle.Solid);

            PointF     center        = (Parent as RadialGauge).Center;
            float      circleWidth   = Parent.Width / 16f;
            float      circleHeight  = Parent.Height / 16f;
            RectangleF pointerCircle = new RectangleF(center.X - circleWidth / 2 * e.ScaleX, center.Y - circleHeight / 2 * e.ScaleY, circleWidth * e.ScaleX, circleHeight * e.ScaleY);

            //double rotateTo = (scale.AverageValue - Parent.Minimum);
            double startAngle = -135 * RadialGauge.Radians;
            double angle      = (Parent.Value - Parent.Minimum) / scale.StepValue * scale.MajorStep * RadialGauge.Radians;

            if ((Parent as RadialGauge).Type == RadialGaugeType.Semicircle)
            {
                if ((Parent as RadialGauge).Position == RadialGaugePosition.Bottom || (Parent as RadialGauge).Position == RadialGaugePosition.Top)
                {
                    startAngle = -90 * RadialGauge.Radians;
                    if ((Parent as RadialGauge).Position == RadialGaugePosition.Bottom)
                    {
                        angle *= -1;
                    }
                }
                else if ((Parent as RadialGauge).Position == RadialGaugePosition.Left)
                {
                    startAngle = -180 * RadialGauge.Radians;
                }
                else if ((Parent as RadialGauge).Position == RadialGaugePosition.Right)
                {
                    startAngle = -180 * RadialGauge.Radians;
                    angle     *= -1;
                }
            }
            else if (RadialUtils.IsQuadrant(Parent))
            {
                if (RadialUtils.IsLeft(Parent) && RadialUtils.IsTop(Parent))
                {
                    startAngle = -90 * RadialGauge.Radians;
                }
                else if (RadialUtils.IsLeft(Parent) && RadialUtils.IsBottom(Parent))
                {
                    startAngle = -180 * RadialGauge.Radians;
                }
                else if (RadialUtils.IsRight(Parent) && RadialUtils.IsTop(Parent))
                {
                    startAngle = 90 * RadialGauge.Radians;
                }
                else if (RadialUtils.IsRight(Parent) && RadialUtils.IsBottom(Parent))
                {
                    startAngle = 180 * RadialGauge.Radians;
                    angle     *= -1;
                }
            }
            //double startAngle = rotateTo / scale.StepValue * -scale.MajorStep * RadialGauge.Radians;

            float ptrLineY     = center.Y - pointerCircle.Width / 2 - pointerCircle.Width / 5;
            float ptrLineY1    = scale.AvrTick.Y + scale.MinorTicks.Length * 1.7f;
            float ptrLineWidth = circleWidth / 3 * e.ScaleX;

            PointF[] pointerPerpStrt = new PointF[2];
            pointerPerpStrt[0] = new PointF(center.X - ptrLineWidth, ptrLineY);
            pointerPerpStrt[1] = new PointF(center.X + ptrLineWidth, ptrLineY);

            PointF[] pointerPerpEnd = new PointF[2];
            pointerPerpEnd[0] = new PointF(center.X - ptrLineWidth / 3, ptrLineY1);
            pointerPerpEnd[1] = new PointF(center.X + ptrLineWidth / 3, ptrLineY1);


            pointerPerpStrt = RadialUtils.RotateVector(pointerPerpStrt, startAngle, center);
            pointerPerpEnd  = RadialUtils.RotateVector(pointerPerpEnd, startAngle, center);

            PointF[] rotatedPointerPerpStrt = RadialUtils.RotateVector(pointerPerpStrt, angle, center);
            PointF[] rotatedPointerPerpEnd  = RadialUtils.RotateVector(pointerPerpEnd, angle, center);

            //calc brush rect
            float x = 0, y = 0, dx = 0, dy = 0;

            if (angle / RadialGauge.Radians >= 0 && angle / RadialGauge.Radians < 45)
            {
                x  = rotatedPointerPerpEnd[1].X;
                y  = rotatedPointerPerpEnd[0].Y - (rotatedPointerPerpEnd[0].Y - pointerCircle.Y);
                dx = pointerCircle.X + pointerCircle.Width - rotatedPointerPerpEnd[0].X;
                dy = rotatedPointerPerpEnd[0].Y - pointerCircle.Y;
            }
            else if (angle / RadialGauge.Radians >= 45 && angle / RadialGauge.Radians < 90)
            {
                x  = rotatedPointerPerpEnd[0].X;
                y  = rotatedPointerPerpEnd[1].Y;
                dx = pointerCircle.X + pointerCircle.Width - rotatedPointerPerpEnd[0].X;
                dy = pointerCircle.Y + pointerCircle.Height - rotatedPointerPerpEnd[0].Y;
            }
            else if (angle / RadialGauge.Radians >= 90 && angle / RadialGauge.Radians < 135)
            {
                x  = rotatedPointerPerpEnd[0].X;
                y  = rotatedPointerPerpEnd[1].Y;
                dx = pointerCircle.X + pointerCircle.Width - rotatedPointerPerpEnd[0].X;
                dy = pointerCircle.Y + pointerCircle.Height - rotatedPointerPerpEnd[1].Y;
            }
            else if (angle / RadialGauge.Radians >= 135 && angle / RadialGauge.Radians < 225)
            {
                x  = pointerCircle.X;
                y  = rotatedPointerPerpEnd[0].Y;
                dx = rotatedPointerPerpEnd[1].X - pointerCircle.X;
                dy = pointerCircle.Y + pointerCircle.Height - rotatedPointerPerpEnd[0].Y;
            }
            else if (angle / RadialGauge.Radians >= 225)
            {
                x  = pointerCircle.X;
                y  = pointerCircle.Y;
                dx = rotatedPointerPerpEnd[0].X - pointerCircle.X;
                dy = rotatedPointerPerpEnd[1].Y - pointerCircle.Y;
            }
            RectangleF brushRect = new RectangleF(x, y, dx, dy);

            if (gradAutoRotate && Fill is LinearGradientFill)
            {
                (Fill as LinearGradientFill).Angle = (int)(startAngle / RadialGauge.Radians + angle / RadialGauge.Radians) + 90;
            }
            Brush brush          = Fill.CreateBrush(brushRect, e.ScaleX, e.ScaleY);

            PointF[] p = new PointF[]
            {
                rotatedPointerPerpStrt[0],
                rotatedPointerPerpStrt[1],
                rotatedPointerPerpEnd[1],
                rotatedPointerPerpEnd[0],
            };
            GraphicsPath path = new GraphicsPath();

            path.AddLines(p);
            path.AddLine(p[3], p[0]);

            g.FillEllipse(brush, pointerCircle);
            g.DrawEllipse(pen, pointerCircle);

            g.FillPath(brush, path);
            g.DrawPath(pen, path);
        }
Ejemplo n.º 43
0
        /// <inheritdoc/>
        public override bool Equals(object obj)
        {
            HighlightCondition c = obj as HighlightCondition;

            return(c != null && Expression == c.Expression && Border.Equals(c.Border) && Fill.Equals(c.Fill) &&
                   TextFill.Equals(c.TextFill) && Font.Equals(c.Font) && Visible == c.Visible &&
                   ApplyBorder == c.ApplyBorder && ApplyFill == c.ApplyFill && ApplyTextFill == c.ApplyTextFill &&
                   ApplyFont == c.ApplyFont);
        }
Ejemplo n.º 44
0
        private void OnInstrumentFill(int qty, string BS, string price, string key)
        {
            // Update position.
            if (BS == "B")
            {
                m_Position += qty;
            }
            else
            {
                m_Position -= qty;
            }

            // Send the data to the TradeMacher.
            Fill m_Fill = new Fill();
            if (BS == "B")
                m_Fill.BS = TradeType.BUY;
            else
                m_Fill.BS = TradeType.SELL;

            m_Fill.Price = Convert.ToDouble(price);
            m_Fill.TradeID = key;
            m_Fill.Qty = qty;
            m_Matcher.Fill_Received(m_Fill);

            m_NetPos = m_Matcher.NetPos;
        }
Ejemplo n.º 45
0
        public List <ICommand> MakeTrace(TModel src, TModel model)
        {
            if (src.NumFilled != 0)
            {
                return(null);
            }

            ICommand modifyCommand = new Fill();

            ((Fill)modifyCommand).Diff.Dy = -1;
            if (model.Name.Contains("FD"))
            {
                modifyCommand = new Void();
                ((Void)modifyCommand).Diff.Dy = -1;
            }

            //      TState state = new TState(model);

            var result = new List <ICommand>();

            result.Add(new Flip());

            var current          = new TCoord();
            var dumpCureTraverse = new TDumpCubeTraverse(model);

            var iteration = 0;

            while ((iteration == 0) || !current.IsAtStart())
            {
                if (iteration == 295)
                {
                    int a = 0;
                }

                var next = model.Name.Contains("FA") ? dumpCureTraverse.Next() : dumpCureTraverse.NextDestroy();
                var move = new StraightMove();
                move.Diff = dumpCureTraverse.GetDirection();
                result.Add(move);
                //               {
                //                   List<ICommand> ss = new List<ICommand>();
                //                 ss.Add(move);
                //                 TCommandsReader cr = new TCommandsReader(ss);
                //                 state.Step(cr);
                //             }

                if ((next.Y > 0) && (model[next.X, next.Y - 1, next.Z] > 0))
                {
                    result.Add(modifyCommand);
                    //              {
                    //                  List<ICommand> ss = new List<ICommand>();
                    //                 ss.Add(move);
                    //                 TCommandsReader cr = new TCommandsReader(ss);
                    //                 state.Step(cr);
                    //            }
                }

                current = next;
                ++iteration;
            }

            result.Add(new Flip());
            result.Add(new Halt());

            return(result);
        }
Ejemplo n.º 46
0
 internal void FromHash(string Hash)
 {
     Fill f = new Fill();
     f.InnerXml = Hash;
     this.FromFill(f);
 }
Ejemplo n.º 47
0
        /*private static DocumentFormat.OpenXml.Spreadsheet.Borders CreateBorders()
        {
            var borders = new Borders();
            var border = new Border
            {
                LeftBorder = new LeftBorder(),
                RightBorder = new RightBorder(),
                TopBorder = new TopBorder(),
                BottomBorder = new BottomBorder(),
                DiagonalBorder = new DiagonalBorder()
            };
            borders.Append(border);

            //	All Boarder Index 1
            border = new Border
            {
                LeftBorder = new LeftBorder { Style = BorderStyleValues.Thin },
                RightBorder = new RightBorder { Style = BorderStyleValues.Thin },
                TopBorder = new TopBorder { Style = BorderStyleValues.Thin },
                BottomBorder = new BottomBorder { Style = BorderStyleValues.Thin },
                DiagonalBorder = new DiagonalBorder()
            };
            borders.Append(border);

            //	Top and Bottom Boarder Index 2
            border = new Border
            {
                LeftBorder = new LeftBorder(),
                RightBorder = new RightBorder(),
                TopBorder = new TopBorder { Style = BorderStyleValues.Thin },
                BottomBorder = new BottomBorder { Style = BorderStyleValues.Thin },
                DiagonalBorder = new DiagonalBorder()
            };
            borders.Append(border);

            //	Left Right
            border = new Border
            {
                LeftBorder = new LeftBorder { Style = BorderStyleValues.Thin },
                RightBorder = new RightBorder { Style = BorderStyleValues.Thin },
                TopBorder = new TopBorder(),
                BottomBorder = new BottomBorder(),
                DiagonalBorder = new DiagonalBorder()
            };
            borders.Append(border);

            //	Left Top Right
            border = new Border
            {
                LeftBorder = new LeftBorder { Style = BorderStyleValues.Thin },
                RightBorder = new RightBorder { Style = BorderStyleValues.Thin },
                TopBorder = new TopBorder { Style = BorderStyleValues.Thin },
                BottomBorder = new BottomBorder(),
                DiagonalBorder = new DiagonalBorder()
            };
            borders.Append(border);

            //	Left Bottom Right
            border = new Border
            {
                LeftBorder = new LeftBorder { Style = BorderStyleValues.Thin },
                RightBorder = new RightBorder { Style = BorderStyleValues.Thin },
                TopBorder = new TopBorder(),
                BottomBorder = new BottomBorder { Style = BorderStyleValues.Thin },
                DiagonalBorder = new DiagonalBorder()
            };
            borders.Append(border);

            //	Bottom
            border = new Border
            {
                LeftBorder = new LeftBorder(),
                RightBorder = new RightBorder(),
                TopBorder = new TopBorder(),
                BottomBorder = new BottomBorder { Style = BorderStyleValues.Thin },
                DiagonalBorder = new DiagonalBorder()
            };
            borders.Append(border);

            borders.Count = UInt32Value.FromUInt32((uint)borders.ChildElements.Count);
            return borders;
        }*/
        private static DocumentFormat.OpenXml.Spreadsheet.Fills CreateFills()
        {
            var fills = new Fills();
            var fill = new Fill();
            var patternFill = new PatternFill { PatternType = PatternValues.None };
            fill.PatternFill = patternFill;
            fills.Append(fill);
            fill = new Fill();
            patternFill = new PatternFill { PatternType = PatternValues.Gray125 };
            fill.PatternFill = patternFill;
            fills.Append(fill);
            //Fill index  2
            fill = new Fill();
            patternFill = new PatternFill
            {
                PatternType = PatternValues.Solid,
                ForegroundColor = new ForegroundColor()
            };
            patternFill.ForegroundColor =
                 TranslateForeground(System.Windows.Media.Colors.LightBlue);
            patternFill.BackgroundColor =
                    new BackgroundColor { Rgb = patternFill.ForegroundColor.Rgb };
            fill.PatternFill = patternFill;
            fills.Append(fill);
            //Fill index  3
            fill = new Fill();
            patternFill = new PatternFill
            {
                PatternType = PatternValues.Solid,
                ForegroundColor = new ForegroundColor()
            };
            patternFill.ForegroundColor =
                 TranslateForeground(System.Windows.Media.Colors.DodgerBlue);
            patternFill.BackgroundColor =
                 new BackgroundColor { Rgb = patternFill.ForegroundColor.Rgb };
            fill.PatternFill = patternFill;
            fills.Append(fill);
            fills.Count = UInt32Value.FromUInt32((uint)fills.ChildElements.Count);
            return fills;
        }
Ejemplo n.º 48
0
        internal void FromFill(Fill f)
        {
            this.SetAllNull();

            bool bFound = false;
            if (f.PatternFill != null)
            {
                this.pfReal = new SLPatternFill(this.listThemeColors, this.listIndexedColors);
                this.pfReal.FromPatternFill(f.PatternFill);
                this.UsePatternFill = true;
                bFound = pfReal.HasForegroundColor || pfReal.HasBackgroundColor || pfReal.HasPatternType;
            }
            else if (f.GradientFill != null)
            {
                this.gfReal = new SLGradientFill(this.listThemeColors, this.listIndexedColors);
                this.gfReal.FromGradientFill(f.GradientFill);
                this.UsePatternFill = false;
                bFound = (gfReal.listGradientStops.Count > 0) || gfReal.HasType || gfReal.Degree != null || gfReal.Left != null || gfReal.Right != null || gfReal.Top != null || gfReal.Bottom != null;
            }

            if (bFound)
            {
                HasBeenAssignedValues = true;
            }
            else
            {
                HasBeenAssignedValues = false;

                // must have either PatternFill or GradientFill
                // Default will be an empty PatternFill
                this.pfReal = new SLPatternFill(this.listThemeColors, this.listIndexedColors);
                this.pfReal.PatternType = PatternValues.None;
                this.UsePatternFill = true;

                RemoveGradientFill();
            }
        }
Ejemplo n.º 49
0
        internal Fill ToFill()
        {
            Fill f = new Fill();
            if (UsePatternFill)
            {
                f.PatternFill = this.pfReal.ToPatternFill();
            }
            else
            {
                f.GradientFill = this.gfReal.ToGradientFill();
            }

            return f;
        }
Ejemplo n.º 50
0
    public void SetFill(Fill fill)
    {
        this.fill = fill;

        if (style != null)
        {
            style.SetFill(fill, this);
        }
    }
Ejemplo n.º 51
0
 /**
  * Fill properties of this shape
  *
  * @return fill properties of this shape
  */
 public Fill GetFill()
 {
     if (_fill == null) _fill = new Fill(this);
     return _Fill;
 }
Ejemplo n.º 52
0
        public static Stylesheet CreateStylesheet()
        {
            var ss = new Stylesheet();

            var fts = new Fonts();
            var ftn = new FontName { Val = "Arial" };
            var ftsz = new FontSize { Val = 11 };
            var ft = new DocumentFormat.OpenXml.Spreadsheet.Font { FontName = ftn, FontSize = ftsz };
            fts.Append(ft);
            fts.Count = (uint)fts.ChildElements.Count;

            var fills = new Fills();
            var fill = new Fill();
            var patternFill = new PatternFill { PatternType = PatternValues.None };
            fill.PatternFill = patternFill;
            fills.Append(fill);

            fill = new Fill();
            patternFill = new PatternFill { PatternType = PatternValues.Gray125 };
            fill.PatternFill = patternFill;
            fills.Append(fill);

            fills.Count = (uint)fills.ChildElements.Count;

            var borders = new Borders();
            var border = new Border
            {
                LeftBorder = new LeftBorder(),
                RightBorder = new RightBorder(),
                TopBorder = new TopBorder(),
                BottomBorder = new BottomBorder(),
                DiagonalBorder = new DiagonalBorder()
            };
            borders.Append(border);
            borders.Count = (uint)borders.ChildElements.Count;

            var csfs = new CellStyleFormats();
            var cf = new CellFormat { NumberFormatId = 0, FontId = 0, FillId = 0, BorderId = 0 };
            csfs.Append(cf);
            csfs.Count = (uint)csfs.ChildElements.Count;

            // dd/mm/yyyy is also Excel style index 14

            uint iExcelIndex = 164;
            var nfs = new NumberingFormats();
            var cfs = new CellFormats();

            cf = new CellFormat { NumberFormatId = 0, FontId = 0, FillId = 0, BorderId = 0, FormatId = 0 };
            cfs.Append(cf);

            var nf = new NumberingFormat { NumberFormatId = iExcelIndex, FormatCode = "dd/mm/yyyy hh:mm:ss" };
            nfs.Append(nf);

            cf = new CellFormat
            {
                NumberFormatId = nf.NumberFormatId,
                FontId = 0,
                FillId = 0,
                BorderId = 0,
                FormatId = 0,
                ApplyNumberFormat = true
            };
            cfs.Append(cf);

            iExcelIndex = 165;
            nfs = new NumberingFormats();
            cfs = new CellFormats();

            cf = new CellFormat { NumberFormatId = 0, FontId = 0, FillId = 0, BorderId = 0, FormatId = 0 };
            cfs.Append(cf);

            nf = new NumberingFormat { NumberFormatId = iExcelIndex, FormatCode = "MMM yyyy" };
            nfs.Append(nf);

            cf = new CellFormat
            {
                NumberFormatId = nf.NumberFormatId,
                FontId = 0,
                FillId = 0,
                BorderId = 0,
                FormatId = 0,
                ApplyNumberFormat = true
            };
            cfs.Append(cf);

            iExcelIndex = 170;
            nf = new NumberingFormat { NumberFormatId = iExcelIndex, FormatCode = "#,##0.0000" };
            nfs.Append(nf);
            cf = new CellFormat
            {
                NumberFormatId = nf.NumberFormatId,
                FontId = 0,
                FillId = 0,
                BorderId = 0,
                FormatId = 0,
                ApplyNumberFormat = true
            };
            cfs.Append(cf);

            // #,##0.00 is also Excel style index 4
            iExcelIndex = 171;
            nf = new NumberingFormat { NumberFormatId = iExcelIndex, FormatCode = "#,##0.00" };
            nfs.Append(nf);
            cf = new CellFormat
            {
                NumberFormatId = nf.NumberFormatId,
                FontId = 0,
                FillId = 0,
                BorderId = 0,
                FormatId = 0,
                ApplyNumberFormat = true
            };
            cfs.Append(cf);

            // @ is also Excel style index 49
            iExcelIndex = 172;
            nf = new NumberingFormat { NumberFormatId = iExcelIndex, FormatCode = "@" };
            nfs.Append(nf);
            cf = new CellFormat
            {
                NumberFormatId = nf.NumberFormatId,
                FontId = 0,
                FillId = 0,
                BorderId = 0,
                FormatId = 0,
                ApplyNumberFormat = true
            };
            cfs.Append(cf);

            nfs.Count = (uint)nfs.ChildElements.Count;
            cfs.Count = (uint)cfs.ChildElements.Count;

            ss.Append(nfs);
            ss.Append(fts);
            ss.Append(fills);
            ss.Append(borders);
            ss.Append(csfs);
            ss.Append(cfs);

            var css = new CellStyles();
            var cs = new CellStyle { Name = "Normal", FormatId = 0, BuiltinId = 0 };
            css.Append(cs);
            css.Count = (uint)css.ChildElements.Count;
            ss.Append(css);

            var dfs = new DifferentialFormats { Count = 0 };
            ss.Append(dfs);

            var tss = new TableStyles
            {
                Count = 0,
                DefaultTableStyle = "TableStyleMedium9",
                DefaultPivotStyle = "PivotStyleLight16"
            };
            ss.Append(tss);

            return ss;
        }
Ejemplo n.º 53
0
 public OnFill(Portfolio portfolio, Fill fill)
 {
     this.Portfolio = portfolio;
     this.Fill = fill;
 }
Ejemplo n.º 54
0
 public static Fill CreateFill(Fills fills, PatternValues patternType)
 {
     var fill = new Fill();
     fill.Append(new PatternFill { PatternType = patternType });
     fills.Append(fill);
     return fill;
 }
Ejemplo n.º 55
0
  private void fillPart( int x, int y, int rep )
  {
   Fill st = new Fill( x, y, 0 );
   Queue< Fill > que = new Queue<Fill>();
   que.Enqueue( st );

   while( que.Count != 0 )
   {
    st = que.Dequeue();

    if( st.x > -1 && st.x < LoadSave.W && st.y > -1 && st.y < LoadSave.H &&
        map[ st.x ][ st.y ].ID == rep && lyr[ st.x ][ st.y ] != -16711936 &&
      ( selectArea.Width == 0 || lyr[ st.x ][ st.y ] == disp ))
    {
     lyr[ st.x ][ st.y ] = -16711936; // set to 0xff00ff00

     if( st.dir != 3 )
      que.Enqueue( new Fill( st.x, st.y - 1, 1 ));

     if( st.dir != 4 )
      que.Enqueue( new Fill( st.x - 1, st.y, 2 ));

     if( st.dir != 1 )
      que.Enqueue( new Fill( st.x, st.y + 1, 3 ));

     if( st.dir != 2 )
      que.Enqueue( new Fill( st.x + 1, st.y, 4 ));

    }
   }
  }
 public override bool IsMatch(Fill fill)
 {
     return m_Qty.Equals(fill.Quantity);
 }
 public override bool IsMatch(Fill fill)
 {
     return m_Price.Equals(fill.MatchPrice);
 }
 public override bool IsMatch(Fill fill)
 {
     return m_BuySell.Equals(fill.BuySell);
 }
Ejemplo n.º 59
-1
        public static UInt32Value CreateFill(Stylesheet styleSheet, System.Drawing.Color fillColor)
        {
            PatternFill patternFill =
                new PatternFill(
                    new ForegroundColor()
                    {
                        Rgb = new HexBinaryValue()
                        {
                            Value =
                            System.Drawing.ColorTranslator.ToHtml(
                                System.Drawing.Color.FromArgb(
                                    fillColor.A,
                                    fillColor.R,
                                    fillColor.G,
                                    fillColor.B)).Replace("#", "")
                        }
                    });

            patternFill.PatternType = fillColor ==
                        System.Drawing.Color.White ? PatternValues.None : PatternValues.LightDown;

            Fill fill = new Fill(patternFill);

            styleSheet.Fills.Append(fill);

            UInt32Value result = styleSheet.Fills.Count;
            styleSheet.Fills.Count++;
            return result;
        }
Ejemplo n.º 60
-1
 private static Fill CreateEmptyFill()
 {
     var fill = new Fill();
     var patternFill = new PatternFill();
     patternFill.PatternType = PatternValues.None;
     return fill;
 }