Ejemplo n.º 1
0
        private void AddViewItem(Shell32.FolderItem item, ref int idImage)
        {
            string[] sValues = new string[10];

            sValues[0] = item.Name;
            if (item.Size == 0)
            {
                sValues[1] = "";
            }
            else
            {
                sValues[1] = Convert.ToString(item.Size / 1024) + " KB";
            }
            sValues[2] = item.Type;
            sValues[3] = item.ModifyDate.ToString();

            /*
             * sValues[4] = item.Path;
             * sValues[5] = item.IsBrowsable.ToString();
             * sValues[6] = item.IsFileSystem.ToString();
             * sValues[7] = item.IsFolder.ToString();
             * sValues[8] = item.IsLink.ToString();
             */
            ImgListViewSmall.Images.Add(ExtractIcon.GetIcon(item.Path, true));

            ListViewItem lvItem = new ListViewItem(sValues, idImage++);

            lvItem.Tag = item;
            LocalView.Items.Add(lvItem);
        }
Ejemplo n.º 2
0
    void GenerateExeIcon()
    {
        for (int i = 0; i < path.Length; i++)
        {
            if (path[i] == null || path[i] == "")
            {
                return;
            }

            GameObject go = Instantiate(imagePrefab);
            go.GetComponent <RawImage>().texture = ExtractIcon.GetTextureFromIconatPath(path[i]);
            go.transform.SetParent(acttachPoint);
        }
    }
Ejemplo n.º 3
0
        private void InitializeIconFolder()
        {
            Shell32.Folder      FolderShell = m_Shell.NameSpace(Shell32.ShellSpecialFolderConstants.ssfWINDOWS);
            Shell32.FolderItems items       = FolderShell.Items();

            foreach (Shell32.FolderItem item in items)
            {
                if (item.IsFolder)
                {
                    m_IconFolder = ExtractIcon.GetIcon(item.Path, true);
                    break;
                }
            }
        }
Ejemplo n.º 4
0
        private void ftpc_DirCompleted(object sender, FTPCom.FTPEventArgs e)
        {
            int    i       = 0;
            int    idimage = 0;
            string msg;

            msg = "Transfered " + e.TotalBytes.ToString() + " bytes in " + ((float)e.TimeElapsed / 1000).ToString() + " seconds" + CRLF;
            TextLog.SelectionColor = Color.Black;
            TextLog.AppendText(msg);

            ServerView.BeginUpdate();
            ServerView.Items.Clear();
            ImgListServerSmall.Images.Clear();

            ListViewItem lvItem = new ListViewItem("..");

            ServerView.Items.Add(lvItem);

            for (i = 0; i < ftpc.FileCount; i++)
            {
                if (ftpc.IsFolder(i))
                {
                    string[] items = new String[2];
                    items[0] = ftpc.GetFileName(i);
                    items[1] = ftpc.GetFileSize(i).ToString();
                    ImgListServerSmall.Images.Add(m_IconFolder);
                    ServerView.Items.Add(new ListViewItem(items, idimage++));
                }
            }
            for (i = 0; i < ftpc.FileCount; i++)
            {
                if (!ftpc.IsFolder(i))
                {
                    string[] items = new String[2];
                    items[0] = ftpc.GetFileName(i);
                    items[1] = ftpc.GetFileSize(i).ToString();
                    ImgListServerSmall.Images.Add(ExtractIcon.GetIcon(items[0], false));
                    ServerView.Items.Add(new ListViewItem(items, idimage++));
                }
            }
            ServerView.EndUpdate();
            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 5
0
    public Progs(string path, string name)
    {
        //Name
        //Content = Image.FromFile(path);

        // Image i =
        IntPtr hBitmap = ExtractIcon.GetIcon(path, false).ToBitmap().GetHbitmap();

        ImageSource wpfBitmap =
            Imaging.CreateBitmapSourceFromHBitmap(
                hBitmap, IntPtr.Zero, Int32Rect.Empty,
                BitmapSizeOptions.FromEmptyOptions());

        // i.Width = 48;
        // i.Height = 48;

        // BitmapImage bi = new BitmapImage();
        // bi.BeginInit();
        // bi = ExtractIcon.GetIcon(path, false);
        // bi.UriSource = new Uri("pack://application:,,,/Resources/close_small_black.ico");
        // bi.EndInit();
        // i.Source = bi;

        this.Source = wpfBitmap;

        //Content = ExtractIcon.GetIcon(path, false).ToBitmap();
        ImagePath = path;

        Width  = 72;
        Height = 64;
        // Background = System.Windows.Media.Brushes.Transparent;
        ToolTip = name;
        Margin  = new System.Windows.Thickness(10);
        Opacity = 0.8;
        this.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(Progs_ClickThread);
        this.MouseEnter        += new System.Windows.Input.MouseEventHandler(Progs_MouseEnter);
        this.MouseLeave        += new System.Windows.Input.MouseEventHandler(Progs_MouseLeave);
    }