Ejemplo n.º 1
0
        internal Protection ToProtection()
        {
            Protection p = new Protection();
            if (this.Locked != null) p.Locked = this.Locked.Value;
            if (this.Hidden != null) p.Hidden = this.Hidden.Value;

            return p;
        }
Ejemplo n.º 2
0
        protected override string Protect(string input, Protection protectionType)
        {
            var bytesToEncode = Encoding.Unicode.GetBytes(input);

            #pragma warning disable 612,618
            var output = MachineKey.Encode(bytesToEncode, ConvertProtection(protectionType));
            #pragma warning restore 612,618

            return output;
        }
Ejemplo n.º 3
0
        protected override string Unprotect(string input, Protection protectionType)
        {
            #pragma warning disable 612,618
            var decodedBytes = MachineKey.Decode(input, ConvertProtection(protectionType));
            #pragma warning restore 612,618

            var output = Encoding.Unicode.GetString(decodedBytes);

            return output;
        }
Ejemplo n.º 4
0
 static MachineKeyProtection ConvertProtection(Protection value)
 {
     switch (value)
     {
         case Protection.Validation:
             return MachineKeyProtection.Validation;
         case Protection.Encryption:
             return MachineKeyProtection.Encryption;
         case Protection.All:
             return MachineKeyProtection.All;
         default:
             throw new Exception("Wrong protection enum.");
     }
 }
Ejemplo n.º 5
0
        internal void FromProtection(Protection p)
        {
            this.SetAllNull();

            if (p.Locked != null)
            {
                this.Locked = p.Locked.Value;
            }

            if (p.Hidden != null)
            {
                this.Hidden = p.Hidden.Value;
            }
        }
        public void SaveProtections(Protection[] protections)
        {
            if(protections == null || protections.Length == 0)
            {
                // nothing to save
                return;
            }

            string database = LWCPlugin.Folder + "lwc.db";
            string backup = LWCPlugin.Folder + "lwc.db.bak";

            // ensure a dirty backup does not exist
            if(File.Exists(backup))
            {
                File.Delete(backup);
            }

            // move the old lwc db if it exists
            if(File.Exists(database))
            {
                File.Move(database, backup);
            }

            // now save the protections
            StreamWriter stream = File.CreateText(database);

            foreach(Protection protection in protections)
            {
                string converted = ConvertProtection(protection);

                if(converted == null)
                {
                    continue;
                }

                stream.WriteLine(converted);
                stream.Flush();
            }

            // close the stream
            stream.Close();

            // everything seems ok, let's delete the backup
            if(File.Exists(backup))
            {
                File.Delete(backup);
            }
        }
        /**
         * Convert a protection to the flatfile format
         */
        public string ConvertProtection(Protection protection)
        {
            if(protection == null || !protection.Valid)
            {
                return null;
            }

            string AccessList = "";

            // if it's a private protection, we should save the access list
            if(protection.Type == Protection.PRIVATE_PROTECTION)
            {
                AccessList = protection.AccessToString();
            }

            return string.Format("{0}:{1}:{2}:{3}:{4}:{5}",
                                 protection.ChestId, protection.Owner, protection.Data, protection.Type,
                                 (protection.X + "," + protection.Y), AccessList);
        }
Ejemplo n.º 8
0
		public void Set(UIntPtr start, long length, Protection prot)
		{
			if ((ulong)start < (ulong)Start)
				throw new ArgumentOutOfRangeException("start");

			if ((ulong)start + (ulong)length > (ulong)End)
				throw new ArgumentOutOfRangeException("length");

#if !MONO
			Kernel32.MemoryProtection p;
			switch (prot)
			{
				case Protection.None: p = Kernel32.MemoryProtection.NOACCESS; break;
				case Protection.R: p = Kernel32.MemoryProtection.READONLY; break;
				case Protection.RW: p = Kernel32.MemoryProtection.READWRITE; break;
				case Protection.RX: p = Kernel32.MemoryProtection.EXECUTE_READ; break;
				default: throw new ArgumentOutOfRangeException("prot");
			}
			Kernel32.MemoryProtection old;
			if (!Kernel32.VirtualProtect(start, (UIntPtr)length, p, out old))
				throw new InvalidOperationException("VirtualProtect() returned FALSE!");
#else
			LibC.ProtType p;
			switch (prot)
			{
				case Protection.None: p = 0; break;
				case Protection.R: p = LibC.ProtType.PROT_READ; break;
				case Protection.RW: p = LibC.ProtType.PROT_READ | LibC.ProtType.PROT_WRITE; break;
				case Protection.RX: p = LibC.ProtType.PROT_READ | LibC.ProtType.PROT_EXEC; break;
				default: throw new ArgumentOutOfRangeException("prot");
			}
			ulong end = (ulong)start + (ulong)length;
			ulong newstart = (ulong)start & ~((ulong)Environment.SystemPageSize - 1);
			if (LibC.mprotect((UIntPtr)newstart, (UIntPtr)(end - newstart), p) != 0)
				throw new InvalidOperationException("mprotect() returned -1!");
#endif
		}
Ejemplo n.º 9
0
 public ProtectionTests()
 {
     protection = new Protection {
         Loader = loader
     };
 }
Ejemplo n.º 10
0
 public void Protect(string title, string reason, TimeSpan expiry, Protection edit, Protection move)
 {
     throw new NotImplementedException();
 }
        /**
         * @return array of protections loaded
         */
        public Protection[] LoadProtections()
        {
            string database = LWCPlugin.Folder + "lwc.db";

            if(!File.Exists(database))
            {
                return new Protection[0];
            }

            List<Protection> protections = new List<Protection>();

            // open the file & read it
            using(StreamReader reader = File.OpenText(database))
            {
                string line = "";

                while((line = reader.ReadLine()) != null)
                {
                    string[] split = line.Split(':');

                    // check for consistency
                    if(split.Length != 6)
                    {
                        continue;
                    }

                    Protection protection = new Protection();

                    // ChestId:Owner:Data:Type:x,y:access1,access2,access3.....
                    int ChestId = int.Parse(split[0]);
                    string Owner = split[1];
                    string Data = split[2];
                    int Type = int.Parse(split[3]);
                    string Location = split[4];
                    string Access = split[5];

                    // parse x/y
                    string[] Location2 = Location.Split(',');

                    int X = int.Parse(Location2[0]);
                    int Y = int.Parse(Location2[1]);

                    // parse Access
                    foreach(string Temp in Access.Split(','))
                    {
                        protection.Access.Add(Temp);
                    }

                    // set everything else
                    protection.ChestId = ChestId;
                    protection.Owner = Owner;
                    protection.Data = Data;
                    protection.Type = Type;
                    protection.X = X;
                    protection.Y = Y;
                    protection.Valid = true;

                    // good!
                    LWCPlugin.Get().Cache.Protections.Add(new LocationKey(X, Y), protection);				}
            }

            return protections.ToArray();
        }
Ejemplo n.º 12
0
 public void Protect(string title, string reason, string expiry, Protection edit, Protection move, bool cascade)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 13
0
 public bool SetProtection(uint dwAddress, uint dwSize, Protection flNewProtect)
 {
     return(WriteProtectedMemory(Handle, (IntPtr)dwAddress, dwSize, (uint)flNewProtect, 0));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Creates a new world protection
 /// </summary>
 /// <param name="protection"></param>
 /// <returns></returns>
 public async Task <Response <Protection> > CreateProtectionAsync(Protection protection) => await PostRequestAsync <Protection>($"/world/{protection.Whereami}/protection", payload : protection);
Ejemplo n.º 15
0
 public void Protect(string title, string reason, string expiry, Protection edit, Protection move, bool cascade, bool watch)
 {
     InvokeFunction("Protect", title, reason, expiry, edit, move, cascade, watch);
 }
Ejemplo n.º 16
0
        // Token: 0x060000FE RID: 254 RVA: 0x00015024 File Offset: 0x00013224
        private void metroButton2_Click(object sender, EventArgs e)
        {
            ModuleDef moduleDef      = ModuleDefMD.Load(this.metroTextBox1.Text);
            bool      numberToString = Settings.NumberToString;

            if (numberToString)
            {
                Constants__numbers_.ObfuscateNumbers(moduleDef);
            }
            bool stackUnderflow = Settings.StackUnderflow;

            if (stackUnderflow)
            {
                Stack_Underflow.StackUnderflow(moduleDef);
            }
            bool sizeOf = Settings.SizeOf;

            if (sizeOf)
            {
                SizeOf.Sizeof(moduleDef);
            }
            bool disConstants = Settings.DisConstants;

            if (disConstants)
            {
                Distant_Constants.DisConstants(moduleDef);
            }
            bool refProxy = Settings.RefProxy;

            if (refProxy)
            {
                Method_Wiper.Execute(moduleDef);
            }
            bool constants = Settings.Constants;

            if (constants)
            {
                Constants__numbers_.Inject(moduleDef);
            }
            bool localToFields = Settings.LocalToFields;

            if (localToFields)
            {
                LocalToFields.Protect(moduleDef);
            }
            bool renamer = Settings.Renamer;

            if (renamer)
            {
                Renamer.Execute(moduleDef);
            }
            bool controlFlow = Settings.ControlFlow;

            if (controlFlow)
            {
                Control_Flow.Encrypt(moduleDef);
                Constants__numbers_.Execute(moduleDef);
            }
            bool constant_Mutation = Settings.Constant_Mutation;

            if (constant_Mutation)
            {
                Constant_Mutation.Execute(moduleDef);
            }
            bool antiDe4dot = Settings.AntiDe4dot;

            if (antiDe4dot)
            {
                Anti_De4dot.RemoveDe4dot(moduleDef);
            }
            bool antiILdasm = Settings.AntiILdasm;

            if (antiILdasm)
            {
                Anti_ILDasm.Anti(moduleDef);
            }
            bool koiVMFakeSig = Settings.KoiVMFakeSig;

            if (koiVMFakeSig)
            {
                KoiVM_Fake_Watermark.Execute(moduleDef);
            }
            bool antiDump = Settings.AntiDump;

            if (antiDump)
            {
                AntiDump.Inject(moduleDef);
            }
            bool invalidMetadata = Settings.InvalidMetadata;

            if (invalidMetadata)
            {
                Invalid_Metadata.InvalidMD(moduleDef);
            }
            bool calli = Settings.Calli;

            if (calli)
            {
                Calli.Execute(moduleDef);
            }
            bool antiHTTPDebugger = Settings.AntiHTTPDebugger;

            if (antiHTTPDebugger)
            {
                Anti_Http_Debugger.Execute(moduleDef);
            }
            bool antiFiddler = Settings.AntiFiddler;

            if (antiFiddler)
            {
                Anti_Fiddler.Execute(moduleDef);
            }
            bool stringEncryption = Settings.StringEncryption;

            if (stringEncryption)
            {
                String_Encryption.Inject(moduleDef);
            }
            Watermark.Execute(moduleDef);
            ModuleDef manifestModule = moduleDef.Assembly.ManifestModule;

            moduleDef.EntryPoint.Name = "BlinkRE";
            moduleDef.Mvid            = new Guid?(Guid.NewGuid());
            bool strong = Settings.Strong;

            if (strong)
            {
                Protection.Protect(moduleDef);
                Inject.ProtectValue(moduleDef);
                Inject.DoubleProtect(moduleDef);
                Inject.Triple(moduleDef);
                Inject.Triple(moduleDef);
                Method_Wiper.Execute(moduleDef);
                Assembly.MarkAssembly(moduleDef);
                Locals.Protect(moduleDef);
            }
            Directory.CreateDirectory(".\\AtomicProtected");
            moduleDef.Write(".\\AtomicProtected\\" + Path.GetFileName(this.metroTextBox1.Text), new ModuleWriterOptions(moduleDef)
            {
                PEHeadersOptions =
                {
                    NumberOfRvaAndSizes = new uint?(13U)
                },
                MetaDataOptions =
                {
                    TablesHeapOptions =
                    {
                        ExtraData     = new uint?(4919U)
                    }
                },
                Logger = DummyLogger.NoThrowInstance
            });
            Process.Start(".\\AtomicProtected");
            MessageBox.Show("Obfuscation complete! Restart to obfuscate again");
            Environment.Exit(0);
        }
Ejemplo n.º 17
0
 public RestorationPhase(Protection ParentBase)
     : base(ParentBase)
 {
 }
Ejemplo n.º 18
0
 public SavePhase(Protection parent)
     : base(parent)
 {
 }
Ejemplo n.º 19
0
 static bool ChangeProtection(IntPtr Address, int Range, Protection Protection)
 {
     return(VirtualProtect(Address, Range, Protection, out Protection OriginalProtection));
 }
Ejemplo n.º 20
0
 public MarkPhase(Protection parent)
     : base(parent)
 {
 }
Ejemplo n.º 21
0
 public MathPurifier(Protection ParentBase)
     : base(ParentBase)
 {
 }
Ejemplo n.º 22
0
 // mprotect
 public static bool VirtualProtect(IntPtr lpAddress, uint dwSize, Protection flNewProtect, out uint lpflOldProtect)
 {
     lpflOldProtect = 0;
     return(false);
 }
Ejemplo n.º 23
0
 protected abstract string Protect(string input, Protection protectionOption);
Ejemplo n.º 24
0
 public InitializePhase(Protection parent, string koiDir)
     : base(parent) => this.koiDir = koiDir;// ExpirationChecker.Init(koiDir);
Ejemplo n.º 25
0
 //To use only if we need a simple way to make protections visually disappear simply.
 /*public void updateProtections() {
         for(int i = protections.Count; i >= 0; i--) {
             protections[i].protectionUpdate();
             if(protections[i].isDisabled()) {
                 protections.RemoveAt(i);
             }
         }
     }*/
 /**Add a protection to the player*/
 public void addProtection(Protection p)
 {
     protections.Add(p);
 }
Ejemplo n.º 26
0
 public FinalizePhase(Protection parent)
     : base(parent)
 {
 }
Ejemplo n.º 27
0
 internal static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize,
    Protection flNewProtect, out uint lpflOldProtect);
