Пример #1
0
 public CustomHeaderAttribute(string text, TextAlignment textAlignment, bool filledBackground, HeaderColor colorTheme)
 {
     m_text                = text;
     m_textAlignment       = textAlignment;
     m_colorThemeByProSkin = false;
     m_colorTheme          = colorTheme;
     m_filledBackground    = filledBackground;
 }
Пример #2
0
 public void MergeFrom(StoreCategory other)
 {
     if (other == null)
     {
         return;
     }
     if (other.IconPath.Length != 0)
     {
         IconPath = other.IconPath;
     }
     if (other.Title.Length != 0)
     {
         Title = other.Title;
     }
     if (other.Header.Length != 0)
     {
         Header = other.Header;
     }
     if (other.headerColor_ != null)
     {
         if (headerColor_ == null)
         {
             HeaderColor = new global::WUProtos.Data.Color();
         }
         HeaderColor.MergeFrom(other.HeaderColor);
     }
     if (other.Background.Length != 0)
     {
         Background = other.Background;
     }
     if (other.backgroundColor_ != null)
     {
         if (backgroundColor_ == null)
         {
             BackgroundColor = new global::WUProtos.Data.Color();
         }
         BackgroundColor.MergeFrom(other.BackgroundColor);
     }
     storeSubcategories_.Add(other.storeSubcategories_);
     if (other.HeaderPrefab.Length != 0)
     {
         HeaderPrefab = other.HeaderPrefab;
     }
     if (other.itemColor_ != null)
     {
         if (itemColor_ == null)
         {
             ItemColor = new global::WUProtos.Data.Color();
         }
         ItemColor.MergeFrom(other.ItemColor);
     }
     if (other.Enabled != false)
     {
         Enabled = other.Enabled;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Пример #3
0
        private void FillCell(ISheet sheet, IRow row, ICell cell, IWorkbook book, IFont font, int rowidx, int endrow,
                              int colidx, int endcol, string content, HeaderColor header)
        {
            List <ICell> cells = FillCell(sheet, row, cell, book, rowidx, endrow, colidx, endcol, content, header);

            foreach (ICell item in cells)
            {
                item.CellStyle.SetFont(font);
            }
        }
Пример #4
0
        /// <summary>Generates a UserString for the given user, for saving</summary>
        /// <returns></returns>
        public string GenerateUserString()
        {
            string DateString     = string.Join("-", JoinDate.Year, JoinDate.Month, JoinDate.Day);
            string ChildrenString = "";

            foreach (User subu in Children)
            {
                ChildrenString += subu.Name + "`";
            }
            return(string.Join("~", Name, "pfp", DateString, HeaderColor.ToArgb(), Description, ChildrenString));
        }
Пример #5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (IconPath.Length != 0)
            {
                hash ^= IconPath.GetHashCode();
            }
            if (Title.Length != 0)
            {
                hash ^= Title.GetHashCode();
            }
            if (Header.Length != 0)
            {
                hash ^= Header.GetHashCode();
            }
            if (headerColor_ != null)
            {
                hash ^= HeaderColor.GetHashCode();
            }
            if (Background.Length != 0)
            {
                hash ^= Background.GetHashCode();
            }
            if (backgroundColor_ != null)
            {
                hash ^= BackgroundColor.GetHashCode();
            }
            hash ^= storeSubcategories_.GetHashCode();
            if (HeaderPrefab.Length != 0)
            {
                hash ^= HeaderPrefab.GetHashCode();
            }
            if (itemColor_ != null)
            {
                hash ^= ItemColor.GetHashCode();
            }
            if (Enabled != false)
            {
                hash ^= Enabled.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #6
0
        private ICellStyle CustomStyle(ICellStyle style, HeaderColor header)
        {
            style.FillForegroundColor = (short)header;
            style.FillPattern         = FillPattern.SolidForeground;
            style.BorderBottom        = BorderStyle.Thin;
            style.BorderLeft          = BorderStyle.Thin;
            style.BorderTop           = BorderStyle.Thin;
            style.BorderRight         = BorderStyle.Thin;

            style.BottomBorderColor = HSSFColor.Black.Index;
            style.LeftBorderColor   = HSSFColor.Black.Index;
            style.RightBorderColor  = HSSFColor.Black.Index;
            style.TopBorderColor    = HSSFColor.Black.Index;


            return(style);
        }
Пример #7
0
        static void Main(string[] args)
        {
            Console.WriteLine("OBSERVER DESIGN PATTERN\n");

            Console.WriteLine("----------");

            IObserver    headerstyle   = new HeaderColor();
            IObserver    footerstyle   = new FooterColor();
            ColorSubject colorNotifier = new ColorSubject();

            colorNotifier.Register(headerstyle);
            colorNotifier.Register(footerstyle);
            colorNotifier.Color = "red";

            Console.WriteLine("----------");

            colorNotifier.Color = "yellow";
        }
Пример #8
0
        private List <ICell> FillCell(ISheet sheet, IRow row, ICell cell, IWorkbook book, int rowidx, int endrow,
                                      int colidx, int endcol, string content, HeaderColor header)
        {
            List <ICell> cells = new List <ICell>();
            ICellStyle   style = book.CreateCellStyle();

            cell = row.CreateCell(colidx);
            cell.SetCellValue(content);
            if (colidx == endcol && rowidx == endrow)
            {
                sheet.AddMergedRegion(new CellRangeAddress(rowidx, endrow, colidx, endcol));
                cell.CellStyle = CustomStyle(style, header);
                cells.Add(cell);
            }
            else
            {
                for (int j = rowidx; j <= endrow; j++)
                {
                    IRow rowregion = sheet.GetRow(j);
                    if (rowregion != row)
                    {
                        cell = rowregion.CreateCell(colidx);
                    }
                    for (int i = colidx + 1; i <= endcol; i++)
                    {
                        cell = rowregion.CreateCell(i);
                    }
                }
                CellRangeAddress region = new CellRangeAddress(rowidx, endrow, colidx, endcol);
                sheet.AddMergedRegion(region);
                for (int i = region.FirstRow; i <= region.LastRow; i++)
                {
                    IRow rowregion = sheet.GetRow(i);
                    for (int j = region.FirstColumn; j <= region.LastColumn; j++)
                    {
                        ICell singleCell = rowregion.GetCell(j);
                        singleCell.CellStyle = CustomStyle(style, header);
                        cells.Add(singleCell);
                    }
                }
            }
            return(cells);
        }
Пример #9
0
 private ICellStyle CustomStyle(ICellStyle style, IFont font, HeaderColor header)
 {
     style = CustomStyle(style, header);
     style.SetFont(font);
     return(style);
 }