From c817c5968942ba9417b02f3cf222e108bb0a95d8 Mon Sep 17 00:00:00 2001 From: KOE_Export_Strings_Commit Date: Wed, 5 Jul 2017 14:24:30 +0200 Subject: [PATCH 1/3] Commit strings #209 --- translations/KOE.pot | 48 ++++++++++++++++++++++++++++++-------- translations/de.po | 30 ++++++++++++++++++++++++ translations/en.po | 54 +++++++++++++++++++++++++++++++++---------- translations/fr.po | 30 ++++++++++++++++++++++++ translations/hu.po | 30 ++++++++++++++++++++++++ translations/it.po | 30 ++++++++++++++++++++++++ translations/nb.po | 30 ++++++++++++++++++++++++ translations/nl.po | 30 ++++++++++++++++++++++++ translations/pt_br.po | 30 ++++++++++++++++++++++++ 9 files changed, 291 insertions(+), 21 deletions(-) diff --git a/translations/KOE.pot b/translations/KOE.pot index 3fb5ac9..e8588f5 100644 --- a/translations/KOE.pot +++ b/translations/KOE.pot @@ -76,22 +76,22 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnLine.Text msgid "Line" msgstr "" -#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabProperties.Text +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text #, csharp-format -msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabProperties.Text" -msgid "General" +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" msgstr "" -#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabWrapperTypes.Text +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text #, csharp-format -msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabWrapperTypes.Text" -msgid "Wrapper types" +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" msgstr "" -#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabWrapperLocations.Text +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text #, csharp-format -msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabWrapperLocations.Text" -msgid "Wrapper locations" +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" msgstr "" #: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\buttonGC.Text @@ -118,6 +118,12 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\buttonLog.Text" msgid "Log" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabProperties.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabProperties.Text" +msgid "General" +msgstr "" + #: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnHeader1.Text #, csharp-format msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader1.Text" @@ -130,6 +136,12 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader2.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabWrapperTypes.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabWrapperTypes.Text" +msgid "Wrapper types" +msgstr "" + #: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnHeader3.Text #, csharp-format msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader3.Text" @@ -142,6 +154,24 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabWrapperLocations.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabWrapperLocations.Text" +msgid "Wrapper locations" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "" + #: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\$this.Text #, csharp-format msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\$this.Text" diff --git a/translations/de.po b/translations/de.po index 445fa9c..2268a4d 100644 --- a/translations/de.po +++ b/translations/de.po @@ -1283,3 +1283,33 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "" + diff --git a/translations/en.po b/translations/en.po index 80c56ff..6392b9b 100644 --- a/translations/en.po +++ b/translations/en.po @@ -76,23 +76,23 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnLine.Text msgid "Line" msgstr "Line" -#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabProperties.Text +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text #, csharp-format -msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabProperties.Text" -msgid "General" -msgstr "General" +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" +msgstr "Event" -#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabWrapperTypes.Text +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text #, csharp-format -msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabWrapperTypes.Text" -msgid "Wrapper types" -msgstr "Wrapper types" +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" +msgstr "Count" -#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabWrapperLocations.Text +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text #, csharp-format -msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabWrapperLocations.Text" -msgid "Wrapper locations" -msgstr "Wrapper locations" +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" +msgstr "Id" #: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\buttonGC.Text #, csharp-format @@ -118,6 +118,12 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\buttonLog.Text" msgid "Log" msgstr "Log" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabProperties.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabProperties.Text" +msgid "General" +msgstr "General" + #: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnHeader1.Text #, csharp-format msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader1.Text" @@ -130,6 +136,12 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader2.T msgid "Count" msgstr "Count" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabWrapperTypes.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabWrapperTypes.Text" +msgid "Wrapper types" +msgstr "Wrapper types" + #: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnHeader3.Text #, csharp-format msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader3.Text" @@ -142,6 +154,24 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "Count" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabWrapperLocations.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabWrapperLocations.Text" +msgid "Wrapper locations" +msgstr "Wrapper locations" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "Events" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "Item events" + #: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\$this.Text #, csharp-format msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\$this.Text" diff --git a/translations/fr.po b/translations/fr.po index 4c5eaac..bc31452 100644 --- a/translations/fr.po +++ b/translations/fr.po @@ -1281,3 +1281,33 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "" + diff --git a/translations/hu.po b/translations/hu.po index defd74c..e8834a3 100644 --- a/translations/hu.po +++ b/translations/hu.po @@ -1284,3 +1284,33 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "" + diff --git a/translations/it.po b/translations/it.po index 0ea17fe..9a88c5e 100644 --- a/translations/it.po +++ b/translations/it.po @@ -1248,3 +1248,33 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "" + diff --git a/translations/nb.po b/translations/nb.po index 9cb3c21..c8aaebe 100644 --- a/translations/nb.po +++ b/translations/nb.po @@ -1036,3 +1036,33 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "" + diff --git a/translations/nl.po b/translations/nl.po index 539cd94..7a69e9b 100644 --- a/translations/nl.po +++ b/translations/nl.po @@ -1283,3 +1283,33 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "" + diff --git a/translations/pt_br.po b/translations/pt_br.po index edac973..3e10a3b 100644 --- a/translations/pt_br.po +++ b/translations/pt_br.po @@ -1038,3 +1038,33 @@ msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnHeader4.T msgid "Count" msgstr "" +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvent.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvent.Text" +msgid "Event" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnCount.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnCount.Text" +msgid "Count" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnId.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnId.Text" +msgid "Id" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\columnEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\columnEvents.Text" +msgid "Events" +msgstr "" + +#: AcaciaZPushPlugin\Features\DebugSupport\DebugDialog\_tabItemEvents.Text +#, csharp-format +msgctxt "AcaciaZPushPlugin\\Features\\DebugSupport\\DebugDialog\\_tabItemEvents.Text" +msgid "Item events" +msgstr "" + From 4ba62b1e1d9ef5be9bfacbf01cd81c53c0a383c3 Mon Sep 17 00:00:00 2001 From: Patrick Simpson Date: Wed, 5 Jul 2017 16:21:23 +0200 Subject: [PATCH 2/3] [KOE-130] Removed cached property accessor, as that seems to keep the wrapper alive when it's no longer used. --- .../DebugSupport/DebugDialog.Designer.cs | 80 ++ .../Features/DebugSupport/DebugDialog.cs | 54 +- .../Features/DebugSupport/DebugDialog.resx | 738 ++++++++++-------- .../Stubs/OutlookWrappers/OutlookWrapper.cs | 62 +- .../AcaciaZPushPlugin/Utils/MailEvents.cs | 120 ++- 5 files changed, 677 insertions(+), 377 deletions(-) diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.Designer.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.Designer.cs index 6cc050a..624e6de 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.Designer.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.Designer.cs @@ -32,6 +32,10 @@ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DebugDialog)); System.Windows.Forms.ColumnHeader columnFile; System.Windows.Forms.ColumnHeader columnLine; + System.Windows.Forms.ColumnHeader columnEvent; + System.Windows.Forms.ColumnHeader columnCount; + System.Windows.Forms.ColumnHeader columnId; + System.Windows.Forms.ColumnHeader columnEvents; this.tableMain = new System.Windows.Forms.TableLayoutPanel(); this.flowButtons = new System.Windows.Forms.FlowLayoutPanel(); this.buttonGC = new System.Windows.Forms.Button(); @@ -51,9 +55,17 @@ this.listWrapperLocations = new System.Windows.Forms.ListView(); this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this._tabItemEvents = new System.Windows.Forms.TabPage(); + this._layoutItemEvents = new System.Windows.Forms.TableLayoutPanel(); + this.listItemEventDetails = new System.Windows.Forms.ListView(); + this.listItemEvents = new System.Windows.Forms.ListView(); columnMethod = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); columnFile = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); columnLine = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + columnEvent = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + columnCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + columnId = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + columnEvents = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.tableMain.SuspendLayout(); this.flowButtons.SuspendLayout(); this._tabs.SuspendLayout(); @@ -61,6 +73,8 @@ this._tabWrapperTypes.SuspendLayout(); this._tabWrapperLocations.SuspendLayout(); this._layoutLocations.SuspendLayout(); + this._tabItemEvents.SuspendLayout(); + this._layoutItemEvents.SuspendLayout(); this.SuspendLayout(); // // columnMethod @@ -75,6 +89,18 @@ // resources.ApplyResources(columnLine, "columnLine"); // + // columnEvent + // + resources.ApplyResources(columnEvent, "columnEvent"); + // + // columnCount + // + resources.ApplyResources(columnCount, "columnCount"); + // + // columnId + // + resources.ApplyResources(columnId, "columnId"); + // // tableMain // resources.ApplyResources(this.tableMain, "tableMain"); @@ -125,6 +151,7 @@ this._tabs.Controls.Add(this._tabProperties); this._tabs.Controls.Add(this._tabWrapperTypes); this._tabs.Controls.Add(this._tabWrapperLocations); + this._tabs.Controls.Add(this._tabItemEvents); resources.ApplyResources(this._tabs, "_tabs"); this._tabs.Name = "_tabs"; this._tabs.SelectedIndex = 0; @@ -223,6 +250,53 @@ // resources.ApplyResources(this.columnHeader4, "columnHeader4"); // + // _tabItemEvents + // + this._tabItemEvents.Controls.Add(this._layoutItemEvents); + resources.ApplyResources(this._tabItemEvents, "_tabItemEvents"); + this._tabItemEvents.Name = "_tabItemEvents"; + this._tabItemEvents.UseVisualStyleBackColor = true; + // + // _layoutItemEvents + // + resources.ApplyResources(this._layoutItemEvents, "_layoutItemEvents"); + this._layoutItemEvents.Controls.Add(this.listItemEventDetails, 0, 1); + this._layoutItemEvents.Controls.Add(this.listItemEvents, 0, 0); + this._layoutItemEvents.Name = "_layoutItemEvents"; + // + // listItemEventDetails + // + this.listItemEventDetails.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + columnEvent, + columnCount}); + resources.ApplyResources(this.listItemEventDetails, "listItemEventDetails"); + this.listItemEventDetails.FullRowSelect = true; + this.listItemEventDetails.MultiSelect = false; + this.listItemEventDetails.Name = "listItemEventDetails"; + this.listItemEventDetails.ShowItemToolTips = true; + this.listItemEventDetails.UseCompatibleStateImageBehavior = false; + this.listItemEventDetails.View = System.Windows.Forms.View.Details; + // + // listItemEvents + // + this.listItemEvents.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + columnId, + columnEvents}); + resources.ApplyResources(this.listItemEvents, "listItemEvents"); + this.listItemEvents.FullRowSelect = true; + this.listItemEvents.HideSelection = false; + this.listItemEvents.MultiSelect = false; + this.listItemEvents.Name = "listItemEvents"; + this.listItemEvents.ShowItemToolTips = true; + this.listItemEvents.Sorting = System.Windows.Forms.SortOrder.Descending; + this.listItemEvents.UseCompatibleStateImageBehavior = false; + this.listItemEvents.View = System.Windows.Forms.View.Details; + this.listItemEvents.SelectedIndexChanged += new System.EventHandler(this.listItemEvents_SelectedIndexChanged); + // + // columnEvents + // + resources.ApplyResources(columnEvents, "columnEvents"); + // // DebugDialog // resources.ApplyResources(this, "$this"); @@ -241,6 +315,8 @@ this._tabWrapperTypes.ResumeLayout(false); this._tabWrapperLocations.ResumeLayout(false); this._layoutLocations.ResumeLayout(false); + this._tabItemEvents.ResumeLayout(false); + this._layoutItemEvents.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -267,5 +343,9 @@ private System.Windows.Forms.ListView listWrapperLocations; private System.Windows.Forms.ColumnHeader columnHeader3; private System.Windows.Forms.ColumnHeader columnHeader4; + private System.Windows.Forms.TabPage _tabItemEvents; + private System.Windows.Forms.TableLayoutPanel _layoutItemEvents; + private System.Windows.Forms.ListView listItemEventDetails; + private System.Windows.Forms.ListView listItemEvents; } } \ No newline at end of file diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.cs index d6b6aaa..7c03ed8 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.cs @@ -51,9 +51,11 @@ namespace Acacia.Features.DebugSupport } else { - listWrapperTypes.ListViewItemSorter = new WrapperCountSorter(); - listWrapperLocations.ListViewItemSorter = new WrapperCountSorter(); + listWrapperTypes.ListViewItemSorter = new WrapperCountSorter(1); + listWrapperLocations.ListViewItemSorter = new WrapperCountSorter(1); + listItemEvents.ListViewItemSorter = new WrapperCountSorter(0); RefreshWrappers(); + RefreshItemEvents(); // Make it a bit bigger Width = Width + 400; @@ -65,6 +67,7 @@ namespace Acacia.Features.DebugSupport { Properties.Refresh(); RefreshWrappers(); + RefreshItemEvents(); } #region Wrappers @@ -104,10 +107,17 @@ namespace Acacia.Features.DebugSupport private class WrapperCountSorter : IComparer { + private readonly int _index; + + public WrapperCountSorter(int index) + { + this._index = index; + } + public int Compare(object x, object y) { - int ix = int.Parse(((ListViewItem)x).SubItems[1].Text); - int iy = int.Parse(((ListViewItem)y).SubItems[1].Text); + int ix = int.Parse(((ListViewItem)x).SubItems[_index].Text); + int iy = int.Parse(((ListViewItem)y).SubItems[_index].Text); return iy - ix; } } @@ -132,6 +142,42 @@ namespace Acacia.Features.DebugSupport #endregion + #region Item events + + private void RefreshItemEvents() + { + listItemEvents.Items.Clear(); + foreach(MailEvents.MailEventDebug events in MailEvents.MailEventsDebug) + { + ListViewItem item = new ListViewItem(events.Id); + item.Tag = events; + item.SubItems.Add(string.Join(", ", events.GetEvents())); + listItemEvents.Items.Add(item); + } + + foreach (ColumnHeader header in listItemEvents.Columns) + header.Width = -2; + } + + private void listItemEvents_SelectedIndexChanged(object sender, EventArgs e) + { + listItemEventDetails.Items.Clear(); + if (listItemEvents.SelectedItems.Count > 0) + { + MailEvents.MailEventDebug debug = (MailEvents.MailEventDebug)listItemEvents.SelectedItems[0].Tag; + foreach (MailEvents.DebugEvent evt in typeof(MailEvents.DebugEvent).GetEnumValues()) + { + ListViewItem item = new ListViewItem(evt.ToString()); + item.SubItems.Add(debug.GetEventCount(evt).ToString()); + listItemEventDetails.Items.Add(item); + } + } + foreach (ColumnHeader header in listItemEventDetails.Columns) + header.Width = -2; + } + + #endregion + #region Cycling private class DebugCycleInfo diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.resx b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.resx index e04e14b..940093e 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.resx +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.resx @@ -142,6 +142,30 @@ Line + + False + + + Event + + + 44 + + + False + + + Count + + + False + + + Id + + + 44 + Top, Bottom, Left, Right @@ -161,325 +185,10 @@ True - - buttonGC - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowButtons - - - 0 - - - buttonRefresh - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowButtons - - - 1 - - - buttonClose - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowButtons - - - 2 - - - buttonLog - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - flowButtons - - - 3 - - - RightToLeft - - - - 4, 703 - - - 4, 3, 4, 3 - - - 615, 64 - - - 1 - - - flowButtons - - - System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableMain - - - 0 - - - Properties - - - System.Windows.Forms.PropertyGrid, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - _tabProperties - - - 0 - - - 4, 33 - - - 3, 3, 3, 3 - - - 609, 657 - - - 0 - - - General - - - _tabProperties - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - _tabs - - - 0 - - - listWrapperTypes - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - _tabWrapperTypes - - - 0 - - - 4, 33 - - - 3, 3, 3, 3 - - - 609, 657 - - - 1 - - - Wrapper types - - - _tabWrapperTypes - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - _tabs - - - 1 - - - 1 - - - Fill - - - 3, 328 - - - 597, 320 - - - 3 - - - listStackTrace - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - _layoutLocations - - - 0 - - - Fill - - - 3, 3 - - - 597, 319 - - - 2 - - - listWrapperLocations - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - _layoutLocations - - - 1 - - - Fill - - - 3, 3 - - - 2 - - - 603, 651 - - - 2 - - - _layoutLocations - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - _tabWrapperLocations - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="listStackTrace" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="listWrapperLocations" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,20" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> - - - 4, 33 - - - 3, 3, 3, 3 - - - 609, 657 - - - 2 - - - Wrapper locations - - - _tabWrapperLocations - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - _tabs - - - 2 - - - Fill - - - 3, 3 - - - 617, 694 - - - 3 - - - _tabs - - - System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableMain - - - 1 - - - 0, 0 - - - 4, 3, 4, 3 - - - 2 - - - 623, 770 - - - 0 - - - tableMain - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 0 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="flowButtons" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_tabs" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,AutoSize,0,Absolute,20" /></TableLayoutSettings> - True + 483, 6 @@ -597,6 +306,33 @@ 3 + + RightToLeft + + + 4, 703 + + + 4, 3, 4, 3 + + + 615, 64 + + + 1 + + + flowButtons + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableMain + + + 0 + Fill @@ -627,6 +363,45 @@ 0 + + 4, 33 + + + 3, 3, 3, 3 + + + 609, 657 + + + 0 + + + General + + + _tabProperties + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _tabs + + + 0 + + + Type + + + 44 + + + Count + + + 44 + Fill @@ -651,17 +426,59 @@ 0 - - Type + + 4, 33 - - 44 + + 3, 3, 3, 3 - - Count + + 609, 657 - - 44 + + 1 + + + Wrapper types + + + _tabWrapperTypes + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _tabs + + + 1 + + + 1 + + + Fill + + + 3, 328 + + + 597, 320 + + + 3 + + + listStackTrace + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _layoutLocations + + + 0 Type @@ -675,6 +492,255 @@ 44 + + Fill + + + 3, 3 + + + 597, 319 + + + 2 + + + listWrapperLocations + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _layoutLocations + + + 1 + + + Fill + + + 3, 3 + + + 2 + + + 603, 651 + + + 2 + + + _layoutLocations + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _tabWrapperLocations + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="listStackTrace" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="listWrapperLocations" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,20" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 4, 33 + + + 3, 3, 3, 3 + + + 609, 657 + + + 2 + + + Wrapper locations + + + _tabWrapperLocations + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _tabs + + + 2 + + + 1 + + + Fill + + + 3, 328 + + + 597, 320 + + + 3 + + + listItemEventDetails + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _layoutItemEvents + + + 0 + + + False + + + Events + + + Fill + + + 3, 3 + + + 597, 319 + + + 2 + + + listItemEvents + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _layoutItemEvents + + + 1 + + + Fill + + + 3, 3 + + + 2 + + + 603, 651 + + + 3 + + + _layoutItemEvents + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _tabItemEvents + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="listItemEventDetails" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="listItemEvents" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,20" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + 4, 33 + + + 3, 3, 3, 3 + + + 609, 657 + + + 3 + + + Item events + + + _tabItemEvents + + + System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + _tabs + + + 3 + + + Fill + + + 3, 3 + + + 617, 694 + + + 3 + + + _tabs + + + System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableMain + + + 1 + + + 0, 0 + + + 4, 3, 4, 3 + + + 2 + + + 623, 770 + + + 0 + + + tableMain + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="flowButtons" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="_tabs" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,AutoSize,0,Absolute,20" /></TableLayoutSettings> + True @@ -714,6 +780,24 @@ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + columnEvent + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnCount + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnId + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + columnHeader1 @@ -738,6 +822,12 @@ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + columnEvents + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + DebugDialog diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/OutlookWrapper.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/OutlookWrapper.cs index b3b0a2d..634eac1 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/OutlookWrapper.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Stubs/OutlookWrappers/OutlookWrapper.cs @@ -41,37 +41,10 @@ namespace Acacia.Stubs.OutlookWrappers { } - protected override void DoRelease() - { - // Always release props, as we allocated that - if (_props != null) - { - ComRelease.Release(_props); - _props = null; - } - - base.DoRelease(); - } - #endregion #region Properties implementation - // Assigned in Props, released in DoRelease - private NSOutlook.PropertyAccessor _props; - - private NSOutlook.PropertyAccessor Props - { - get - { - if (_props == null) - { - _props = GetPropertyAccessor(); - } - return _props; - } - } - /// /// Returns the wrapped item's property accessor. /// @@ -145,11 +118,11 @@ namespace Acacia.Stubs.OutlookWrappers // into a string which must be parsed again. get { - return Props.GetProperty(OutlookConstants.PR_CATEGORIES); + return (string[])GetProperty(OutlookConstants.PR_CATEGORIES); } set { - Props.SetProperty(OutlookConstants.PR_CATEGORIES, value); + SetProperty(OutlookConstants.PR_CATEGORIES, value); } } @@ -159,7 +132,7 @@ namespace Acacia.Stubs.OutlookWrappers { try { - return Props.GetProperty(OutlookConstants.PR_ATTR_HIDDEN); + return (bool)GetProperty(OutlookConstants.PR_ATTR_HIDDEN); } catch(System.Exception) { @@ -168,30 +141,51 @@ namespace Acacia.Stubs.OutlookWrappers } set { - Props.SetProperty(OutlookConstants.PR_ATTR_HIDDEN, value); + SetProperty(OutlookConstants.PR_ATTR_HIDDEN, value); } } public object GetProperty(string property) { + NSOutlook.PropertyAccessor props = GetPropertyAccessor(); try { - object val = Props.GetProperty(property); + object val = props.GetProperty(property); if (val is DBNull) return null; return val; } catch(System.Exception) { return null; } + finally + { + ComRelease.Release(props); + } } public void SetProperty(string property, object value) { - Props.SetProperty(property, value); + NSOutlook.PropertyAccessor props = GetPropertyAccessor(); + try + { + props.SetProperty(property, value); + } + finally + { + ComRelease.Release(props); + } } public void SetProperties(string[] properties, object[] values) { - Props.SetProperties(properties, values); + NSOutlook.PropertyAccessor props = GetPropertyAccessor(); + try + { + props.SetProperties(properties, values); + } + finally + { + ComRelease.Release(props); + } } #endregion diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/MailEvents.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/MailEvents.cs index 8e7d799..bc79f4a 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/MailEvents.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/MailEvents.cs @@ -22,6 +22,8 @@ using System.Threading.Tasks; using Acacia.Stubs; using Acacia.Stubs.OutlookWrappers; using System.Reflection; +using System.Threading; +using System.Collections.Concurrent; namespace Acacia.Utils { @@ -360,13 +362,47 @@ namespace Acacia.Utils } } + public enum DebugEvent + { + BeforeDelete, + Forward, + PropertyChange, + Read, + Reply, + ReplyAll, + Unload, + Write, + + Dispose, + GC + } + + public interface MailEventDebug + { + string Id { get; } + int GetEventCount(DebugEvent which); + IEnumerable GetEvents(); + } + + public static IEnumerable MailEventsDebug + { + get { return _hookers.Values; } + } + + private static readonly ConcurrentDictionary _hookers = new ConcurrentDictionary(); + private static int _nextHookerId; + private class MailEventHooker : DisposableWrapper { + private readonly MailEventDebugImpl _debug; private IItem _item; private readonly MailEvents _events; public MailEventHooker(IItem item, MailEvents events) { + _debug = new MailEventDebugImpl(Interlocked.Increment(ref _nextHookerId)); + _hookers.TryAdd(_debug._id, _debug); + this._item = item; this._events = events; HookEvents(true); @@ -374,7 +410,19 @@ namespace Acacia.Utils protected override void DoRelease() { - _item.Dispose(); + if (_item != null) + { + _debug.RecordEvent(DebugEvent.Dispose); + _item.Dispose(); + _item = null; + } + MailEventDebugImpl dummy; + _hookers.TryRemove(_debug._id, out dummy); + } + + ~MailEventHooker() + { + _debug.RecordEvent(DebugEvent.GC); } private void HookEvents(bool add) @@ -383,11 +431,10 @@ namespace Acacia.Utils { if (add) { - + events.Read += HandleRead; events.BeforeDelete += HandleBeforeDelete; events.Forward += HandleForward; events.PropertyChange += HandlePropertyChange; - events.Read += HandleRead; events.Reply += HandleReply; events.ReplyAll += HandleReplyAll; events.Unload += HandleUnload; @@ -395,10 +442,10 @@ namespace Acacia.Utils } else { + events.Read -= HandleRead; events.BeforeDelete -= HandleBeforeDelete; events.Forward -= HandleForward; events.PropertyChange -= HandlePropertyChange; - events.Read -= HandleRead; events.Reply -= HandleReply; events.ReplyAll -= HandleReplyAll; events.Unload -= HandleUnload; @@ -409,41 +456,52 @@ namespace Acacia.Utils private void HandleBeforeDelete(object item, ref bool cancel) { - using (IItem wrapped = item.WrapOrDefault(false)) - _events.OnBeforeDelete(wrapped, ref cancel); + _debug.RecordEvent(DebugEvent.BeforeDelete); + //using (IItem wrapped = item.WrapOrDefault(false)) + // _events.OnBeforeDelete(wrapped, ref cancel); } private void HandleForward(object response, ref bool cancel) { - using (IItem wrapped = response.WrapOrDefault(false)) - _events.OnForward(_item as IMailItem, wrapped as IMailItem); + _debug.RecordEvent(DebugEvent.Forward); + //using (IItem wrapped = response.WrapOrDefault(false)) + // _events.OnForward(_item as IMailItem, wrapped as IMailItem); } private void HandlePropertyChange(string name) { - _events.OnPropertyChange(_item, name); + _debug.RecordEvent(DebugEvent.PropertyChange); + //_events.OnPropertyChange(_item, name); } private void HandleRead() { + _debug.RecordEvent(DebugEvent.Read); // TODO: should this not be simply an IItem? - _events.OnRead(_item as IMailItem); + IMailItem mail = _item as IMailItem; + if (mail != null) + { + _events.OnRead(mail); + } } private void HandleReply(object response, ref bool cancel) { - using (IItem wrapped = response.WrapOrDefault(false)) - _events.OnReply(_item as IMailItem, wrapped as IMailItem); + _debug.RecordEvent(DebugEvent.Reply); + //using (IItem wrapped = response.WrapOrDefault(false)) + // _events.OnReply(_item as IMailItem, wrapped as IMailItem); } private void HandleReplyAll(object response, ref bool cancel) { - using (IItem wrapped = response.WrapOrDefault(false)) - _events.OnReplyAll(_item as IMailItem, wrapped as IMailItem); + _debug.RecordEvent(DebugEvent.ReplyAll); + //using (IItem wrapped = response.WrapOrDefault(false)) + // _events.OnReplyAll(_item as IMailItem, wrapped as IMailItem); } private void HandleUnload() { + _debug.RecordEvent(DebugEvent.Unload); // All events must be unhooked on unload, otherwise a resource leak is created. HookEvents(false); Dispose(); @@ -451,10 +509,42 @@ namespace Acacia.Utils private void HandleWrite(ref bool cancel) { - _events.OnWrite(_item, ref cancel); + _debug.RecordEvent(DebugEvent.Write); + //_events.OnWrite(_item, ref cancel); } } + private class MailEventDebugImpl : MailEventDebug + { + private readonly ConcurrentDictionary _eventCounts = new ConcurrentDictionary(); + + public readonly int _id; + + public MailEventDebugImpl(int id) + { + this._id = id; + } + + public int GetEventCount(DebugEvent which) + { + int count; + _eventCounts.TryGetValue(which, out count); + return count; + } + + public void RecordEvent(DebugEvent which) + { + _eventCounts.AddOrUpdate(which, 1, (i, value) => value + 1); + } + + public IEnumerable GetEvents() + { + return _eventCounts.Keys; + } + + public string Id { get { return _id.ToString(); } } + } + #endregion } } From 0d42105f933784f934a87295981f2b174de6143d Mon Sep 17 00:00:00 2001 From: Patrick Simpson Date: Wed, 5 Jul 2017 17:33:17 +0200 Subject: [PATCH 3/3] [KOE-130] Cleanup and fixes for disabling wrapper tracing --- .../Features/DebugSupport/DebugDialog.cs | 6 ++ .../AcaciaZPushPlugin/Utils/MailEvents.cs | 66 ++++++++++--------- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.cs index 7c03ed8..a5e710f 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Features/DebugSupport/DebugDialog.cs @@ -74,6 +74,9 @@ namespace Acacia.Features.DebugSupport private void RefreshWrappers() { + if (_tracer == null) + return; + // Wrapper types listWrapperTypes.Items.Clear(); foreach(KeyValuePair type in _tracer.GetTypes()) @@ -146,6 +149,9 @@ namespace Acacia.Features.DebugSupport private void RefreshItemEvents() { + if (_tracer == null) + return; + listItemEvents.Items.Clear(); foreach(MailEvents.MailEventDebug events in MailEvents.MailEventsDebug) { diff --git a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/MailEvents.cs b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/MailEvents.cs index bc79f4a..a68e50c 100644 --- a/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/MailEvents.cs +++ b/src/AcaciaZPushPlugin/AcaciaZPushPlugin/Utils/MailEvents.cs @@ -386,10 +386,11 @@ namespace Acacia.Utils public static IEnumerable MailEventsDebug { - get { return _hookers.Values; } + get { return _hookers?.Values; } } - private static readonly ConcurrentDictionary _hookers = new ConcurrentDictionary(); + private static readonly ConcurrentDictionary _hookers = + GlobalOptions.INSTANCE.WrapperTrace ? new ConcurrentDictionary() : null; private static int _nextHookerId; private class MailEventHooker : DisposableWrapper @@ -400,8 +401,11 @@ namespace Acacia.Utils public MailEventHooker(IItem item, MailEvents events) { - _debug = new MailEventDebugImpl(Interlocked.Increment(ref _nextHookerId)); - _hookers.TryAdd(_debug._id, _debug); + if (_hookers != null) + { + _debug = new MailEventDebugImpl(Interlocked.Increment(ref _nextHookerId)); + _hookers.TryAdd(_debug._id, _debug); + } this._item = item; this._events = events; @@ -412,17 +416,21 @@ namespace Acacia.Utils { if (_item != null) { - _debug.RecordEvent(DebugEvent.Dispose); _item.Dispose(); _item = null; } - MailEventDebugImpl dummy; - _hookers.TryRemove(_debug._id, out dummy); + + if (_debug != null) + { + _debug.RecordEvent(DebugEvent.Dispose); + MailEventDebugImpl dummy; + _hookers.TryRemove(_debug._id, out dummy); + } } ~MailEventHooker() { - _debug.RecordEvent(DebugEvent.GC); + _debug?.RecordEvent(DebugEvent.GC); } private void HookEvents(bool add) @@ -456,52 +464,48 @@ namespace Acacia.Utils private void HandleBeforeDelete(object item, ref bool cancel) { - _debug.RecordEvent(DebugEvent.BeforeDelete); - //using (IItem wrapped = item.WrapOrDefault(false)) - // _events.OnBeforeDelete(wrapped, ref cancel); + _debug?.RecordEvent(DebugEvent.BeforeDelete); + using (IItem wrapped = item.WrapOrDefault(false)) + _events.OnBeforeDelete(wrapped, ref cancel); } private void HandleForward(object response, ref bool cancel) { - _debug.RecordEvent(DebugEvent.Forward); - //using (IItem wrapped = response.WrapOrDefault(false)) - // _events.OnForward(_item as IMailItem, wrapped as IMailItem); + _debug?.RecordEvent(DebugEvent.Forward); + using (IItem wrapped = response.WrapOrDefault(false)) + _events.OnForward(_item as IMailItem, wrapped as IMailItem); } private void HandlePropertyChange(string name) { - _debug.RecordEvent(DebugEvent.PropertyChange); - //_events.OnPropertyChange(_item, name); + _debug?.RecordEvent(DebugEvent.PropertyChange); + _events.OnPropertyChange(_item, name); } private void HandleRead() { - _debug.RecordEvent(DebugEvent.Read); + _debug?.RecordEvent(DebugEvent.Read); // TODO: should this not be simply an IItem? - IMailItem mail = _item as IMailItem; - if (mail != null) - { - _events.OnRead(mail); - } + _events.OnRead(_item as IMailItem); } private void HandleReply(object response, ref bool cancel) { - _debug.RecordEvent(DebugEvent.Reply); - //using (IItem wrapped = response.WrapOrDefault(false)) - // _events.OnReply(_item as IMailItem, wrapped as IMailItem); + _debug?.RecordEvent(DebugEvent.Reply); + using (IItem wrapped = response.WrapOrDefault(false)) + _events.OnReply(_item as IMailItem, wrapped as IMailItem); } private void HandleReplyAll(object response, ref bool cancel) { - _debug.RecordEvent(DebugEvent.ReplyAll); - //using (IItem wrapped = response.WrapOrDefault(false)) - // _events.OnReplyAll(_item as IMailItem, wrapped as IMailItem); + _debug?.RecordEvent(DebugEvent.ReplyAll); + using (IItem wrapped = response.WrapOrDefault(false)) + _events.OnReplyAll(_item as IMailItem, wrapped as IMailItem); } private void HandleUnload() { - _debug.RecordEvent(DebugEvent.Unload); + _debug?.RecordEvent(DebugEvent.Unload); // All events must be unhooked on unload, otherwise a resource leak is created. HookEvents(false); Dispose(); @@ -509,8 +513,8 @@ namespace Acacia.Utils private void HandleWrite(ref bool cancel) { - _debug.RecordEvent(DebugEvent.Write); - //_events.OnWrite(_item, ref cancel); + _debug?.RecordEvent(DebugEvent.Write); + _events.OnWrite(_item, ref cancel); } }