Ejemplo n.º 28
0
        // Generates content of workbookStylesPart1.
        private void GenerateWorkbookStylesPart1Content(WorkbookStylesPart workbookStylesPart1)
        {
            Stylesheet stylesheet1 = new Stylesheet();

            NumberingFormats numberingFormats1 = new NumberingFormats() { Count = (UInt32Value)3U };
            NumberingFormat numberingFormat1 = new NumberingFormat() { NumberFormatId = (UInt32Value)164U, FormatCode = "_(\"$\"* #,##0.00_);_(\"$\"* \\(#,##0.00\\);_(\"$\"* \"-\"??_);_(@_)" };
            NumberingFormat numberingFormat2 = new NumberingFormat() { NumberFormatId = (UInt32Value)165U, FormatCode = "_(* #,##0.00_);_(* \\(#,##0.00\\);_(* \"-\"??_);_(@_)" };
            NumberingFormat numberingFormat3 = new NumberingFormat() { NumberFormatId = (UInt32Value)166U, FormatCode = "_-* #,##0\\ _€_-;\\-* #,##0\\ _€_-;_-* \"-\"??\\ _€_-;_-@_-" };

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

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

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

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

            Font font2 = new Font();
            FontSize fontSize2 = new FontSize() { Val = 10D };
            FontName fontName2 = new FontName() { Val = "Arial" };

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

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

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

            Font font4 = new Font();
            Bold bold1 = new Bold();
            FontSize fontSize4 = new FontSize() { Val = 10D };
            FontName fontName4 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering3 = new FontFamilyNumbering() { Val = 2 };

            font4.Append(bold1);
            font4.Append(fontSize4);
            font4.Append(fontName4);
            font4.Append(fontFamilyNumbering3);

            Font font5 = new Font();
            Bold bold2 = new Bold();
            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(bold2);
            font5.Append(fontSize5);
            font5.Append(color2);
            font5.Append(fontName5);
            font5.Append(fontFamilyNumbering4);

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

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

            Font font7 = new Font();
            Bold bold3 = new Bold();
            FontSize fontSize7 = new FontSize() { Val = 12D };
            FontName fontName7 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering6 = new FontFamilyNumbering() { Val = 2 };

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

            Font font8 = new Font();
            Bold bold4 = new Bold();
            FontSize fontSize8 = new FontSize() { Val = 9D };
            Color color4 = new Color() { Indexed = (UInt32Value)9U };
            FontName fontName8 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering7 = new FontFamilyNumbering() { Val = 2 };

            font8.Append(bold4);
            font8.Append(fontSize8);
            font8.Append(color4);
            font8.Append(fontName8);
            font8.Append(fontFamilyNumbering7);

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

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

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

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

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

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

            Font font12 = new Font();
            Bold bold6 = new Bold();
            FontSize fontSize12 = new FontSize() { Val = 9D };
            Color color6 = new Color() { Indexed = (UInt32Value)56U };
            FontName fontName12 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering11 = new FontFamilyNumbering() { Val = 2 };

            font12.Append(bold6);
            font12.Append(fontSize12);
            font12.Append(color6);
            font12.Append(fontName12);
            font12.Append(fontFamilyNumbering11);

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

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

            Font font14 = new Font();
            Bold bold8 = new Bold();
            FontSize fontSize14 = new FontSize() { Val = 8D };
            Color color7 = new Color() { Indexed = (UInt32Value)9U };
            FontName fontName14 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering13 = new FontFamilyNumbering() { Val = 2 };

            font14.Append(bold8);
            font14.Append(fontSize14);
            font14.Append(color7);
            font14.Append(fontName14);
            font14.Append(fontFamilyNumbering13);

            Font font15 = new Font();
            Bold bold9 = new Bold();
            FontSize fontSize15 = new FontSize() { Val = 10D };
            Color color8 = new Color() { Indexed = (UInt32Value)10U };
            FontName fontName15 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering14 = new FontFamilyNumbering() { Val = 2 };

            font15.Append(bold9);
            font15.Append(fontSize15);
            font15.Append(color8);
            font15.Append(fontName15);
            font15.Append(fontFamilyNumbering14);

            Font font16 = new Font();
            FontSize fontSize16 = new FontSize() { Val = 8D };
            FontName fontName16 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering15 = new FontFamilyNumbering() { Val = 2 };

            font16.Append(fontSize16);
            font16.Append(fontName16);
            font16.Append(fontFamilyNumbering15);

            Font font17 = new Font();
            Bold bold10 = new Bold();
            FontSize fontSize17 = new FontSize() { Val = 15D };
            FontName fontName17 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering16 = new FontFamilyNumbering() { Val = 2 };

            font17.Append(bold10);
            font17.Append(fontSize17);
            font17.Append(fontName17);
            font17.Append(fontFamilyNumbering16);

            Font font18 = new Font();
            Bold bold11 = new Bold();
            FontSize fontSize18 = new FontSize() { Val = 9D };
            Color color9 = new Color() { Indexed = (UInt32Value)12U };
            FontName fontName18 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering17 = new FontFamilyNumbering() { Val = 2 };

            font18.Append(bold11);
            font18.Append(fontSize18);
            font18.Append(color9);
            font18.Append(fontName18);
            font18.Append(fontFamilyNumbering17);

            Font font19 = new Font();
            Underline underline2 = new Underline();
            FontSize fontSize19 = new FontSize() { Val = 12D };
            Color color10 = new Color() { Indexed = (UInt32Value)12U };
            FontName fontName19 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering18 = new FontFamilyNumbering() { Val = 2 };

            font19.Append(underline2);
            font19.Append(fontSize19);
            font19.Append(color10);
            font19.Append(fontName19);
            font19.Append(fontFamilyNumbering18);

            Font font20 = new Font();
            Bold bold12 = new Bold();
            FontSize fontSize20 = new FontSize() { Val = 11D };
            FontName fontName20 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering19 = new FontFamilyNumbering() { Val = 2 };

            font20.Append(bold12);
            font20.Append(fontSize20);
            font20.Append(fontName20);
            font20.Append(fontFamilyNumbering19);

            Font font21 = new Font();
            FontSize fontSize21 = new FontSize() { Val = 12D };
            FontName fontName21 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering20 = new FontFamilyNumbering() { Val = 2 };

            font21.Append(fontSize21);
            font21.Append(fontName21);
            font21.Append(fontFamilyNumbering20);

            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);
            fonts1.Append(font15);
            fonts1.Append(font16);
            fonts1.Append(font17);
            fonts1.Append(font18);
            fonts1.Append(font19);
            fonts1.Append(font20);
            fonts1.Append(font21);

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

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

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

            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)63U };
            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.Solid };
            ForegroundColor foregroundColor7 = new ForegroundColor() { Indexed = (UInt32Value)43U };
            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() { Indexed = (UInt32Value)45U };
            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() { Indexed = (UInt32Value)42U };
            BackgroundColor backgroundColor9 = new BackgroundColor() { Indexed = (UInt32Value)64U };

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

            fill11.Append(patternFill11);

            Fill fill12 = new Fill();

            PatternFill patternFill12 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor10 = new ForegroundColor() { Indexed = (UInt32Value)47U };
            BackgroundColor backgroundColor10 = new BackgroundColor() { Indexed = (UInt32Value)64U };

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

            fill12.Append(patternFill12);

            Fill fill13 = new Fill();

            PatternFill patternFill13 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor11 = new ForegroundColor() { Indexed = (UInt32Value)22U };
            BackgroundColor backgroundColor11 = new BackgroundColor() { Indexed = (UInt32Value)64U };

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

            fill13.Append(patternFill13);

            Fill fill14 = new Fill();

            PatternFill patternFill14 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor12 = new ForegroundColor() { Indexed = (UInt32Value)23U };
            BackgroundColor backgroundColor12 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill14.Append(foregroundColor12);
            patternFill14.Append(backgroundColor12);

            fill14.Append(patternFill14);

            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);
            fills1.Append(fill14);

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

            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 color11 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder2.Append(color11);

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

            rightBorder2.Append(color12);

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

            topBorder2.Append(color13);
            BottomBorder bottomBorder2 = new BottomBorder();
            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() { Style = BorderStyleValues.Thin };
            Color color14 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder3.Append(color14);

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

            rightBorder3.Append(color15);

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

            topBorder3.Append(color16);

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

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

            leftBorder4.Append(color18);

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

            rightBorder4.Append(color19);
            TopBorder topBorder4 = new TopBorder();

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

            bottomBorder4.Append(color20);
            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 color21 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder5.Append(color21);

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

            rightBorder5.Append(color22);
            TopBorder topBorder5 = new TopBorder();
            BottomBorder bottomBorder5 = new BottomBorder();
            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();

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

            rightBorder6.Append(color23);
            TopBorder topBorder6 = new TopBorder();

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

            bottomBorder6.Append(color24);
            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.Medium };
            Color color25 = new Color() { Indexed = (UInt32Value)64U };

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

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

            topBorder7.Append(color26);

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

            bottomBorder7.Append(color27);
            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();

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

            topBorder8.Append(color28);

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

            bottomBorder8.Append(color29);
            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();

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

            rightBorder9.Append(color30);

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

            topBorder9.Append(color31);

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

            bottomBorder9.Append(color32);
            DiagonalBorder diagonalBorder9 = new DiagonalBorder();

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

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

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

            CellFormat cellFormat3 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)5U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, ApplyNumberFormat = false, ApplyFill = false, ApplyBorder = false, ApplyAlignment = false, ApplyProtection = false };
            Alignment alignment1 = new Alignment() { Vertical = VerticalAlignmentValues.Top };
            Protection protection1 = new Protection() { Locked = false };

            cellFormat3.Append(alignment1);
            cellFormat3.Append(protection1);
            CellFormat cellFormat4 = new CellFormat() { NumberFormatId = (UInt32Value)165U, FontId = (UInt32Value)2U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, ApplyFont = false, ApplyFill = false, ApplyBorder = false, ApplyAlignment = false, ApplyProtection = false };
            CellFormat cellFormat5 = new CellFormat() { NumberFormatId = (UInt32Value)164U, FontId = (UInt32Value)2U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, ApplyFont = false, ApplyFill = false, ApplyBorder = false, ApplyAlignment = false, ApplyProtection = false };

            cellStyleFormats1.Append(cellFormat1);
            cellStyleFormats1.Append(cellFormat2);
            cellStyleFormats1.Append(cellFormat3);
            cellStyleFormats1.Append(cellFormat4);
            cellStyleFormats1.Append(cellFormat5);

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

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

            cellFormat7.Append(alignment2);
            CellFormat cellFormat8 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true };

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

            cellFormat9.Append(alignment3);

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

            cellFormat10.Append(alignment4);

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

            cellFormat11.Append(alignment5);

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

            cellFormat12.Append(alignment6);

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

            cellFormat13.Append(alignment7);
            CellFormat cellFormat14 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)8U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true };
            CellFormat cellFormat15 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)9U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };

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

            cellFormat16.Append(alignment8);
            CellFormat cellFormat17 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };

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

            cellFormat18.Append(alignment9);

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

            cellFormat19.Append(alignment10);

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

            cellFormat20.Append(alignment11);
            CellFormat cellFormat21 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)10U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true };

            CellFormat cellFormat22 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)10U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true };
            Alignment alignment12 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat22.Append(alignment12);
            CellFormat cellFormat23 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)8U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true };
            CellFormat cellFormat24 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)8U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };
            CellFormat cellFormat25 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)10U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true };

            CellFormat cellFormat26 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)10U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyAlignment = true };
            Alignment alignment13 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat26.Append(alignment13);

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

            cellFormat27.Append(alignment14);
            CellFormat cellFormat28 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)10U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true };

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

            cellFormat29.Append(alignment15);

            CellFormat cellFormat30 = new CellFormat() { NumberFormatId = (UInt32Value)166U, FontId = (UInt32Value)3U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)3U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment16 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat30.Append(alignment16);

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

            cellFormat31.Append(alignment17);

            CellFormat cellFormat32 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)13U, FillId = (UInt32Value)7U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment18 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat32.Append(alignment18);

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

            cellFormat33.Append(alignment19);
            CellFormat cellFormat34 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)10U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };
            CellFormat cellFormat35 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)12U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };
            CellFormat cellFormat36 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)12U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true };
            CellFormat cellFormat37 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)13U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };

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

            cellFormat38.Append(alignment20);

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

            cellFormat39.Append(alignment21);
            CellFormat cellFormat40 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };

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

            cellFormat41.Append(alignment22);
            CellFormat cellFormat42 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)15U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)6U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };
            CellFormat cellFormat43 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)15U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)7U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };

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

            cellFormat44.Append(alignment23);
            CellFormat cellFormat45 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)15U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)8U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };
            CellFormat cellFormat46 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)15U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };

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

            cellFormat47.Append(alignment24);
            CellFormat cellFormat48 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)9U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true };

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

            cellFormat49.Append(alignment25);

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

            cellFormat50.Append(alignment26);
            CellFormat cellFormat51 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)18U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)2U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            CellFormat cellFormat52 = new CellFormat() { NumberFormatId = (UInt32Value)49U, FontId = (UInt32Value)10U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            CellFormat cellFormat53 = new CellFormat() { NumberFormatId = (UInt32Value)1U, FontId = (UInt32Value)6U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true };

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

            cellFormat54.Append(alignment27);
            CellFormat cellFormat55 = new CellFormat() { NumberFormatId = (UInt32Value)1U, FontId = (UInt32Value)9U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true };

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

            cellFormat56.Append(alignment28);
            CellFormat cellFormat57 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)9U, FillId = (UInt32Value)7U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)1U, ApplyFont = true, ApplyFill = true, ApplyBorder = true };

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

            cellFormat58.Append(alignment29);

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

            cellFormat59.Append(alignment30);

            CellFormat cellFormat60 = new CellFormat() { NumberFormatId = (UInt32Value)49U, FontId = (UInt32Value)6U, FillId = (UInt32Value)8U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)1U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment31 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };

            cellFormat60.Append(alignment31);

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

            cellFormat61.Append(alignment32);

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

            cellFormat62.Append(alignment33);

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

            cellFormat63.Append(alignment34);

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

            cellFormat64.Append(alignment35);

            CellFormat cellFormat65 = new CellFormat() { NumberFormatId = (UInt32Value)16U, FontId = (UInt32Value)9U, FillId = (UInt32Value)12U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)1U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment36 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };

            cellFormat65.Append(alignment36);
            CellFormat cellFormat66 = new CellFormat() { NumberFormatId = (UInt32Value)17U, FontId = (UInt32Value)3U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)1U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true };

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

            cellFormat67.Append(alignment37);

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

            cellFormat68.Append(alignment38);

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

            cellFormat69.Append(alignment39);

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

            cellFormat70.Append(alignment40);

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

            cellFormat71.Append(alignment41);

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

            cellFormat72.Append(alignment42);

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

            cellFormat73.Append(alignment43);

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

            cellFormat74.Append(alignment44);

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

            cellFormat75.Append(alignment45);

            CellFormat cellFormat76 = new CellFormat() { NumberFormatId = (UInt32Value)2U, FontId = (UInt32Value)4U, FillId = (UInt32Value)7U, BorderId = (UInt32Value)5U, FormatId = (UInt32Value)4U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true };
            Alignment alignment46 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };

            cellFormat76.Append(alignment46);

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

            CellStyles cellStyles1 = new CellStyles() { Count = (UInt32Value)5U };
            CellStyle cellStyle1 = new CellStyle() { Name = "Hipervínculo", FormatId = (UInt32Value)2U, BuiltinId = (UInt32Value)8U };
            CellStyle cellStyle2 = new CellStyle() { Name = "Millares 2", FormatId = (UInt32Value)3U };
            CellStyle cellStyle3 = new CellStyle() { Name = "Moneda 2", FormatId = (UInt32Value)4U };
            CellStyle cellStyle4 = new CellStyle() { Name = "Normal", FormatId = (UInt32Value)0U, BuiltinId = (UInt32Value)0U };
            CellStyle cellStyle5 = new CellStyle() { Name = "Normal 2", FormatId = (UInt32Value)1U };

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

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

            workbookStylesPart1.Stylesheet = stylesheet1;
        }
