ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/gr2lib/trunk/gr2lib/core/exceptions/granny2apiloadexception.cs
(Generate patch)

Comparing trunk/gr2lib/core/exceptions/granny2apiloadexception.cs (file contents):
Revision 48 by william, Thu Jul 15 07:29:23 2010 UTC vs.
Revision 49 by william, Thu Jul 15 07:39:08 2010 UTC

# Line 1 | Line 1
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
# Line 26 | Line 28 | namespace gr2lib.core.exceptions
28              }
29          }
30  
31 <        #region public class granny2dllnotfoundexception
31 >        #region private class granny2dllnotfoundexception
32          [Serializable()]
33          private class granny2dllnotfoundexception : System.Exception, ISerializable
34          {
# Line 37 | Line 39 | namespace gr2lib.core.exceptions
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          }
# Line 47 | Line 50 | namespace gr2lib.core.exceptions
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines