예제 #1
0
 internal Style(Workbook wb, XfRecord xf) : base(wb)
 {
     if (xf.FontIdx > 0 && xf.FontIdx < wb.Fonts.Count)
     {
         _font = wb.Fonts[xf.FontIdx - 1];
     }
     _format            = wb.Formats[xf.FormatIdx];
     _typeAndProtection = xf.TypeAndProtection;
     if (_typeAndProtection.IsCell)
     {
         _parentStyle = wb.Styles[xf.ParentIdx];
     }
     _horizontalAlignment          = xf.HorizontalAlignment;
     _wrapped                      = xf.Wrapped;
     _verticalAlignment            = xf.VerticalAlignment;
     _rotation                     = xf.Rotation;
     _indentLevel                  = xf.IndentLevel;
     _shrinkContent                = xf.ShrinkContent;
     _parentStyleAttributes        = xf.ParentStyle;
     _leftLineStyle                = xf.LeftLineStyle;
     _rightLineStyle               = xf.RightLineStyle;
     _topLineStyle                 = xf.TopLineStyle;
     _bottomLineStyle              = xf.BottomLineStyle;
     _leftLineColor                = wb.Palette.GetColor(xf.LeftLineColor);
     _rightLineColor               = wb.Palette.GetColor(xf.RightLineColor);
     _diagonalRightTopToLeftBottom = xf.DiagonalRightTopToLeftBottom;
     _diagonalLeftBottomToTopRight = xf.DiagonalLeftBottomToTopRight;
     _topLineColor                 = wb.Palette.GetColor(xf.TopLineColor);
     _bottomLineColor              = wb.Palette.GetColor(xf.BottomLineColor);
     _diagonalLineColor            = wb.Palette.GetColor(xf.DiagonalLineColor);
     _diagonalLineStyle            = xf.DiagonalLineStyle;
     _fillPattern                  = xf.FillPattern;
     _patternColor                 = wb.Palette.GetColor(xf.PatternColor);
     _patternBackground            = wb.Palette.GetColor(xf.PatternBackground);
 }
예제 #2
0
		internal Style(Workbook wb, XfRecord xf) : base(wb)
		{	
			if(xf.FontIdx > 0 && xf.FontIdx < wb.Fonts.Count)
    	        _font = wb.Fonts[xf.FontIdx - 1];
		    _format = wb.Formats[xf.FormatIdx];
			_typeAndProtection = xf.TypeAndProtection;
			if(_typeAndProtection.IsCell)
				_parentStyle = wb.Styles[xf.ParentIdx];
			_horizontalAlignment = xf.HorizontalAlignment;
			_wrapped = xf.Wrapped;
			_verticalAlignment = xf.VerticalAlignment;
			_rotation = xf.Rotation;
			_indentLevel = xf.IndentLevel;
			_shrinkContent = xf.ShrinkContent;
			_parentStyleAttributes = xf.ParentStyle;
			_leftLineStyle = xf.LeftLineStyle;
			_rightLineStyle = xf.RightLineStyle;
			_topLineStyle = xf.TopLineStyle;
			_bottomLineStyle = xf.BottomLineStyle;
			_leftLineColor = wb.Palette.GetColor(xf.LeftLineColor);
			_rightLineColor = wb.Palette.GetColor(xf.RightLineColor);
			_diagonalRightTopToLeftBottom = xf.DiagonalRightTopToLeftBottom;
			_diagonalLeftBottomToTopRight = xf.DiagonalLeftBottomToTopRight;
			_topLineColor = wb.Palette.GetColor(xf.TopLineColor);
			_bottomLineColor = wb.Palette.GetColor(xf.BottomLineColor);
			_diagonalLineColor = wb.Palette.GetColor(xf.DiagonalLineColor);
			_diagonalLineStyle = xf.DiagonalLineStyle;
			_fillPattern = xf.FillPattern;
			_patternColor = wb.Palette.GetColor(xf.PatternColor);
			_patternBackground = wb.Palette.GetColor(xf.PatternBackground);
		}
예제 #3
0
 internal Font(Workbook wb, FontRecord f) : base(wb)
 {
     _height       = f.FontHeight;
     _options      = f.Options;
     _color        = wb.Palette.GetColor(f.ColorIdx);
     _boldNess     = f.Boldness;
     _escapement   = f.Escapement;
     _underline    = f.Underline;
     _family       = f.FontFamily;
     _characterSet = f.CharacterSet;
     _fontName     = f.FontName;
 }
예제 #4
0
        internal void Initialize(PaletteRecord p)
        {
            int idx = _minUserDefined;

            foreach (int c in p.Colors)
            {
                PaletteEntry pe = _colors[idx++];

                if (pe != null)
                {
                    pe.Color = Color.FromArgb(c);
                }
                else
                {
                    break;
                }
            }
        }
예제 #5
0
		internal Palette(Workbook wb) : base(wb)
		{
			_builtIn = new PaletteEntry[] { new PaletteEntry(wb, Color.Black), new PaletteEntry(wb, Color.White), 
				new PaletteEntry(wb, Color.Red), new PaletteEntry(wb, Color.Green), 
				new PaletteEntry(wb, Color.Blue), new PaletteEntry(wb, Color.Yellow), 
				new PaletteEntry(wb, Color.Magenta), new PaletteEntry(wb, Color.Cyan)
										  };

			_others = new Dictionary<int, PaletteEntry>(3);
			_others[0x0040] = new PaletteEntry(wb, Color.FromKnownColor(KnownColor.ActiveBorder));
			_others[0x0041] = new PaletteEntry(wb, Color.FromKnownColor(KnownColor.Window));
			_others[0x7FFF] = new PaletteEntry(wb, Color.FromKnownColor(KnownColor.WindowText));

			_colors = new PaletteEntry[56];
			int idx = 0;
			foreach(int c in _defaultPalette)
				_colors[idx++] = new PaletteEntry(wb, Color.FromArgb(c));
		}
예제 #6
0
        internal Palette(Workbook wb) : base(wb)
        {
            _builtIn = new PaletteEntry[] { new PaletteEntry(wb, Color.Black), new PaletteEntry(wb, Color.White),
                                            new PaletteEntry(wb, Color.Red), new PaletteEntry(wb, Color.Green),
                                            new PaletteEntry(wb, Color.Blue), new PaletteEntry(wb, Color.Yellow),
                                            new PaletteEntry(wb, Color.Magenta), new PaletteEntry(wb, Color.Cyan) };

            _others         = new Dictionary <int, PaletteEntry>(3);
            _others[0x0040] = new PaletteEntry(wb, Color.FromKnownColor(KnownColor.ActiveBorder));
            _others[0x0041] = new PaletteEntry(wb, Color.FromKnownColor(KnownColor.Window));
            _others[0x7FFF] = new PaletteEntry(wb, Color.FromKnownColor(KnownColor.WindowText));

            _colors = new PaletteEntry[56];
            int idx = 0;

            foreach (int c in _defaultPalette)
            {
                _colors[idx++] = new PaletteEntry(wb, Color.FromArgb(c));
            }
        }