OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / UpdateCheckInformation.cs
1 using System;\r
2 using System.Threading;\r
3 \r
4 namespace Handbrake.Functions\r
5 {\r
6     /// <summary>\r
7     /// Provides information about an update check.\r
8     /// </summary>\r
9     public struct UpdateCheckInformation\r
10     {\r
11         public bool NewVersionAvailable { get; set; }\r
12         public bool ErrorOccured { get { return Error != null; } }\r
13 \r
14         /// <summary>\r
15         /// Gets information about the new build, if any. This will be null if there is no new verison.\r
16         /// </summary>\r
17         public AppcastReader BuildInformation { get; set; }\r
18 \r
19         /// <summary>\r
20         /// Gets the error that occurred, if any. This will be null if no error occured.\r
21         /// </summary>\r
22         public Exception Error { get; set; }\r
23     }\r
24 \r
25     /// <summary>\r
26     /// Used in EndUpdateCheck() for update checking and the IAsyncResult design pattern.\r
27     /// </summary>\r
28     public class UpdateCheckResult : IAsyncResult\r
29     {\r
30         public UpdateCheckResult(object asyncState, UpdateCheckInformation info)\r
31         {\r
32             AsyncState = asyncState;\r
33             Result = info;\r
34         }\r
35 \r
36         /// <summary>\r
37         /// Gets whether the check was executed in debug mode.\r
38         /// </summary>\r
39         public object AsyncState { get; private set; }\r
40 \r
41         /// <summary>\r
42         /// Gets the result of the update check.\r
43         /// </summary>\r
44         public UpdateCheckInformation Result { get; private set; }\r
45 \r
46         public WaitHandle AsyncWaitHandle { get { throw new NotImplementedException(); } }\r
47         public bool CompletedSynchronously { get { throw new NotImplementedException(); } }\r
48         public bool IsCompleted { get { throw new NotImplementedException(); } }\r
49     }\r
50 }\r