1 |
|
using System; |
2 |
|
using System.Collections.Generic; |
3 |
|
using System.Text; |
4 |
< |
|
4 |
> |
using System.Windows.Forms; |
5 |
|
using System.Runtime.Serialization; |
6 |
|
|
7 |
|
namespace gr2lib.core.exceptions |
8 |
|
{ |
9 |
+ |
|
10 |
+ |
|
11 |
|
#region Granny2 API Load Exceptions |
12 |
|
|
13 |
|
#region public class granny2apiloadexception |
28 |
|
} |
29 |
|
} |
30 |
|
|
31 |
< |
#region public class granny2dllnotfoundexception |
31 |
> |
#region private class granny2dllnotfoundexception |
32 |
|
[Serializable()] |
33 |
|
private class granny2dllnotfoundexception : System.Exception, ISerializable |
34 |
|
{ |
39 |
|
return this.InnerException.Message + " was not found."; |
40 |
|
} |
41 |
|
} |
42 |
< |
public granny2dllnotfoundexception() : this(new System.IO.FileNotFoundException("granny2.dll")) { } |
42 |
> |
|
43 |
> |
public granny2dllnotfoundexception() : this(new System.IO.FileNotFoundException(core.sharedio.granny_dll)) { } |
44 |
|
private granny2dllnotfoundexception(Exception inner) : base("", inner) { } |
45 |
|
protected granny2dllnotfoundexception(SerializationInfo info, StreamingContext context) : base(info, context) { } |
46 |
|
} |
50 |
|
#endregion |
51 |
|
|
52 |
|
|
53 |
+ |
#region public class granny2apiloader |
54 |
+ |
public class granny2apiloader |
55 |
+ |
{ |
56 |
+ |
string application_path; |
57 |
+ |
public granny2apiloader() |
58 |
+ |
{ |
59 |
+ |
application_path = Application.StartupPath; |
60 |
+ |
|
61 |
+ |
if (!System.IO.File.Exists(core.sharedio.granny_dll)) |
62 |
+ |
{ |
63 |
+ |
throw new granny2apiloadexception(); |
64 |
+ |
} |
65 |
+ |
|
66 |
+ |
} |
67 |
+ |
} |
68 |
+ |
#endregion |
69 |
+ |
|
70 |
|
#endregion |
71 |
|
} |
72 |
|
|