Welcome to TimeSnapper Forums Sign in | Join | Faq

Help Needed

Started by Jason_Grigsby at 03-10-2009 20:06. Topic has 5 replies.

Print Search
Sort Posts:    
   03-10-2009, 20:06
Jason_Grigsby is not online. Last active: 3/11/2009 11:07:17 PM Jason_Grigsby

Top 50 Posts
Joined on 03-11-2009
Posts 3
CSharpSamplePlugin doesn't seem to be loading
Reply Quote
I haven't looked into this much yet but figure I would let you know.  I loaded up the sample project and changed the reference to point to iTimeSnapperPlugin.dll and did a build with no problems. So I dropped the resulting CSharpSamplePlugin.dll file into my plugins directory but it doesn't appear in the plugins dropdown in the options.  There's also nothing in the timesnapper log file about any errors.

I did a build using the VB sample project and followed basically the same procedure and it works fine.. appears in the dropdown and all that good stuff so it's just the C# sample.

   Report 
   03-11-2009, 4:42
secretGeek is not online. Last active: 1/28/2009 7:12:39 PM secretGeek



Top 10 Posts
Joined on 05-30-2006
Brisbane
Posts 58
Cool [H] Re: CSharpSamplePlugin doesn't seem to be loading
Reply Quote
Excellent description Jason.

I'll give it a try and see what I can discover. (Those samples were put together a bit too hastily, sorry)
lb
.: http://secretGeek.net :: dot Nuts about dot Net :.
   Report 
   03-12-2009, 0:08
secretGeek is not online. Last active: 1/28/2009 7:12:39 PM secretGeek



Top 10 Posts
Joined on 05-30-2006
Brisbane
Posts 58
Cool [H] Re: CSharpSamplePlugin doesn't seem to be loading
Reply Quote

Aha! I found one interesting trick.

"class AnotherPluginSample : ITimeSnapperPlugin"

is not declared as public.

Hence, timesnapper doesn't find that class when it goes hunting for plugins.

Also, generally, the code in those samples needs to be fleshed out... Not implemented exceptions need to be replaced with your own choice of implementation.

Here's a more complete version of 'AnotherSamplePlugin'...

using System;

using System.Diagnostics;

using TimeSnapperPluginAPI;

namespace CSharpSamplePlugin

{

   public class AnotherPluginSample : ITimeSnapperPlugin

   {

      bool ITimeSnapperPlugin.Configurable

      {  get { return false; }}

      void ITimeSnapperPlugin.Configure()

      {

         throw new NotImplementedException();

      }

      string ITimeSnapperPlugin.Description

      {

         get { return "Hello from another"; }

      }

      string ITimeSnapperPlugin.FriendlyName

      {

         get { return "Another"; }

      }

      object ITimeSnapperPlugin.HandleEvent(TimeSnapperEvent TimeSnapperEvent, EventArgs args)

      {

         switch (TimeSnapperEvent)

         {

         case TimeSnapperEvent.FlagSaved :

            Debug.WriteLine("A flag was saved");

            break;

         case TimeSnapperEvent.SnapshotSaved :

            Debug.WriteLine("A snapshot was saved");

            break;

      default:

            Debug.Assert(false, "Hey! I didn't subscribe to " + TimeSnapperEvent.ToString() + "... why am I being      notified?");

            break;

      }

      return null;

  }

TimeSnapperMenuItem[] ITimeSnapperPlugin.MenuItems()

{

   return null;

 }

Guid ITimeSnapperPlugin.PluginID

{

get

{

      return new Guid("E569317D-1F8D-4c51-BA91-D7EA0375B8CD");

}

}

   TimeSnapperEvent[] ITimeSnapperPlugin.SubscribesTo()

   {

   return new TimeSnapperEvent[] { TimeSnapperEvent.FlagSaved,

   TimeSnapperEvent.SnapshotSaved };

}

}

}


.: http://secretGeek.net :: dot Nuts about dot Net :.
   Report 
   03-12-2009, 6:22
secretGeek is not online. Last active: 1/28/2009 7:12:39 PM secretGeek



Top 10 Posts
Joined on 05-30-2006
Brisbane
Posts 58
Confused [8-)] Re: CSharpSamplePlugin doesn't seem to be loading
Reply Quote
By the way, i've updated the c sharp sample, linked to from the plugin FAQ
http://timesnapper.com/pluginhowto.aspx
and available at:
http://timesnapper.com/Downloads/SamplePlugin_CSharp.zip

I've also been asked, off line, to provide further details about what can be done inside each of the events -- so i'll be writing more about that as soon as I get a chance.

(I've also fielded a few thorny questions about my choice of implementation technique... there's certainly many ways to implement a plugin API!)
.: http://secretGeek.net :: dot Nuts about dot Net :.
   Report 
   03-13-2009, 19:35
Jason_Grigsby is not online. Last active: 3/11/2009 11:07:17 PM Jason_Grigsby

Top 50 Posts
Joined on 03-11-2009
Posts 3
Re: CSharpSamplePlugin doesn't seem to be loading
Reply Quote
Excellent, thank you.  I will check it out.

   Report 
   03-14-2009, 20:39
secretGeek is not online. Last active: 1/28/2009 7:12:39 PM secretGeek



Top 10 Posts
Joined on 05-30-2006
Brisbane
Posts 58
Cool [H] Re: CSharpSamplePlugin doesn't seem to be loading
Reply Quote

I've added another Plugin example inside the CSharp sample project.

It's a logging sample that is much more thorough than the other examples. It shows a lot more about what can be done with a TimeSnapper event.


.: http://secretGeek.net :: dot Nuts about dot Net :.
   Report 
TimeSnapper For... » TimeSnapper » Help Needed » CSharpSamplePlugin doesn't seem to be loading

Powered by Community Server, by Telligent Systems