private void GetDrawingstodisplay()
        {
            if (Directory.Exists(rlog.Path))
            {
                foreach (string item in Directory.GetFiles(rlog.Path).Where(str => !str.Contains(@"\~$")).OrderByDescending(fi => fi))
                {
                    try
                    {
                        string sDocFileName     = item;
                        wpfThumbnailCreator pvf = new wpfThumbnailCreator
                        {
                            DesiredSize = new Size
                            {
                                Width  = 256,
                                Height = 256
                            }
                        };
                        System.Drawing.Bitmap pic = pvf.GetThumbNail(sDocFileName);
                        imageList2.Images.Add(pic);
                    }
                    catch (Exception)
                    {
                        const ShellEx.IconSizeEnum size = ShellEx.IconSizeEnum.ExtraLargeIcon;
                        imageList2.Images.Add(ShellEx.GetBitmapFromFilePath(item, size));
                    }

                    FileInfo fi = new FileInfo(item);
                    listFilesDrawings.Add(fi.FullName);
                    listView1.Items.Add(fi.Name, imageList2.Images.Count - 1);
                }
            }
        }
Exemple #2
0
        private void getitemstodisplay(string Pathpart, string ItemNo)
        {
            if (Directory.Exists(Pathpart))
            {
                foreach (string item in Directory.GetFiles(Pathpart, "*" + ItemNo.ToString() + "*").Where(str => !str.Contains(@"\~$")).OrderByDescending(fi => fi))
                {
                    try
                    {
                        string sDocFileName = item;
                        wpfThumbnailCreator pvf;
                        pvf = new wpfThumbnailCreator();
                        System.Drawing.Size size = new Size
                        {
                            Width  = 256,
                            Height = 256
                        };
                        pvf.DesiredSize = size;
                        System.Drawing.Bitmap pic = pvf.GetThumbNail(sDocFileName);
                        imageList.Images.Add(pic);
                        //axEModelViewControl1 = new EModelViewControl();
                        //axEModelViewControl1.OpenDoc(item, false, false, true, "");
                    }
                    catch (Exception)
                    {
                        //MessageBox.Show(ex.Message);

                        var size = ShellEx.IconSizeEnum.ExtraLargeIcon;
                        imageList.Images.Add(ShellEx.GetBitmapFromFilePath(item, size));
                        // imageList.Images.Add(GetIcon(item));
                    }

                    // imageList.Images.Add(GetIcon(item));

                    FileInfo fi = new FileInfo(item);
                    listFiles.Add(fi.FullName);
                    listView.Items.Add(fi.Name, imageList.Images.Count - 1);
                }
            }
        }