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

Comparing trunk/gr2lib/core/coreclasses/header/granny_reference.cs (file contents):
Revision 94 by william, Sat Jul 17 05:09:42 2010 UTC vs.
Revision 102 by william, Sat Jul 17 13:54:18 2010 UTC

--- trunk/gr2lib/core/coreclasses/header/granny_reference.cs	2010/07/17 05:09:42	94
+++ trunk/gr2lib/core/coreclasses/header/granny_reference.cs	2010/07/17 13:54:18	102
@@ -1,4 +1,5 @@
-´╗┐using System;
+´╗┐//#define HAVE_GRN_REFERENCE // when defined enabled GRN_REFERNCE in Header, else it is disabled
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,6 +9,7 @@ using gr2lib.core.helpers;
 
 namespace gr2lib.core.coreclasses.header
 {
+#if HAVE_GRN_REFERENCE
     public class granny_reference : igranny_reference
     {
 
@@ -26,10 +28,12 @@ namespace gr2lib.core.coreclasses.header
                 managed.NativePointer = pointer;
                 return managed;
             }
-            catch (Exception ex)
+          catch
             {
                 StackTrace st = new StackTrace(true);
-                Console.WriteLine(st.ToString() + "\n\n" + "Stack Trace: \n" + ex.ToString());
+#if  ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE
+                Console.WriteLine(st.ToString());
+#endif
                 return default(granny_reference);
             }
         }
@@ -43,25 +47,28 @@ namespace gr2lib.core.coreclasses.header
                 managed.Offset = native.Offset;
                 return managed;
             }
-            catch (Exception ex)
+           catch
             {
                 StackTrace st = new StackTrace(true);
-                Console.WriteLine(st.ToString() + "\n\n" + "Stack Trace: \n" + ex.ToString());
+#if  ENABLE_EXCEPTION_OUTPUT_TO_CONSOLE
+                Console.WriteLine(st.ToString());
+#endif
                 return default(granny_reference);
             }
         }
 
-        #region INativePointer Members
+    #region INativePointer Members
         private IntPtr _NativePointer;
         public IntPtr NativePointer { get { return _NativePointer; } set { _NativePointer = value; } }
-        #endregion
+    #endregion
 
-        #region igranny_reference members
+    #region igranny_reference members
         private Int32 _SectionIndex;
         private Int32 _Offset;
 
         public Int32 SectionIndex { get { return _SectionIndex; } set { _SectionIndex = value; } }
         public Int32 Offset { get { return _Offset; } set { _Offset = value; } }
-        #endregion
+    #endregion
     }
+#endif
 }