Ejemplo n.º 29
0
 public void Protect(string title, string reason, string expiry, Protection edit, Protection move)
 {
     Protect(title, reason, expiry, edit, move, false, false);
 }
Ejemplo n.º 30
0
 private static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress, uint dwSize, Protection flNewProtect,
                                         out Protection lpflOldProtect);
Ejemplo n.º 31
0
 public static extern Error uc_mem_map(IntPtr uc, ulong address, UIntPtr size, Protection perms);
Ejemplo n.º 32
0
 public CreditDefaultSwap(Protection.Side side, double notional, double spread, Schedule schedule, BusinessDayConvention paymentConvention, DayCounter dayCounter, bool settlesAccrual, bool paysAtDefaultTime) : this(NQuantLibcPINVOKE.new_CreditDefaultSwap__SWIG_0((int)side, notional, spread, Schedule.getCPtr(schedule), (int)paymentConvention, DayCounter.getCPtr(dayCounter), settlesAccrual, paysAtDefaultTime), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
        private void CreateStylesheet(WorkbookPart workbookPart)
        {
            var workbookStylesPart = workbookPart.AddNewPart <WorkbookStylesPart>("rId101");

            var stylesheet = new Stylesheet {
                MCAttributes = new MarkupCompatibilityAttributes {
                    Ignorable = "x14ac"
                }
            };

            stylesheet.AddNamespaceDeclaration("mc", MC_SCHEMA);
            stylesheet.AddNamespaceDeclaration("x14ac", X14_AC_SCHEMA);

            var numberingFormats = new NumberingFormats(new NumberingFormat
            {
                NumberFormatId = 44U,
                FormatCode     = FORMAT_CODE
            })
            {
                Count = 1U
            };

            var fonts = new Fonts {
                Count = 3U, KnownFonts = true
            };

            var font1 = new Font(new FontSize {
                Val = 11D
            }, new Color {
                Theme = 1U
            }, new FontName {
                Val = "Calibri"
            },
                                 new FontFamilyNumbering {
                Val = 2
            }, new FontScheme {
                Val = FontSchemeValues.Minor
            });

            var font2 = new Font(new FontSize {
                Val = 11D
            }, new Color {
                Theme = 1U
            }, new FontName {
                Val = "Calibri"
            },
                                 new FontFamilyNumbering {
                Val = 2
            }, new FontScheme {
                Val = FontSchemeValues.Minor
            });

            var font3 = new Font(new Bold(), new FontSize {
                Val = 11D
            }, new Color {
                Theme = 0U
            },
                                 new FontName {
                Val = "Calibri"
            }, new FontFamilyNumbering {
                Val = 2
            },
                                 new FontScheme {
                Val = FontSchemeValues.Minor
            });

            fonts.Append(font1, font2, font3);

            var fills = new Fills {
                Count = 3U
            };

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

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

            var fill3 = new Fill(new PatternFill(
                                     new ForegroundColor {
                Rgb = "FF0070C0"
            },
                                     new BackgroundColor {
                Indexed = 64U
            })
            {
                PatternType = PatternValues.Solid
            });

            fills.Append(fill1, fill2, fill3);

            var borders = new Borders(new Border(), new LeftBorder(), new RightBorder(), new TopBorder(),
                                      new BottomBorder(), new DiagonalBorder())
            {
                Count = 1U
            };

            var cellStyleFormats = new CellStyleFormats {
                Count = 2U
            };
            var cellFormat1 = new CellFormat {
                NumberFormatId = 0U, FontId = 0U, FillId = 0U, BorderId = 0U
            };
            var cellFormat2 = new CellFormat
            {
                NumberFormatId  = 44U,
                FontId          = 1U,
                FillId          = 0U,
                BorderId        = 0U,
                ApplyFont       = false,
                ApplyFill       = false,
                ApplyBorder     = false,
                ApplyAlignment  = false,
                ApplyProtection = false
            };

            cellStyleFormats.Append(cellFormat1, cellFormat2);

            var cellFormats = new CellFormats {
                Count = 6U
            };
            var cellFormat3 = new CellFormat
            {
                NumberFormatId = 0U,
                FontId         = 0U,
                FillId         = 0U,
                BorderId       = 0U,
                FormatId       = 0U
            };

            var cellFormat4 = new CellFormat
            {
                NumberFormatId  = 0U,
                FontId          = 0U,
                FillId          = 0U,
                BorderId        = 0U,
                FormatId        = 0U,
                ApplyProtection = true
            };

            var protection1 = new Protection {
                Locked = false
            };

            cellFormat4.AppendChild(protection1);

            var cellFormat5 = new CellFormat
            {
                NumberFormatId  = 44U,
                FontId          = 0U,
                FillId          = 0U,
                BorderId        = 0U,
                FormatId        = 1U,
                ApplyFont       = true,
                ApplyProtection = true
            };

            var protection2 = new Protection {
                Locked = false
            };

            cellFormat5.AppendChild(protection2);

            var cellFormat6 = new CellFormat
            {
                NumberFormatId    = 14U,
                FontId            = 0U,
                FillId            = 0U,
                BorderId          = 0U,
                FormatId          = 0U,
                ApplyNumberFormat = true,
                ApplyProtection   = true
            };

            var protection3 = new Protection {
                Locked = false
            };

            cellFormat6.AppendChild(protection3);
            var cellFormat7 = new CellFormat
            {
                NumberFormatId  = 0U,
                FontId          = 2U,
                FillId          = 2U,
                BorderId        = 0U,
                FormatId        = 0U,
                ApplyFont       = true,
                ApplyFill       = true,
                ApplyProtection = true
            };

            var cellFormat8 = new CellFormat
            {
                NumberFormatId  = 0U,
                FontId          = 0U,
                FillId          = 0U,
                BorderId        = 0U,
                FormatId        = 0U,
                ApplyProtection = true
            };

            cellFormats.Append(cellFormat3, cellFormat4, cellFormat5, cellFormat6, cellFormat7, cellFormat8);

            var cellStyles = new CellStyles {
                Count = 2U
            };
            var cellStyle1 = new CellStyle {
                Name = "Currency", FormatId = 1U, BuiltinId = 4U
            };
            var cellStyle2 = new CellStyle {
                Name = "Normal", FormatId = 0U, BuiltinId = 0U
            };

            cellStyles.Append(cellStyle1, cellStyle2);

            var differentialFormats = new DifferentialFormats {
                Count = 0U
            };

            var tableStyles = new TableStyles
            {
                Count             = 0U,
                DefaultTableStyle = "TableStyleMedium2",
                DefaultPivotStyle = "PivotStyleLight16"
            };

            var stylesheetExtensionList = new StylesheetExtensionList();

            var stylesheetExtension = new StylesheetExtension {
                Uri = "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}"
            };

            stylesheetExtension.AddNamespaceDeclaration("x14",
                                                        X14_SCHEMA);

            var slicerStyles = new X14.SlicerStyles {
                DefaultSlicerStyle = "SlicerStyleLight1"
            };

            stylesheetExtension.AppendChild(slicerStyles);

            stylesheetExtensionList.AppendChild(stylesheetExtension);

            stylesheet.Append(numberingFormats, fonts, fills, borders, cellStyleFormats, cellFormats, cellStyles,
                              differentialFormats, tableStyles, stylesheetExtensionList);

            workbookStylesPart.Stylesheet = stylesheet;
        }
Ejemplo n.º 34
0
 public void Protect(string title, string reason, TimeSpan expiry, Protection edit, Protection move)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 35
0
        private UInt32Value SetCellStyle(System.Drawing.Color fillColor, bool locked)
        {
            Fill fill = new Fill();
            PatternFill patternFill = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor1 = new ForegroundColor() { Rgb = System.Drawing.Color.FromArgb(fillColor.A, fillColor.R, fillColor.G, fillColor.B).Name };
            BackgroundColor backgroundColor1 = new BackgroundColor() { Indexed = (UInt32Value)64U };

            patternFill.Append(foregroundColor1);
            patternFill.Append(backgroundColor1);
            fill.Append(patternFill);
            ExcelStyleSheet.Fills.Count++;
            ExcelStyleSheet.Fills.Append(fill);

            CellFormat myCellFormat =
              new CellFormat
              {
                  FontId = (UInt32Value)0U,
                  FillId = (UInt32Value)ExcelStyleSheet.Fills.Count - 1,
                  ApplyFill = true,
                  NumberFormatId = (UInt32Value)0U,
                  FormatId = (UInt32Value)0U,
                  BorderId = (UInt32Value)1U,
                  ApplyBorder = true,
                  ApplyProtection = true
              };

            Alignment alignment = new Alignment() { WrapText = true };
            myCellFormat.Append(alignment);

            if (!locked)
            {
                Protection protection = new Protection() { Locked = false };
                myCellFormat.Append(protection);
            }

            ExcelStyleSheet.CellFormats.Count++;
            ExcelStyleSheet.CellFormats.Append(myCellFormat);
            return (UInt32Value)ExcelStyleSheet.CellFormats.Count - 1;
        }
Ejemplo n.º 36
0
        /// <summary>
        /// set r/w/x protection on a portion of memory.  rounded to encompassing pages
        /// </summary>
        public void Protect(ulong start, ulong length, Protection prot)
        {
            if (length == 0)
                return;
            int pstart = GetPage(start);
            int pend = GetPage(start + length - 1);

            var p = GetKernelMemoryProtectionValue(prot);
            for (int i = pstart; i <= pend; i++)
                _pageData[i] = prot; // also store the value for later use

            if (Active) // it's legal to Protect() if we're not active; the information is just saved for the next activation
            {
                // TODO: if using another OS's memory protection calls, they must give the same non-aligned behavior
                // as VirtualProtect, or this must be changed
                Kernel32.MemoryProtection old;
                if (!Kernel32.VirtualProtect(Z.UU(start), Z.UU(length), p, out old))
                    throw new InvalidOperationException("VirtualProtect() returned FALSE!");
            }
        }
Ejemplo n.º 37
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Protection obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Ejemplo n.º 38
0
 public override string ToString()
 {
     return
         (this == XLStyle.Default.Key ? "Default" :
          string.Format("Alignment: {0} Border: {1} Fill: {2} Font: {3} IncludeQuotePrefix: {4} NumberFormat: {5} Protection: {6} Name: {7}",
                        Alignment == XLStyle.Default.Key.Alignment ? "Default" : Alignment.ToString(),
                        Border == XLStyle.Default.Key.Border ? "Default" : Border.ToString(),
                        Fill == XLStyle.Default.Key.Fill ? "Default" : Fill.ToString(),
                        Font == XLStyle.Default.Key.Font ? "Default" : Font.ToString(),
                        IncludeQuotePrefix == XLStyle.Default.Key.IncludeQuotePrefix ? "Default" : IncludeQuotePrefix.ToString(),
                        NumberFormat == XLStyle.Default.Key.NumberFormat ? "Default" : NumberFormat.ToString(),
                        Protection == XLStyle.Default.Key.Protection ? "Default" : Protection.ToString(),
                        Name ?? string.Empty));
 }
        // 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)164U, FormatCode = "_-* #,##0\\ _p_t_a_-;\\-* #,##0\\ _p_t_a_-;_-* \"-\"??\\ _p_t_a_-;_-@_-" };
            NumberingFormat numberingFormat2 = new NumberingFormat() { NumberFormatId = (UInt32Value)165U, FormatCode = "_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"??_);_(@_)" };

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

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

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

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

            Font font2 = new Font();
            FontSize fontSize2 = new FontSize() { Val = 10D };
            FontName fontName2 = new FontName() { Val = "Times New Roman" };

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

            Font font3 = new Font();
            Bold bold1 = new Bold();
            FontSize fontSize3 = new FontSize() { Val = 8D };
            FontName fontName3 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering2 = new FontFamilyNumbering() { Val = 2 };

            font3.Append(bold1);
            font3.Append(fontSize3);
            font3.Append(fontName3);
            font3.Append(fontFamilyNumbering2);

            Font font4 = new Font();
            FontSize fontSize4 = new FontSize() { Val = 8D };
            FontName fontName4 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering3 = new FontFamilyNumbering() { Val = 2 };

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

            Font font5 = new Font();
            FontSize fontSize5 = new FontSize() { Val = 10D };
            FontName fontName5 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering4 = new FontFamilyNumbering() { Val = 2 };

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

            Font font6 = new Font();
            Bold bold2 = new Bold();
            FontSize fontSize6 = new FontSize() { Val = 9D };
            Color color2 = new Color() { Indexed = (UInt32Value)9U };
            FontName fontName6 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering5 = new FontFamilyNumbering() { Val = 2 };

            font6.Append(bold2);
            font6.Append(fontSize6);
            font6.Append(color2);
            font6.Append(fontName6);
            font6.Append(fontFamilyNumbering5);

            Font font7 = new Font();
            FontSize fontSize7 = new FontSize() { Val = 9D };
            FontName fontName7 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering6 = new FontFamilyNumbering() { Val = 2 };

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

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

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

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

            font9.Append(bold4);
            font9.Append(fontSize9);
            font9.Append(color3);
            font9.Append(fontName9);
            font9.Append(fontFamilyNumbering8);

            Font font10 = new Font();
            Underline underline1 = new Underline();
            FontSize fontSize10 = new FontSize() { Val = 9D };
            Color color4 = new Color() { Indexed = (UInt32Value)12U };
            FontName fontName10 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering9 = new FontFamilyNumbering() { Val = 2 };

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

            Font font11 = new Font();
            Bold bold5 = new Bold();
            FontSize fontSize11 = new FontSize() { Val = 9D };
            Color color5 = new Color() { Indexed = (UInt32Value)12U };
            FontName fontName11 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering10 = new FontFamilyNumbering() { Val = 2 };

            font11.Append(bold5);
            font11.Append(fontSize11);
            font11.Append(color5);
            font11.Append(fontName11);
            font11.Append(fontFamilyNumbering10);

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

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

            Font font13 = new Font();
            FontSize fontSize13 = new FontSize() { Val = 10D };
            Color color6 = new Color() { Indexed = (UInt32Value)8U };
            FontName fontName13 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering12 = new FontFamilyNumbering() { Val = 2 };

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

            Font font14 = new Font();
            Bold bold6 = new Bold();
            FontSize fontSize14 = new FontSize() { Val = 10D };
            FontName fontName14 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering13 = new FontFamilyNumbering() { Val = 2 };

            font14.Append(bold6);
            font14.Append(fontSize14);
            font14.Append(fontName14);
            font14.Append(fontFamilyNumbering13);

            Font font15 = new Font();
            Bold bold7 = new Bold();
            FontSize fontSize15 = new FontSize() { Val = 10D };
            Color color7 = new Color() { Indexed = (UInt32Value)9U };
            FontName fontName15 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering14 = new FontFamilyNumbering() { Val = 2 };

            font15.Append(bold7);
            font15.Append(fontSize15);
            font15.Append(color7);
            font15.Append(fontName15);
            font15.Append(fontFamilyNumbering14);

            Font font16 = new Font();
            Bold bold8 = new Bold();
            FontSize fontSize16 = new FontSize() { Val = 8D };
            Color color8 = new Color() { Indexed = (UInt32Value)9U };
            FontName fontName16 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering15 = new FontFamilyNumbering() { Val = 2 };

            font16.Append(bold8);
            font16.Append(fontSize16);
            font16.Append(color8);
            font16.Append(fontName16);
            font16.Append(fontFamilyNumbering15);

            Font font17 = new Font();
            Bold bold9 = new Bold();
            FontSize fontSize17 = new FontSize() { Val = 15D };
            FontName fontName17 = new FontName() { Val = "Arial" };
            FontFamilyNumbering fontFamilyNumbering16 = new FontFamilyNumbering() { Val = 2 };

            font17.Append(bold9);
            font17.Append(fontSize17);
            font17.Append(fontName17);
            font17.Append(fontFamilyNumbering16);

            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);
            fonts1.Append(font15);
            fonts1.Append(font16);
            fonts1.Append(font17);

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

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

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

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

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

            fill5.Append(patternFill5);

            Fill fill6 = new Fill();

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

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

            fill6.Append(patternFill6);

            Fill fill7 = new Fill();

            PatternFill patternFill7 = new PatternFill() { PatternType = PatternValues.Solid };
            ForegroundColor foregroundColor5 = new ForegroundColor() { Theme = (UInt32Value)0U };
            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() { Theme = (UInt32Value)0U };
            BackgroundColor backgroundColor6 = new BackgroundColor() { Rgb = "FFFFFFCC" };

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

            fill8.Append(patternFill8);

            fills1.Append(fill1);
            fills1.Append(fill2);
            fills1.Append(fill3);
            fills1.Append(fill4);
            fills1.Append(fill5);
            fills1.Append(fill6);
            fills1.Append(fill7);
            fills1.Append(fill8);

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

            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 color9 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder2.Append(color9);

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

            rightBorder2.Append(color10);

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

            topBorder2.Append(color11);

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

            bottomBorder2.Append(color12);
            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.Medium };
            Color color13 = new Color() { Indexed = (UInt32Value)64U };

            topBorder3.Append(color13);

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

            bottomBorder3.Append(color14);
            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 color15 = new Color() { Indexed = (UInt32Value)64U };

            rightBorder4.Append(color15);

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

            topBorder4.Append(color16);

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

            bottomBorder4.Append(color17);
            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 color18 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder5.Append(color18);
            RightBorder rightBorder5 = new RightBorder();

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

            topBorder5.Append(color19);
            BottomBorder bottomBorder5 = new BottomBorder();
            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 color20 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder6.Append(color20);
            RightBorder rightBorder6 = new RightBorder();
            TopBorder topBorder6 = new TopBorder();
            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();

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

            rightBorder7.Append(color21);
            TopBorder topBorder7 = new TopBorder();
            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() { Style = BorderStyleValues.Thin };
            Color color22 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder8.Append(color22);
            RightBorder rightBorder8 = new RightBorder();

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

            topBorder8.Append(color23);

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

            bottomBorder8.Append(color24);
            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 color25 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder9.Append(color25);
            RightBorder rightBorder9 = new RightBorder();
            TopBorder topBorder9 = new TopBorder();

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

            bottomBorder9.Append(color26);
            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();
            RightBorder rightBorder10 = new RightBorder();
            TopBorder topBorder10 = new TopBorder();

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

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

            leftBorder11.Append(color28);

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

            rightBorder11.Append(color29);

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

            topBorder11.Append(color30);
            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 color31 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder12.Append(color31);

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

            rightBorder12.Append(color32);
            TopBorder topBorder12 = new TopBorder();

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

            bottomBorder12.Append(color33);
            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();

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

            rightBorder13.Append(color34);
            TopBorder topBorder13 = new TopBorder();

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

            bottomBorder13.Append(color35);
            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 color36 = new Color() { Indexed = (UInt32Value)64U };

            leftBorder14.Append(color36);
            RightBorder rightBorder14 = new RightBorder();

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

            topBorder14.Append(color37);

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

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

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

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

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

            cellStyleFormats1.Append(cellFormat1);
            cellStyleFormats1.Append(cellFormat2);

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

            CellFormat cellFormat4 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection1 = new Protection() { Locked = false };

            cellFormat4.Append(protection1);

            CellFormat cellFormat5 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection2 = new Protection() { Locked = false };

            cellFormat5.Append(protection2);

            CellFormat cellFormat6 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection3 = new Protection() { Locked = false };

            cellFormat6.Append(protection3);

            CellFormat cellFormat7 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)6U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection4 = new Protection() { Locked = false };

            cellFormat7.Append(protection4);

            CellFormat cellFormat8 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)5U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment1 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };
            Protection protection5 = new Protection() { Locked = false };

            cellFormat8.Append(alignment1);
            cellFormat8.Append(protection5);

            CellFormat cellFormat9 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection6 = new Protection() { Locked = false };

            cellFormat9.Append(protection6);

            CellFormat cellFormat10 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)6U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection7 = new Protection() { Locked = false };

            cellFormat10.Append(protection7);

            CellFormat cellFormat11 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)5U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)4U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment2 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection8 = new Protection() { Locked = false };

            cellFormat11.Append(alignment2);
            cellFormat11.Append(protection8);

            CellFormat cellFormat12 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)5U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)10U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment3 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection9 = new Protection() { Locked = false };

            cellFormat12.Append(alignment3);
            cellFormat12.Append(protection9);

            CellFormat cellFormat13 = new CellFormat() { NumberFormatId = (UInt32Value)16U, FontId = (UInt32Value)5U, FillId = (UInt32Value)3U, BorderId = (UInt32Value)11U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment4 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection10 = new Protection() { Locked = false };

            cellFormat13.Append(alignment4);
            cellFormat13.Append(protection10);

            CellFormat cellFormat14 = new CellFormat() { NumberFormatId = (UInt32Value)20U, FontId = (UInt32Value)4U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)11U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment5 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection11 = new Protection() { Locked = false };

            cellFormat14.Append(alignment5);
            cellFormat14.Append(protection11);

            CellFormat cellFormat15 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment6 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection12 = new Protection() { Locked = false };

            cellFormat15.Append(alignment6);
            cellFormat15.Append(protection12);

            CellFormat cellFormat16 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)14U, FillId = (UInt32Value)4U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment7 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection13 = new Protection() { Locked = false };

            cellFormat16.Append(alignment7);
            cellFormat16.Append(protection13);

            CellFormat cellFormat17 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)5U, FillId = (UInt32Value)4U, BorderId = (UInt32Value)1U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment8 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection14 = new Protection() { Locked = false };

            cellFormat17.Append(alignment8);
            cellFormat17.Append(protection14);

            CellFormat cellFormat18 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)13U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)6U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment9 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection15 = new Protection() { Locked = false };

            cellFormat18.Append(alignment9);
            cellFormat18.Append(protection15);

            CellFormat cellFormat19 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)8U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection16 = new Protection() { Locked = false };

            cellFormat19.Append(protection16);

            CellFormat cellFormat20 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection17 = new Protection() { Locked = false };

            cellFormat20.Append(protection17);

            CellFormat cellFormat21 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)0U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection18 = new Protection() { Locked = false };

            cellFormat21.Append(protection18);

            CellFormat cellFormat22 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection19 = new Protection() { Locked = false };

            cellFormat22.Append(protection19);

            CellFormat cellFormat23 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)6U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection20 = new Protection() { Locked = false };

            cellFormat23.Append(protection20);

            CellFormat cellFormat24 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection21 = new Protection() { Locked = false };

            cellFormat24.Append(protection21);

            CellFormat cellFormat25 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)13U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)13U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment10 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };
            Protection protection22 = new Protection() { Locked = false };

            cellFormat25.Append(alignment10);
            cellFormat25.Append(protection22);

            CellFormat cellFormat26 = new CellFormat() { NumberFormatId = (UInt32Value)164U, FontId = (UInt32Value)13U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment11 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };
            Protection protection23 = new Protection() { Locked = false };

            cellFormat26.Append(alignment11);
            cellFormat26.Append(protection23);

            CellFormat cellFormat27 = new CellFormat() { NumberFormatId = (UInt32Value)165U, FontId = (UInt32Value)13U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)3U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection24 = new Protection() { Locked = false };

            cellFormat27.Append(protection24);

            CellFormat cellFormat28 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)4U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment12 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center };
            Protection protection25 = new Protection() { Locked = false };

            cellFormat28.Append(alignment12);
            cellFormat28.Append(protection25);

            CellFormat cellFormat29 = new CellFormat() { NumberFormatId = (UInt32Value)9U, FontId = (UInt32Value)13U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)13U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment13 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };
            Protection protection26 = new Protection() { Locked = false };

            cellFormat29.Append(alignment13);
            cellFormat29.Append(protection26);

            CellFormat cellFormat30 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)9U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection27 = new Protection() { Locked = false };

            cellFormat30.Append(protection27);

            CellFormat cellFormat31 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)12U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection28 = new Protection() { Locked = false };

            cellFormat31.Append(protection28);

            CellFormat cellFormat32 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)5U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment14 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };
            Protection protection29 = new Protection() { Locked = false };

            cellFormat32.Append(alignment14);
            cellFormat32.Append(protection29);

            CellFormat cellFormat33 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)6U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection30 = new Protection() { Locked = false };

            cellFormat33.Append(protection30);

            CellFormat cellFormat34 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)5U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection31 = new Protection() { Locked = false };

            cellFormat34.Append(protection31);

            CellFormat cellFormat35 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection32 = new Protection() { Locked = false };

            cellFormat35.Append(protection32);

            CellFormat cellFormat36 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)4U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment15 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };
            Protection protection33 = new Protection() { Locked = false };

            cellFormat36.Append(alignment15);
            cellFormat36.Append(protection33);

            CellFormat cellFormat37 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)7U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection34 = new Protection() { Locked = false };

            cellFormat37.Append(protection34);

            CellFormat cellFormat38 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)3U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection35 = new Protection() { Locked = false };

            cellFormat38.Append(protection35);

            CellFormat cellFormat39 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)16U, FillId = (UInt32Value)7U, BorderId = (UInt32Value)2U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment16 = new Alignment() { Horizontal = HorizontalAlignmentValues.Center, Vertical = VerticalAlignmentValues.Center };
            Protection protection36 = new Protection() { Locked = false };

            cellFormat39.Append(alignment16);
            cellFormat39.Append(protection36);

            CellFormat cellFormat40 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)15U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection37 = new Protection() { Locked = false };

            cellFormat40.Append(protection37);

            CellFormat cellFormat41 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)2U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)6U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyProtection = true };
            Protection protection38 = new Protection() { Locked = false };

            cellFormat41.Append(protection38);

            CellFormat cellFormat42 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)8U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment17 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };
            Protection protection39 = new Protection() { Locked = false };

            cellFormat42.Append(alignment17);
            cellFormat42.Append(protection39);

            CellFormat cellFormat43 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)8U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment18 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };
            Protection protection40 = new Protection() { Locked = false };

            cellFormat43.Append(alignment18);
            cellFormat43.Append(protection40);

            CellFormat cellFormat44 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)7U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection41 = new Protection() { Locked = false };

            cellFormat44.Append(protection41);

            CellFormat cellFormat45 = new CellFormat() { NumberFormatId = (UInt32Value)17U, FontId = (UInt32Value)10U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment19 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };
            Protection protection42 = new Protection() { Locked = false };

            cellFormat45.Append(alignment19);
            cellFormat45.Append(protection42);

            CellFormat cellFormat46 = new CellFormat() { NumberFormatId = (UInt32Value)17U, FontId = (UInt32Value)7U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyNumberFormat = true, ApplyFont = true, ApplyFill = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment20 = new Alignment() { Horizontal = HorizontalAlignmentValues.Left };
            Protection protection43 = new Protection() { Locked = false };

            cellFormat46.Append(alignment20);
            cellFormat46.Append(protection43);

            CellFormat cellFormat47 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)12U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection44 = new Protection() { Locked = false };

            cellFormat47.Append(protection44);

            CellFormat cellFormat48 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)9U, FillId = (UInt32Value)5U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection45 = new Protection() { Locked = false };

            cellFormat48.Append(protection45);

            CellFormat cellFormat49 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)11U, FillId = (UInt32Value)6U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyProtection = true };
            Protection protection46 = new Protection() { Locked = false };

            cellFormat49.Append(protection46);

            CellFormat cellFormat50 = new CellFormat() { NumberFormatId = (UInt32Value)0U, FontId = (UInt32Value)6U, FillId = (UInt32Value)2U, BorderId = (UInt32Value)0U, FormatId = (UInt32Value)0U, ApplyFont = true, ApplyFill = true, ApplyBorder = true, ApplyAlignment = true, ApplyProtection = true };
            Alignment alignment21 = new Alignment() { Horizontal = HorizontalAlignmentValues.Right };
            Protection protection47 = new Protection() { Locked = false };

            cellFormat50.Append(alignment21);
            cellFormat50.Append(protection47);

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

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

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

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

            workbookStylesPart1.Stylesheet = stylesheet1;
        }
