protected override void OnClick()
 {
     IMxDocument pMxDoc = ArcMap.Application.Document as IMxDocument;
     IMap pMap = pMxDoc.FocusMap;
     IFeatureLayer pFeatLayer = pMap.Layer[0] as IFeatureLayer;
     IFeatureSelection featSel = pFeatLayer as IFeatureSelection;
     ISimpleFillSymbol polySym = new SimpleFillSymbol();
     IRgbColor pColor = new RgbColor();
     pColor.Red = 0;
     pColor.Green = 250;
     pColor.Blue = 0;
     IRgbColor pOutColor = new RgbColor();
     pOutColor.Red = 0;
     pOutColor.Green = 0;
     pOutColor.Blue = 250;
     ILineSymbol pLineSym = new SimpleLineSymbol();
     pLineSym.Color = pOutColor;
     pLineSym.Width = 2;
     polySym.Color = pColor;
     polySym.Outline = pLineSym;
     featSel.SetSelectionSymbol = true;
     featSel.SelectionSymbol = polySym as ISymbol;
     //
     ArcMap.Application.CurrentTool = null;
 }
        /// <summary>
        /// Adds a mapping from the given RGB color to the given ARGB color.
        /// </summary>
        /// <param name="source">The source RGB color.</param>
        /// <param name="destination">The destination ARGB color.</param>
        /// <exception cref="T:System.ArgumentException">The <paramref name="source"/> and <paramref name="destination"/> colors are
        /// identical, and thus this mapping is trivial.</exception>
        public void AddMapping(RgbColor source, ArgbColor destination)
        {
            if (source.ToArgb() == destination.ToArgb())
                throw new ArgumentException(
                    "source and destination colors are identical. Trivial mappings may not be explicitly defined.");

            map.Add(source, destination);
        }
Esempio n. 3
0
        /// <summary>
        /// Convert a color to a string
        /// </summary>
        /// <param name="color">the windows forms color</param>
        /// <returns>the color in a string</returns>
        private static string ConvertColor(System.Drawing.Color color)
        {
            int i = color.ToArgb();
            byte r = (byte)((i >> 16) & 255);
            byte g = (byte)((i >> 8) & 255);
            byte b = (byte)(i & 255);

            RgbColor rgbColor = new RgbColor(r, g, b);
            return rgbColor.ToString();
        }
Esempio n. 4
0
        internal void AddPPGeocodedPoint(double lat, double lng)
        {
            // Set the coordinate system of the data frame.
            ArcMap.Document.ActiveView.FocusMap.SpatialReference = DefineGCS(); 
            ArcMap.Document.ActiveView.Refresh();

            IPoint iPoint = new PointClass();
            // Set the coordinate system of your point to match your data frame
            iPoint.SpatialReference = DefineGCS();
            iPoint.X = lng;
            iPoint.Y = lat;

            IMap map = ArcMap.Document.ActiveView as IMap;
            IGraphicsContainer graphicsContainer = (IGraphicsContainer)map; // Explicit Cast
            IElement element = null;

            // set the point color
            IColor pointColor = new RgbColor();
            //pointColor.RGB = 255255255;
            pointColor.RGB = 255000000;

            // Marker symbols
            ESRI.ArcGIS.Display.ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass();
            simpleMarkerSymbol.Color = pointColor;
            simpleMarkerSymbol.Outline = true;
            simpleMarkerSymbol.OutlineColor = pointColor;
            simpleMarkerSymbol.Size = 10;
            simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;

            // Marker element
            IMarkerElement markerElement = new MarkerElementClass();
            markerElement.Symbol = simpleMarkerSymbol;
            markerElement.Symbol.Color = pointColor;

            element = (IElement)markerElement; // Explicit Cast

            // set the element name
            IElementProperties3 elemProperties = element as IElementProperties3;
            elemProperties.Name = string.Concat(lng, " ,", lat);
            elemProperties.AnchorPoint = esriAnchorPointEnum.esriCenterPoint;

            // Add the element to a graphics container and refresh the ActiveView
            if (!(element == null))
            {
                element.Geometry = iPoint;
                graphicsContainer.AddElement(element, 0);
                IEnvelope envelope = new EnvelopeClass();
                envelope = ArcMap.Document.ActiveView.Extent;
                envelope.CenterAt(iPoint);
                //ArcMap.Document.ActiveView.Extent = envelope;
                //map.MapScale = 2400;
                map.MapScale = 5000;
                ArcMap.Document.ActiveView.Refresh();
            }
        }
Esempio n. 5
0
        public override byte[] Render()
        {
            if (TimePassed(5))
            {
                if (FirstFrame)
                {
                    Image.SetAll(_bgcolor);
                }

                for (int i = 0; i < LedCount; i++)
                {
                    if (_pixelArray[i] > 256)
                    {
                        _pixelArray[i] = _pixelArray[i] - 500 / (256 - _speed) * 4 > 0 ? _pixelArray[i] - 500 / (256 - _speed) * 4 : 0;
                    }
                    else
                    {
                        _pixelArray[i] = _pixelArray[i] - 500 / (256 - _speed) > 0 ? _pixelArray[i] - 500 / (256 - _speed) : 0;
                    }
                }

                if (Rndm.Next(1000) < _count)
                {
                    var index = RndmIndex();
                    if (_pixelArray[index] < 0.1)
                    {
                        _pixelArray[index] = 510;
                    }
                }

                for (int i = 0; i < LedCount; i++)
                {
                    if (_pixelArray[i] != 0)
                    {
                        RgbColor newColor;

                        if (_pixelArray[i] > 255)
                        {
                            newColor = RgbColor.Transition(_color, _bgcolor, ((_pixelArray[i] - 255) + 1) / 256, _evenColors);
                        }
                        else
                        {
                            newColor = RgbColor.Transition(_bgcolor, _color, (_pixelArray[i] + 1) / 256, _evenColors);
                        }
                        Image.Leds[i] = newColor;
                    }
                    else
                    {
                        Image.Leds[i] = _bgcolor;
                    }
                }
                return(Image.ToByteArray());
            }
            return(null);
        }
Esempio n. 6
0
        private void ReadColors(BinaryReader reader, Swatch swatch, int count, short version)
        {
            for (int i = 0; i < count; i++)
            {
                var space = (ColorSpace)reader.ReadInt16();
                var item1 = reader.ReadUInt16();
                var item2 = reader.ReadUInt16();
                var item3 = reader.ReadUInt16();
                var item4 = reader.ReadUInt16();

                ColorBase color = null;
                switch (space)
                {
                case ColorSpace.RGB:
                    color = new RgbColor(Convert.ToByte(item1 / 256), Convert.ToByte(item2 / 256), Convert.ToByte(item3 / 256));
                    break;

                case ColorSpace.HSB:
                    color = new HsvColor(item1 / 65535f, item2 / 65535f, item3 / 65535f);
                    break;

                case ColorSpace.Grayscale:
                    color = new GrayColor(item1 / 10000f);
                    break;

                case ColorSpace.CMYK:
                    color = new CmykColor(1f - (item1 / 65535f), 1f - (item2 / 65535f), 1f - (item3 / 65535f), 1f - (item4 / 65535f));
                    break;

                case ColorSpace.WideCMYK:
                    color = new CmykColor(item1 / 10000f, item2 / 10000f, item3 / 10000f, item4 / 10000f);
                    break;

                case ColorSpace.Lab:
                    color = new LabColor((short)(item1 / 100), (short)(item2 / 100), (short)(item3 / 100));
                    break;

                default:
                    break;
                }

                if (version == 2)
                {
                    reader.ReadBytes(2);
                    var nameLength = reader.ReadInt16() * 2;
                    if (nameLength > 0)
                    {
                        var nameBuffer = reader.ReadBytes(nameLength);
                        color.Name = Encoding.BigEndianUnicode.GetString(nameBuffer, 0, nameLength - 2);
                    }
                }

                swatch.Colors.Add(color);
            }
        }
Esempio n. 7
0
        internal static ICmyk TranslateColor(IRgb rgb, Uri cmykProfile, Uri rgbProfile)
        {
            const double dividend    = 65535;
            var          profileName = new StringBuilder(256);
            var          size        = (uint)profileName.Capacity * 2;

            ProfileFilename sRgbFilename;

            if (rgbProfile == null)
            {
                GetStandardColorSpaceProfile(0, LogicalColorSpace.SRgb, profileName, ref size);
                sRgbFilename = new ProfileFilename(profileName.ToString());
            }
            else
            {
                sRgbFilename = new ProfileFilename(rgbProfile.LocalPath);
            }

            var hSRgbProfile = OpenColorProfile(sRgbFilename, ProfileRead, FileShare.Read,
                                                CreateDisposition.OpenExisting);
            var isoCoatedFilename = new ProfileFilename(cmykProfile.LocalPath);
            var hIsoCoatedProfile = OpenColorProfile(isoCoatedFilename, ProfileRead, FileShare.Read,
                                                     CreateDisposition.OpenExisting);

            var profiles  = new[] { hSRgbProfile, hIsoCoatedProfile };
            var intents   = new[] { IntentPerceptual };
            var transform = CreateMultiProfileTransform(profiles, 2, intents, 1, ColorTransformMode.BestMode,
                                                        IndexDontCare);

            var rgbColors = new RgbColor[1];

            rgbColors[0] = new RgbColor();

            var cmykColors = new CmykColor[1];

            cmykColors[0] = new CmykColor();

            rgbColors[0].red   = (ushort)(rgb.R * dividend / 255.0);
            rgbColors[0].green = (ushort)(rgb.G * dividend / 255.0);
            rgbColors[0].blue  = (ushort)(rgb.B * dividend / 255.0);

            TranslateColors(transform, rgbColors, 1, ColorType.Rgb, cmykColors, ColorType.Cmyk);

            DeleteColorTransform(transform);
            CloseColorProfile(hSRgbProfile);
            CloseColorProfile(hIsoCoatedProfile);

            return(new Cmyk
            {
                C = cmykColors[0].cyan / dividend,
                M = cmykColors[0].magenta / dividend,
                Y = cmykColors[0].yellow / dividend,
                K = cmykColors[0].black / dividend
            });
        }
Esempio n. 8
0
        private void btnLabel_Click(object sender, RoutedEventArgs e)
        {
            //The FeatureLayer for labelling


            IFeatureLayer    labelLayer  = this.m_map.Map.get_Layer(0) as IFeatureLayer;
            IGeoFeatureLayer gLabelLayer = labelLayer as IGeoFeatureLayer;
            IAnnotateLayerPropertiesCollection annoPropCol = gLabelLayer.AnnotationProperties;

            annoPropCol.Clear();
            //ITextSymbol uasage
            ITextSymbol pTextSyl = new TextSymbol();
            //Font fnt = new System.Drawing.Font("宋体", 10f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
            //using stdole
            IFontDisp font = new StdFont() as IFontDisp;

            font.Size   = 20;
            font.Italic = true;
            // pTextSyl.Size = 20;
            pTextSyl.Font = font;
            //IRgbColor fromColor = new RgbColor(255,0, 0);
            //ESRI.ArcGIS.Display.RgbColorClass()
            RgbColor color = new RgbColor();

            color.Red      = 255;
            color.Green    = 0;
            color.Blue     = 0;
            pTextSyl.Color = color;
            //Position
            IBasicOverposterLayerProperties pBasic = new BasicOverposterLayerProperties();

            //   if (labelLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)
            //   {
            IPointPlacementPriorities pPlacementPoint = new PointPlacementPriorities();

            pBasic.FeatureType = esriBasicOverposterFeatureType.esriOverposterPoint;
            pBasic.PointPlacementPriorities = pPlacementPoint;
            pBasic.PointPlacementOnTop      = false;
            pBasic.PointPlacementMethod     = esriOverposterPointPlacementMethod.esriOnTopPoint;// esriAroundPoint;
            //      }

            //Point a field as a label
            ILabelEngineLayerProperties labelField = new LabelEngineLayerProperties() as ILabelEngineLayerProperties;

            labelField.Expression = "[name]";
            //set postion
            labelField.BasicOverposterLayerProperties = pBasic;
            //set  symbol
            labelField.Symbol = pTextSyl;
            IAnnotateLayerProperties annoProp = labelField as IAnnotateLayerProperties;

            annoPropCol.Add(annoProp);
            gLabelLayer.DisplayAnnotation = true;
            m_map.Refresh();
        }
Esempio n. 9
0
        public void MixWithIsNotAssociative()
        {
            // Counter-example
            var x = new RgbColor(67, 108, 13);
            var y = new RgbColor(33, 114, 130);
            var z = new RgbColor(38, 104, 245);

            Assert.NotEqual(
                x.MixWith(y).MixWith(z),
                x.MixWith(y.MixWith(z)));
        }
Esempio n. 10
0
 public override void RegisterSample(RgbColor weight, float misWeight, Vector2 pixel,
                                     int cameraPathLength, int lightPathLength, int fullLength)
 {
     if (!RenderTechniquePyramid)
     {
         return;
     }
     weight /= NumIterations;
     techPyramidRaw.Add(cameraPathLength, lightPathLength, fullLength, pixel, weight);
     techPyramidWeighted.Add(cameraPathLength, lightPathLength, fullLength, pixel, weight * misWeight);
 }
Esempio n. 11
0
    private static LabColor RgbToLabColor(RgbColor color)
    {
        using (var bitmap = new Aurigma.GraphicsMill.Bitmap(1, 1, PixelFormat.Format24bppRgb, color))
        {
            bitmap.ColorProfile = ColorProfile.FromSrgb();

            bitmap.ColorManagement.Convert(PixelFormat.Format24bppLab);

            return((LabColor)bitmap.GetPixel(0, 0));
        }
    }
Esempio n. 12
0
        public void DrawSelGeometry()
        {
            ((IGraphicsContainer)this.m_app.FocusMap).DeleteAllElements();
            if (this.m_pDrawGeo != null)
            {
                IRgbColor rgbColor        = new RgbColor();
                IRgbColor selectionCorlor = this.m_app.Config.SelectionEnvironment.DefaultColor as IRgbColor;
                rgbColor.Blue         = ((int)selectionCorlor.Blue);
                rgbColor.Green        = ((int)selectionCorlor.Green);
                rgbColor.Red          = ((int)selectionCorlor.Red);
                rgbColor.Transparency = (selectionCorlor.Transparency);
                object  obj = null;
                int     selectionBufferInPixels = this.m_app.Config.SelectionEnvironment.SearchTolerance;
                ISymbol symbol = null;
                switch ((int)this.m_pDrawGeo.GeometryType)
                {
                case 1:
                {
                    ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol();
                    symbol      = (ISymbol)simpleMarkerSymbol;
                    symbol.ROP2 = (esriRasterOpCode)(10);
                    simpleMarkerSymbol.Color = (rgbColor);
                    simpleMarkerSymbol.Size  =
                        ((double)(selectionBufferInPixels + selectionBufferInPixels + selectionBufferInPixels));
                    break;
                }

                case 3:
                {
                    ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbol();
                    symbol                 = (ISymbol)simpleLineSymbol;
                    symbol.ROP2            = (esriRasterOpCode)(10);
                    simpleLineSymbol.Color = (rgbColor);
                    simpleLineSymbol.Color.Transparency = (1);
                    simpleLineSymbol.Width = ((double)selectionBufferInPixels);
                    break;
                }

                case 4:
                case 5:
                {
                    ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbol();
                    symbol                 = (ISymbol)simpleFillSymbol;
                    symbol.ROP2            = (esriRasterOpCode)(10);
                    simpleFillSymbol.Color = (rgbColor);
                    simpleFillSymbol.Color.Transparency = (1);
                    break;
                }
                }
                obj = symbol;

                this.m_app.MapControl.DrawShape(this.m_pDrawGeo, ref obj);
            }
        }
