kopano-ol-extension/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/TaskItemWrapper.cs

91 lines
2.4 KiB
C#
Raw Normal View History

2016-12-21 12:53:16 +01:00
/// Copyright 2016 Kopano b.v.
///
/// This program is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License, version 3,
/// as published by the Free Software Foundation.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
/// GNU Affero General Public License for more details.
///
/// You should have received a copy of the GNU Affero General Public License
/// along with this program.If not, see<http://www.gnu.org/licenses/>.
///
/// Consult LICENSE file for details
using Acacia.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
2017-02-08 15:40:48 +01:00
using NSOutlook = Microsoft.Office.Interop.Outlook;
2016-12-21 12:53:16 +01:00
namespace Acacia.Stubs.OutlookWrappers
{
class TaskItemWrapper : OutlookItemWrapper<NSOutlook.TaskItem>, ITaskItem
2016-12-21 12:53:16 +01:00
{
2017-02-08 15:40:48 +01:00
internal TaskItemWrapper(NSOutlook.TaskItem item)
2016-12-21 12:53:16 +01:00
:
base(item)
{
}
2017-02-08 15:40:48 +01:00
#region Wrapper methods
protected override NSOutlook.UserProperties GetUserProperties()
{
return _item.UserProperties;
}
protected override NSOutlook.PropertyAccessor GetPropertyAccessor()
2016-12-21 12:53:16 +01:00
{
return _item.PropertyAccessor;
}
2017-02-08 15:40:48 +01:00
public override string ToString()
{
return "Task:" + Subject;
}
#endregion
2016-12-21 12:53:16 +01:00
2017-02-08 15:40:48 +01:00
#region IItem implementation
2016-12-21 12:53:16 +01:00
public string Body
{
get { return _item.Body; }
set { _item.Body = value; }
}
public string Subject
{
get { return _item.Subject; }
2017-02-08 15:40:48 +01:00
set { _item.Subject = value; }
2016-12-21 12:53:16 +01:00
}
2017-02-08 15:40:48 +01:00
public void Save() { _item.Save(); }
2016-12-21 12:53:16 +01:00
#endregion
2017-02-08 15:40:48 +01:00
#region IBase implementation
2016-12-21 12:53:16 +01:00
override public string EntryID { get { return _item.EntryID; } }
2016-12-21 12:53:16 +01:00
override protected IFolder ParentUnchecked
2016-12-21 12:53:16 +01:00
{
2017-02-08 15:40:48 +01:00
get
{
// The wrapper manages the returned folder
return Mapping.Wrap<IFolder>(_item.Parent as NSOutlook.Folder);
}
2016-12-21 12:53:16 +01:00
}
2017-02-08 15:40:48 +01:00
override public void Delete() { _item.Delete(); }
2017-02-08 15:40:48 +01:00
#endregion
2016-12-21 12:53:16 +01:00
}
}