/[gr2lib]/trunk/gr2lib/core/coretypes/implementation/granny_log_callback_builder.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/coretypes/implementation/granny_log_callback_builder.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 187 by william, Sat Jul 24 04:16:43 2010 UTC revision 191 by william, Sat Jul 24 06:31:50 2010 UTC
# Line 131  namespace gr2lib.core.coretypes.implemen Line 131  namespace gr2lib.core.coretypes.implemen
131          /// <summary>          /// <summary>
132          /// Get Message Log Type name          /// Get Message Log Type name
133          /// </summary>          /// </summary>
134          public string TypeString { get { return coreapi.GrannyGetLogMessageTypeString(type); } }          public string TypeString { get { return coreapi.EnumToStringSupport.GrannyGetLogMessageTypeString(type); } }
135          /// <summary>          /// <summary>
136          /// Get Message Log Origin name          /// Get Message Log Origin name
137          /// </summary>          /// </summary>
138          public string OriginString { get { return coreapi.GrannyGetLogMessageOriginString(origin); } }          public string OriginString { get { return coreapi.EnumToStringSupport.GrannyGetLogMessageOriginString(origin); } }
139          /// <summary>          /// <summary>
140          /// Get the Message          /// Get the Message
141          /// </summary>          /// </summary>
# Line 193  namespace gr2lib.core.coretypes.implemen Line 193  namespace gr2lib.core.coretypes.implemen
193          #region Log Call Back          #region Log Call Back
194          private void LogCallback(granny_log_message_type Type, granny_log_message_origin Origin, [MarshalAs(UnmanagedType.LPStr)] string Message, IntPtr UserData)          private void LogCallback(granny_log_message_type Type, granny_log_message_origin Origin, [MarshalAs(UnmanagedType.LPStr)] string Message, IntPtr UserData)
195          {                    {          
196              string TypeString = coreapi.GrannyGetLogMessageTypeString(Type);              string TypeString = coreapi.EnumToStringSupport.GrannyGetLogMessageTypeString(Type);
197              string OriginString = coreapi.GrannyGetLogMessageOriginString(Origin);              string OriginString = coreapi.EnumToStringSupport.GrannyGetLogMessageOriginString(Origin);
198    
199              switch (Type)              switch (Type)
200              {              {
# Line 276  namespace gr2lib.core.coretypes.implemen Line 276  namespace gr2lib.core.coretypes.implemen
276                  _log_call_back.Function = _callback;                  _log_call_back.Function = _callback;
277                  _log_call_back.UserData = IntPtr.Zero;                  _log_call_back.UserData = IntPtr.Zero;
278                  GC.KeepAlive(this);                  GC.KeepAlive(this);
279                  coreapi.GrannySetLogCallback(ref _log_call_back);                  coreapi.LoggingSupport.GrannySetLogCallback(ref _log_call_back);
280                                    
281                  Console.WriteLine("Granny2 API Logger: {0}", "Activated");                  Console.WriteLine("Granny2 API Logger: {0}", "Activated");
282              }              }
# Line 301  namespace gr2lib.core.coretypes.implemen Line 301  namespace gr2lib.core.coretypes.implemen
301                  granny_log_callback_method _granny_log_callback_method = null;                  granny_log_callback_method _granny_log_callback_method = null;
302                  _log_call_back.Function = _granny_log_callback_method;                  _log_call_back.Function = _granny_log_callback_method;
303                  _log_call_back.UserData = IntPtr.Zero;                  _log_call_back.UserData = IntPtr.Zero;
304                  coreapi.GrannySetLogCallback(ref _log_call_back);                  coreapi.LoggingSupport.GrannySetLogCallback(ref _log_call_back);
305                  Console.WriteLine("Granny2 API Logger: {0}", "Deactivated");                  Console.WriteLine("Granny2 API Logger: {0}", "Deactivated");
306              }              }
307              catch              catch

Legend:
Removed from v.187  
changed lines
  Added in v.191

  ViewVC Help
Powered by ViewVC 1.1.22