Esempio n. 13
0
        public void DrawEnvelope(IEnvelope envelope)
        {
            if (envelope == null)
            {
                return;
            }
            try
            {
                //将鹰眼地图设置为地理容器,再设置为活动视图
                IGraphicsContainer pGraphicsContainer = this.axMapControl.Map as IGraphicsContainer;
                IActiveView        pActiveView        = pGraphicsContainer as IActiveView;
                //清除鹰眼地图中的任何图形元素
                pGraphicsContainer.DeleteAllElements();
                //设置矩形范围
                IRectangleElement pRectangeEle = new RectangleElementClass();
                IElement          pElement     = pRectangeEle as IElement;
                pElement.Geometry = envelope;

                //创建鹰眼图中的红线框
                IRgbColor pColor = new RgbColor();
                pColor.Red          = 255;
                pColor.Blue         = 0;
                pColor.Green        = 0;
                pColor.Transparency = 255;
                //创建线符号对象
                ILineSymbol pOutline = new SimpleLineSymbolClass();
                pOutline.Width = 2;
                pOutline.Color = pColor;

                //设置颜色属性
                pColor              = new RgbColorClass();
                pColor.Red          = 255;
                pColor.Blue         = 0;
                pColor.Green        = 0;
                pColor.Transparency = 0;

                //设置填充符号
                IFillSymbol pFillSymbol = new SimpleFillSymbolClass();
                pFillSymbol.Color   = pColor;
                pFillSymbol.Outline = pOutline;

                IFillShapeElement pFillShapeEle = pElement as IFillShapeElement;
                pFillShapeEle.Symbol = pFillSymbol;

                pGraphicsContainer.AddElement((IElement)pFillShapeEle, 0);
                pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);

                interEnvelope = envelope;
            }
            catch (Exception ex)
            {
                LoggingService.Error(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
    private static void RgbToLabWithColorManagement()
    {
        RgbColor rgbColor = new RgbColor(223, 210, 30)
        {
            Profile = ColorProfile.FromSrgb()
        };

        LabColor labColor = rgbColor.To <LabColor>();

        Console.WriteLine("With color management: {0} to {1}", rgbColor, labColor);
    }
Esempio n. 15
0
        public async Task ExecuteAsync()
        {
            var senseHat       = _senseHatFactory.Create();
            var foregroundPink = new RgbColor(255, 0, 255);
            var config         = _ledPixelConfigFactory.CreateForNumber(
                1,
                foregroundPink,
                RgbColor.CreateBlack());

            await senseHat.LedMatrix.ShowPixels(config);
        }
Esempio n. 16
0
 public void SetColor(RgbColor color)
 {
     // Keyboard
     CueSDK.KeyboardSDK.Brush = (SolidColorBrush)color.GetColor();
     foreach (var corsairLed in _keyboard.GetLeds())
     {
         corsairLed.Color = color.GetColor();
     }
     _keyboard.Update();
     // TODO: Mouse, Mousepad, and headset
 }
Esempio n. 17
0
 public HtmlColorSample(string name, RgbColor @base, string hex, HtmlColorSampleRgb rgb, HtmlColorSampleHsl hsl, HtmlColorSampleHsv hsv, HtmlColorSampleCmy cmy, HtmlColorSampleCmyk cmyk)
 {
     Name = name;
     Base = @base;
     Hex  = hex;
     Rgb  = rgb;
     Hsl  = hsl;
     Hsv  = hsv;
     Cmy  = cmy;
     Cmyk = cmyk;
 }
Esempio n. 18
0
 protected override RgbColor OnInvalidHit(Ray ray, float pdfFromAncestor, RgbColor throughput,
                                          int depth)
 {
     path.Vertices.Add(new PathPdfPair {
         PdfFromAncestor = pdfFromAncestor,
         PdfToAncestor   = 0
     });
     path.Throughput = throughput;
     path.Distances.Add(float.PositiveInfinity);
     return(integrator.OnBackgroundHit(ray, path));
 }
    private static void RgbToCmykWithColorManagement()
    {
        RgbColor rgbColor = new RgbColor(253, 202, 12)
        {
            Profile = ColorProfile.FromSrgb()
        };

        CmykColor cmykColor = rgbColor.To <CmykColor>("../../../../_Input/ColorProfiles/ISOcoated_v2_eci.icc", transformationIntent: ColorTransformationIntent.Perceptual);

        Console.WriteLine("With color management: {0} to {1}", rgbColor, cmykColor);
    }
    private static void CmykToRgbWithColorManagement()
    {
        CmykColor cmykColor = new CmykColor(20, 42, 211, 40)
        {
            Profile = new ColorProfile("../../../../_Input/ColorProfiles/ISOcoated_v2_eci.icc")
        };

        RgbColor rgbColor = cmykColor.To <RgbColor>(ColorProfile.FromSrgb());

        Console.WriteLine("With color management: {0} to {1}", cmykColor, rgbColor);
    }
Esempio n. 21
0
        public void TurnOffHalfWayThroughSecondBlink()
        {
            animation.RepeatBlink = 2;
            for (int i = animation.DurationBlink + animation.DurationBlink / 2; i < animation.DurationBlink * 2; i++)
            {
                RgbColor newColor = animation.GetColor(StartTime, StartTime.AddMilliseconds(i));

                Assert.AreEqual(RgbColor.Black().ToString(), newColor.ToString());
            }
            Assert.IsTrue(!animation.AnimationFinished);
        }
Esempio n. 22
0
        private static void SymbolInit()
        {
            //设置各种地图符号的颜色
            IRgbColor pFcolor;
            IRgbColor pOcolor;
            IRgbColor pTrackcolor;
            IRgbColor pVcolor;
            IRgbColor pSColor;

            pFcolor     = new RgbColor();
            pOcolor     = new RgbColor();
            pTrackcolor = new RgbColor();
            pVcolor     = new RgbColor();
            pSColor     = new RgbColor();
            pFcolor     = MapManager.GetRgbColor(255, 0, 0);
            pOcolor     = MapManager.GetRgbColor(0, 0, 255);
            pTrackcolor = MapManager.GetRgbColor(0, 255, 255);
            pVcolor     = MapManager.GetRgbColor(0, 255, 0);
            pSColor     = MapManager.GetRgbColor(0, 0, 0);
            //设置各种地图符号的属性
            m_markerSym              = new SimpleMarkerSymbol();
            m_markerSym.Style        = esriSimpleMarkerStyle.esriSMSCircle;
            m_markerSym.Color        = pFcolor;
            m_markerSym.Outline      = true;
            m_markerSym.OutlineColor = pOcolor;
            m_markerSym.OutlineSize  = 1;
            m_vertexSym              = new SimpleMarkerSymbol();
            m_vertexSym.Style        = esriSimpleMarkerStyle.esriSMSSquare;
            m_vertexSym.Color        = pVcolor;
            m_vertexSym.Size         = 4;
            m_selPointSym            = new SimpleMarkerSymbol();
            m_selPointSym.Style      = esriSimpleMarkerStyle.esriSMSSquare;
            m_selPointSym.Color      = pSColor;
            m_selPointSym.Size       = 4;
            m_endPointSym            = new SimpleMarkerSymbol();
            m_endPointSym.Style      = esriSimpleMarkerStyle.esriSMSSquare;
            m_endPointSym.Color      = pFcolor;
            m_endPointSym.Size       = 4;
            m_lineSym            = new SimpleLineSymbol();
            m_lineSym.Color      = pFcolor;
            m_lineSym.Width      = 1;
            m_tracklineSym       = new SimpleLineSymbol();
            m_tracklineSym.Color = pTrackcolor;
            m_tracklineSym.Width = 1;
            ISimpleLineSymbol pOsym = default(ISimpleLineSymbol);

            pOsym             = new SimpleLineSymbol();
            pOsym.Color       = pOcolor;
            pOsym.Width       = 1;
            m_fillSym         = new SimpleFillSymbol();
            m_fillSym.Color   = pFcolor;
            m_fillSym.Style   = esriSimpleFillStyle.esriSFSVertical;
            m_fillSym.Outline = pOsym;
        }
Esempio n. 23
0
        public override void OnCreate(object hook)
        {
            this.m_caption  = "节点编辑工具";
            this.m_category = "编辑";
            this.m_toolTip  = "节点编辑工具";
            this.m_name     = "Edit_VerticsEdit";
            _context        = hook as IAppContext;
            this._key       = "Edit_VerticsEdit";
            base._itemType  = RibbonItemType.Tool;
            this.m_cursor   =
                new System.Windows.Forms.Cursor(
                    base.GetType()
                    .Assembly.GetManifestResourceStream("Yutai.Plugins.Editor.Resources.Cursor.DeleteVertex.cur"));
            this.isymbol_0 = new SimpleMarkerSymbol() as ISymbol;
            (this.isymbol_0 as ISimpleMarkerSymbol).Style   = esriSimpleMarkerStyle.esriSMSSquare;
            (this.isymbol_0 as ISimpleMarkerSymbol).Size    = 6;
            (this.isymbol_0 as ISimpleMarkerSymbol).Outline = true;
            IRgbColor rgbColorClass = new RgbColor()
            {
                Red   = 255,
                Green = 0,
                Blue  = 0
            };

            (this.isymbol_0 as ISimpleMarkerSymbol).OutlineColor = rgbColorClass;
            (this.isymbol_0 as ISimpleMarkerSymbol).OutlineSize  = 2;
            IRgbColor rgbColor = new RgbColor()
            {
                NullColor = true
            };

            (this.isymbol_0 as ISimpleMarkerSymbol).Color = rgbColor;

            (_context as IApplicationEvents).OnActiveHookChanged +=
                new OnActiveHookChangedHandler(this.App_ActiveHookChanged);

            if (this.iactiveViewEvents_Event_0 != null)
            {
                try
                {
                    this.iactiveViewEvents_Event_0.AfterDraw -=
                        new IActiveViewEvents_AfterDrawEventHandler(this.ActiveView_AfterDraw);
                }
                catch
                {
                }
            }
            if (_context.FocusMap != null)
            {
                this.iactiveViewEvents_Event_0            = _context.ActiveView as IActiveViewEvents_Event;
                this.iactiveViewEvents_Event_0.AfterDraw +=
                    new IActiveViewEvents_AfterDrawEventHandler(this.ActiveView_AfterDraw);
            }
        }
Esempio n. 24
0
        public static IRgbColor MakeRGB(int int_0, int int_1, int int_2)
        {
            IRgbColor rgbColorClass = new RgbColor()
            {
                Red   = int_0,
                Green = int_1,
                Blue  = int_2
            };

            return(rgbColorClass);
        }
Esempio n. 25
0
        public static RgbColor RgbColor(System.Drawing.Color col)
        {
            RgbColor c = new RgbColor();

            c.Red        = col.R;
            c.Green      = col.G;
            c.Blue       = col.B;
            c.AlphaValue = col.A;

            return(c);
        }
Esempio n. 26
0
        /// <summary>
        /// Calculates the overall color at a specific location.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <param name="x">The location x.</param>
        /// <param name="radius">The analyzation radius.</param>
        /// <param name="quality">The quality (higher is better).</param>
        /// <returns>The overall color at a specific location.</returns>
        private static RgbColor CalculateColorAt(MultislitConfiguration configuration, double x, double radius, int quality)
        {
            RgbColor result = new RgbColor(0, 0, 0);

            foreach (WavelengthColorPair light in configuration.LightSources)
            {
                result = result + (light.Color * MultiSlitIntensityCalculator.CalculateIntensity(light.Wavelength, configuration.Slits, x, radius, quality));
            }

            return(result);
        }
Esempio n. 27
0
        public ActionResult DbEkle(string Renk)
        {
            // Arduino ile bağlantı kuruyorum. Eğer bağlantıda sorun çıkarsa catch'e atlayıp sayfayı yeniliyorum
            try
            {
                // Hex kodu int olarak renklere ayırıyorum
                string colour = Renk.TrimStart('#');
                int    red    = int.Parse(colour.Substring(0, 2), NumberStyles.AllowHexSpecifier);
                int    green  = int.Parse(colour.Substring(2, 2), NumberStyles.AllowHexSpecifier);
                int    blue   = int.Parse(colour.Substring(4, 2), NumberStyles.AllowHexSpecifier);

                // Arduino ile bağlantı kurulmaya çalışılıyor
                TcpClient     TcpAc         = new TcpClient("192.168.1.13", 8090);
                NetworkStream networkStream = TcpAc.GetStream();
                StreamWriter  streamWriter  = new StreamWriter(networkStream);
                StreamReader  streamReader  = new StreamReader(networkStream);

                // Arduino'ya renklerin aralarına '+' işareti koyarak mesaj gönderiyorum. En sona hex kodu ekliyorum
                streamWriter.Write(red + "+" + green + "+" + blue + "+" + Renk + "\n");
                streamWriter.Flush();

                // Arduino'dan gelen mesaja bakıyorum. Eğer renk aynı mesajı geldiyse bağlantıyı sonlandırıp sayfayı yeniliyorum
                if (streamReader.ReadToEnd() == "Renk aynı")
                {
                    networkStream.Close();

                    return(RedirectToAction("Index", "Home"));
                }

                // Renk aynı değilse bağlantıyı sonlandırıp veri tabanına verileri ekliyorum. Sayfayı yeniliyorum
                else
                {
                    networkStream.Close();

                    Led      database1 = new Led();
                    RgbColor database2 = new RgbColor();

                    database1.Color     = Renk;
                    database1.IsOpen    = true;
                    database1.Time      = DateTime.Now;
                    database2.LastColor = Renk;

                    db.Leds.Add(database1);
                    db.RgbColors.Add(database2);
                    db.SaveChanges();

                    return(RedirectToAction("Index", "Home"));
                }
            }
            catch
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
        public async Task Can_replace_OneToOne_relationship_from_principal_side()
        {
            // Arrange
            List <WorkItemGroup> existingGroups = _fakers.WorkItemGroup.Generate(2);

            existingGroups[0].Color = _fakers.RgbColor.Generate();
            existingGroups[1].Color = _fakers.RgbColor.Generate();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                dbContext.Groups.AddRange(existingGroups);
                await dbContext.SaveChangesAsync();
            });

            var requestBody = new
            {
                data = new
                {
                    type = "rgbColors",
                    id   = existingGroups[0].Color.StringId
                }
            };

            string route = $"/workItemGroups/{existingGroups[1].StringId}/relationships/color";

            // Act
            (HttpResponseMessage httpResponse, string responseDocument) = await _testContext.ExecutePatchAsync <string>(route, requestBody);

            httpResponse.Should().HaveStatusCode(HttpStatusCode.NoContent);

            responseDocument.Should().BeEmpty();

            await _testContext.RunOnDatabaseAsync(async dbContext =>
            {
                List <WorkItemGroup> groupsInDatabase = await dbContext.Groups.Include(group => group.Color).ToListAsync();

                WorkItemGroup groupInDatabase1 = groupsInDatabase.Single(group => group.Id == existingGroups[0].Id);
                groupInDatabase1.Color.Should().BeNull();

                WorkItemGroup groupInDatabase2 = groupsInDatabase.Single(group => group.Id == existingGroups[1].Id);
                groupInDatabase2.Color.Should().NotBeNull();
                groupInDatabase2.Color.Id.Should().Be(existingGroups[0].Color.Id);

                List <RgbColor> colorsInDatabase = await dbContext.RgbColors.Include(color => color.Group).ToListAsync();

                RgbColor colorInDatabase1 = colorsInDatabase.Single(color => color.Id == existingGroups[0].Color.Id);
                colorInDatabase1.Group.Should().NotBeNull();
                colorInDatabase1.Group.Id.Should().Be(existingGroups[1].Id);

                RgbColor colorInDatabase2 = colorsInDatabase.SingleOrDefault(color => color.Id == existingGroups[1].Color.Id);
                colorInDatabase1.Should().NotBeNull();
                colorInDatabase2 !.Group.Should().BeNull();
            });
        }
Esempio n. 29
0
        private void setColor(RgbColor color)
        {
            Color c = color.ToColor();

            colorControl.SelectedColor = c;

            if (NeedUpdateUI != null)
            {
                NeedUpdateUI(this, EventArgs.Empty);
            }
        }
Esempio n. 30
0
        /// <summary>
        /// 文字颜色
        /// </summary>
        /// <params name="red"></params>
        /// <params name="green"></params>
        /// <params name="blue"></params>
        /// <returns></returns>
        private IRgbColor GetRGBColor(int red, int green, int blue)
        {
            //创建rgb颜色和实例化IRGBColor接口
            IRgbColor rGB = new RgbColor();

            //设置RGB属性
            rGB.Red   = red;
            rGB.Green = green;
            rGB.Blue  = blue;
            rGB.UseWindowsDithering = true;
            return(rGB);
        }
Esempio n. 31
0
        private static IColor BuildRGB(int int_0, int int_1, int int_2)
        {
            IRgbColor rgbColorClass = new RgbColor()
            {
                Red   = int_0,
                Green = int_1,
                Blue  = int_2,
                UseWindowsDithering = true
            };

            return(rgbColorClass);
        }
Esempio n. 32
0
        private void clarionLongTextBox_TextChanged(object sender, EventArgs e)
        {
            if (!_ignoreTextFieldChange)
            {
                _changingControl = (Control)sender;
                notifyValueChangedByUser(LeadingInputElement.ClarionLongInput);

                setColor(RgbColor.FromColor(ColorTranslator.FromOle(Int32.Parse(clarionLongTextBox.Text))));

                _changingControl = null;
            }
        }
Esempio n. 33
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (colorDialog1.ShowDialog() == DialogResult.OK)
            {
                textBox1.BackColor = colorDialog1.Color;
                Form1.fontColor    = colorDialog1.Color;
            }

            IColor pColor = new RgbColor();

            pColor.RGB = 255;
        }
