@@ -28,6 +28,20 @@ public static partial class ParseClient {
28
28
"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'f'Z'" ,
29
29
} ;
30
30
31
+ /// <summary>
32
+ /// Represents the configuration of the Parse SDK.
33
+ /// </summary>
34
+ public struct Configuration {
35
+ /// <summary>
36
+ /// The Parse.com application ID of your app.
37
+ /// </summary>
38
+ public String ApplicationId { get ; set ; }
39
+
40
+ /// <summary>
41
+ /// The Parse.com .NET key for your app.
42
+ /// </summary>
43
+ public String WindowsKey { get ; set ; }
44
+ }
31
45
32
46
private static readonly object mutex = new object ( ) ;
33
47
private static readonly string [ ] assemblyNames = {
@@ -60,10 +74,12 @@ private static Type GetParseType(string name) {
60
74
private static readonly IParseCommandRunner commandRunner ;
61
75
internal static IParseCommandRunner ParseCommandRunner { get { return commandRunner ; } }
62
76
77
+ /// <summary>
78
+ /// The current configuration that parse has been initialized with.
79
+ /// </summary>
80
+ public static Configuration CurrentConfiguration { get ; internal set ; }
63
81
internal static Uri HostName { get ; set ; }
64
82
internal static string MasterKey { get ; set ; }
65
- internal static string ApplicationId { get ; set ; }
66
- internal static string WindowsKey { get ; set ; }
67
83
68
84
internal static Version Version {
69
85
get {
@@ -90,10 +106,24 @@ internal static string VersionString {
90
106
/// <param name="dotnetKey">The .NET API Key provided in the Parse dashboard.
91
107
/// </param>
92
108
public static void Initialize ( string applicationId , string dotnetKey ) {
109
+ Initialize ( new Configuration {
110
+ ApplicationId = applicationId ,
111
+ WindowsKey = dotnetKey
112
+ } ) ;
113
+ }
114
+
115
+ /// <summary>
116
+ /// Authenticates this client as belonging to your application. This must be
117
+ /// called before your application can use the Parse library. The recommended
118
+ /// way is to put a call to <c>ParseFramework.Initialize</c> in your
119
+ /// Application startup.
120
+ /// </summary>
121
+ /// <param name="configuration">The configuration to initialze Parse with.
122
+ /// </param>
123
+ public static void Initialize ( Configuration configuration ) {
93
124
lock ( mutex ) {
94
125
HostName = HostName ?? new Uri ( "https://api.parse.com/1/" ) ;
95
- ApplicationId = applicationId ;
96
- WindowsKey = dotnetKey ;
126
+ CurrentConfiguration = configuration ;
97
127
98
128
ParseObject . RegisterSubclass < ParseUser > ( ) ;
99
129
ParseObject . RegisterSubclass < ParseInstallation > ( ) ;
0 commit comments