예제 #1
0
        void OnEndingComputeThread(ThreadComputeInterface tci)
        {
            ListViewItem item = new ListViewItem();

            item.Text = tci.HashMethod;
            var subItem = new ListViewItem.ListViewSubItem();

            subItem.Text = tci.Result;
            item.SubItems.Add(subItem);
            lvMain.Items.Add(item);
        }
예제 #2
0
        void StartOfComputeThread(object obj)
        {
            ThreadComputeInterface ti = (ThreadComputeInterface)obj;

            ti.Parent.BeginInvoke(new VCDelegate(OnStartComputeThread), ti);
            try
            {
                using (HashAlgorithm ha = ti.CreateHashAlgorithm())
                {
                    byte[] result = ha.ComputeHash(ti.Pipe);
                    ti.Result = BitConverter.ToString(ha.Hash).Replace("-", "");
                }
            }
            catch (Exception ex)
            {
                Alert(ex.Message);
            }
            ti.ClosePipe();
            ti.Parent.EndInvoke(ti.Parent.BeginInvoke(new VCDelegate(OnEndingComputeThread), ti));
            ti.Parent.BeginInvoke(new VCDelegate(OnEndedComputeThread), ti);
        }
예제 #3
0
 void OnEndedComputeThread(ThreadComputeInterface tci)
 {
     Debug.Assert(!InvokeRequired);
     this.BeginInvoke(new VCloseThread(closeThread), tci.TheThread);
     --_totalThreadCount;
 }
예제 #4
0
 void OnStartComputeThread(ThreadComputeInterface tci)
 {
     Debug.Assert(!InvokeRequired);
     ++_totalThreadCount;
 }