Esempio n. 34
0
 public void FromHex()
 {
     foreach (HtmlColorSample sample in HtmlColorSamples.All)
     {
         string   hex       = sample.Hex;
         RgbColor colorTest = ColorUtils.HexToRgb(hex);
         Assert.AreEqual(sample.Hex, colorTest.ToHex(), sample.Name);
         Assert.AreEqual(sample.Rgb.Red, colorTest.Red, sample.Name);
         Assert.AreEqual(sample.Rgb.Green, colorTest.Green, sample.Name);
         Assert.AreEqual(sample.Rgb.Blue, colorTest.Blue, sample.Name);
     }
 }
Esempio n. 35
0
        //��˸��
        public static void FlashPoint(IMapControlDefault mapControl, IScreenDisplay iScreenDisplay, IGeometry iGeometry)
        {
            ISimpleMarkerSymbol iMarkerSymbol;
            ISymbol iSymbol;
            IRgbColor iRgbColor;

            iMarkerSymbol = new SimpleMarkerSymbol();
            iMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
            iRgbColor = new RgbColor();
            iRgbColor.RGB = System.Drawing.Color.FromArgb(0, 0, 0).ToArgb();
            iMarkerSymbol.Color = iRgbColor;
            iSymbol = (ISymbol)iMarkerSymbol;
            iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            mapControl.FlashShape(iGeometry, 5, 300, iSymbol);
        }
Esempio n. 36
0
        //��˸��
        public static void FlashLine(IMapControlDefault mapControl, IScreenDisplay iScreenDisplay, IGeometry iGeometry)
        {
            ISimpleLineSymbol iLineSymbol;
            ISymbol iSymbol;
            IRgbColor iRgbColor;

            iLineSymbol = new SimpleLineSymbol();
            iLineSymbol.Width = 4;
            iRgbColor = new RgbColor();
            iRgbColor.Red = 255;
            iLineSymbol.Color = iRgbColor;
            iSymbol = (ISymbol)iLineSymbol;
            iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            mapControl.FlashShape(iGeometry, 5, 300, iSymbol);
        }
Esempio n. 37
0
        protected override void OnClick()
        {
            try
            {
                IMxDocument mxDoc = ArcMap.Document;
                IMap map = mxDoc.FocusMap;
                IGraphicsContainer graphicsCon = map as IGraphicsContainer;
                graphicsCon.Reset();
                IElement element = graphicsCon.Next();

                IRgbColor red = new RgbColor();
                red.Blue = 0;
                red.Green = 0;
                red.Red = 255;

                IRgbColor green = new RgbColor();
                green.Blue = 0;
                green.Green = 255;
                green.Red = 0;

                ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass();
                fillSymbol.Color = green;
                fillSymbol.Outline.Color = red; // This change did not change the outline color in the display (a bug at 10.1)
                fillSymbol.Outline.Width = 3.0; // // This change did not change the outline width in the display (a bug at 10.1)

                // For assigning the symbol
                // --------------------------------------------------------------------------------

                (element as IFillShapeElement).Symbol = fillSymbol;

                // --------------------------------------------------------------------------------

                graphicsCon.DeleteAllElements();
                (graphicsCon as IActiveView).Refresh();

                graphicsCon.AddElement(element, 0);

                (graphicsCon as IActiveView).Refresh();
            }

            catch (Exception myEx)
            {
                System.Diagnostics.Debug.WriteLine(myEx.Message + " " + myEx.Source.ToString());
            }

            ArcMap.Application.CurrentTool = null;
        }
Esempio n. 38
0
 /// <summary>
 /// 文字颜色
 /// </summary>
 /// <params name="red"></params>
 /// <params name="green"></params>
 /// <params name="blue"></params>
 /// <returns></returns>
 private IRgbColor GetRGBColor(int red, int green, int blue)
 {
     //创建rgb颜色和实例化IRGBColor接口
     IRgbColor rGB = new RgbColor();
     //设置RGB属性
     rGB.Red = red;
     rGB.Green = green;
     rGB.Blue = blue;
     rGB.UseWindowsDithering = true;
     return rGB;
 }
		private ESRI.ArcGIS.Display.IColor GetCombinedColor(IColor pColor1, IColor pColor2, EColorCombinationType eCombinationMethod, IColor pOriginColor)
		{
			// combines the input colors based on m_eColorCombinationMethod

			// (11/08/04) -- RGB and enuLabLChColorRamp aren't used by GUI

			IColor pOutColor = null;

			long MyOLE_COLOR = 0; // As OLE_COLOR in VB6
			IRgbColor pMainRGBColor = null;
			IRgbColor pVariationRGBColor = null;
			IRgbColor pMergedRGBColor = null;
			bool bOK = false;
			IAlgorithmicColorRamp pAlgorithmicCR = null;

			// if either of the colors are null, then don't run the color through any algorithm,
			//   instead, just return the other color.  if both are null, then return a null color
			if (pColor1.NullColor)
			{
				pOutColor = pColor2;

			}
			else if (pColor2.NullColor)
			{
				pOutColor = pColor1;

			}
			else if (eCombinationMethod == EColorCombinationType.enuComponents)
			{
				// HSV components
				// create a new HSV color
				IHsvColor pHSVDrawColor = null;
				pHSVDrawColor = new HsvColor();
				// get HSV values from Color1 and Color2 and assign to pHSVDrawColor
				IHsvColor pHSVColor1 = null;
				IHsvColor pHSVColor2 = null;

				// (new 4/27/04) didn't think I had to do this...
				//pHSVColor1 = pColor1
				//pHSVColor2 = pColor2
				pHSVColor1 = new HsvColor();
				pHSVColor1.RGB = pColor1.RGB;
				pHSVColor2 = new HsvColor();
				pHSVColor2.RGB = pColor2.RGB;

				pHSVDrawColor.Hue = pHSVColor1.Hue;
				pHSVDrawColor.Saturation = pHSVColor2.Saturation;
				pHSVDrawColor.Value = pHSVColor2.Value;

				pOutColor = pHSVDrawColor;

			}
			else if (eCombinationMethod == EColorCombinationType.enuRGBAverage)
			{
				// use additive color model to merge the two colors
				MyOLE_COLOR = pColor1.RGB;
				pMainRGBColor = new RgbColor();
				pMainRGBColor.RGB = (int)MyOLE_COLOR;
				MyOLE_COLOR = pColor2.RGB;
				pVariationRGBColor = new RgbColor();
				pVariationRGBColor.RGB = (int)MyOLE_COLOR;
				// merged color = RGB average of the two colors
				pMergedRGBColor = new RgbColor();
				pMergedRGBColor.Red = (pMainRGBColor.Red + pVariationRGBColor.Red) / 2;
				pMergedRGBColor.Green = (pMainRGBColor.Green + pVariationRGBColor.Green) / 2;
				pMergedRGBColor.Blue = (pMainRGBColor.Blue + pVariationRGBColor.Blue) / 2;

				pOutColor = pMergedRGBColor;
			}
			else if ((eCombinationMethod == EColorCombinationType.enuCIELabColorRamp) | (eCombinationMethod == EColorCombinationType.enuLabLChColorRamp))
			{
				// use color ramp and take central color between the two colors
				pAlgorithmicCR = new AlgorithmicColorRamp();
				if (m_eColorCombinationMethod == EColorCombinationType.enuCIELabColorRamp)
					pAlgorithmicCR.Algorithm = esriColorRampAlgorithm.esriCIELabAlgorithm;
				else
					pAlgorithmicCR.Algorithm = esriColorRampAlgorithm.esriLabLChAlgorithm;
				pAlgorithmicCR.Size = 3;
				pAlgorithmicCR.FromColor = pColor1;
				pAlgorithmicCR.ToColor = pColor2;
				pAlgorithmicCR.CreateRamp(out bOK);

				pOutColor = pAlgorithmicCR.get_Color(1); // middle color in ramp
			}
			else // EColorCombinationType.enuCIELabMatrix
			{

				double[] iLab1 = new double[4]; // L, a, b values for Color1
				double[] iLab2 = new double[4]; // L, a, b values for Color2
				double[] iLabOrig = new double[4]; // L, a, b values for pOriginColor
				pColor1.GetCIELAB(out iLab1[0], out iLab1[1], out iLab1[2]);
				pColor2.GetCIELAB(out iLab2[0], out iLab2[1], out iLab2[2]);
				pOriginColor.GetCIELAB(out iLabOrig[0], out iLabOrig[1], out iLabOrig[2]);

				double[] iLabOut = new double[4];
				// add color1 vector and color2 vector, then subtract the origin color vector
				iLabOut[0] = iLab1[0] + iLab2[0] - iLabOrig[0];
				iLabOut[1] = iLab1[1] + iLab2[1] - iLabOrig[1];
				iLabOut[2] = iLab1[2] + iLab2[2] - iLabOrig[2];

				CorrectLabOutofRange(ref iLabOut[0], ref iLabOut[1], ref iLabOut[2]);

				IHsvColor pHSVColor = null;
				pHSVColor = new HsvColor();
				pHSVColor.SetCIELAB(iLabOut[0], iLabOut[1], iLabOut[2]);
				pOutColor = pHSVColor;
			}

			return pOutColor;

		}
Esempio n. 40
0
        private bool addMarkerAtAdres(string Adres)
        {
            datacontract.locationResult loc = getAdres(Adres);
            IPoint fromXY; IPoint toXY;
            IRgbColor innerClr; IRgbColor outlineClr;

            if (loc != null )
            {
                fromXY = new ESRI.ArcGIS.Geometry.Point()
                {
                    X = loc.Location.Lon_WGS84,
                    Y = loc.Location.Lat_WGS84,
                    SpatialReference = wgs
                };
                toXY = geopuntHelper.Transform(fromXY as IGeometry, map.SpatialReference) as IPoint;

                innerClr = new RgbColor() { Red = 255, Blue = 0, Green = 255 };
                outlineClr = new RgbColor() { Red = 0, Blue = 0, Green = 0 };
                geopuntHelper.AddGraphicToMap(map, toXY, innerClr, outlineClr, 12, false);
                geopuntHelper.AddTextElement(map , toXY, loc.FormattedAddress);

                infoLabel.Text = geopuntHelper.adresTypeStringTranslate(loc.LocationType);

                view.Refresh();
                return true;
            }
            return false;
        }
        private ISymbol GetFeatureSymbol(IFeature Feature)
        {
            ICartographicLineSymbol hashsym = null;
            IRgbColor pcolor = null;
            ILineSymbol lsym = null;
               // ISimpleEdgeFeature seFeat = null;
            ILineProperties lineProperties = null;
            IArrowMarkerSymbol aMSymbol = null;
            ILineDecoration lineDecoration = null;
            ISimpleLineDecorationElement simpleLineDecorationElement = null;
            IMarkerSymbol smSym = null;
            bool isMultiLyrSym = false;
            int multiLyrSymIndex = -1;
            try
            {
                if (Feature.HasOID)
                {
                    int status = 0;
                    if (string.Compare(Feature.Class.AliasName.Substring(Feature.Class.AliasName.LastIndexOf('.') + 1), "PrimaryConductor", true) == 0)
                    {
                        if (ExtensionInfo.netUtil.primaryStatuses.ContainsKey(Feature.OID))
                            status = ExtensionInfo.netUtil.primaryStatuses[Feature.OID];
                    }
                    else if (ExtensionInfo.netUtil.secondaryStatuses.ContainsKey(Feature.OID))
                        status = ExtensionInfo.netUtil.secondaryStatuses[Feature.OID];

                       //int fldIndexGUID = Feature.Fields.FindField("FuturaGUID");
                       //if (fldIndexGUID != -1)
                       //{
                       //    IFeatureClass featCls = Feature.Class as IFeatureClass;
                       //    IFeature feat = featCls.GetFeature(Feature.OID);

                       //    string guid = feat.get_Value(fldIndexGUID).ToString();
                       //    if (guid != null)
                       //        status = (int)NetworkExtension.FuturaNetworkExt.netUtil._sectionList[guid].status;
                       //}

                   // int status = NetworkExtension.FuturaNetworkExt.netUtil._sectionList.Values.FirstOrDefault(obj => (obj.objectId == Feature.OID && string.Compare(Feature.Class.AliasName.Substring(Feature.Class.AliasName.LastIndexOf('.')+1), obj.className, true) == 0)).status;

                   // string guid = Feature.get_Value(Feature.Fields.FindField("FuturaGUID")).ToString();
                   // int status = NetworkExtension.FuturaNetworkExt.netUtil._sectionList[guid].status;
                    pcolor = new RgbColor();
                    //FeatureRenderer.PrepareFilter(Feature.Class as IFeatureClass, new QueryFilterClass());
                    //below line used to get default linesymbol of a featureclass
                    lsym = FeatureRenderer.get_SymbolByFeature(Feature) as ILineSymbol;

                    if (lsym is ICartographicLineSymbol)
                        hashsym = lsym as ICartographicLineSymbol;
                    else if (lsym is IMultiLayerLineSymbol)
                    {
                        IMultiLayerLineSymbol multiLyrLineSymbol = lsym as IMultiLayerLineSymbol;
                        for (int i = 0; i < multiLyrLineSymbol.LayerCount; i++)
                        {
                            if (multiLyrLineSymbol.get_Layer(i) != null && multiLyrLineSymbol.get_Layer(i) is ICartographicLineSymbol)
                            {
                                hashsym = multiLyrLineSymbol.get_Layer(i) as ICartographicLineSymbol;
                                isMultiLyrSym = true;
                                multiLyrSymIndex = i;
                                break;
                            }
                        }
                    }

                    if (hashsym == null)
                    {
                        hashsym = new CartographicLineSymbolClass();
                        hashsym.Color = lsym.Color;
                        hashsym.Width = lsym.Width;
                    }
                    if (FeatureSelection.SelectionSet.Count > 0 && IsSelected(Feature.OID))
                    {
                        //if (MobileSettings.settings.UserSettings.TraceSettings.LineColor.R == 0 && MobileSettings.settings.UserSettings.TraceSettings.LineColor.G == 255 && MobileSettings.settings.UserSettings.TraceSettings.LineColor.B == 255)
                        //{
                        //    pcolor.Red = 0;
                        //    pcolor.Green = 255;
                        //    pcolor.Blue = 0;
                        //}
                        //else
                        //{
                            pcolor.Red = 0;
                            pcolor.Green = 255;
                            pcolor.Blue = 255;
                       // }
                        //lsym.Color = pcolor;
                        //lsym.Width = lsym.Width + 1;
                        hashsym.Color = pcolor;
                        hashsym.Width = hashsym.Width + 1;
                    }
                    else
                    {
                        //pcolor.Red = MobileSettings.settings.UserSettings.TraceSettings.LineColor.R;
                        //pcolor.Green = MobileSettings.settings.UserSettings.TraceSettings.LineColor.G;
                        //pcolor.Blue = MobileSettings.settings.UserSettings.TraceSettings.LineColor.B;
                        //lsym.Color = pcolor;
                    }

                    if (Feature.Shape.GeometryType == esriGeometryType.esriGeometryLine || Feature.Shape.GeometryType == esriGeometryType.esriGeometryPolyline)
                    {
                       // SectionObject sObj = null;
                       // Orientation dir = Orientation.Uninitialized;
                       // seFeat = Feature as ISimpleEdgeFeature;
                      //   int fldIndexGUID = Feature.Fields.FindField(((IClassEx)Feature.Class).GlobalIDFieldName);
                       // if(fldIndexGUID != -1)
                      //  {
                            //IFeatureClass featCls = Feature.Class as IFeatureClass;
                            //IFeature feat = featCls.GetFeature(Feature.OID);

                            //object guid = feat.get_Value(fldIndexGUID);
                            // if (guid != null)
                            //    sObj = secElements.ContainsKey(guid.ToString()) ? secElements[guid.ToString()] : null;

                            //if(sObj != null)
                            //{
                            //    IPolyline pl = Feature.ShapeCopy as IPolyline;
                            //    NodeObject fNode = nodeElements.ContainsKey(sObj.Parent) ? nodeElements[sObj.Parent] : null;
                            //    NodeObject tNode = nodeElements.ContainsKey(sObj.Child) ? nodeElements[sObj.Child] : null;
                            //    if(fNode != null && tNode != null)
                            //    {
                            //        if (Math.Abs(fNode.X - pl.FromPoint.X) < 0.001 && Math.Abs(fNode.Y - pl.FromPoint.Y) < 0.001)
                            //            dir = Orientation.WithFlow;
                            //        else
                            //            dir = Orientation.AgainstFlow;

                            //    }
                            //}
                       // }

                        //bool isPrimary = string.Compare(Feature.Class.AliasName, "PrimaryConductor", true) == 0;
                        //try
                        //{
                        //    if (isPrimary && PrimaryFlowDirections != null)
                        //        dir = PrimaryFlowDirections[Feature.OID];
                        //    // dir = secElements.Values.FirstOrDefault(obj => (obj.OID == Feature.OID && string.Compare(Feature.Class.AliasName, obj.LayerName, true) == 0));
                        //    else if (SecFlowDirections != null)
                        //        dir = SecFlowDirections[Feature.OID];
                        //}
                        //catch
                        //{
                        //    dir = Orientation.Uninitialized;
                        //}
                        //if (sObj != null)
                       // {
                           // dir = sObj.FlowDirection;
                                //IPolyline pl = Feature.ShapeCopy as IPolyline;
                                //NodeObject fNode = nodeElements.ContainsKey(sObj.Parent) ? nodeElements[sObj.Parent] : null;
                                //NodeObject tNode = nodeElements.ContainsKey(sObj.Child) ? nodeElements[sObj.Child] : null;
                                //if (fNode != null && tNode != null)
                                //{
                                //    bool isUninitialized = false;
                                //    if (string.Compare(fNode.LayerName, FuturaNetJunctions.Futura_NetJunctions_TableName, true) == 0 && secElements.Values.FirstOrDefault(obj => (obj.Child == fNode.GUID)) == null)
                                //        dir = Orientation.Indeterminate;
                                //    else
                                //    {
                                //        if (Math.Abs(fNode.X - pl.FromPoint.X) < 0.001 && Math.Abs(fNode.Y - pl.FromPoint.Y) < 0.001)
                                //            dir = Orientation.WithFlow;
                                //        else
                                //            dir = Orientation.AgainstFlow;
                                //    }
                                //}

                       // }

                        lineProperties = hashsym as ILineProperties;
                        simpleLineDecorationElement = new SimpleLineDecorationElement();
                        if (FuturaNetwork.StatusExtensions.IsLoop(status))
                            simpleLineDecorationElement.MarkerSymbol = DefaultUninitializedSymbol();
                        else if (FuturaNetwork.StatusExtensions.IsEnergized(status))
                        {
                            //if (smSym == null)
                            //    smSym = Global.DefaultFlowSymbol();

                            if (FuturaNetwork.StatusExtensions.BreakDown(status).Contains(FuturaNetwork.Constants.WithFlow))
                                simpleLineDecorationElement.MarkerSymbol = DefaultFlowSymbol(false);
                            else
                                simpleLineDecorationElement.MarkerSymbol = DefaultFlowSymbol(true);

                        }
                        else
                            simpleLineDecorationElement.MarkerSymbol = DefaultUninitializedSymbol();

                        simpleLineDecorationElement.AddPosition(0.5);
                        simpleLineDecorationElement.PositionAsRatio = true;
                        lineDecoration = new LineDecoration();
                        lineDecoration.AddElement(simpleLineDecorationElement);
                        lineProperties.LineDecoration = lineDecoration;
                    }

                    ISymbol featSymbol = null;

                    if (isMultiLyrSym && multiLyrSymIndex != -1)
                    {
                        IMultiLayerLineSymbol multiLyrLineSymbol = lsym as IMultiLayerLineSymbol;
                        if (multiLyrLineSymbol.get_Layer(multiLyrSymIndex) != null && multiLyrLineSymbol.get_Layer(multiLyrSymIndex) is ICartographicLineSymbol)
                        {
                            ILineSymbol lineSymbol = multiLyrLineSymbol.get_Layer(multiLyrSymIndex);
                            multiLyrLineSymbol.DeleteLayer(lineSymbol);
                            multiLyrLineSymbol.AddLayer(hashsym as ILineSymbol);
                        }
                        featSymbol = multiLyrLineSymbol as ISymbol;
                    }
                    else
                        featSymbol = hashsym as ISymbol;

                    return featSymbol;
                }
                else
                {
                    return null;
                }
            }
            catch (Exception ex)
            {
                //EngineLogger.Logger.LogException(ex);
                return null;
            }
            finally
            {
                hashsym = null;
                pcolor = null;
                lsym = null;
                //seFeat = null;
                lineProperties = null;
                aMSymbol = null;
                lineDecoration = null;
                simpleLineDecorationElement = null;
                smSym = null;
            }
        }