Ejemplo n.º 40
0
        //------------------------------------------------------------
        /// <summary>
        /// StaticTypeDef:
        ///   ClassDef
        ///   EnumDef
        ///   InterfaceDef
        ///   PodDef
        ///   TypedefDef
        ///   UtilityDef
        /// </summary>
        StaticTypeDef parseStaticTypeDef(Protection aDefaultTypeProtection, bool aIsProtoType)
        {
            StaticTypeDef.Kind kind           = StaticTypeDef.Kind.Unknown;
            Protection         typeProtection = Protection.DEFAULT;

            // 前修飾解析
            while (true)
            {
                Token t = currentToken();
                {// typeProtection
                    Protection tokenTypeProtection = parseTypeProtection(t);
                    if (tokenTypeProtection != Protection.Unknown)
                    {
                        if (typeProtection != Protection.DEFAULT)
                        {
                            setErrorKind(ErrorKind.STATIC_TYPE_DEF_ALREADY_ASIGNED_TYPE_PROTECTION);
                            return(null);
                        }
                        typeProtection = tokenTypeProtection;
                        nextToken();
                        continue;
                    }
                }
                {// kind
                    StaticTypeDef.Kind tokenStaticTypeKind = parseStaticTypeKind(t);
                    if (tokenStaticTypeKind != StaticTypeDef.Kind.Unknown)
                    {
                        if (kind != StaticTypeDef.Kind.Unknown)
                        {
                            setErrorKind(ErrorKind.STATIC_TYPE_DEF_ALREADY_ASIGNED_TYPE_KIND);
                            return(null);
                        }
                        kind = tokenStaticTypeKind;
                        nextToken();
                        continue;
                    }
                }
                // exit
                break;
            }

            // デフォルト値を設定
            typeProtection = getProtectionWithDefaultValue(typeProtection, aDefaultTypeProtection);

            // 種類の指定確認
            if (kind == StaticTypeDef.Kind.Unknown)
            {
                setErrorKind(ErrorKind.STATIC_TYPE_DEF_TYPE_KEYWORD_EXPECTED);
                return(null);
            }

            // 型の解析
            StaticTypeDef staticTypeDef = new StaticTypeDef(kind, typeProtection);

            if (kind == StaticTypeDef.Kind.Enum)
            {// enum
                if (!parseEnumDef(staticTypeDef))
                {
                    return(null);
                }
            }
            else if (kind == StaticTypeDef.Kind.Typedef)
            {// typedef
                if (!parseTypedefDef(staticTypeDef))
                {
                    return(null);
                }
            }
            else
            {// other
                if (!parseStaticTypeStandardDef(staticTypeDef, aIsProtoType))
                {
                    return(null);
                }
            }
            return(staticTypeDef);
        }
