1
0
mirror of https://github.com/Kopano-dev/kopano-ol-extension.git synced 2023-10-10 13:37:40 +02:00

Removed debug logging

This commit is contained in:
Patrick Simpson 2017-02-14 15:48:13 +01:00
parent 80735cbaa0
commit 33e38f16dc

View File

@ -202,21 +202,16 @@ namespace Acacia.Utils
{ {
private IItem _item; private IItem _item;
private readonly MailEvents _events; private readonly MailEvents _events;
// TODO: remove id and debug logging
private int _id;
private static int nextId;
public MailEventHooker(IItem item, MailEvents events) public MailEventHooker(IItem item, MailEvents events)
{ {
this._item = item; this._item = item;
this._id = ++nextId;
this._events = events; this._events = events;
HookEvents(true); HookEvents(true);
} }
protected override void DoRelease() protected override void DoRelease()
{ {
Logger.Instance.Debug(this, "DoRelease: {0}", _id);
_item.Dispose(); _item.Dispose();
} }
@ -250,37 +245,31 @@ namespace Acacia.Utils
private void HandleBeforeDelete(object item, ref bool cancel) private void HandleBeforeDelete(object item, ref bool cancel)
{ {
Logger.Instance.Debug(this, "HandleBeforeDelete: {0}", _id);
_events.OnBeforeDelete(item.WrapOrDefault<IItem>(), ref cancel); _events.OnBeforeDelete(item.WrapOrDefault<IItem>(), ref cancel);
} }
private void HandleForward(object response, ref bool cancel) private void HandleForward(object response, ref bool cancel)
{ {
Logger.Instance.Debug(this, "HandleForward: {0}", _id);
_events.OnForward(_item as IMailItem, response.WrapOrDefault<IMailItem>()); _events.OnForward(_item as IMailItem, response.WrapOrDefault<IMailItem>());
} }
private void HandleRead() private void HandleRead()
{ {
Logger.Instance.Debug(this, "HandleRead: {0}", _id);
_events.OnRead(_item as IMailItem); _events.OnRead(_item as IMailItem);
} }
private void HandleReply(object response, ref bool cancel) private void HandleReply(object response, ref bool cancel)
{ {
Logger.Instance.Debug(this, "HandleReply: {0}", _id);
_events.OnReply(_item as IMailItem, response.WrapOrDefault<IMailItem>()); _events.OnReply(_item as IMailItem, response.WrapOrDefault<IMailItem>());
} }
private void HandleReplyAll(object response, ref bool cancel) private void HandleReplyAll(object response, ref bool cancel)
{ {
Logger.Instance.Debug(this, "HandleReplyAll: {0}", _id);
_events.OnReplyAll(_item as IMailItem, response.WrapOrDefault<IMailItem>()); _events.OnReplyAll(_item as IMailItem, response.WrapOrDefault<IMailItem>());
} }
private void HandleUnload() private void HandleUnload()
{ {
Logger.Instance.Debug(this, "HandleUnload: {0}", _id);
// All events must be unhooked on unload, otherwise a resource leak is created. // All events must be unhooked on unload, otherwise a resource leak is created.
HookEvents(false); HookEvents(false);
Dispose(); Dispose();
@ -288,7 +277,6 @@ namespace Acacia.Utils
private void HandleWrite(ref bool cancel) private void HandleWrite(ref bool cancel)
{ {
Logger.Instance.Debug(this, "HandleWrite: {0}", _id);
_events.OnWrite(_item, ref cancel); _events.OnWrite(_item, ref cancel);
} }
} }