Esempio n. 42
0
        public IElement addTitleToLayout(IMxDocument pMxDoc,double S, double x, double y,  IGraphicsContainer pGc, bool b, string texto)
        {
            ITextElement pTxtElem;
            ITextSymbol pTxtSym = default(ITextSymbol);
            IRgbColor myColor = default(IRgbColor);
            stdole.IFontDisp myFont;
            IElement pElem;
            IEnvelope pEnv;
            IPoint pPoint = default(IPoint);
            try{
                // pGc.Reset()
                //Set the font and color properties
                //for the title
                myFont = (stdole.IFontDisp)new stdole.StdFont();
                myFont.Name = "Times New Roman";
                myFont.Bold = b;
               // myFont.Size = S;
                myColor = new RgbColor();
                myColor.Red = 0;
                myColor.Green = 0;
                myColor.Blue = 0;
                ///''''''''''''''''''''''''''''''
                //Create a text element
                pTxtElem = (ITextElement)new TextElement();

                //Create a text symbol
                pTxtSym = new TextSymbol();
                pTxtSym.Color = myColor;
                pTxtSym.Font = myFont;
                pTxtSym.Size = S;
                //Set symbol property
                pTxtElem.Symbol = pTxtSym;

                //set the text property to be the layer's name (Uppercase)
                pTxtElem.Text = texto;

                //Create an envelope for the TextElements Geometry
                pEnv = (IEnvelope)new Envelope();
                pPoint = new ESRI.ArcGIS.Geometry.Point();

                pPoint.X = x;
                pPoint.Y = y;
                pEnv.LowerLeft = pPoint;
                pPoint.X = 1;
                pPoint.Y = 1;
                pEnv.UpperRight = pPoint;
                //set the text elements geomtery
                pElem = (IElement)pTxtElem;
                pElem.Geometry = pEnv;

                //Add the element to the graphics container
                pGc.AddElement(pElem, 1);
                pMxDoc.ActiveView.Refresh();
                return (pElem);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "clsMapTools.addTitleToLayout");
                MessageBox.Show("Error: " + ex.StackTrace);
                return null ;
            }
        }
Esempio n. 43
0
        private void DrawArc(IEllipticArc pEllipArc)
        {
            if (pEllipArc == null) return;

            try
            {
                ISegmentCollection pSegColl;
                IPolyline pPolyline;
                pSegColl = new PolylineClass();
                pSegColl.AddSegment(pEllipArc as ISegment);
                pPolyline = pSegColl as IPolyline;

                IRgbColor pColor = new RgbColor();
                pColor.Red = 0;
                pColor.Green = 0;
                pColor.Blue = 0;

                m_LineSym = new SimpleLineSymbol();
                m_LineSym.Color = pColor;
                m_LineSym.Width = 1;
                m_LineSym.Style = esriSimpleLineStyle.esriSLSSolid;

                ISymbol pSym = m_LineSym as ISymbol;
                pSym.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
                m_pEnvFeedback.Symbol = pSym;

                m_hookHelper.ActiveView.ScreenDisplay.StartDrawing(m_hookHelper.ActiveView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
                m_hookHelper.ActiveView.ScreenDisplay.SetSymbol(pSym);
                m_hookHelper.ActiveView.ScreenDisplay.DrawPolyline(pPolyline);
                m_hookHelper.ActiveView.ScreenDisplay.FinishDrawing();
            }
            catch (Exception)
            {
                return;
            }
        }
		private ISymbol ApplyColor(ISymbol pSym, IFeature pFeat)
		{
	try
	{
			ISymbol pSym1 = null;
			ISymbol pSym2 = null;
			IColor pColor = null;
			IHsvColor pHSVColor = null;

			if ((m_pColorRend1 != null) & (m_pColorRend2 != null)) // for now both color renderers need to be set to apply color
			{
				pSym1 = m_pColorRend1.get_SymbolByFeature(pFeat);
				pSym2 = m_pColorRend2.get_SymbolByFeature(pFeat);
				// only use GetCombinedColor for HSV component-type combination method
				if (m_eColorCombinationMethod == EColorCombinationType.enuComponents)
				{
					pColor = GetCombinedColor(GetSymbolColor(pSym1), GetSymbolColor(pSym2), m_eColorCombinationMethod);

					
					// Hue is good when I do this...
					pHSVColor = pColor as IHsvColor;
					//'MsgBox(Str(pHSVColor.Hue) & " " & Str(pHSVColor.Saturation) & " " & " " & Str(pHSVColor.Value()))

				}
				else
				{
					
					pColor = new RgbColor();
                    pColor.RGB = (int)m_OLEColorMatrix[GetSymbolIndex(pSym1 as ISymbol, m_pColorRend1 as IClassBreaksRenderer), GetSymbolIndex(pSym2 as ISymbol, m_pColorRend2 as IClassBreaksRenderer)];
					
					
				}


				if (pSym is IMarkerSymbol)
				{
					IMarkerSymbol pMarkerSym = null;
                    pMarkerSym = pSym as IMarkerSymbol;
					pMarkerSym.Color = pColor;
				}
				else if (pSym is ILineSymbol)
				{
					ILineSymbol pLineSym = null;
                    pLineSym = pSym as ILineSymbol;
					pLineSym.Color = pColor;
				}
				else if (pSym != null)
				{
					IFillSymbol pFillSym = null;
					pFillSym = pSym as IFillSymbol;
					pFillSym.Color = pColor;
					

				}


			}

			return pSym;
			return null;
}

catch
{
    return null;
}
		}
 /// <summary>
 /// Creates a new <see cref="T:DesktopSprites.SpriteManagement.BitmapFrame"/> from the raw buffer, loading extra transparency
 /// information and adjusting the colors as required by the transparency.
 /// </summary>
 /// <param name="buffer">The raw buffer.</param>
 /// <param name="palette">The color palette.</param>
 /// <param name="transparentIndex">The index of the transparent color.</param>
 /// <param name="stride">The stride width of the buffer.</param>
 /// <param name="width">The logical width of the buffer.</param>
 /// <param name="height">The logical height of the buffer.</param>
 /// <param name="depth">The bit depth of the buffer.</param>
 /// <param name="hashCode">The hash code of the frame.</param>
 /// <param name="fileName">The path to the GIF file being loaded.</param>
 /// <returns>A new <see cref="T:DesktopSprites.SpriteManagement.BitmapFrame"/> for the frame held in the raw buffer.</returns>
 private BitmapFrame BitmapFrameFromBuffer(byte[] buffer, RgbColor[] palette, int transparentIndex,
     int stride, int width, int height, int depth, int hashCode, string fileName)
 {
     return Disposable.SetupSafely(
         BitmapFrame.FromBuffer(buffer, palette, transparentIndex, stride, width, height, depth, hashCode),
         frame =>
         {
             if (IsAlphaBlended)
             {
                 // Check for an alpha remapping table, and apply it if one exists.
                 string mapFilePath = Path.ChangeExtension(fileName, AlphaRemappingTable.FileExtension);
                 if (File.Exists(mapFilePath))
                 {
                     AlphaRemappingTable map = new AlphaRemappingTable();
                     map.LoadMap(mapFilePath);
                     ColorPalette colorPalette = frame.Image.Palette;
                     for (int i = 0; i < colorPalette.Entries.Length; i++)
                     {
                         Color color = colorPalette.Entries[i];
                         ArgbColor argbColor;
                         if (map.TryGetMapping(new RgbColor(color.R, color.G, color.B), out argbColor))
                             colorPalette.Entries[i] = Color.FromArgb(argbColor.ToArgb());
                     }
                     frame.Image.Palette = colorPalette;
                     // We only need to pre-multiply when we add an alpha channel ourselves, as GIFs only support 1 bit transparency.
                     frame.Image.PreMultiplyAlpha();
                 }
             }
             else
             {
                 frame.Image.RemapColors(paletteMapping);
             }
         });
 }
    private void DrawPoint(IPoint pPoint)
    {
      //Draw a red graphic dot on the display at the given point location
      IRgbColor color = null;
      ISimpleMarkerSymbol marker = null;
      IAppDisplay appDisplay = m_editor.Display as IAppDisplay;
      
      //Set the symbol (red, size 8)
      color = new RgbColor();
      color.Red = 255;
      color.Green = 0;
      color.Blue = 0;
      marker = new SimpleMarkerSymbol();
      marker.Color = color;
      marker.Size = 8;

      //Draw the point
      appDisplay.StartDrawing(0, (short)esriScreenCache.esriNoScreenCache);
      appDisplay.SetSymbol(marker as ISymbol);
      appDisplay.DrawPoint(pPoint);
      appDisplay.FinishDrawing();
    }
        /// <summary>
        /// Converts an RGB color to an HSB color, with output flags to indicate whether or not hue and/or saturation 
        /// are defined after the conversion.
        /// </summary>
        /// <param name="rgbColor">An RGB color to convert to HSB color space.</param>
        /// <param name="isHueDefined">True if input color lies off the R=G=B line in the RGB cube, false if it lies on this line.</param>
        /// <param name="isSaturationDefined">True if input color isn't at either HLS cone tip, false if it is.</param>
        /// <returns>
        /// An HLS color corresponding to the input RGB color.
        /// If isHueDefined comes out false, then the resulting hue defaults to 0.
        /// If isSaturationDefined comes out false, then the resulting saturation defaults to 0.
        /// </returns>
        private static HlsColor RgbToHls(RgbColor rgbColor, out bool isHueDefined, out bool isSaturationDefined)
        {
            Debug.Assert(rgbColor.Red >= 0 && rgbColor.Red <= 1, "Red must be between 0 and 1.");
            Debug.Assert(rgbColor.Green >= 0 && rgbColor.Green <= 1, "Green must be between 0 and 1.");
            Debug.Assert(rgbColor.Blue >= 0 && rgbColor.Blue <= 1, "Blue must be between 0 and 1.");

            float min = Math.Min(rgbColor.Red, Math.Min(rgbColor.Green, rgbColor.Blue));
            float max = Math.Max(rgbColor.Red, Math.Max(rgbColor.Green, rgbColor.Blue));

            float hue = 0;
            float lightness = (min + max) / 2;
            float saturation = 0;

            // Three classifications of a point in the HLS double-cone: 
            // (1) Point is on either cone's tip => hue & saturation both undefined
            // (2) Point is on the saturation=0 axis and isn't on either cone's tip => hue undefined, saturation=0
            // (3) Point lies off the saturation=0 axis and off both cone's tips => hue defined, saturation defined
            // So the only invalid value for hue & saturation defined flags is: (hue defined, saturation undefined).

            if (min == max)
            {
                // Red, green, and blue are equal (the achromatic case).
                // Hue is undefined, so we arbitrarily choose zero.
                // If lightness is zero or one, then saturation is also undefined, so we arbitrarily choose zero.
                // Otherwise, saturation is zero.
                isHueDefined = false;
                isSaturationDefined = (lightness > 0 && lightness < 1);
            }
            else
            {
                // Hue and saturation are both defined.
                // Point lies off the saturation=0 axis and isn't on either HLS cone tip.

                isHueDefined = isSaturationDefined = true;

                float delta = max - min;
                saturation = (lightness <= 0.5f ? delta / (min + max) : delta / (2 - min - max));

                // Force saturation to be between 0 and 1 in case of numerical instability
                saturation = Math.Max(0.0f, Math.Min(saturation, 1.0f));
                if ((float)rgbColor.Red == max)
                {
                    // between yellow & magenta
                    hue = (rgbColor.Green - rgbColor.Blue) / delta;
                }
                else if ((float)rgbColor.Green == max)
                {
                    // between cyan & yellow
                    hue = 2 + (rgbColor.Blue - rgbColor.Red) / delta;
                }
                else
                {
                    // between magenta & cyan
                    hue = 4 + (rgbColor.Red - rgbColor.Green) / delta;
                }

                // Make hue positive.
                if (hue < 0)
                {
                    hue += 6;
                }

                // Scale hue to [0, 1].
                hue /= 6;
            }

            Debug.Assert(hue >= 0 && hue <= 1, "Output hue should be between 0 and 1.");
            Debug.Assert(lightness >= 0 && lightness <= 1, "Output lightness should be between 0 and 1.");
            Debug.Assert(saturation >= 0 && saturation <= 1, "Output saturation should be between 0 and 1.");

            Debug.Assert(!isHueDefined || isSaturationDefined, "If hue is defined, saturation must also be defined.");

            return new HlsColor(rgbColor.Alpha, hue, lightness, saturation);
        }
 /// <summary>
 /// Converts a color from RGB to HLS color space.
 /// If hue is undefined (because color is achromatic), it defaults to zero.
 /// If saturation is undefined (because lightness is zero or one), it defaults to zero.
 /// </summary>
 /// <param name="rgbColor">The input color.</param>
 /// <returns>An HLS color corresponding to the input RGB color.</returns>
 private static HlsColor RgbToHls(RgbColor rgbColor)
 {
     bool isHueDefined;
     bool isSaturationDefined;
     return RgbToHls(rgbColor, out isHueDefined, out isSaturationDefined);
 }
Esempio n. 49
0
        private void addMarkerBtn_Click(object sender, EventArgs e)
        {
            if (perceel == null) return;

            datacontract.geojsonPolygon jsPoly = JsonConvert.DeserializeObject<datacontract.geojsonPolygon>(perceel.geometry.shape);
            IPolygon lbShape = geopuntHelper.geojson2esriPolygon(jsPoly, (int)dataHandler.CRS.Lambert72);
            IPolygon mapShape = (IPolygon)geopuntHelper.Transform(lbShape, map.SpatialReference);

            string adres = string.Join("-", perceel.adres.ToArray()) ;
            if (adres.Length > 120) adres = adres.Substring(0, 120);

            IRgbColor innerClr = new RgbColor() { Red = 0, Blue = 0, Green = 0 };
            IRgbColor outlineClr = new RgbColor() { Red = 0, Blue = 200, Green = 0 };

            IPoint center = ((IArea)mapShape).LabelPoint;

            geopuntHelper.AddGraphicToMap(map, mapShape, innerClr, outlineClr, 2, false);
            geopuntHelper.AddTextElement(map, center, perceel.capakey + "\r\n" + adres);

            view.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
        }
 //填充外边框颜色变化响应事件
 private void cbOutlineColor_MouseUp(object sender, MouseEventArgs e)
 {
     IRgbColor pColor = new RgbColor();
     pColor.RGB = 255;
     tagRECT ptagRECT = new tagRECT();
     ptagRECT.left = cbOutlineColor.PointToScreen(System.Drawing.Point.Empty).X;
     ptagRECT.bottom = cbOutlineColor.PointToScreen(System.Drawing.Point.Empty).Y + cbOutlineColor.Height;
     IColorPalette pColorPalette = new ColorPalette();
     pColorPalette.TrackPopupMenu(ref ptagRECT, pColor, false, 0);
     pColor = pColorPalette.Color as IRgbColor;
     Color color = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);
     //btOutlineColor.BackColor = color;
     cbOutlineColor.BackColor = color;
     ILineSymbol pLineSymbol = ((IFillSymbol)pStyleGalleryItem.Item).Outline;
     pLineSymbol.Color = pColor;
     ((IFillSymbol)pStyleGalleryItem.Item).Outline = pLineSymbol;
     PreviewPicture();
 }
