Created
February 23, 2012 10:49
-
-
Save JakeGinnivan/1892233 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Office.Interop.Outlook; | |
using VSTOContrib.Outlook; | |
namespace GithubForOutlook.Logic | |
{ | |
public class GithubTaskAdapter | |
{ | |
private const string Githubissueid = "GithubIssueId"; | |
private readonly TaskItem outlookTask; | |
private bool? isGithubTask; | |
public GithubTaskAdapter(TaskItem outlookTask) | |
{ | |
this.outlookTask = outlookTask; | |
} | |
public bool IsGithubTask | |
{ | |
get | |
{ | |
if (isGithubTask == null) | |
{ | |
isGithubTask = CheckIfGithubTask(); | |
} | |
return isGithubTask.Value; | |
} | |
set | |
{ | |
isGithubTask = value; | |
outlookTask.SetPropertyValue(Githubissueid, OlUserPropertyType.olInteger, value, true); | |
} | |
} | |
private bool CheckIfGithubTask() | |
{ | |
var issueId = outlookTask.GetPropertyValue(Githubissueid, OlUserPropertyType.olInteger, false, o=>(int?)o, null); | |
return issueId != null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment