Making the plugins behave more stable, fixing a part of Bug #3528518

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1899 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-05-23 09:21:02 +00:00
commit 2d88d8e588
5 changed files with 98 additions and 47 deletions

View file

@ -40,19 +40,28 @@ namespace GreenshotConfluencePlugin {
private static ConfluenceConfiguration config = IniConfig.GetIniSection<ConfluenceConfiguration>();
private static Image confluenceIcon = null;
private Confluence.Page page;
public static bool IsInitialized {
get;
private set;
}
static ConfluenceDestination() {
Uri confluenceIconUri = new Uri("/GreenshotConfluencePlugin;component/Images/Confluence.ico", UriKind.Relative);
using (Stream iconStream = Application.GetResourceStream(confluenceIconUri).Stream) {
using (Image tmpImage = Image.FromStream(iconStream)) {
confluenceIcon = ImageHelper.Clone(tmpImage);
IsInitialized = false;
try {
Uri confluenceIconUri = new Uri("/GreenshotConfluencePlugin;component/Images/Confluence.ico", UriKind.Relative);
using (Stream iconStream = Application.GetResourceStream(confluenceIconUri).Stream) {
using (Image tmpImage = Image.FromStream(iconStream)) {
confluenceIcon = ImageHelper.Clone(tmpImage);
}
}
IsInitialized = true;
} catch (Exception ex) {
LOG.ErrorFormat("Problem in the confluence static initializer: {0}", ex.Message);
}
}
public ConfluenceDestination() {
}
public ConfluenceDestination(Confluence.Page page) {
this.page = page;
}