Esempio n. 51
0
        private void SetNewLineFeedBack()
        {
            m_pEnvFeedback = new NewEnvelopeFeedback();
            IRgbColor pColor = new RgbColor();
            pColor.Red = 0;
            pColor.Green = 0;
            pColor.Blue = 0;

            m_LineSym = new SimpleLineSymbol();
            m_LineSym.Color = pColor;
            m_LineSym.Width = 1;
            m_LineSym.Style = esriSimpleLineStyle.esriSLSSolid;

            ISymbol pSym = m_LineSym as ISymbol;
            pSym.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            m_pEnvFeedback.Symbol = pSym;

            m_hookHelper.ActiveView.ScreenDisplay.StartDrawing(m_hookHelper.ActiveView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache);
            m_hookHelper.ActiveView.ScreenDisplay.SetSymbol(pSym);
            m_hookHelper.ActiveView.ScreenDisplay.FinishDrawing();

            m_pEnvFeedback.Display = m_hookHelper.ActiveView.ScreenDisplay;
        }
        private void UpdateFeedbackWithEllipse(bool HasMinorAxis = true)
        {
            if (!HasPoint1)
                return;
            
            ClearTempGraphics();

            AddGraphicToMap(Point1, new RgbColor() { Green = 255 } as IColor, true);

            var ellipticArc = new Polyline() as IConstructGeodetic;

            var minorAxis = MinorAxisDistance;
            if (!HasMinorAxis || minorAxis == 0.0)
                minorAxis = MajorAxisDistance;

            if (minorAxis > MajorAxisDistance)
                minorAxis = MajorAxisDistance;

            ellipticArc.ConstructGeodesicEllipse(Point1, GetLinearUnit(), MajorAxisDistance, minorAxis, Azimuth, esriCurveDensifyMethod.esriCurveDensifyByAngle, 0.45);
            var line = ellipticArc as IPolyline;
            if (line != null)
            {
                var color = new RgbColor() as IColor;
                AddGraphicToMap(line as IGeometry, color, true, rasterOpCode: esriRasterOpCode.esriROPNotXOrPen);
            }
        }
Esempio n. 53
0
        /// <summary>
        /// 画线
        /// <param name="arrPointAll">点坐标数组</param>
        ///<returns></returns>
        private void DrawLine2(ArrayList arrPointAll)
        {
            if (arrPointAll.Count <= 0)//点坐标数组不能为空
            {
                return;
            }

            IActiveView activeView = this.axMapControl.ActiveView.FocusMap as IActiveView;

            //删除以前的element
            //DeleteOldElement(activeView.GraphicsContainer);

            // 获取IRGBColor接口
            IRgbColor color = new RgbColor();
            // 设置颜色属性
            color.Red = 255;
            color.Transparency = 255;

            //点
            IPoint pPoint = new PointClass();

            //线样式
            ISimpleLineSymbol lineSymbol = new SimpleLineSymbolClass();
            lineSymbol.Color = color;
            lineSymbol.Style = esriSimpleLineStyle.esriSLSInsideFrame;
            lineSymbol.Width = 10;

            //线元素
            ILineElement lineElement = new LineElementClass();
            lineElement.Symbol = lineSymbol;

            //创建线
            IPolyline m_Polyline = new PolylineClass();
            //点集合
            IPointCollection m_PointCollection = new PolylineClass();
            //点数组
            ArrayList arrPoint = new ArrayList();
            object missing = Type.Missing;

            for (int i = 0; i < arrPointAll.Count; i++)
            {
                //pPoint.PutCoords(int.Parse(arrPointAll[i].ToString()), int.Parse(arrPointAll[i].ToString()));
                pPoint.PutCoords(-1520445, 1038916);
                m_PointCollection.AddPoint(pPoint, ref missing, ref missing);
                pPoint.PutCoords(389327, 1613427);
                m_PointCollection.AddPoint(pPoint, ref missing, ref missing);
            }
                //QI for IPolyline
                m_Polyline = m_PointCollection as IPolyline;

            //放大地图

            //折线范围
            IEnvelope pEnvelope = m_Polyline.Envelope;
            //折线区域
            IArea pArea = pEnvelope as IArea;
            pPoint = pArea.Centroid;

               // this.ChangeEnvelope(pPoint, 0.06, 0.06);
            //QI for IElement
            IElement element = lineElement as IElement;

            element.Geometry = m_Polyline;

            //加载线元素到地图
            activeView.GraphicsContainer.AddElement(element, 0);
            //Refresh the graphics
            activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
        }
        public void Activate(ESRI.ArcGIS.CatalogUI.IGxApplication Application, ESRI.ArcGIS.Catalog.IGxCatalog Catalog)
        {
            try
            {
                //Get selection
                m_pSelection = (GxSelection) Application.Selection;
                m_pSelection.OnSelectionChanged += new IGxSelectionEvents_OnSelectionChangedEventHandler(OnSelectionChanged);
                // get data from the MyProject's settings.
                // please change accordingly
                m_path = Properties.Settings.Default.DataLocation;
                //Add data to map control
                frmExtentView.AxMapControl1.AddShapeFile(m_path, "world30");
                frmExtentView.AxMapControl1.Extent = frmExtentView.AxMapControl1.FullExtent;

                //Create and setup the fill symbol that will be used to draw the dataset's extent
                // rectangle if it is not cached
                if (m_pFillSymbol == null)
                {
                    m_pFillSymbol = new SimpleFillSymbol();

                    IColor pColor = null;
                    ILineSymbol pLineSymbol = null;
                    pColor = new RgbColor();
                    pColor.NullColor = true;
                    m_pFillSymbol.Color = pColor;

                    pLineSymbol = new SimpleLineSymbol();
                    pColor.NullColor = false;
                    pColor.RGB = 200; //Red
                    pLineSymbol.Color = pColor;
                    pLineSymbol.Width = 2;
                    m_pFillSymbol.Outline = pLineSymbol;
                }

                //Draw extent
                Refresh();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
            }
        }
        //点、线、面填充颜色变化响应事件
        private void cbColor_MouseUp(object sender, MouseEventArgs e)
        {
            IRgbColor pColor = new RgbColor();    //颜色实例
            pColor.RGB = 255;
            tagRECT pTag = new tagRECT();    //用于下面显示 ColorPalette 的位置
            pTag.left = cbColor.PointToScreen(System.Drawing.Point.Empty).X;            //按钮控件的左边全局横坐标
            pTag.bottom = cbColor.PointToScreen(System.Drawing.Point.Empty).Y + cbColor.Height;  //按钮控件的下边全局纵坐标
            IColorPalette pColorPalette = new ColorPalette();
            pColorPalette.TrackPopupMenu(ref pTag, pColor, false, 0);     //显示 ColorPalette
            pColor = pColorPalette.Color as IRgbColor;          //获取选中的颜色
            Color color = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);  //将颜色转为 C# 颜色
            btColor.BackColor = color;
            cbColor.BackColor = color;

            switch (((IFeatureLayer)pLayer).FeatureClass.ShapeType)  //判断几何体样式
            {
                case esriGeometryType.esriGeometryPoint:          //点
                    ((IMarkerSymbol)pStyleGalleryItem.Item).Color = pColor;  //转为 IMarkerSymbol,注意改好后要在图片上显示
                    PreviewPicture();
                    break;
                case esriGeometryType.esriGeometryPolyline:        //线
                    ((ILineSymbol)pStyleGalleryItem.Item).Color = pColor;  //转为 ILineSymbol
                    PreviewPicture();
                    break;
                case esriGeometryType.esriGeometryPolygon:      //面
                    ((IFillSymbol)pStyleGalleryItem.Item).Color = pColor;  //转为 IFillSymbol
                    PreviewPicture();
                    break;
                default:
                    break;
            }
        }
