IProgressEvents.cs :  » GUI » Paint.net » PaintDotNet » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » GUI » Paint.net 
Paint.net » PaintDotNet » IProgressEvents.cs
////////////////////////////////////////////////////////////////////////////////
// Paint.NET                                                                   //
// Copyright (C) dotPDN LLC, Rick Brewster, Tom Jackson, and contributors.     //
// Portions Copyright (C) Microsoft Corporation. All Rights Reserved.          //
// See src/Resources/Files/License.txt for full licensing and attribution      //
// details.                                                                    //
// .                                                                           //
/////////////////////////////////////////////////////////////////////////////////

using System;
using System.Windows.Forms;

namespace PaintDotNet{
    public interface IProgressEvents<TItemInfo>
    {
        /// <summary>
        /// This method is called at the very beginning of the operation.
        /// </summary>
        /// <param name="owner">
        /// If the operation has a modal window open, this represents it. Otherwise, this is null and you should 
        /// use your own current modal window.</param>
        /// <param name="callWhenUIShown">
        /// You must call this method after initializing any UI you want to display. 
        /// If you will not be displaying UI, you must call this anyway.</param>
        /// <param name="cancelSink">
        /// An object that can be used to cancel the operation at any time after callWhenUIShown is invoked, 
        /// and any time before EndOperation() is called.
        /// </param>
        /// <remarks>
        /// This method must not return until EndOperation() is called. Note that EndOperation() will
        /// be called from a separate thread. 
        /// </remarks>
        void BeginOperation(IWin32Window owner, EventHandler callWhenUIShown, ICancelable cancelSink);

        /// <summary>
        /// Called to report the total number of work items that are part of the operation.
        /// </summary>
        /// <param name="itemCount">The total number of work items that are part of the operation.</param>
        void SetItemCount(int itemCount);

        /// <summary>
        /// Called to change which work item of the operation is in progress.
        /// </summary>
        /// <param name="itemOrdinal"></param>
        /// <remarks>
        /// This method is called after BeginOperation() but before BeginItem(),
        /// or after EndItem() but before BeginItem(). 
        /// </remarks>
        void SetItemOrdinal(int itemOrdinal);

        /// <summary>
        /// Called to report information about the current work item.
        /// </summary>
        /// <param name="itemInfo">Operation-dependent information about the current work item.</param>
        void SetItemInfo(TItemInfo itemInfo);

        /// <summary>
        /// Reports the total number of work units that are involved in completing the current work item.
        /// </summary>
        /// <param name="totalWork">The total number of work units that comprise the current work item.</param>
        void SetItemWorkTotal(long totalWork);

        /// <summary>
        /// Called when a work item is starting.
        /// </summary>
        /// <param name="itemName"></param>
        void BeginItem();

        /// <summary>
        /// Reports the total amount of progress for the current work item.
        /// </summary>
        /// <param name="totalProgress">The total number of work units that have completed for the current work item.</param>
        void SetItemWorkProgress(long totalProgress);

        /// <summary>
        /// Called when there is an error while completing the current work item.
        /// </summary>
        /// <param name="ex">The exception that was encountered while completing the current work item.</param>
        /// <returns>You must return a value from the ItemFailedUserChoice enumeration.</returns>
        WorkItemFailureAction ReportItemFailure(Exception ex);

        /// <summary>
        /// Called after a work item is finished.
        /// </summary>
        void EndItem(WorkItemResult result);

        /// <summary>
        /// Called after the operation is complete.
        /// </summary>
        /// <param name="result">Indicates whether the operation finished, or was cancelled.</param>
        /// <remarks>
        /// Even if the operation finished, individual work items may not have succeeded.
        /// You will need to track the data passed to to EndItem() ReportItemError() to be able to monitor this.
        /// You must close any UI shown during BeginOperation(), and then return from that method.
        /// </remarks>
        void EndOperation(OperationResult result);
    }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.