Beispiel #1
0
        public static CelChunk ReadCelChunk(uint length, BinaryReader reader, Frame frame)
        {
            ushort  layerIndex = reader.ReadUInt16();
            short   x          = reader.ReadInt16();
            short   y          = reader.ReadInt16();
            byte    opacity    = reader.ReadByte();
            CelType type       = (CelType)reader.ReadUInt16();

            reader.ReadBytes(7); // For Future


            switch (type)
            {
            case CelType.Raw:
                return(new RawCelChunk(length, layerIndex, x, y, opacity, frame, reader));

            case CelType.Linked:
                return(new LinkedCelChunk(length, layerIndex, x, y, opacity, frame, reader));

            case CelType.Compressed:
                return(new CompressedCelChunk(length, layerIndex, x, y, opacity, frame, reader));
            }


            return(null);
        }
Beispiel #2
0
 public CelChunk(uint length, ushort layerIndex, short x, short y, byte opacity, CelType type) : base(length, ChunkType.Cel)
 {
     LayerIndex = layerIndex;
     X          = x;
     Y          = y;
     Opacity    = opacity;
     CelType    = type;
 }
Beispiel #3
0
 public SolarPanel(int id, string name, int serial, int stock, string brand, string description, int warranty, int power, CelType celtype, string color, int length, int width, int height, decimal price) : base(id, name, serial, stock, brand, description, warranty, price)
 {
     Power   = power;
     Celtype = celtype;
     Color   = color;
     Length  = length;
     Width   = width;
     Height  = height;
 }
        private SolarPanel CreateFromReader(SqlDataReader reader)
        {
            string     Name        = reader["Naam"].ToString();
            string     Brand       = reader["Merk"].ToString();
            string     Description = reader["Omschrijving"].ToString();
            int        Warranty    = Convert.ToInt32(reader["Garantie"]);
            int        Power       = Convert.ToInt32(reader["Vermogen"]);
            string     Color       = Convert.ToString(reader["kleur"]);
            int        Length      = Convert.ToInt32(reader["lengte"]);
            int        Width       = Convert.ToInt32(reader["Breedte"]);
            int        Id          = Convert.ToInt32(reader["Id"]);
            string     CelType     = Convert.ToString(reader["Celtype"]);
            int        Serial      = Convert.ToInt32(reader["Serienummer"]);
            int        Height      = Convert.ToInt32(reader["Hoogte"]);
            int        Stock       = Convert.ToInt32(reader["Voorraad"]);
            decimal    Price       = Convert.ToDecimal(reader["Prijs"]);
            CelType    CelTypeEnum = (CelType)Enum.Parse(typeof(CelType), CelType, true);
            SolarPanel solarPanel  = new SolarPanel(Id, Name, Serial, Stock, Brand, Description, Warranty, Power, CelTypeEnum, Color, Length, Width, Height, Price);

            return(solarPanel);
        }
Beispiel #5
0
        /// <summary>
        /// 增加一行数据
        /// </summary>
        /// <param name="rowDate"></param>
        private void addRow(List <string> rowData, CelType celType)
        {
            float newX = 0F;

            rowLabel = new List <XRLabel>();
            for (int i = 0; i < rowData.Count; i++)
            {
                string rowStr = rowData[i];
                if (i == 0)
                {
                    string[] btStrs = rowData[i].Split('_');
                    if (btStrs.Length > 1)
                    {
                        rowStr = btStrs[1];
                        if (!this.BigFz.Contains(btStrs[0]))
                        {
                            List <string> newRowData = new List <string>();
                            for (int j = 0; j < rowData.Count; j++)
                            {
                                if (j == 0)
                                {
                                    newRowData.Add(btStrs[0]);
                                }
                                else
                                {
                                    newRowData.Add("-");
                                }
                            }
                            this.addRow(newRowData, CelType.FZ);
                            this.BigFz.Add(btStrs[0]);
                        }
                    }
                }
                XRLabel label = new XRLabel();
                label           = new XRLabel();
                label.LocationF = new PointF(newX, newY);
                label.WidthF    = this.columnsWidth[i];
                label.HeightF   = this.labelHeight;
                label.Text      = rowStr;
                if (i < rowData.Count - 1)
                {
                    label.Borders = DevExpress.XtraPrinting.BorderSide.Bottom | DevExpress.XtraPrinting.BorderSide.Left;
                }
                else
                {
                    label.Borders = DevExpress.XtraPrinting.BorderSide.Bottom | DevExpress.XtraPrinting.BorderSide.Left | DevExpress.XtraPrinting.BorderSide.Right;
                }

                if (i == 0)
                {
                    label.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleLeft;
                }
                else
                {
                    label.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleCenter;
                }

                if (celType == CelType.FZ)
                {
                    label.Font = new System.Drawing.Font("微软雅黑", 10F, FontStyle.Bold);
                }
                else
                {
                    label.Font = new System.Drawing.Font("微软雅黑", 10F);
                }
                rowLabel.Add(label);
                this.Detail.Controls.Add(label);
                newX = newX + this.columnsWidth[i];
            }
            this.AdjustRowHeight();
        }