Esempio n. 56
0
 //闪烁面
 static void FlashPolygon(AxMapControl mapControl, IScreenDisplay iScreenDisplay, IGeometry iGeometry)
 {
     ISimpleFillSymbol iFillSymbol;
     ISymbol iSymbol;
     IRgbColor iRgbColor;
     iFillSymbol = new SimpleFillSymbol();
     iFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;
     iFillSymbol.Outline.Width = 12;
     iRgbColor = new RgbColor();
     iRgbColor.RGB = System.Drawing.Color.FromArgb(100, 180, 180).ToArgb();
     iFillSymbol.Color = iRgbColor;
     iSymbol = (ISymbol)iFillSymbol;
     iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
     iScreenDisplay.SetSymbol(iSymbol);
     mapControl.FlashShape(iGeometry, 3, 200, iSymbol);
 }
        // Generates content of workbookStylesPart1.
        private void GenerateWorkbookStylesPart1Content(WorkbookStylesPart workbookStylesPart1)
        {
            Stylesheet stylesheet1 = new Stylesheet();

            NumberingFormats numberingFormats1 = new NumberingFormats() { Count = (UInt32Value)2U };
            NumberingFormat numberingFormat1 = new NumberingFormat() { NumberFormatId = (UInt32Value)166U, FormatCode = "_(* #,##0_);_(* \\(#,##0\\);_(* \"-\"??_);_(@_)" };
            NumberingFormat numberingFormat2 = new NumberingFormat() { NumberFormatId = (UInt32Value)167U, FormatCode = "_-* #,##0\\ _€_-;\\-* #,##0\\ _€_-;_-* \"-\"??\\ _€_-;_-@_-" };

            numberingFormats1.Append(numberingFormat1);
            numberingFormats1.Append(numberingFormat2);

            Fonts fonts1 = new Fonts() { Count = (UInt32Value)14U };

            Font font1 = new Font();
            FontSize fontSize1 = new FontSize() { Val = 10D };
            FontName fontName1 = new FontName() { Val = "Arial" };

            font1.Append(fontSize1);
            font1.Append(fontName1);

            Font font2 = new Font();
            Bold bold1 = new Bold();
            FontSize fontSize2 = new FontSize() { Val = 10D };
            FontName fontName2 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering1 = new FontFamilyNumbering() { Val = 2 };

            font2.Append(bold1);
            font2.Append(fontSize2);
            font2.Append(fontName2);
            font2.Append(fontFamilyNumbering1);

            Font font3 = new Font();
            Bold bold2 = new Bold();
            Italic italic1 = new Italic();
            FontSize fontSize3 = new FontSize() { Val = 10D };
            FontName fontName3 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering2 = new FontFamilyNumbering() { Val = 2 };

            font3.Append(bold2);
            font3.Append(italic1);
            font3.Append(fontSize3);
            font3.Append(fontName3);
            font3.Append(fontFamilyNumbering2);

            Font font4 = new Font();
            Bold bold3 = new Bold();
            FontSize fontSize4 = new FontSize() { Val = 10D };
            Color color1 = new Color() { Indexed = (UInt32Value)9U };
            FontName fontName4 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering3 = new FontFamilyNumbering() { Val = 2 };

            font4.Append(bold3);
            font4.Append(fontSize4);
            font4.Append(color1);
            font4.Append(fontName4);
            font4.Append(fontFamilyNumbering3);

            Font font5 = new Font();
            FontSize fontSize5 = new FontSize() { Val = 10D };
            Color color2 = new Color() { Indexed = (UInt32Value)9U };
            FontName fontName5 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering4 = new FontFamilyNumbering() { Val = 2 };

            font5.Append(fontSize5);
            font5.Append(color2);
            font5.Append(fontName5);
            font5.Append(fontFamilyNumbering4);

            Font font6 = new Font();
            Bold bold4 = new Bold();
            FontSize fontSize6 = new FontSize() { Val = 10D };
            Color color3 = new Color() { Indexed = (UInt32Value)12U };
            FontName fontName6 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering5 = new FontFamilyNumbering() { Val = 2 };

            font6.Append(bold4);
            font6.Append(fontSize6);
            font6.Append(color3);
            font6.Append(fontName6);
            font6.Append(fontFamilyNumbering5);

            Font font7 = new Font();
            FontSize fontSize7 = new FontSize() { Val = 12D };
            Color color4 = new Color() { Indexed = (UInt32Value)12U };
            FontName fontName7 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering6 = new FontFamilyNumbering() { Val = 2 };

            font7.Append(fontSize7);
            font7.Append(color4);
            font7.Append(fontName7);
            font7.Append(fontFamilyNumbering6);

            Font font8 = new Font();
            Bold bold5 = new Bold();
            FontSize fontSize8 = new FontSize() { Val = 9D };
            FontName fontName8 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering7 = new FontFamilyNumbering() { Val = 2 };

            font8.Append(bold5);
            font8.Append(fontSize8);
            font8.Append(fontName8);
            font8.Append(fontFamilyNumbering7);

            Font font9 = new Font();
            Bold bold6 = new Bold();
            FontSize fontSize9 = new FontSize() { Val = 8D };
            Color color5 = new Color() { Indexed = (UInt32Value)9U };
            FontName fontName9 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering8 = new FontFamilyNumbering() { Val = 2 };

            font9.Append(bold6);
            font9.Append(fontSize9);
            font9.Append(color5);
            font9.Append(fontName9);
            font9.Append(fontFamilyNumbering8);

            Font font10 = new Font();
            FontSize fontSize10 = new FontSize() { Val = 12D };
            FontName fontName10 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering9 = new FontFamilyNumbering() { Val = 2 };

            font10.Append(fontSize10);
            font10.Append(fontName10);
            font10.Append(fontFamilyNumbering9);

            Font font11 = new Font();
            Bold bold7 = new Bold();
            FontSize fontSize11 = new FontSize() { Val = 12D };
            FontName fontName11 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering10 = new FontFamilyNumbering() { Val = 2 };

            font11.Append(bold7);
            font11.Append(fontSize11);
            font11.Append(fontName11);
            font11.Append(fontFamilyNumbering10);

            Font font12 = new Font();
            Bold bold8 = new Bold();
            FontSize fontSize12 = new FontSize() { Val = 11D };
            FontName fontName12 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering11 = new FontFamilyNumbering() { Val = 2 };

            font12.Append(bold8);
            font12.Append(fontSize12);
            font12.Append(fontName12);
            font12.Append(fontFamilyNumbering11);

            Font font13 = new Font();
            FontSize fontSize13 = new FontSize() { Val = 11D };
            FontName fontName13 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering12 = new FontFamilyNumbering() { Val = 2 };

            font13.Append(fontSize13);
            font13.Append(fontName13);
            font13.Append(fontFamilyNumbering12);

            Font font14 = new Font();
            Underline underline1 = new Underline();
            FontSize fontSize14 = new FontSize() { Val = 12D };
            Color color6 = new Color() { Indexed = (UInt32Value)12U };
            FontName fontName14 = new FontName() { Val = "Arial" };

            font14.Append(underline1);
            font14.Append(fontSize14);
            font14.Append(color6);
            font14.Append(fontName14);

            fonts1.Append(font1);
            fonts1.Append(font2);
            fonts1.Append(font3);
            fonts1.Append(font4);
            fonts1.Append(font5);
            fonts1.Append(font6);
            fonts1.Append(font7);
            fonts1.Append(font8);
            fonts1.Append(font9);
            fonts1.Append(font10);
            fonts1.Append(font11);
            fonts1.Append(font12);
            fonts1.Append(font13);
            fonts1.Append(font14);

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

            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() { Indexed = (UInt32Value)9U };
            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() { Indexed = (UInt32Value)10U };
            BackgroundColor backgroundColor2 = new BackgroundColor() { Indexed = (UInt32Value)64U };

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

            fill4.Append(patternFill4);

            Fill fill5 = new Fill();

            PatternFill patternFill5 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor3 = new ForegroundColor() { Indexed = (UInt32Value)23U };
            BackgroundColor backgroundColor3 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill5.Append(foregroundColor3);
            patternFill5.Append(backgroundColor3);

            fill5.Append(patternFill5);

            Fill fill6 = new Fill();

            PatternFill patternFill6 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor4 = new ForegroundColor() { Indexed = (UInt32Value)43U };
            BackgroundColor backgroundColor4 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill6.Append(foregroundColor4);
            patternFill6.Append(backgroundColor4);

            fill6.Append(patternFill6);

            Fill fill7 = new Fill();

            PatternFill patternFill7 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor5 = new ForegroundColor() { Indexed = (UInt32Value)42U };
            BackgroundColor backgroundColor5 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill7.Append(foregroundColor5);
            patternFill7.Append(backgroundColor5);

            fill7.Append(patternFill7);

            Fill fill8 = new Fill();

            PatternFill patternFill8 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor6 = new ForegroundColor() { Indexed = (UInt32Value)55U };
            BackgroundColor backgroundColor6 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill8.Append(foregroundColor6);
            patternFill8.Append(backgroundColor6);

            fill8.Append(patternFill8);

            Fill fill9 = new Fill();

            PatternFill patternFill9 = new PatternFill() { PatternType = PatternValues.None };
            ForegroundColor foregroundColor7 = new ForegroundColor() { Indexed = (UInt32Value)9U };
            BackgroundColor backgroundColor7 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill9.Append(foregroundColor7);
            patternFill9.Append(backgroundColor7);

            fill9.Append(patternFill9);

            Fill fill10 = new Fill();

            PatternFill patternFill10 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor8 = new ForegroundColor() { Theme = (UInt32Value)0U };
            BackgroundColor backgroundColor8 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill10.Append(foregroundColor8);
            patternFill10.Append(backgroundColor8);

            fill10.Append(patternFill10);

            Fill fill11 = new Fill();

            PatternFill patternFill11 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor9 = new ForegroundColor() { Rgb = "FFFFE699" };
            BackgroundColor backgroundColor9 = new BackgroundColor() { Rgb = "FF000000" };

            patternFill11.Append(foregroundColor9);
            patternFill11.Append(backgroundColor9);

            fill11.Append(patternFill11);

            Fill fill12 = new Fill();

            PatternFill patternFill12 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor10 = new ForegroundColor() { Rgb = "FFCCFFCC" };
            BackgroundColor backgroundColor10 = new BackgroundColor() { Rgb = "FF000000" };

            patternFill12.Append(foregroundColor10);
            patternFill12.Append(backgroundColor10);

            fill12.Append(patternFill12);

            Fill fill13 = new Fill();

            PatternFill patternFill13 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor11 = new ForegroundColor() { Rgb = "FF969696" };
            BackgroundColor backgroundColor11 = new BackgroundColor() { Rgb = "FF000000" };

            patternFill13.Append(foregroundColor11);
            patternFill13.Append(backgroundColor11);

            fill13.Append(patternFill13);

            fills1.Append(fill1);
            fills1.Append(fill2);
            fills1.Append(fill3);
            fills1.Append(fill4);
            fills1.Append(fill5);
            fills1.Append(fill6);
            fills1.Append(fill7);
            fills1.Append(fill8);
            fills1.Append(fill9);
            fills1.Append(fill10);
            fills1.Append(fill11);
            fills1.Append(fill12);
            fills1.Append(fill13);

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

            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() { Style = BorderStyleValues.Thin };
            Color color7 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder2.Append(color7);

            RightBorder rightBorder2 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color8 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder2.Append(color8);

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

            topBorder2.Append(color9);

            BottomBorder bottomBorder2 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color10 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder2.Append(color10);
            DiagonalBorder diagonalBorder2 = new DiagonalBorder();

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

            Border border3 = new Border();
            LeftBorder leftBorder3 = new LeftBorder();
            RightBorder rightBorder3 = new RightBorder();

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

            topBorder3.Append(color11);

            BottomBorder bottomBorder3 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color12 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder3.Append(color12);
            DiagonalBorder diagonalBorder3 = new DiagonalBorder();

            border3.Append(leftBorder3);
            border3.Append(rightBorder3);
            border3.Append(topBorder3);
            border3.Append(bottomBorder3);
            border3.Append(diagonalBorder3);

            Border border4 = new Border();
            LeftBorder leftBorder4 = new LeftBorder();

            RightBorder rightBorder4 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color13 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder4.Append(color13);

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

            topBorder4.Append(color14);

            BottomBorder bottomBorder4 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color15 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder4.Append(color15);
            DiagonalBorder diagonalBorder4 = new DiagonalBorder();

            border4.Append(leftBorder4);
            border4.Append(rightBorder4);
            border4.Append(topBorder4);
            border4.Append(bottomBorder4);
            border4.Append(diagonalBorder4);

            Border border5 = new Border();

            LeftBorder leftBorder5 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color16 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder5.Append(color16);

            RightBorder rightBorder5 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color17 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder5.Append(color17);
            TopBorder topBorder5 = new TopBorder();

            BottomBorder bottomBorder5 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color18 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder5.Append(color18);
            DiagonalBorder diagonalBorder5 = new DiagonalBorder();

            border5.Append(leftBorder5);
            border5.Append(rightBorder5);
            border5.Append(topBorder5);
            border5.Append(bottomBorder5);
            border5.Append(diagonalBorder5);

            Border border6 = new Border();

            LeftBorder leftBorder6 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color19 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder6.Append(color19);

            RightBorder rightBorder6 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color20 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder6.Append(color20);

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

            topBorder6.Append(color21);
            BottomBorder bottomBorder6 = new BottomBorder();
            DiagonalBorder diagonalBorder6 = new DiagonalBorder();

            border6.Append(leftBorder6);
            border6.Append(rightBorder6);
            border6.Append(topBorder6);
            border6.Append(bottomBorder6);
            border6.Append(diagonalBorder6);

            Border border7 = new Border();

            LeftBorder leftBorder7 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color22 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder7.Append(color22);
            RightBorder rightBorder7 = new RightBorder();

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

            topBorder7.Append(color23);
            BottomBorder bottomBorder7 = new BottomBorder();
            DiagonalBorder diagonalBorder7 = new DiagonalBorder();

            border7.Append(leftBorder7);
            border7.Append(rightBorder7);
            border7.Append(topBorder7);
            border7.Append(bottomBorder7);
            border7.Append(diagonalBorder7);

            Border border8 = new Border();
            LeftBorder leftBorder8 = new LeftBorder();

            RightBorder rightBorder8 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color24 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder8.Append(color24);
            TopBorder topBorder8 = new TopBorder();

            BottomBorder bottomBorder8 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color25 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder8.Append(color25);
            DiagonalBorder diagonalBorder8 = new DiagonalBorder();

            border8.Append(leftBorder8);
            border8.Append(rightBorder8);
            border8.Append(topBorder8);
            border8.Append(bottomBorder8);
            border8.Append(diagonalBorder8);

            Border border9 = new Border();

            LeftBorder leftBorder9 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color26 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder9.Append(color26);

            RightBorder rightBorder9 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color27 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder9.Append(color27);
            TopBorder topBorder9 = new TopBorder();
            BottomBorder bottomBorder9 = new BottomBorder();
            DiagonalBorder diagonalBorder9 = new DiagonalBorder();

            border9.Append(leftBorder9);
            border9.Append(rightBorder9);
            border9.Append(topBorder9);
            border9.Append(bottomBorder9);
            border9.Append(diagonalBorder9);

            Border border10 = new Border();

            LeftBorder leftBorder10 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color28 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder10.Append(color28);
            RightBorder rightBorder10 = new RightBorder();

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

            topBorder10.Append(color29);

            BottomBorder bottomBorder10 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color30 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder10.Append(color30);
            DiagonalBorder diagonalBorder10 = new DiagonalBorder();

            border10.Append(leftBorder10);
            border10.Append(rightBorder10);
            border10.Append(topBorder10);
            border10.Append(bottomBorder10);
            border10.Append(diagonalBorder10);

            Border border11 = new Border();
            LeftBorder leftBorder11 = new LeftBorder();

            RightBorder rightBorder11 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color31 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder11.Append(color31);
            TopBorder topBorder11 = new TopBorder();
            BottomBorder bottomBorder11 = new BottomBorder();
            DiagonalBorder diagonalBorder11 = new DiagonalBorder();

            border11.Append(leftBorder11);
            border11.Append(rightBorder11);
            border11.Append(topBorder11);
            border11.Append(bottomBorder11);
            border11.Append(diagonalBorder11);

            Border border12 = new Border();

            LeftBorder leftBorder12 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color32 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder12.Append(color32);
            RightBorder rightBorder12 = new RightBorder();
            TopBorder topBorder12 = new TopBorder();
            BottomBorder bottomBorder12 = new BottomBorder();
            DiagonalBorder diagonalBorder12 = new DiagonalBorder();

            border12.Append(leftBorder12);
            border12.Append(rightBorder12);
            border12.Append(topBorder12);
            border12.Append(bottomBorder12);
            border12.Append(diagonalBorder12);

            Border border13 = new Border();

            LeftBorder leftBorder13 = new LeftBorder() { Style = BorderStyleValues.Medium };
            Color color33 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder13.Append(color33);

            RightBorder rightBorder13 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color34 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder13.Append(color34);

            TopBorder topBorder13 = new TopBorder() { Style = BorderStyleValues.Medium };
            Color color35 = new Color() { Indexed = (UInt32Value)64U };

            topBorder13.Append(color35);

            BottomBorder bottomBorder13 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color36 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder13.Append(color36);
            DiagonalBorder diagonalBorder13 = new DiagonalBorder();

            border13.Append(leftBorder13);
            border13.Append(rightBorder13);
            border13.Append(topBorder13);
            border13.Append(bottomBorder13);
            border13.Append(diagonalBorder13);

            Border border14 = new Border();

            LeftBorder leftBorder14 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color37 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder14.Append(color37);

            RightBorder rightBorder14 = new RightBorder() { Style = BorderStyleValues.Medium };
            Color color38 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder14.Append(color38);

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

            topBorder14.Append(color39);

            BottomBorder bottomBorder14 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color40 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder14.Append(color40);
            DiagonalBorder diagonalBorder14 = new DiagonalBorder();

            border14.Append(leftBorder14);
            border14.Append(rightBorder14);
            border14.Append(topBorder14);
            border14.Append(bottomBorder14);
            border14.Append(diagonalBorder14);

            Border border15 = new Border();

            LeftBorder leftBorder15 = new LeftBorder() { Style = BorderStyleValues.Medium };
            Color color41 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder15.Append(color41);

            RightBorder rightBorder15 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color42 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder15.Append(color42);
            TopBorder topBorder15 = new TopBorder();

            BottomBorder bottomBorder15 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color43 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder15.Append(color43);
            DiagonalBorder diagonalBorder15 = new DiagonalBorder();

            border15.Append(leftBorder15);
            border15.Append(rightBorder15);
            border15.Append(topBorder15);
            border15.Append(bottomBorder15);
            border15.Append(diagonalBorder15);

            Border border16 = new Border();
            LeftBorder leftBorder16 = new LeftBorder();

            RightBorder rightBorder16 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color44 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder16.Append(color44);
            TopBorder topBorder16 = new TopBorder();

            BottomBorder bottomBorder16 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color45 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder16.Append(color45);
            DiagonalBorder diagonalBorder16 = new DiagonalBorder();

            border16.Append(leftBorder16);
            border16.Append(rightBorder16);
            border16.Append(topBorder16);
            border16.Append(bottomBorder16);
            border16.Append(diagonalBorder16);

            Border border17 = new Border();

            LeftBorder leftBorder17 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color46 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder17.Append(color46);

            RightBorder rightBorder17 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color47 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder17.Append(color47);
            TopBorder topBorder17 = new TopBorder();

            BottomBorder bottomBorder17 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color48 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder17.Append(color48);
            DiagonalBorder diagonalBorder17 = new DiagonalBorder();

            border17.Append(leftBorder17);
            border17.Append(rightBorder17);
            border17.Append(topBorder17);
            border17.Append(bottomBorder17);
            border17.Append(diagonalBorder17);

            Border border18 = new Border();

            LeftBorder leftBorder18 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color49 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder18.Append(color49);

            RightBorder rightBorder18 = new RightBorder() { Style = BorderStyleValues.Medium };
            Color color50 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder18.Append(color50);

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

            topBorder18.Append(color51);

            BottomBorder bottomBorder18 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color52 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder18.Append(color52);
            DiagonalBorder diagonalBorder18 = new DiagonalBorder();

            border18.Append(leftBorder18);
            border18.Append(rightBorder18);
            border18.Append(topBorder18);
            border18.Append(bottomBorder18);
            border18.Append(diagonalBorder18);

            Border border19 = new Border();
            LeftBorder leftBorder19 = new LeftBorder();

            RightBorder rightBorder19 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color53 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder19.Append(color53);

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

            topBorder19.Append(color54);
            BottomBorder bottomBorder19 = new BottomBorder();
            DiagonalBorder diagonalBorder19 = new DiagonalBorder();

            border19.Append(leftBorder19);
            border19.Append(rightBorder19);
            border19.Append(topBorder19);
            border19.Append(bottomBorder19);
            border19.Append(diagonalBorder19);

            Border border20 = new Border();

            LeftBorder leftBorder20 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color55 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder20.Append(color55);

            RightBorder rightBorder20 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color56 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder20.Append(color56);

            TopBorder topBorder20 = new TopBorder() { Style = BorderStyleValues.Medium };
            Color color57 = new Color() { Indexed = (UInt32Value)64U };

            topBorder20.Append(color57);

            BottomBorder bottomBorder20 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color58 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder20.Append(color58);
            DiagonalBorder diagonalBorder20 = new DiagonalBorder();

            border20.Append(leftBorder20);
            border20.Append(rightBorder20);
            border20.Append(topBorder20);
            border20.Append(bottomBorder20);
            border20.Append(diagonalBorder20);

            Border border21 = new Border();

            LeftBorder leftBorder21 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color59 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder21.Append(color59);

            RightBorder rightBorder21 = new RightBorder() { Style = BorderStyleValues.Medium };
            Color color60 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder21.Append(color60);

            TopBorder topBorder21 = new TopBorder() { Style = BorderStyleValues.Medium };
            Color color61 = new Color() { Indexed = (UInt32Value)64U };

            topBorder21.Append(color61);

            BottomBorder bottomBorder21 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color62 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder21.Append(color62);
            DiagonalBorder diagonalBorder21 = new DiagonalBorder();

            border21.Append(leftBorder21);
            border21.Append(rightBorder21);
            border21.Append(topBorder21);
            border21.Append(bottomBorder21);
            border21.Append(diagonalBorder21);

            Border border22 = new Border();

            LeftBorder leftBorder22 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color63 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder22.Append(color63);

            RightBorder rightBorder22 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color64 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder22.Append(color64);

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

            topBorder22.Append(color65);

            BottomBorder bottomBorder22 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color66 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder22.Append(color66);
            DiagonalBorder diagonalBorder22 = new DiagonalBorder();

            border22.Append(leftBorder22);
            border22.Append(rightBorder22);
            border22.Append(topBorder22);
            border22.Append(bottomBorder22);
            border22.Append(diagonalBorder22);

            Border border23 = new Border();

            LeftBorder leftBorder23 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color67 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder23.Append(color67);

            RightBorder rightBorder23 = new RightBorder() { Style = BorderStyleValues.Medium };
            Color color68 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder23.Append(color68);
            TopBorder topBorder23 = new TopBorder();

            BottomBorder bottomBorder23 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color69 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder23.Append(color69);
            DiagonalBorder diagonalBorder23 = new DiagonalBorder();

            border23.Append(leftBorder23);
            border23.Append(rightBorder23);
            border23.Append(topBorder23);
            border23.Append(bottomBorder23);
            border23.Append(diagonalBorder23);

            Border border24 = new Border();

            LeftBorder leftBorder24 = new LeftBorder() { Style = BorderStyleValues.Medium };
            Color color70 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder24.Append(color70);

            RightBorder rightBorder24 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color71 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder24.Append(color71);

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

            topBorder24.Append(color72);

            BottomBorder bottomBorder24 = new BottomBorder() { Style = BorderStyleValues.Thin };
            Color color73 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder24.Append(color73);
            DiagonalBorder diagonalBorder24 = new DiagonalBorder();

            border24.Append(leftBorder24);
            border24.Append(rightBorder24);
            border24.Append(topBorder24);
            border24.Append(bottomBorder24);
            border24.Append(diagonalBorder24);

            Border border25 = new Border();

            LeftBorder leftBorder25 = new LeftBorder() { Style = BorderStyleValues.Medium };
            Color color74 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder25.Append(color74);

            RightBorder rightBorder25 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color75 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder25.Append(color75);

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

            topBorder25.Append(color76);

            BottomBorder bottomBorder25 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color77 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder25.Append(color77);
            DiagonalBorder diagonalBorder25 = new DiagonalBorder();

            border25.Append(leftBorder25);
            border25.Append(rightBorder25);
            border25.Append(topBorder25);
            border25.Append(bottomBorder25);
            border25.Append(diagonalBorder25);

            Border border26 = new Border();

            LeftBorder leftBorder26 = new LeftBorder() { Style = BorderStyleValues.Medium };
            Color color78 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder26.Append(color78);

            RightBorder rightBorder26 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color79 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder26.Append(color79);

            TopBorder topBorder26 = new TopBorder() { Style = BorderStyleValues.Medium };
            Color color80 = new Color() { Indexed = (UInt32Value)64U };

            topBorder26.Append(color80);

            BottomBorder bottomBorder26 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color81 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder26.Append(color81);
            DiagonalBorder diagonalBorder26 = new DiagonalBorder();

            border26.Append(leftBorder26);
            border26.Append(rightBorder26);
            border26.Append(topBorder26);
            border26.Append(bottomBorder26);
            border26.Append(diagonalBorder26);

            Border border27 = new Border();

            LeftBorder leftBorder27 = new LeftBorder() { Style = BorderStyleValues.Thin };
            Color color82 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder27.Append(color82);

            RightBorder rightBorder27 = new RightBorder() { Style = BorderStyleValues.Thin };
            Color color83 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder27.Append(color83);

            TopBorder topBorder27 = new TopBorder() { Style = BorderStyleValues.Medium };
            Color color84 = new Color() { Indexed = (UInt32Value)64U };

            topBorder27.Append(color84);

            BottomBorder bottomBorder27 = new BottomBorder() { Style = BorderStyleValues.Medium };
            Color color85 = new Color() { Indexed = (UInt32Value)64U };

            bottomBorder27.Append(color85);
            DiagonalBorder diagonalBorder27 = new DiagonalBorder();

            border27.Append(leftBorder27);
            border27.Append(rightBorder27);
            border27.Append(topBorder27);
            border27.Append(bottomBorder27);
            border27.Append(diagonalBorder27);

            borders1.Append(border1);
            borders1.Append(border2);
            borders1.Append(border3);
            borders1.Append(border4);
            borders1.Append(border5);
            borders1.Append(border6);
            borders1.Append(border7);
            borders1.Append(border8);
            borders1.Append(border9);
            borders1.Append(border10);
            borders1.Append(border11);
            borders1.Append(border12);
            borders1.Append(border13);
            borders1.Append(border14);
            borders1.Append(border15);
            borders1.Append(border16);
            borders1.Append(border17);
            borders1.Append(border18);
            borders1.Append(border19);
            borders1.Append(border20);
            borders1.Append(border21);
            borders1.Append(border22);
            borders1.Append(border23);
            borders1.Append(border24);
            borders1.Append(border25);
            borders1.Append(border26);
            borders1.Append(border27);

            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)95U };
            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)0U, FillId = (UInt32Value)9U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment1 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

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

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

            cellFormat7.Append(alignment2);

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

            cellFormat8.Append(alignment3);
            CellFormat cellFormat9 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };

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

            cellFormat10.Append(alignment4);
            CellFormat cellFormat11 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };

            CellFormat cellFormat12 = new CellFormat() { NumberFormatId = (UInt32Value)17U, FontId = (UInt32Value)5U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment5 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };

            cellFormat12.Append(alignment5);

            CellFormat cellFormat13 = new CellFormat() { NumberFormatId = (UInt32Value)166U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment6 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };

            cellFormat13.Append(alignment6);

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

            cellFormat14.Append(alignment7);

            CellFormat cellFormat15 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment8 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };

            cellFormat15.Append(alignment8);

            CellFormat cellFormat16 = new CellFormat() { NumberFormatId = (UInt32Value)17U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment9 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };

            cellFormat16.Append(alignment9);
            CellFormat cellFormat17 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)13U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            CellFormat cellFormat18 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };

            CellFormat cellFormat19 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment10 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };

            cellFormat19.Append(alignment10);

            CellFormat cellFormat20 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)5U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment11 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat20.Append(alignment11);

            CellFormat cellFormat21 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)6U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment12 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat21.Append(alignment12);

            CellFormat cellFormat22 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment13 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat22.Append(alignment13);

            CellFormat cellFormat23 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment14 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat23.Append(alignment14);

            CellFormat cellFormat24 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)8U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment15 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat24.Append(alignment15);

            CellFormat cellFormat25 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)10U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment16 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat25.Append(alignment16);

            CellFormat cellFormat26 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)4U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)8U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment17 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat26.Append(alignment17);

            CellFormat cellFormat27 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)4U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)11U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment18 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat27.Append(alignment18);

            CellFormat cellFormat28 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)4U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)18U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment19 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat28.Append(alignment19);

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

            cellFormat29.Append(alignment20);

            CellFormat cellFormat30 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)7U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment21 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat30.Append(alignment21);
            CellFormat cellFormat31 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)11U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            CellFormat cellFormat32 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)12U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };

            CellFormat cellFormat33 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)19U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment22 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat33.Append(alignment22);

            CellFormat cellFormat34 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)20U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment23 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat34.Append(alignment23);

            CellFormat cellFormat35 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)7U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment24 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat35.Append(alignment24);

            CellFormat cellFormat36 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment25 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat36.Append(alignment25);

            CellFormat cellFormat37 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment26 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat37.Append(alignment26);

            CellFormat cellFormat38 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment27 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat38.Append(alignment27);

            CellFormat cellFormat39 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)11U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment28 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat39.Append(alignment28);

            CellFormat cellFormat40 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)13U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment29 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat40.Append(alignment29);

            CellFormat cellFormat41 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)17U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment30 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat41.Append(alignment30);

            CellFormat cellFormat42 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)7U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment31 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat42.Append(alignment31);

            CellFormat cellFormat43 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)11U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment32 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center, WrapText = true };

            cellFormat43.Append(alignment32);

            CellFormat cellFormat44 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)14U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment33 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat44.Append(alignment33);

            CellFormat cellFormat45 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)15U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment34 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat45.Append(alignment34);

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

            cellFormat46.Append(alignment35);
            CellFormat cellFormat47 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)10U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            CellFormat cellFormat48 = new CellFormat() { NumberFormatId = (UInt32Value)49U, FontId = (UInt32Value)10U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };

            CellFormat cellFormat49 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment36 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat49.Append(alignment36);

            CellFormat cellFormat50 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment37 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat50.Append(alignment37);

            CellFormat cellFormat51 = new CellFormat() { NumberFormatId = (UInt32Value)167U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment38 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat51.Append(alignment38);
            CellFormat cellFormat52 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)10U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            CellFormat cellFormat53 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)9U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };

            CellFormat cellFormat54 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)4U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment39 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat54.Append(alignment39);

            CellFormat cellFormat55 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)8U, FillId = (UInt32Value)4U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment40 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat55.Append(alignment40);

            CellFormat cellFormat56 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)11U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)5U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment41 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center, WrapText = true };

            cellFormat56.Append(alignment41);

            CellFormat cellFormat57 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)12U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment42 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right, Vertical = VerticalAlignmentValues.Center };

            cellFormat57.Append(alignment42);

            CellFormat cellFormat58 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)11U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment43 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat58.Append(alignment43);

            CellFormat cellFormat59 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)12U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment44 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right, Vertical = VerticalAlignmentValues.Center };

            cellFormat59.Append(alignment44);

            CellFormat cellFormat60 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)11U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment45 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat60.Append(alignment45);
            CellFormat cellFormat61 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)7U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };

            CellFormat cellFormat62 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)7U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment46 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat62.Append(alignment46);

            CellFormat cellFormat63 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment47 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat63.Append(alignment47);

            CellFormat cellFormat64 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)16U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment48 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat64.Append(alignment48);

            CellFormat cellFormat65 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)22U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment49 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat65.Append(alignment49);
            CellFormat cellFormat66 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)23U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };

            CellFormat cellFormat67 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)24U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment50 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };

            cellFormat67.Append(alignment50);

            CellFormat cellFormat68 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)21U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment51 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat68.Append(alignment51);

            CellFormat cellFormat69 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)10U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment52 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat69.Append(alignment52);

            CellFormat cellFormat70 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)8U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment53 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat70.Append(alignment53);

            CellFormat cellFormat71 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)8U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment54 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat71.Append(alignment54);

            CellFormat cellFormat72 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)8U, FormatId = (UInt32Value)0U, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment55 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat72.Append(alignment55);

            CellFormat cellFormat73 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)25U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment56 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat73.Append(alignment56);

            CellFormat cellFormat74 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)26U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment57 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat74.Append(alignment57);

            CellFormat cellFormat75 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)11U, FillId = (UInt32Value)11U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment58 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat75.Append(alignment58);

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

            cellFormat76.Append(alignment59);

            CellFormat cellFormat77 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)11U, FillId = (UInt32Value)11U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment60 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat77.Append(alignment60);

            CellFormat cellFormat78 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)12U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment61 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat78.Append(alignment61);

            CellFormat cellFormat79 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)12U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment62 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat79.Append(alignment62);

            CellFormat cellFormat80 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)12U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment63 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat80.Append(alignment63);

            CellFormat cellFormat81 = new CellFormat() { NumberFormatId = (UInt32Value)17U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment64 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };

            cellFormat81.Append(alignment64);

            CellFormat cellFormat82 = new CellFormat() { NumberFormatId = (UInt32Value)17U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment65 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };

            cellFormat82.Append(alignment65);

            CellFormat cellFormat83 = new CellFormat() { NumberFormatId = (UInt32Value)17U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment66 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };

            cellFormat83.Append(alignment66);

            CellFormat cellFormat84 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)10U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment67 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };

            cellFormat84.Append(alignment67);

            CellFormat cellFormat85 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)10U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment68 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };

            cellFormat85.Append(alignment68);

            CellFormat cellFormat86 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)1U, FillId = (UInt32Value)10U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment69 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };

            cellFormat86.Append(alignment69);

            CellFormat cellFormat87 = new CellFormat() { NumberFormatId = (UInt32Value)2U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)8U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment70 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat87.Append(alignment70);

            CellFormat cellFormat88 = new CellFormat() { NumberFormatId = (UInt32Value)2U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment71 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat88.Append(alignment71);

            CellFormat cellFormat89 = new CellFormat() { NumberFormatId = (UInt32Value)2U, FontId = (UInt32Value)1U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment72 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat89.Append(alignment72);

            CellFormat cellFormat90 = new CellFormat() { NumberFormatId = (UInt32Value)2U, FontId = (UInt32Value)3U, FillId = (UInt32Value)4U, BorderId = (UInt32Value)7U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment73 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat90.Append(alignment73);

            CellFormat cellFormat91 = new CellFormat() { NumberFormatId = (UInt32Value)4U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment74 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat91.Append(alignment74);

            CellFormat cellFormat92 = new CellFormat() { NumberFormatId = (UInt32Value)4U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)5U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment75 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat92.Append(alignment75);

            CellFormat cellFormat93 = new CellFormat() { NumberFormatId = (UInt32Value)4U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)26U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment76 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat93.Append(alignment76);

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

            cellFormat94.Append(alignment77);

            CellFormat cellFormat95 = new CellFormat() { NumberFormatId = (UInt32Value)2U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)5U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment78 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat95.Append(alignment78);

            CellFormat cellFormat96 = new CellFormat() { NumberFormatId = (UInt32Value)2U, FontId = (UInt32Value)0U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)26U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment79 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat96.Append(alignment79);

            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);
            cellFormats1.Append(cellFormat18);
            cellFormats1.Append(cellFormat19);
            cellFormats1.Append(cellFormat20);
            cellFormats1.Append(cellFormat21);
            cellFormats1.Append(cellFormat22);
            cellFormats1.Append(cellFormat23);
            cellFormats1.Append(cellFormat24);
            cellFormats1.Append(cellFormat25);
            cellFormats1.Append(cellFormat26);
            cellFormats1.Append(cellFormat27);
            cellFormats1.Append(cellFormat28);
            cellFormats1.Append(cellFormat29);
            cellFormats1.Append(cellFormat30);
            cellFormats1.Append(cellFormat31);
            cellFormats1.Append(cellFormat32);
            cellFormats1.Append(cellFormat33);
            cellFormats1.Append(cellFormat34);
            cellFormats1.Append(cellFormat35);
            cellFormats1.Append(cellFormat36);
            cellFormats1.Append(cellFormat37);
            cellFormats1.Append(cellFormat38);
            cellFormats1.Append(cellFormat39);
            cellFormats1.Append(cellFormat40);
            cellFormats1.Append(cellFormat41);
            cellFormats1.Append(cellFormat42);
            cellFormats1.Append(cellFormat43);
            cellFormats1.Append(cellFormat44);
            cellFormats1.Append(cellFormat45);
            cellFormats1.Append(cellFormat46);
            cellFormats1.Append(cellFormat47);
            cellFormats1.Append(cellFormat48);
            cellFormats1.Append(cellFormat49);
            cellFormats1.Append(cellFormat50);
            cellFormats1.Append(cellFormat51);
            cellFormats1.Append(cellFormat52);
            cellFormats1.Append(cellFormat53);
            cellFormats1.Append(cellFormat54);
            cellFormats1.Append(cellFormat55);
            cellFormats1.Append(cellFormat56);
            cellFormats1.Append(cellFormat57);
            cellFormats1.Append(cellFormat58);
            cellFormats1.Append(cellFormat59);
            cellFormats1.Append(cellFormat60);
            cellFormats1.Append(cellFormat61);
            cellFormats1.Append(cellFormat62);
            cellFormats1.Append(cellFormat63);
            cellFormats1.Append(cellFormat64);
            cellFormats1.Append(cellFormat65);
            cellFormats1.Append(cellFormat66);
            cellFormats1.Append(cellFormat67);
            cellFormats1.Append(cellFormat68);
            cellFormats1.Append(cellFormat69);
            cellFormats1.Append(cellFormat70);
            cellFormats1.Append(cellFormat71);
            cellFormats1.Append(cellFormat72);
            cellFormats1.Append(cellFormat73);
            cellFormats1.Append(cellFormat74);
            cellFormats1.Append(cellFormat75);
            cellFormats1.Append(cellFormat76);
            cellFormats1.Append(cellFormat77);
            cellFormats1.Append(cellFormat78);
            cellFormats1.Append(cellFormat79);
            cellFormats1.Append(cellFormat80);
            cellFormats1.Append(cellFormat81);
            cellFormats1.Append(cellFormat82);
            cellFormats1.Append(cellFormat83);
            cellFormats1.Append(cellFormat84);
            cellFormats1.Append(cellFormat85);
            cellFormats1.Append(cellFormat86);
            cellFormats1.Append(cellFormat87);
            cellFormats1.Append(cellFormat88);
            cellFormats1.Append(cellFormat89);
            cellFormats1.Append(cellFormat90);
            cellFormats1.Append(cellFormat91);
            cellFormats1.Append(cellFormat92);
            cellFormats1.Append(cellFormat93);
            cellFormats1.Append(cellFormat94);
            cellFormats1.Append(cellFormat95);
            cellFormats1.Append(cellFormat96);

            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)1U };

            DifferentialFormat differentialFormat1 = new DifferentialFormat();

            Fill fill14 = new Fill();

            PatternFill patternFill14 = new PatternFill() { PatternType = PatternValues.Solid };
            BackgroundColor backgroundColor12 = new BackgroundColor() { Indexed = (UInt32Value)9U };

            patternFill14.Append(backgroundColor12);

            fill14.Append(patternFill14);

            differentialFormat1.Append(fill14);

            differentialFormats1.Append(differentialFormat1);
            TableStyles tableStyles1 = new TableStyles() { Count = (UInt32Value)0U, DefaultTableStyle = "TableStyleMedium9", DefaultPivotStyle = "PivotStyleLight16" };

            Colors colors1 = new Colors();

            IndexedColors indexedColors1 = new IndexedColors();
            RgbColor rgbColor1 = new RgbColor() { Rgb = "00000000" };
            RgbColor rgbColor2 = new RgbColor() { Rgb = "00FFFFFF" };
            RgbColor rgbColor3 = new RgbColor() { Rgb = "00FF0000" };
            RgbColor rgbColor4 = new RgbColor() { Rgb = "0000FF00" };
            RgbColor rgbColor5 = new RgbColor() { Rgb = "000000FF" };
            RgbColor rgbColor6 = new RgbColor() { Rgb = "00FFFF00" };
            RgbColor rgbColor7 = new RgbColor() { Rgb = "00FF00FF" };
            RgbColor rgbColor8 = new RgbColor() { Rgb = "0000FFFF" };
            RgbColor rgbColor9 = new RgbColor() { Rgb = "00000000" };
            RgbColor rgbColor10 = new RgbColor() { Rgb = "00FFFFFF" };
            RgbColor rgbColor11 = new RgbColor() { Rgb = "00FF0000" };
            RgbColor rgbColor12 = new RgbColor() { Rgb = "0000FF00" };
            RgbColor rgbColor13 = new RgbColor() { Rgb = "000000FF" };
            RgbColor rgbColor14 = new RgbColor() { Rgb = "00FFFF00" };
            RgbColor rgbColor15 = new RgbColor() { Rgb = "00FF00FF" };
            RgbColor rgbColor16 = new RgbColor() { Rgb = "0000FFFF" };
            RgbColor rgbColor17 = new RgbColor() { Rgb = "00800000" };
            RgbColor rgbColor18 = new RgbColor() { Rgb = "00008000" };
            RgbColor rgbColor19 = new RgbColor() { Rgb = "00000080" };
            RgbColor rgbColor20 = new RgbColor() { Rgb = "00808000" };
            RgbColor rgbColor21 = new RgbColor() { Rgb = "00800080" };
            RgbColor rgbColor22 = new RgbColor() { Rgb = "00008080" };
            RgbColor rgbColor23 = new RgbColor() { Rgb = "00C0C0C0" };
            RgbColor rgbColor24 = new RgbColor() { Rgb = "00808080" };
            RgbColor rgbColor25 = new RgbColor() { Rgb = "008080FF" };
            RgbColor rgbColor26 = new RgbColor() { Rgb = "00802060" };
            RgbColor rgbColor27 = new RgbColor() { Rgb = "00FFFFC0" };
            RgbColor rgbColor28 = new RgbColor() { Rgb = "00A0E0E0" };
            RgbColor rgbColor29 = new RgbColor() { Rgb = "00600080" };
            RgbColor rgbColor30 = new RgbColor() { Rgb = "00FF8080" };
            RgbColor rgbColor31 = new RgbColor() { Rgb = "000080C0" };
            RgbColor rgbColor32 = new RgbColor() { Rgb = "00C0C0FF" };
            RgbColor rgbColor33 = new RgbColor() { Rgb = "00000080" };
            RgbColor rgbColor34 = new RgbColor() { Rgb = "00FF00FF" };
            RgbColor rgbColor35 = new RgbColor() { Rgb = "00FFFF00" };
            RgbColor rgbColor36 = new RgbColor() { Rgb = "0000FFFF" };
            RgbColor rgbColor37 = new RgbColor() { Rgb = "00800080" };
            RgbColor rgbColor38 = new RgbColor() { Rgb = "00800000" };
            RgbColor rgbColor39 = new RgbColor() { Rgb = "00008080" };
            RgbColor rgbColor40 = new RgbColor() { Rgb = "000000FF" };
            RgbColor rgbColor41 = new RgbColor() { Rgb = "0000CCFF" };
            RgbColor rgbColor42 = new RgbColor() { Rgb = "0069FFFF" };
            RgbColor rgbColor43 = new RgbColor() { Rgb = "00CCFFCC" };
            RgbColor rgbColor44 = new RgbColor() { Rgb = "00FFFF99" };
            RgbColor rgbColor45 = new RgbColor() { Rgb = "00A6CAF0" };
            RgbColor rgbColor46 = new RgbColor() { Rgb = "00CC9CCC" };
            RgbColor rgbColor47 = new RgbColor() { Rgb = "00CC99FF" };
            RgbColor rgbColor48 = new RgbColor() { Rgb = "00E3E3E3" };
            RgbColor rgbColor49 = new RgbColor() { Rgb = "003366FF" };
            RgbColor rgbColor50 = new RgbColor() { Rgb = "0033CCCC" };
            RgbColor rgbColor51 = new RgbColor() { Rgb = "00339933" };
            RgbColor rgbColor52 = new RgbColor() { Rgb = "00999933" };
            RgbColor rgbColor53 = new RgbColor() { Rgb = "00996633" };
            RgbColor rgbColor54 = new RgbColor() { Rgb = "00996666" };
            RgbColor rgbColor55 = new RgbColor() { Rgb = "00666699" };
            RgbColor rgbColor56 = new RgbColor() { Rgb = "00969696" };
            RgbColor rgbColor57 = new RgbColor() { Rgb = "003333CC" };
            RgbColor rgbColor58 = new RgbColor() { Rgb = "00336666" };
            RgbColor rgbColor59 = new RgbColor() { Rgb = "00003300" };
            RgbColor rgbColor60 = new RgbColor() { Rgb = "00333300" };
            RgbColor rgbColor61 = new RgbColor() { Rgb = "00663300" };
            RgbColor rgbColor62 = new RgbColor() { Rgb = "00993366" };
            RgbColor rgbColor63 = new RgbColor() { Rgb = "00333399" };
            RgbColor rgbColor64 = new RgbColor() { Rgb = "00424242" };

            indexedColors1.Append(rgbColor1);
            indexedColors1.Append(rgbColor2);
            indexedColors1.Append(rgbColor3);
            indexedColors1.Append(rgbColor4);
            indexedColors1.Append(rgbColor5);
            indexedColors1.Append(rgbColor6);
            indexedColors1.Append(rgbColor7);
            indexedColors1.Append(rgbColor8);
            indexedColors1.Append(rgbColor9);
            indexedColors1.Append(rgbColor10);
            indexedColors1.Append(rgbColor11);
            indexedColors1.Append(rgbColor12);
            indexedColors1.Append(rgbColor13);
            indexedColors1.Append(rgbColor14);
            indexedColors1.Append(rgbColor15);
            indexedColors1.Append(rgbColor16);
            indexedColors1.Append(rgbColor17);
            indexedColors1.Append(rgbColor18);
            indexedColors1.Append(rgbColor19);
            indexedColors1.Append(rgbColor20);
            indexedColors1.Append(rgbColor21);
            indexedColors1.Append(rgbColor22);
            indexedColors1.Append(rgbColor23);
            indexedColors1.Append(rgbColor24);
            indexedColors1.Append(rgbColor25);
            indexedColors1.Append(rgbColor26);
            indexedColors1.Append(rgbColor27);
            indexedColors1.Append(rgbColor28);
            indexedColors1.Append(rgbColor29);
            indexedColors1.Append(rgbColor30);
            indexedColors1.Append(rgbColor31);
            indexedColors1.Append(rgbColor32);
            indexedColors1.Append(rgbColor33);
            indexedColors1.Append(rgbColor34);
            indexedColors1.Append(rgbColor35);
            indexedColors1.Append(rgbColor36);
            indexedColors1.Append(rgbColor37);
            indexedColors1.Append(rgbColor38);
            indexedColors1.Append(rgbColor39);
            indexedColors1.Append(rgbColor40);
            indexedColors1.Append(rgbColor41);
            indexedColors1.Append(rgbColor42);
            indexedColors1.Append(rgbColor43);
            indexedColors1.Append(rgbColor44);
            indexedColors1.Append(rgbColor45);
            indexedColors1.Append(rgbColor46);
            indexedColors1.Append(rgbColor47);
            indexedColors1.Append(rgbColor48);
            indexedColors1.Append(rgbColor49);
            indexedColors1.Append(rgbColor50);
            indexedColors1.Append(rgbColor51);
            indexedColors1.Append(rgbColor52);
            indexedColors1.Append(rgbColor53);
            indexedColors1.Append(rgbColor54);
            indexedColors1.Append(rgbColor55);
            indexedColors1.Append(rgbColor56);
            indexedColors1.Append(rgbColor57);
            indexedColors1.Append(rgbColor58);
            indexedColors1.Append(rgbColor59);
            indexedColors1.Append(rgbColor60);
            indexedColors1.Append(rgbColor61);
            indexedColors1.Append(rgbColor62);
            indexedColors1.Append(rgbColor63);
            indexedColors1.Append(rgbColor64);

            colors1.Append(indexedColors1);

            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(colors1);

            workbookStylesPart1.Stylesheet = stylesheet1;
        }
        public static void AddAnnotate(ILayer layer, string fieldName)
        {
            var pGeoLayer = layer as IGeoFeatureLayer;
            if (pGeoLayer != null)
            {
                var ipalpColl = pGeoLayer.AnnotationProperties;
                ipalpColl.Clear();
                IColor fontColor = new RgbColor();
                fontColor.RGB = 255; //字体颜色
                var font = new Font("宋体", 10, FontStyle.Bold);
                var dispFont = (IFontDisp)OLE.GetIFontDispFromFont(font);

                ITextSymbol pTextSymbol = new TextSymbolClass
                {
                    Color = fontColor,
                    Font = dispFont,
                    Size = 12
                };
                ////用来控制标注和要素的相对位置关系

                ILineLabelPosition pLineLpos = new LineLabelPositionClass
                {
                    Parallel = true, //修改标注的属性
                    //Perpendicular = false,
                    Below = true,
                    InLine = false,
                    Above = false
                };

                //用来控制标注冲突
                ILineLabelPlacementPriorities pLinePlace = new LineLabelPlacementPrioritiesClass
                {
                    AboveStart = 5, //让above 和start的优先级为5
                    BelowAfter = 4
                };

                //用来实现对ILineLabelPosition 和 ILineLabelPlacementPriorities以及更高级属性的控制

                IBasicOverposterLayerProperties pBolp = new BasicOverposterLayerPropertiesClass
                {
                    FeatureType = esriBasicOverposterFeatureType.esriOverposterPolygon,
                    LineLabelPlacementPriorities = pLinePlace,
                    LineLabelPosition = pLineLpos
                };
                //创建标注对象
                ILabelEngineLayerProperties pLableEngine = new LabelEngineLayerPropertiesClass
                {
                    Symbol = pTextSymbol,
                    BasicOverposterLayerProperties = pBolp,
                    IsExpressionSimple = true,
                    Expression = "[" + fieldName + "]"
                };
                //设置标注的参考比例尺
                var pAnnoLyrPros = (IAnnotateLayerTransformationProperties)pLableEngine;
                pAnnoLyrPros.ReferenceScale = 2500000;
                //设置标注可见的最大最小比例尺
                var pAnnoPros = pLableEngine as IAnnotateLayerProperties;
                //pAnnoPros.AnnotationMaximumScale = 2500000;
                //pAnnoPros.AnnotationMinimumScale = 25000000;
                //pAnnoPros.WhereClause属性  设置过滤条件
                ipalpColl.Add(pAnnoPros);
            }
            if (pGeoLayer != null) pGeoLayer.DisplayAnnotation = true;
        }
 /// <summary>
 /// Gets the ARGB color that is mapped to from the given RGB color.
 /// </summary>
 /// <param name="source">The source RGB color.</param>
 /// <param name="destination">When this method returns, contains resulting ARGB color, if a mapping exists; otherwise, the default
 /// ARGB color. This parameter is passed uninitialized.</param>
 /// <returns>Returns true if a mapping was found; otherwise, false.</returns>
 public bool TryGetMapping(RgbColor source, out ArgbColor destination)
 {
     return map.TryGetValue(source, out destination);
 }
        private byte[] getLayerCountByType(System.Collections.Specialized.NameValueCollection boundVariables,
            ESRI.ArcGIS.SOESupport.JsonObject operationInput,
            string outputFormat,
            string requestProperties,
            out string responseProperties) 
        {
            IMapImage mapImage = null;

            bool? shouldAdd = null;
            operationInput.TryGetAsBoolean("addlayer", out shouldAdd);

            if (shouldAdd.HasValue)
            {
                if ((bool)shouldAdd)
                {
                    if (((IMapServerInfo4)mapServerInfo).SupportsDynamicLayers)
                    {
                        IRgbColor color = new RgbColor(){ Blue = 255};

                        ISimpleLineSymbol outline = new SimpleLineSymbol(){ 
                            Color = color, 
                            Width = 1, 
                            Style = esriSimpleLineStyle.esriSLSSolid
                        };

                        ISimpleFillSymbol sfs = new SimpleFillSymbol(){ 
                            Color = color, 
                            Outline = outline, 
                            Style = esriSimpleFillStyle.esriSFSSolid
                        };
                        
                        ISimpleRenderer sr = new SimpleRenderer(){ Symbol = (ISymbol)sfs };

                        IFeatureLayerDrawingDescription featureLayerDrawingDesc = new FeatureLayerDrawingDescription(){
                            FeatureRenderer = (IFeatureRenderer)sr
                        };

                        IMapServerSourceDescription mapServerSourceDesc = new TableDataSourceDescriptionClass();
                        ((IDataSourceDescription)mapServerSourceDesc).WorkspaceID = "MyFGDB";
                        ((ITableDataSourceDescription)mapServerSourceDesc).TableName = "B";

                        IDynamicLayerDescription dynamicLayerDesc = new LayerDescriptionClass(){
                            ID = 3,
                            Visible = true,
                            DrawingDescription = (ILayerDrawingDescription)featureLayerDrawingDesc,
                            Source = mapServerSourceDesc
                        };

                        mapDesc.HonorLayerReordering = true;
                        mapDesc.LayerDescriptions.Insert(0, (ILayerDescription)dynamicLayerDesc);

                        mapImage = exportMap();
                    }    
                }
                else
                {
                    mapImage = exportMap();
                }
            }
            responseProperties = null; 
  
        	JSONObject json = new JSONObject();
            json.AddString("URL", mapImage.URL);
            return Encoding.UTF8.GetBytes(json.ToJSONString(null));
        }