Ejemplo n.º 41
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Protection obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
Ejemplo n.º 42
0
        //------------------------------------------------------------
        // StaticTypeDef
        bool parseStaticTypeStandardDef(StaticTypeDef aTD, bool aIsProtoType)
        {
            // 最初はIdentifierのはず
            if (currentToken().Value != Token.Kind.Identifier)
            {
                setErrorKind(ErrorKind.STATIC_TYPE_DEF_IDENTIFIER_EXPECTED);
                return(false);
            }
            aTD.Ident = new Identifier(currentToken());
            nextToken();

            if (currentToken().Value == Token.Kind.OpColon)
            {// 継承
                if (aTD.TypeKind != StaticTypeDef.Kind.Class ||
                    aTD.TypeKind != StaticTypeDef.Kind.Interface
                    )
                {
                    setErrorKind(ErrorKind.STATIC_TYPE_DEF_ONLY_CLASS_OR_INTERFACE_CAN_IMPLEMENT_INTERFACE);
                    return(false);
                }
                nextToken();

                // IdentifierPath , のループ
                while (true)
                {
                    // 継承するインターフェースのパス
                    IdentPath typeIdentPath = parseIdentPath();
                    if (typeIdentPath == null)
                    {
                        setErrorKind(ErrorKind.STATIC_TYPE_DEF_IDENTIFIER_EXPECTED);
                        return(false);
                    }

                    // 登録
                    aTD.InheritTypeList.Add(new InheritType(typeIdentPath));

                    if (currentToken().Value == Token.Kind.OpColon)
                    {// 次のインターフェースへ
                        nextToken();
                        continue;
                    }

                    break;
                }
            }

            // 開始括弧
            if (currentToken().Value != Token.Kind.OpLCurly)
            {
                setErrorKind(ErrorKind.STATIC_TYPE_DEF_LCURLY_EXPECTED);
                return(false);
            }
            nextToken();

            // 内部実装ループ
            {
                Protection defaultProtection = Protection.Public;
                while (currentToken().Value != Token.Kind.OpRCurly &&
                       currentToken().Value != Token.Kind.EOF
                       )
                {
                    // Protection
                    if (parseTypeProtection(currentToken()) != Protection.Unknown &&
                        currentToken().Next.Value == Token.Kind.OpColon
                        )
                    {// DefaultProtectionChange
                        defaultProtection = parseTypeProtection(currentToken());
                        if (!checkProtection(defaultProtection, aIsProtoType))
                        {
                            return(false);
                        }
                        nextToken();
                        nextToken();
                        continue;
                    }

                    // Symbol
                    SymbolDef symbolDef = parseSymbolDef(aTD, defaultProtection, aIsProtoType);
                    if (symbolDef == null)
                    {
                        return(false);
                    }
                    aTD.SymbolDefList.Add(symbolDef);
                }
            }

            // 終端括弧
            if (currentToken().Value != Token.Kind.OpRCurly)
            {
                setErrorKind(ErrorKind.STATIC_TYPE_DEF_RCURLY_EXPECTED);
                return(false);
            }
            nextToken();

            // セミコロン
            if (currentToken().Value != Token.Kind.OpSemicolon)
            {
                setErrorKind(ErrorKind.STATIC_TYPE_DEF_SEMICOLON_EXPECTED);
                return(false);
            }
            nextToken();

            return(true);
        }
