コード例 #1
0
 /// <summary>
 /// The scan service scan status changed event handler
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void ScanStatusChangedHandler(object sender, ScanProgressEventArgs e)
 {
     Subscribers.ForEach(
         delegate(IHbServiceCallback callback)
     {
         if (((ICommunicationObject)callback).State == CommunicationState.Opened)
         {
             Console.WriteLine("Scan Changed Callback");
             callback.ScanProgressCallback(e);
         }
         else
         {
             Subscribers.Remove(callback);
         }
     });
 }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: altoplano/HandBrake
        /// <summary>
        /// Update the Status label for the scan
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void SourceScanScanStatusChanged(object sender, ScanProgressEventArgs e)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new ScanProgessStatus(this.SourceScanScanStatusChanged), new[] { sender, e });
                return;
            }

            labelSource.Text = string.Format("Processing Title: {0} of {1}", e.CurrentTitle, e.Titles);
        }
コード例 #3
0
        /// <summary>
        /// Fire an event when the scan process progresses
        /// </summary>
        /// <param name="sender">the sender</param>
        /// <param name="currentTitle">the current title being scanned</param>
        /// <param name="titleCount">the total number of titles</param>
        private void OnScanProgress(object sender, int currentTitle, int titleCount)
        {
            ScanProgressEventArgs eventArgs = new ScanProgressEventArgs
            {
                CurrentTitle = currentTitle,
                Titles = titleCount
            };

            if (this.ScanStatusChanged != null)
            {
                this.ScanStatusChanged(this, eventArgs);
            }
        }
コード例 #4
0
 /// <summary>
 /// Scan Status has changed, update log window.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void ScanServiceScanStatusChanged(object sender, ScanProgressEventArgs e)
 {
     this.NotifyOfPropertyChange(() => this.ScanLog);
 }
コード例 #5
0
ファイル: ServerService.cs プロジェクト: evolver56k/HandBrake
 /// <summary>
 /// The scan service scan status changed event handler
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void ScanStatusChangedHandler(object sender, ScanProgressEventArgs e)
 {
     Subscribers.ForEach(
         delegate(IHbServiceCallback callback)
             {
                 if (((ICommunicationObject)callback).State == CommunicationState.Opened)
                 {
                     Console.WriteLine("Scan Changed Callback");
                     callback.ScanProgressCallback(e);
                 }
                 else
                 {
                     Subscribers.Remove(callback);
                 }
             });
 }
コード例 #6
0
        /// <summary>
        /// The scan progress callback.
        /// </summary>
        /// <param name="eventArgs">
        /// The event args.
        /// </param>
        public override void ScanProgressCallback(ScanProgressEventArgs eventArgs)
        {
            if (this.ScanStatusChanged != null)
            {
                ThreadPool.QueueUserWorkItem(delegate { this.ScanStatusChanged(this, eventArgs); });
            }

            base.ScanProgressCallback(eventArgs);
        }
コード例 #7
0
 /// <summary>
 /// The scan progress.
 /// </summary>
 /// <param name="eventArgs">
 /// The event args.
 /// </param>
 public virtual void ScanProgressCallback(ScanProgressEventArgs eventArgs)
 {
 }
コード例 #8
0
 /// <summary>
 /// Handle the Scan Status Changed Event.
 /// </summary>
 /// <param name="sender">
 /// The Sender
 /// </param>
 /// <param name="e">
 /// The EventArgs
 /// </param>
 private void ScanStatusChanged(object sender, ScanProgressEventArgs e)
 {
     this.SourceLabel = string.Format("Scanning Title {0} of {1} ({2}%)", e.CurrentTitle, e.Titles, e.Percentage);
     this.StatusLabel = string.Format("Scanning Title {0} of {1} ({2}%)", e.CurrentTitle, e.Titles, e.Percentage);
 }