Particls helps you track your favorite sites and apps by displaying desktop alerts for important changes.
The real power in Particls, however, is that it's a platform. A platform for Attention Management. This wiki will help you leverage that platform to help users pay attention to the stuff that matters to them.
Writing an Output Adapter for Particls is not a complex exercise.
To get started, create a new Class Library project. In this page, I'll discuss implementing a C# adapter, however nothing stops the same being done in any other .NET language (such as VB.NET or even J#.NET).
To be able to implement a Particls Output Adapter, your project will need to reference Particls.Core.dll (in Program Files\Particls).
In your class Library, create a class that implements Particls.Core.Adapters.IOutputAdapter. This interface requires implementing the following methods:
And thats it. Five methods to implement. Now, for a simple implementation.
using System;
using System.IO;
using Particls.Core;
using Particls.Core.Adapters;
using Particls.Core.Entities;
namespace Particls.SDK.Output.LoggingAdapter {
public class AdapterBase : IOutputAdapter {
private string mOutputFile = @"C:LogOutput.txt";
private TextWriter mOutput;
private bool mShouldWrite = false;
public ItemStatus AddItem(Item objItem) {
if (!mShouldWrite) return ItemStatus.Success;
if (objItem.State == ITEMSTATE.NEW) {
mOutput.WriteLine(string.Format("{0} {1} {2}", objItem.iAmValue, objItem.Title, objItem.Description));
mOutput.Flush();
}
return ItemStatus.Success;
}
public void Init() {
mOutput = new StreamWriter(mOutputFile, true);
}
public void Finish() {
mOutput.Close();
}
public ItemStatus Start() {
mShouldWrite = true;
return ItemStatus.Failed;
}
public ItemStatus Pause() {
mShouldWrite = false;
return ItemStatus.Failed;
}
}
}
Build the adapter, and put the resulting Adapter in your Program Files\Particls\Adapters directory. Start (or restart) Particls. The spam should arrive in no time!
Page Information
|
Wiki Information |
Recent PBwiki Blog Posts |