Ejemplo n.º 43
0
 public CreditDefaultSwap(Protection.Side side, double notional, double upfront, double spread, Schedule schedule, BusinessDayConvention paymentConvention, DayCounter dayCounter) : this(NQuantLibcPINVOKE.new_CreditDefaultSwap__SWIG_5((int)side, notional, upfront, spread, Schedule.getCPtr(schedule), (int)paymentConvention, DayCounter.getCPtr(dayCounter)), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Ejemplo n.º 44
0
        //------------------------------------------------------------
        // SymbolDef。
        SymbolDef parseSymbolDef(StaticTypeDef aTD, Protection aDefaultProtection, bool aIsProtoType)
        {
            Protection protect    = Protection.DEFAULT;
            Token      isAbstract = null;
            Token      isConst    = null;
            Token      isOverride = null;
            Token      isReadonly = null;
            Token      isRef      = null;
            Token      isStatic   = null;

            while (true)
            {         // pre
                Token t = currentToken();
                {     // attribute
                    { // ChangeProtection
                        Protection tmpProtection = parseTypeProtection(t);
                        if (tmpProtection != Protection.Unknown)
                        {// set protect
                            if (protect != Protection.DEFAULT)
                            {
                                setErrorKind(ErrorKind.SYMBOL_DEF_ALREADY_ASIGNED_TYPE_PROTECTION);
                                return(null);
                            }
                            protect = tmpProtection;
                            if (!checkProtection(protect, aIsProtoType))
                            {
                                return(null);
                            }
                            nextToken();
                            continue;
                        }
                    }
                    if (t.Value == Token.Kind.KeyAbstract)
                    {// SetAbstractAttribute
                        if (aTD.TypeKind != StaticTypeDef.Kind.Interface)
                        {
                            setErrorKind(ErrorKind.SYMBOL_DEF_ONLY_INTERFACE_TYPE_CAN_ABSTRACT_ATTRIBUTE_MEMBER);
                            return(null);
                        }
                        if (isAbstract != null)
                        {
                            setErrorKind(ErrorKind.SYMBOL_DEF_ALREADY_ASSIGNED_ATTRIBUTE_ABSTRACT);
                            return(null);
                        }
                        isAbstract = currentToken();
                        nextToken();
                        continue;
                    }
                    if (t.Value == Token.Kind.KeyConst)
                    {// SetConstAttribute
                        if (isConst != null)
                        {
                            setErrorKind(ErrorKind.SYMBOL_DEF_ALREADY_ASSIGNED_ATTRIBUTE_CONST);
                            return(null);
                        }
                        isConst = currentToken();
                        nextToken();
                        continue;
                    }
                    if (t.Value == Token.Kind.KeyOverride)
                    {// SetOverrideAttribute
                        if (aTD.TypeKind != StaticTypeDef.Kind.Class)
                        {
                            setErrorKind(ErrorKind.SYMBOL_DEF_ONLY_CLASS_TYPE_CAN_OVERRIDE_ATTRIBUTE_MEMBER);
                            return(null);
                        }
                        if (isConst != null)
                        {
                            setErrorKind(ErrorKind.SYMBOL_DEF_ALREADY_ASSIGNED_ATTRIBUTE_OVERRIDE);
                            return(null);
                        }
                        isOverride = currentToken();
                        nextToken();
                        continue;
                    }
                    if (t.Value == Token.Kind.KeyRef)
                    {// SetRefAttribute
                        if (isRef != null)
                        {
                            setErrorKind(ErrorKind.SYMBOL_DEF_ALREADY_ASSIGNED_ATTRIBUTE_REF);
                            return(null);
                        }
                        isRef = currentToken();
                        nextToken();
                        continue;
                    }
                    if (t.Value == Token.Kind.KeyReadonly)
                    {// SetReadonlyAttribute
                        if (isReadonly != null)
                        {
                            setErrorKind(ErrorKind.SYMBOL_DEF_ALREADY_ASSIGNED_ATTRIBUTE_READONLY);
                            return(null);
                        }
                        isReadonly = currentToken();
                        nextToken();
                        continue;
                    }
                    if (t.Value == Token.Kind.KeyStatic)
                    {// SetStaticAttribute
                        if (isStatic != null)
                        {
                            setErrorKind(ErrorKind.SYMBOL_DEF_ALREADY_ASSIGNED_ATTRIBUTE_STATIC);
                            return(null);
                        }
                        isStatic = currentToken();
                        nextToken();
                        continue;
                    }
                }

                // シンボルの実装の前準備
                protect = getProtectionWithDefaultValue(protect, aDefaultProtection);

                {// StaticTypeDef
                    StaticTypeDef.Kind typeKind = parseStaticTypeKind(t);
                    if (typeKind != StaticTypeDef.Kind.Unknown)
                    {
                        // 無効な属性のチェック
                        if (checkErrorSymbolDefIllegalAttr(isAbstract, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_STATIC_TYPE_DEF) ||
                            checkErrorSymbolDefIllegalAttr(isConst, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_STATIC_TYPE_DEF) ||
                            checkErrorSymbolDefIllegalAttr(isOverride, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_STATIC_TYPE_DEF) ||
                            checkErrorSymbolDefIllegalAttr(isReadonly, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_STATIC_TYPE_DEF) ||
                            checkErrorSymbolDefIllegalAttr(isRef, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_STATIC_TYPE_DEF) ||
                            checkErrorSymbolDefIllegalAttr(isStatic, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_STATIC_TYPE_DEF)
                            )
                        {
                            return(null);
                        }
                        // 解析
                        StaticTypeDef staticTypeDef = parseStaticTypeDef(protect, aIsProtoType);
                        if (staticTypeDef == null)
                        {
                            return(null);
                        }
                        return(new SymbolDef(staticTypeDef));
                    }
                }
                {// StaticCtorDef,CtorDef
                 // todo: impl
                }
                {// StaticDtorDef,DtorDef
                 // todo: impl
                }
                {// MemberDef
                    // 戻り値の型もしくは変数の型
                    TypePath firstTypePath = parseTypePath();
                    if (firstTypePath != null)
                    {
                        // メンバ名
                        if (currentToken().Value != Token.Kind.Identifier)
                        {
                            setErrorKind(ErrorKind.MEMBER_DEF_IDENTIFIER_EXPECTED);
                            return(null);
                        }
                        Identifier nameIdent = new Identifier(currentToken());
                        nextToken();

                        if (currentToken().Value == Token.Kind.OpAssign ||
                            currentToken().Value == Token.Kind.OpSemicolon
                            )
                        {// '=' or ';' ならMemberVariableDecl
                            // エラーチェック
                            if (checkErrorSymbolDefIllegalAttr(isAbstract, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_MEMBER_VARIABLE_DECL) ||
                                checkErrorSymbolDefIllegalAttr(isOverride, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_MEMBER_VARIABLE_DECL) ||
                                checkErrorSymbolDefIllegalAttr(isRef, ErrorKind.SYMBOL_DEF_ILLEGAL_ATTRIBUTE_FOR_MEMBER_VARIABLE_DECL)
                                )
                            {
                                return(null);
                            }
                            if (isStatic == null)
                            {
                                if (aTD.TypeKind == StaticTypeDef.Kind.Interface)
                                {// interface型は非staticメンバ変数をもてない
                                    setErrorKind(ErrorKind.MEMBER_VARIABLE_DECL_INTERFACE_CANT_HAVE_NONSTATIC_MEMBER_VARIABLE);
                                    return(null);
                                }
                                if (aTD.TypeKind == StaticTypeDef.Kind.Utility)
                                {// utility型は非staticメンバ変数をもてない
                                    setErrorKind(ErrorKind.MEMBER_VARIABLE_DECL_UTILITY_CANT_HAVE_NONSTATIC_MEMBER_VARIABLE);
                                    return(null);
                                }
                            }

                            // 右辺
                            IExpression expr = null;
                            if (currentToken().Value == Token.Kind.OpAssign)
                            {
                                nextToken();

                                // 右辺解析
                                expr = parseConditionalExpression();
                            }

                            // ';'
                            if (currentToken().Value != Token.Kind.OpSemicolon)
                            {
                                setErrorKind(ErrorKind.SYMBOL_DEF_SEMICOLON_EXPECTED);
                                return(null);
                            }
                            nextToken();

                            return(new SymbolDef(
                                       new MemberVariableDecl(
                                           new VariableDecl(firstTypePath, nameIdent, expr)
                                           , isStatic != null
                                           , isConst != null
                                           , isReadonly != null
                                           )
                                       ));
                        }
                        else if (currentToken().Value == Token.Kind.OpLParen)
                        {// '(' ならMemberFunctionDecl
                            // 戻り値
                            FunctionReturnValueDecl retValueDecl = new FunctionReturnValueDecl(
                                firstTypePath
                                , isConst != null
                                , isRef != null
                                );

                            // 引数リスト
                            FunctionArgumentDeclList argDeclList = parseFunctionArgumentDeclList();
                            if (argDeclList == null)
                            {
                                return(null);
                            }

                            // ) の後のconst
                            Token isFunctionConst = null;
                            if (currentToken().Value == Token.Kind.KeyConst)
                            {
                                isFunctionConst = currentToken();
                                nextToken();
                            }

                            // '{' or ';'
                            BlockStatement blockStatement = null;
                            if (isAbstract != null || aIsProtoType)
                            {// 宣言のみ。セミコロンがくるはず。
                                if (currentToken().Value != Token.Kind.OpSemicolon)
                                {
                                    setErrorKind(ErrorKind.MEMBER_FUNCTION_DECL_SEMICOLON_EXPECTED);
                                    return(null);
                                }
                                nextToken();
                            }
                            else
                            {// non abstract function
                                if (currentToken().Value != Token.Kind.OpLCurly)
                                {
                                    setErrorKind(ErrorKind.MEMBER_FUNCTION_DECL_LCURLY_EXPECTED);
                                    return(null);
                                }
                                // BlockStatement
                                blockStatement = parseBlockStatement();
                                if (blockStatement == null)
                                {
                                    return(null);
                                }
                            }

                            // 作成
                            return(new SymbolDef(new MemberFunctionDecl(
                                                     nameIdent
                                                     , retValueDecl
                                                     , argDeclList
                                                     , blockStatement
                                                     , isAbstract != null
                                                     , isFunctionConst != null
                                                     , isOverride != null
                                                     , isStatic != null
                                                     )));
                        }
                        else
                        {// エラー
                            setErrorKind(ErrorKind.SYMBOL_DEF_ILLEGAL_MEMBER_SYNTAX);
                            return(null);
                        }
                    }
                }
                break;
            }
            return(null);
        }
Ejemplo n.º 45
0
 public void Protect(string title, string reason, string expiry, Protection edit, Protection move, bool cascade)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 46
0
        public Task StartAsync(CancellationToken cancellationToken)
        {
            log.LogInformation($"Start Hub Service for {chainSettings.Symbol}.");

            Protection    protection = new Protection();
            Mnemonic      recoveryPhrase;
            DirectoryInfo dataFolder = new DirectoryInfo(hubSettings.DataFolder);

            if (!dataFolder.Exists)
            {
                dataFolder.Create();
            }

            string path = Path.Combine(dataFolder.FullName, "recoveryphrase.txt");

            if (!File.Exists(path))
            {
                recoveryPhrase = new Mnemonic(Wordlist.English, WordCount.Twelve);
                string cipher = protection.Protect(recoveryPhrase.ToString());
                File.WriteAllText(path, cipher);
            }
            else
            {
                string cipher = File.ReadAllText(path);
                recoveryPhrase = new Mnemonic(protection.Unprotect(cipher));
            }

            if (recoveryPhrase.ToString() != "border indicate crater public wealth luxury derive media barely survey rule hen")
            {
                //throw new ApplicationException("RECOVERY PHRASE IS DIFFERENT!");
            }

            // Read the identity from the secure storage and provide it here.
            //host.Setup(new Identity(recoveryPhrase.ToString()), stoppingToken);


            IPAddress[] IPAddresses = Dns.GetHostAddresses(hubSettings.Server);

            if (IPAddresses.Length == 0)
            {
                throw new ApplicationException("Did not find any IP address for the hub server.");
            }

            //ServerEndpoint = new IPEndPoint(IPAddress.Parse(hubSettings.Server), hubSettings.Port);
            // TODO: #4
            ServerEndpoint = new IPEndPoint(IPAddresses[0], hubSettings.Port);
            LocalHubInfo   = new HubInfo();
            AckResponces   = new List <Ack>();

            UDPClientGateway.AllowNatTraversal(true);
            UDPClientGateway.Client.SetIPProtectionLevel(IPProtectionLevel.Unrestricted);
            UDPClientGateway.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);

            LocalHubInfo.Name           = Environment.MachineName;
            LocalHubInfo.ConnectionType = ConnectionTypes.Unknown;
            LocalHubInfo.Id             = Guid.NewGuid().ToString();
            //LocalHubInfo.Id = DateTime.Now.Ticks;

            IEnumerable <IPAddress> IPs = Dns.GetHostEntry(Dns.GetHostName()).AddressList.Where(ip => ip.AddressFamily == AddressFamily.InterNetwork);

            foreach (IPAddress IP in IPs)
            {
                log.LogInformation("Internal Address: {IP}", IP);
                LocalHubInfo.InternalAddresses.Add(IP);
            }

            // To avoid circular reference we must resolve these in the startup.
            messageProcessing = serviceProvider.GetService <IHubMessageProcessing>();
            messageSerializer = serviceProvider.GetService <MessageSerializer>();

            // Prepare the messaging processors for message handling.
            MessageMaps maps = messageProcessing.Build();

            messageSerializer.Maps = maps;

            hub.Subscribe <ConnectionAddedEvent>(this, e =>
            {
                StringBuilder entry = new StringBuilder();

                entry.AppendLine($"ConnectionAddedEvent: {e.Data.Id}");
                entry.AppendLine($"                    : ExternalIPAddress: {e.Data.ExternalEndpoint}");
                entry.AppendLine($"                    : InternalIPAddress: {e.Data.InternalEndpoint}");
                entry.AppendLine($"                    : Name: {e.Data.Name}");

                foreach (System.Net.IPAddress address in e.Data.InternalAddresses)
                {
                    entry.AppendLine($"                    : Address: {address}");
                }

                log.LogInformation(entry.ToString());

                //var msg = new MessageModel
                //{
                //   Type = "ConnectionAddedEvent",
                //   Date = DateTime.UtcNow,
                //   Message = entry.ToString(),
                //   Data = e
                //};

                hubContext.Clients.All.SendAsync("Event", e);
            });

            hub.Subscribe <ConnectionRemovedEvent>(this, e =>
            {
                log.LogInformation($"ConnectionRemovedEvent: {e.Data.Id}");

                log.LogInformation($"ConnectionRemovedEvent: {e.Data.Id}");

                if (ConnectedHubs.ContainsKey(e.Data.Id))
                {
                    ConnectedHubs.Remove(e.Data.Id);
                }


                //var msg = new MessageModel
                //{
                //   Type = "ConnectionRemovedEvent",
                //   Date = DateTime.UtcNow,
                //   Message = e.Data.ToString(),
                //   Data = e.Data
                //};



                hubContext.Clients.All.SendAsync("Event", e);
            });

            hub.Subscribe <ConnectionStartedEvent>(this, e =>
            {
                log.LogInformation($"ConnectionStartedEvent: {e.Endpoint}");

                //var msg = new MessageModel
                //{
                //   Type = "ConnectionStartedEvent",
                //   Date = DateTime.UtcNow,
                //   Message = e.Endpoint.ToString(),
                //   Data = e.Endpoint.ToString()
                //};

                hubContext.Clients.All.SendAsync("Event", e);
            });

            hub.Subscribe <ConnectionStartingEvent>(this, e =>
            {
                log.LogInformation($"ConnectionStartingEvent: {e.Data.Id}");

                //var msg = new MessageModel
                //{
                //   Type = "ConnectionStartingEvent",
                //   Date = DateTime.UtcNow,
                //   Message = e.Data.Id.ToString(),
                //   Data = e.Data.Id.ToString()
                //};

                hubContext.Clients.All.SendAsync("Event", e);
            });

            hub.Subscribe <ConnectionUpdatedEvent>(this, e =>
            {
                log.LogInformation($"ConnectionUpdatedEvent: {e.Data.Id}");

                //var msg = new MessageModel
                //{
                //   Type = "ConnectionUpdatedEvent",
                //   Date = DateTime.UtcNow,
                //   Message = e.Data.Id.ToString(),
                //   Data = e.Data.Id
                //};

                hubContext.Clients.All.SendAsync("Event", e);

                // Automatically connect to discovered hubs.
                if (LocalHubInfo.Id != e.Data.Id)
                {
                    ConnectToClient(e.Data);
                }
            });

            hub.Subscribe <GatewayConnectedEvent>(this, e =>
            {
                log.LogInformation("Connected to Gateway");

                //var msg = new MessageModel
                //{
                //   Type = "GatewayConnectedEvent",
                //   Date = DateTime.UtcNow,
                //   Message = "",
                //   Data = ""
                //};

                hubContext.Clients.All.SendAsync("Event", e);
            });

            hub.Subscribe <GatewayShutdownEvent>(this, e =>
            {
                log.LogInformation("Disconnected from Gateway");

                //var msg = new MessageModel
                //{
                //   Type = "GatewayShutdownEvent",
                //   Date = DateTime.UtcNow,
                //   Message = "",
                //   Data = ""
                //};

                hubContext.Clients.All.SendAsync("Event", e);
            });

            hub.Subscribe <HubInfoEvent>(this, e =>
            {
                //var msg = new MessageModel
                //{
                //   Type = "HubInfoEvent",
                //   Date = DateTime.UtcNow,
                //   Message = e.Data.ToString(),
                //   Data = e.Data
                //};

                //if (e.Data.Id == Identity.Id)
                //{
                //   return;
                //}

                AvailableHubs.Add(e.Data.Id, new HubInfo(e.Data));

                hubContext.Clients.All.SendAsync("Event", e);
            });

            hub.Subscribe <MessageReceivedEvent>(this, e =>
            {
                log.LogInformation($"MessageReceivedEvent: {e.Data.Content}");

                //var msg = new MessageModel
                //{
                //   Type = "MessageReceivedEvent",
                //   Date = DateTime.UtcNow,
                //   Message = e.Data.Content,
                //   Data = e.Data.Content
                //};

                hubContext.Clients.All.SendAsync("Event", e);
            });

            hub.Subscribe <GatewayErrorEvent>(this, e =>
            {
                log.LogInformation($"GatewayErrorEvent: {e.Message}");

                //var msg = new MessageModel
                //{
                //   Type = "GatewayErrorEvent",
                //   Date = DateTime.UtcNow,
                //   Message = e.Message,
                //   Data = e.Message
                //};

                hubContext.Clients.All.SendAsync("Event", e);
            });

            Task.Run(async() =>
            {
                try
                {
                    bool connectedToGateway = false;

                    while (!cancellationToken.IsCancellationRequested)
                    {
                        //Task tcpTask = Task.Run(() =>
                        //{
                        //   TcpWorker(cancellationToken);
                        //}, cancellationToken);

                        //Task udTask = Task.Run(() =>
                        //{
                        //   UdpWorker(cancellationToken);
                        //}, cancellationToken);

                        //Task.WaitAll(new Task[] { tcpTask, udTask }, cancellationToken);

                        if (!connectedToGateway)
                        {
                            connectedToGateway = ConnectGateway();
                        }

                        // TODO: This loop will just continue to run after connected to gateway. It should check status and attempt to recycle and reconnect when needed.
                        Task.Delay(TimeSpan.FromSeconds(retryInterval), cancellationToken).Wait(cancellationToken);

                        //Task.Delay(TimeSpan.FromSeconds(retryInterval), cancellationToken).Wait(cancellationToken);

                        //var tokenSource = new CancellationTokenSource();
                        //cancellationToken.Register(() => { tokenSource.Cancel(); });

                        //try
                        //{
                        //   using (IServiceScope scope = scopeFactory.CreateScope())
                        //   {
                        //      Runner runner = scope.ServiceProvider.GetService<Runner>();
                        //      System.Collections.Generic.IEnumerable<Task> runningTasks = runner.RunAll(tokenSource);

                        //      Task.WaitAll(runningTasks.ToArray(), cancellationToken);

                        //      if (cancellationToken.IsCancellationRequested)
                        //      {
                        //         tokenSource.Cancel();
                        //      }
                        //   }

                        //   break;
                        //}
                        //catch (OperationCanceledException)
                        //{
                        //   // do nothing the task was cancel.
                        //   throw;
                        //}
                        //catch (AggregateException ae)
                        //{
                        //   if (ae.Flatten().InnerExceptions.OfType<SyncRestartException>().Any())
                        //   {
                        //      log.LogInformation("Sync: ### - Restart requested - ###");
                        //      log.LogTrace("Sync: Signalling token cancelation");
                        //      tokenSource.Cancel();

                        //      continue;
                        //   }

                        //   foreach (Exception innerException in ae.Flatten().InnerExceptions)
                        //   {
                        //      log.LogError(innerException, "Sync");
                        //   }

                        //   tokenSource.Cancel();

                        //   int retryInterval = 10;

                        //   log.LogWarning($"Unexpected error retry in {retryInterval} seconds");
                        //   //this.tracer.ReadLine();

                        //   // Blokcore Indexer is designed to be idempotent, we want to continue running even if errors are found.
                        //   // so if an unepxected error happened we log it wait and start again

                        //   Task.Delay(TimeSpan.FromSeconds(retryInterval), cancellationToken).Wait(cancellationToken);

                        //   continue;
                        //}
                        //catch (Exception ex)
                        //{
                        //   log.LogError(ex, "Sync");
                        //   break;
                        //}
                    }
                }
                catch (OperationCanceledException)
                {
                    // do nothing the task was cancel.
                    throw;
                }
                catch (Exception ex)
                {
                    log.LogError(ex, "Gateway");
                    throw;
                }
            }, cancellationToken);

            return(Task.CompletedTask);
        }
