Exemple #1
0
        internal XF GetDataCellXF(XlsDocument xls, Type dataType)
        {
            if (m_XF == null)
            {
                VerticalAlignments v1 = ConvertAlignments(VerticalAlignment).GetValueOrDefault(VerticalAlignments.Centered);
                bool hasBorder1       = HasBorder.GetValueOrDefault(true);

                XF xf = xls.NewXF();
                xf.VerticalAlignment = v1;
                xf.Font.Height       = (ushort)(10 * this.FONT_HEIGHT_SCALE);
                if (hasBorder1)
                {
                    xf.LeftLineStyle   = 1;
                    xf.LeftLineColor   = Colors.Black;
                    xf.TopLineStyle    = 1;
                    xf.TopLineColor    = Colors.Black;
                    xf.RightLineStyle  = 1;
                    xf.RightLineColor  = Colors.Black;
                    xf.BottomLineStyle = 1;
                    xf.BottomLineColor = Colors.Black;
                    xf.TextWrapRight   = true;
                }
                m_XF = xf;
            }
            HorizontalAlignments h1 = ConvertAlignments(HorizontalAlignment).GetValueOrDefault(SetDefaultHorizontalAlignmentsForType(dataType));

            m_XF.HorizontalAlignment = h1;
            return(m_XF);
        }
        public override int GetHashCode()
        {
            int hashCode = 253911835;

            hashCode = hashCode * -1521134295 + HorizontalAlignment.GetHashCode();
            hashCode = hashCode * -1521134295 + VerticalAlignment.GetHashCode();
            hashCode = hashCode * -1521134295 + HasBorder.GetHashCode();
            hashCode = hashCode * -1521134295 + WrapText.GetHashCode();
            hashCode = hashCode * -1521134295 + BackgroundColor.GetHashCode();
            hashCode = hashCode * -1521134295 + Font.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(DataFormat);

            return(hashCode);
        }