Exemplo n.º 1
0
 public VirtualTreeRow(VirtualTreeList grid, String name)
 {
     Name = name;
     Grid = grid;
     //Children = new List<VirtualTreeRow>(100);
     //Rows = new List<VirtualGridRow>(100);
 }
Exemplo n.º 2
0
        public static byte[] getImage(String filename, VirtualTreeList list)
        {
            try
            {
                System.IO.FileInfo fi = new System.IO.FileInfo(filename);
                if (fi.Exists)
                {
                    //byte[] buf = new byte[fi.Length];
                    using (System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Open, System.IO.FileAccess.Read))
                    {
                        //fs.Read(buf, 0, buf.Length);
                        System.Drawing.Image img = System.Drawing.Image.FromStream(fs);

                        System.IO.MemoryStream ms = new System.IO.MemoryStream();

                        //System.Drawing.Imaging.EncoderParameters

                        System.Drawing.Image thumb = img;
                        if (list.Parameter.ImageScaleing == ImageScaleings.Scale)
                        {
                            thumb = ResizeImage(img, 100, 100);
                        }

                        thumb.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        return(ms.ToArray());
                    }
                }
                return(new byte[0]);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString()); //TODO logger
                return(new byte[0]);
            }
        }
Exemplo n.º 3
0
 public VirtualGridHeaderColumn(VirtualTreeList grid, String columnName)
 {
     Grid         = grid;
     ColumnName   = columnName;
     CustomOption = String.Empty;
     //Rows = new List<VirtualGridRow>(1000);
 }
Exemplo n.º 4
0
 public VirtualTreeRow(VirtualTreeList grid, String name)
 {
     Name = name;
     Grid = grid;
     //Children = new List<VirtualTreeRow>(100);
     //Rows = new List<VirtualGridRow>(100);
 }
Exemplo n.º 5
0
 public VirtualGridHeaderColumn(VirtualTreeList grid, String columnName)
 {
     Grid = grid;
     ColumnName = columnName;
     CustomOption = String.Empty;
     //Rows = new List<VirtualGridRow>(1000);
 }
Exemplo n.º 6
0
 public VirtualGridRow(VirtualTreeList grid)
 {
     Grid         = grid;
     Cells        = new List <VirtualGridCell>(1000);
     ChildRows    = new List <VirtualGridRow>(1000);
     dataCache    = new Dictionary <string, object>(100);
     CustomOption = String.Empty;
 }
Exemplo n.º 7
0
 public VirtualTreeRow(VirtualTreeList grid, String name, String nodevalue)
 {
     Name = name;
     Grid = grid;
     NodeValue = nodevalue;
     //Children = new List<VirtualTreeRow>(100);
     //Rows = new List<VirtualGridRow>(100);
 }
Exemplo n.º 8
0
 public VirtualGridRow(VirtualTreeList grid)
 {
     Grid = grid;
     Cells = new List<VirtualGridCell>(1000);
     ChildRows = new List<VirtualGridRow>(1000);
     dataCache = new Dictionary<string, object>(100);
     CustomOption = String.Empty;
 }
Exemplo n.º 9
0
 public VirtualTreeRow(VirtualTreeList grid, String name, String nodevalue)
 {
     Name      = name;
     Grid      = grid;
     NodeValue = nodevalue;
     //Children = new List<VirtualTreeRow>(100);
     //Rows = new List<VirtualGridRow>(100);
 }
Exemplo n.º 10
0
 public VirtualGridCell(VirtualTreeList grid, VirtualGridRow row, VirtualGridHeaderColumn headercolumn, object data)
 {
     HeaderColumn = headercolumn;
     Row          = row;
     Grid         = grid;
     Data         = data;
     Changed      = false;
     CustomOption = String.Empty;
 }
Exemplo n.º 11
0
 public VirtualGridCell(VirtualTreeList grid, VirtualGridRow row, VirtualGridHeaderColumn headercolumn, object data)
 {
     HeaderColumn = headercolumn;
     Row = row;
     Grid = grid;
     Data = data;
     Changed = false;
     CustomOption = String.Empty;
 }
Exemplo n.º 12
0
        public static byte[] getImage(String filename,VirtualTreeList list)
        {
            try
            {
                System.IO.FileInfo fi = new System.IO.FileInfo(filename);
                if (fi.Exists)
                {
                    //byte[] buf = new byte[fi.Length];
                    using (System.IO.FileStream fs = new System.IO.FileStream(filename, System.IO.FileMode.Open,System.IO.FileAccess.Read))
                    {
                        //fs.Read(buf, 0, buf.Length);
                        System.Drawing.Image img = System.Drawing.Image.FromStream(fs);

                        System.IO.MemoryStream ms = new System.IO.MemoryStream();

                        //System.Drawing.Imaging.EncoderParameters

                        System.Drawing.Image thumb = img;
                        if (list.Parameter.ImageScaleing == ImageScaleings.Scale)
                        {
                            thumb = ResizeImage(img, 100, 100);
                        }

                        thumb.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        return ms.ToArray();
                    }
                }
                return new byte[0];
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString()); //TODO logger
                return new byte[0];
            }
        }