Ejemplo n.º 47
0
 private static Kernel32.MemoryProtection GetKernelMemoryProtectionValue(Protection prot)
 {
     Kernel32.MemoryProtection p;
     switch (prot)
     {
         case Protection.None: p = Kernel32.MemoryProtection.NOACCESS; break;
         case Protection.R: p = Kernel32.MemoryProtection.READONLY; break;
         case Protection.RW: p = Kernel32.MemoryProtection.READWRITE; break;
         case Protection.RX: p = Kernel32.MemoryProtection.EXECUTE_READ; break;
         default: throw new ArgumentOutOfRangeException("prot");
     }
     return p;
 }
Ejemplo n.º 48
0
 public ArithmeticPurifier(Protection ParentBase)
     : base(ParentBase)
 {
 }
Ejemplo n.º 49
0
 protected abstract string Unprotect(string encodedData, Protection protectionOption);
Ejemplo n.º 50
0
 /// <summary>set r/w/x protection on a portion of memory. rounded to encompassing pages</summary>
 public abstract void Protect(ulong start, ulong length, Protection prot);
Ejemplo n.º 51
0
 private static extern bool VirtualProtectEx(IntPtr hProcess, IntPtr lpAddress, uint dwSize, Protection flNewProtect,
                                             out Protection lpflOldProtect);
