Пример #1
0
        public ZipOutputStream(Stream baseOutputStream)
        {
            if (ZipWrap.ZipAssembly == null)
            {
                throw new ArgumentNullException(ZipWrap.ZipError);
            }

            object[] args = new object[] { baseOutputStream };

            _ZipOutputStream = ZipWrap.ZipAssembly.CreateInstance("ICSharpCode.SharpZipLib.Zip.ZipOutputStream", false,
                                                                  BindingFlags.CreateInstance, null, args, null, null);

            Type theClassType = _ZipOutputStream.GetType();

            ZipWrap.PropertySettingByEnum(_ZipOutputStream, theClassType, "UseZip64", "Off");
            this._PutNextEntry = theClassType.GetMethod("PutNextEntry");
            Type[] types = new Type[3];
            types[0]     = typeof(byte[]);
            types[1]     = typeof(int);
            types[2]     = typeof(int);
            this._Write  = theClassType.GetMethod("Write", types);
            types        = new Type[0];
            this._Finish = theClassType.GetMethod("Finish", types);
            this._Close  = theClassType.GetMethod("Close", types);
        }
Пример #2
0
        internal ExcelValet()
        {
            _Sheets      = new List <SheetInfo>();
            _Grid        = null;
            _StringCache = new StringCache();
            _BorderCache = new StringCache();
            _FontCache   = new StringCache();
            _FillCache   = new StringCache();
            // work around so that the first 2 fill caches matches what Excel chooses for them
            _FillCache.GetIndex("<fill><patternFill patternType=\"none\"/></fill>");    //index 0
            _FillCache.GetIndex("<fill><patternFill patternType=\"gray125\"/></fill>"); //index 1

            _StyleCache    = new StringCache();
            _StyleXfsCache = new StringCache();
            _DefaultStyle  = new StyleInfo();                   // use this when no style is specified

            GetStyleIndex(_DefaultStyle);                       // populates the default style entries as 0
            ZipWrap.Init();                                     // intialize the zip utility (doesn't hurt to do if already done)
        }