private void UofListView_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
        {
            Rectangle           subRect = e.Bounds;
            WorkingListViewItem item    = ((WorkingListViewItem)e.Item);

            if (e.ColumnIndex == status.Index)
            {
                //High Light
                bool bHighLight = e.Item.Selected;
                if (bHighLight)
                {
                    e.Graphics.FillRectangle(SystemBrushes.Highlight, e.Item.Bounds);
                }

                //Draw Focus
                if (e.Item.Focused)
                {
                    e.DrawFocusRectangle(e.Item.Bounds);
                }
            }
            else if (e.ColumnIndex == name.Index)
            {
                //Draw Name
                DrawIcon(subRect, e.Graphics, item.FileIcon);
            }
        }
        private void lstFiles_ItemDrag(object sender, ItemDragEventArgs e)
        {
            List <string> filelist = new List <string>();

            foreach (ListViewItem item in lstFiles.SelectedItems)
            {
                WorkingListViewItem workingItem = (WorkingListViewItem)item;
                if (workingItem.State.StateValProgress == StateVal.STATE_DONE)
                {
                    if (File.Exists(workingItem.State.DestinationFileName) || Directory.Exists(workingItem.State.DestinationFileName))
                    {
                        filelist.Add(workingItem.State.DestinationFileName);
                    }
                }
            }

            if (filelist.Count == 0)
            {
                return;
            }

            string[]        files  = filelist.ToArray();
            DragDropEffects effect = DoDragDrop(new DataObject(DataFormats.FileDrop, files), DragDropEffects.Copy);

            return;
        }
 private void btnStartAllOOX_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem item in lstFiles.Items)
     {
         WorkingListViewItem workItem = item as WorkingListViewItem;
         if (workItem != null)
         {
             if (workItem.State.StateValProgress == StateVal.STATE_READY)
             {
                 if (workItem.State.TransType == TranslationType.OoxToUof)
                 {
                     workItem.start();
                 }
                 else
                 {
                     if (Directory.Exists(workItem.State.SourceFileName))
                     {
                         workItem.State.setDirTranslationType(DocumentType.All, TranslationType.OoxToUof);
                         workItem.start();
                     }
                 }
             }
         }
     }
 }
        public UofStatusButton(WorkingListViewItem item)
        {
            this.item = item;
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            InitializeComponent();
            toogleIcon();
        }
Beispiel #5
0
        public UofProgressBar(WorkingListViewItem item)
        {
            this.item = item;
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.Style = ProgressBarStyle.Marquee;
            this.MarqueeAnimationSpeed = 0;

            InitializeComponent();
        }
 private void btnStopAll_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem item in lstFiles.Items)
     {
         WorkingListViewItem workItem = item as WorkingListViewItem;
         if (workItem != null)
         {
             if (workItem.State.StateValProgress == StateVal.STATE_WORKING)
             {
                 workItem.stop();
             }
         }
     }
 }
 private void lstFiles_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
 {
     if (lstFiles.SelectedItems.Count == 0)
     {
         txtbxResult.Text = "";
     }
     else
     {
         WorkingListViewItem item = lstFiles.SelectedItems[0] as WorkingListViewItem;
         if (item != null)
         {
             txtbxResult.Text = item.LogText;
         }
     }
 }
 private void onRemove(WorkingListViewItem item)
 {
     if (item.State.StateValProgress == StateVal.STATE_DONE)
     {
         if (!String.IsNullOrEmpty(item.State.DestinationFileName))
         {
             string parentPath;
             parentPath = Path.GetDirectoryName(item.State.DestinationFileName);
             if (Directory.Exists(parentPath))
             {
                 Directory.Delete(parentPath, true);
             }
         }
     }
     lstFiles.Controls.Remove(item.PgbItem);
 }