Ejemplo n.º 52
0
 static extern bool VirtualProtect(IntPtr lpAddress, uint dwSize, Protection flNewProtect, out Protection lpflOldProtect);
Ejemplo n.º 53
0
        public void Protect(string title, string reason, string expiry, Protection edit, Protection move, bool cascade, bool watch)
        {
            if (string.IsNullOrEmpty(title)) throw new ArgumentException("Page name required", "title");
            if (string.IsNullOrEmpty(reason)) throw new ArgumentException("Deletion reason required", "reason");

            Reset();
            Action = "protect";

            string result = HttpGet(
                new[,]
                    {
                        {"action", "query"},
                        {"prop", "info"},
                        {"intoken", "protect"},
                        {"titles", title},

                    });

            CheckForError(result);

            try
            {
                XmlReader xr = XmlReader.Create(new StringReader(result));
                if (!xr.ReadToFollowing("page")) throw new Exception("Cannot find <page> element");
                Page.EditToken = xr.GetAttribute("protecttoken");
            }
            catch (Exception ex)
            {
                throw new ApiBrokenXmlException(this, ex);
            }

            if (m_Aborting) throw new ApiAbortedException(this);
            
            result = HttpPost(
                new[,]
                    {
                        {"action", "protect"}
                    },
                new[,]
                    {
                        {"title", title},
                        {"token", Page.EditToken},
                        {"reason", reason},
                        {"protections", "edit" + edit + "|move=" + move},
                        {"expiry", expiry},
                        {cascade ? "cascade" : null, null},
                        {watch ? "watch" : null, null},
                    });

            CheckForError(result);

            Reset();
        }
Ejemplo n.º 54
0
 public void Protect(string title, string reason, string expiry, Protection edit, Protection move)
 {
     Protect(title, reason, expiry, edit, move, false);
 }
 private static bool ProtectionsAreEqual(Protection protection, IXLProtection xlProtection)
 {
     var p = new XLProtection();
     if (protection != null)
     {
         if (protection.Locked != null)
             p.Locked = protection.Locked.Value;
         if (protection.Hidden != null)
             p.Hidden = protection.Hidden.Value;
     }
     return p.Equals(xlProtection);
 }
Ejemplo n.º 56
0
 public void Protect(string title, string reason, TimeSpan expiry, Protection edit, Protection move, bool cascade)
 {
     Protect(title, reason, expiry.ToString(), edit, move, cascade);
 }
Ejemplo n.º 57
0
 public void Protect(string title, string reason, TimeSpan expiry, Protection edit, Protection move, bool cascade, bool watch)
 {
     Protect(title, reason, expiry.ToString(), edit, move, cascade, watch);
 }
Ejemplo n.º 58
0
        public void Protect(string title, string reason, string expiry, Protection edit, Protection move, bool cascade)
        {
            if (string.IsNullOrEmpty(title))
            {
                throw new ArgumentException("Page name required", "title");
            }
            if (string.IsNullOrEmpty(reason))
            {
                throw new ArgumentException("Deletion reason required", "reason");
            }

            Reset();
            Action = "protect";

            string result = HttpGet(
                new[, ]
            {
                { "action", "query" },
                { "prop", "info" },
                { "intoken", "protect" },
                { "titles", title },
            });

            CheckForError(result);

            try
            {
                XmlReader xr = XmlReader.Create(new StringReader(result));
                if (!xr.ReadToFollowing("page"))
                {
                    throw new Exception("Cannot find <page> element");
                }
                EditToken = xr.GetAttribute("protecttoken");
            }
            catch (Exception ex)
            {
                throw new ApiBrokenXmlException(this, ex);
            }

            result = HttpPost(
                new[, ]
            {
                { "action", "protect" }
            },
                new[, ]
            {
                { "title", title },
                { "token", EditToken },
                { "reason", reason },
                { "protections", "edit" + edit + "|move=" + move },
                { "expiry", expiry },
                { cascade ? "cascade" : null, null },
            });

            CheckForError(result);

            Reset();
        }
Ejemplo n.º 59
0
 public void Protect(string title, string reason, TimeSpan expiry, Protection edit, Protection move)
 {
     Protect(title, reason, expiry.ToString(), edit, move, false, false);
 }
Ejemplo n.º 60
0
 /// <summary>
 /// Class to hold the armor bonus attributes and chances
 /// </summary>
 /// <param name="protectionContainer">container with all possible types of armor protection related bonus and their chances.</param>
 /// <param name="durabilityContainer">container with all possible types of armor durability related bonus and their chances.</param>
 public ArMod(Protection protectionContainer, Durability durabilityContainer)
 {
     m_ProtectionContainer = protectionContainer;
     m_DurabilityContainer = durabilityContainer;
 }