From beb76068fb4fa03a8a2105fbc03a35c145436020 Mon Sep 17 00:00:00 2001 From: jogibear9988 Date: Sun, 26 Oct 2014 09:11:05 +0100 Subject: [PATCH] Fixes for Formated Text Editor and Context Menu Handling --- .../WpfDesign.Designer/Project/DesignPanel.cs | 14 ++++---- .../PartialPanelSelectionHandler.cs | 26 +++++++++----- .../Extensions/RightClickContextMenu.xaml | 24 ++++++++++--- ...tClickMultipleItemsContextMenuExtension.cs | 4 +-- .../TextBlockRightClickContextMenu.xaml | 6 +++- ...TextBlockRightClickContextMenuExtension.cs | 1 + .../Project/Images/edit-bold.png | Bin 0 -> 282 bytes .../Project/Images/edit-color.png | Bin 0 -> 326 bytes .../Project/Images/edit-italic.png | Bin 0 -> 247 bytes .../Project/Images/edit-strike.png | Bin 0 -> 312 bytes .../Project/Images/edit.png | Bin 0 -> 445 bytes .../Images/layers-alignment-bottom.png | Bin 0 -> 581 bytes .../Images/layers-alignment-center.png | Bin 0 -> 624 bytes .../Project/Images/layers-alignment-left.png | Bin 0 -> 551 bytes .../Images/layers-alignment-middle.png | Bin 0 -> 657 bytes .../Project/Images/layers-alignment-right.png | Bin 0 -> 559 bytes .../Project/Images/layers-alignment.png | Bin 0 -> 645 bytes .../Project/Images/layers-arrange-back.png | Bin 0 -> 646 bytes .../Project/Images/layers-arrange.png | Bin 0 -> 639 bytes .../Images/layers-stack-arrange-back.png | Bin 0 -> 750 bytes .../Project/Images/layers-stack-arrange.png | Bin 0 -> 739 bytes .../Project/Translations.cs | 12 ++++++- .../Project/WpfDesign.Designer.csproj | 20 ++++++++++- .../Project/Extensions/ExtensionAttribute.cs | 32 ++++++++++++++++++ .../Project/Extensions/ExtensionManager.cs | 11 +++--- .../WpfDesign/Project/WpfDesign.csproj | 1 + 26 files changed, 123 insertions(+), 28 deletions(-) create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/edit-bold.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/edit-color.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/edit-italic.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/edit-strike.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/edit.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-alignment-bottom.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-alignment-center.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-alignment-left.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-alignment-middle.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-alignment-right.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-alignment.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-arrange-back.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-arrange.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-stack-arrange-back.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-stack-arrange.png create mode 100644 src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionAttribute.cs diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs index 558585c50e..a413005fb2 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs @@ -450,11 +450,11 @@ namespace ICSharpCode.WpfDesign.Designer #region ContextMenu - private Dictionary> contextMenusAndEntries = new Dictionary>(); + private Dictionary>> contextMenusAndEntries = new Dictionary>>(); public void AddContextMenu(ContextMenu contextMenu) { - contextMenusAndEntries.Add(contextMenu, new List(contextMenu.Items.Cast())); + contextMenusAndEntries.Add(contextMenu, new Tuple>(contextMenusAndEntries.Count, new List(contextMenu.Items.Cast()))); contextMenu.Items.Clear(); UpdateContextMenu(); @@ -477,16 +477,16 @@ namespace ICSharpCode.WpfDesign.Designer this.ContextMenu.Items.Clear(); - foreach (var entries in contextMenusAndEntries.Values) - { - if (this.ContextMenu.Items.Count > 0) - this.ContextMenu.Items.Add(new Separator()); + foreach (var entries in contextMenusAndEntries.Values.OrderBy(x => x.Item1).Select(x => x.Item2)) + { + if (this.ContextMenu.Items.Count > 0) + this.ContextMenu.Items.Add(new Separator()); foreach (var entry in entries) { ContextMenu.Items.Add(entry); } - } + } } #endregion diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PartialPanelSelectionHandler.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PartialPanelSelectionHandler.cs index 26159e559d..5c03df06a3 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PartialPanelSelectionHandler.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PartialPanelSelectionHandler.cs @@ -1,11 +1,21 @@ -/* - * Created by SharpDevelop. - * User: trubra - * Date: 2014-08-06 - * Time: 14:13 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ +// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickContextMenu.xaml b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickContextMenu.xaml index 6d0e41b6d8..81c743fed1 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickContextMenu.xaml +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickContextMenu.xaml @@ -3,8 +3,24 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Translation="clr-namespace:ICSharpCode.WpfDesign.Designer" > - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenuExtension.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenuExtension.cs index eea059067d..11f7fcec88 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenuExtension.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenuExtension.cs @@ -31,10 +31,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions /// /// /// - [ExtensionServer(typeof(MultipleSelectedExtensionServer))] + [ExtensionServer(typeof(PrimarySelectionButOnlyWhenMultipleSelectedExtensionServer))] [ExtensionFor(typeof(UIElement))] public class RightClickMultipleItemsContextMenuExtension : SelectionAdornerProvider - { + { DesignPanel panel; ContextMenu contextMenu; diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenu.xaml b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenu.xaml index e4bc9cd3c6..986ba39960 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenu.xaml +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenu.xaml @@ -3,5 +3,9 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Translation="clr-namespace:ICSharpCode.WpfDesign.Designer" > - + + + + + diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenuExtension.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenuExtension.cs index 0553b5aa2d..fd89f3db5f 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenuExtension.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/TextBlockRightClickContextMenuExtension.cs @@ -30,6 +30,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions { [ExtensionServer(typeof (OnlyOneItemSelectedExtensionServer))] [ExtensionFor(typeof (TextBlock))] + [Extension(Order = 10)] public class TextBlockRightClickContextMenuExtension : PrimarySelectionAdornerProvider { DesignPanel panel; diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/edit-bold.png b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/edit-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..200b9cfe5f851eeb45c991c8f44084e3a8f5c87a GIT binary patch literal 282 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 literal 0 HcmV?d00001 diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-alignment.png b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-alignment.png new file mode 100644 index 0000000000000000000000000000000000000000..1b10483acf37423ce3ee74f0931297138503b54e GIT binary patch literal 645 zcmV;00($+4P)RCwB?Q@d^xQ4pQ`@On3xSQd_h zXfQ}1TADOz!%u_?3Xq_q;TNE!08t>QpiDuH(z%Hg2_%G&k|K{Hjxk==_P*}!>}6)L zlUOk{j5I!X&fPgX53jJ+!vC1&p9jwdHjX10kH;_^1~3{8Aq*o((+sSYpp*-aQv=ss zES=ArZ(8C+fK2qU4@MbC7YtY>pmM>1^e_YON)?1qB!cvG1i40V(%NhV+x|8^BvwH} z8$2RBzNqZgoApk~16&0l0U!a0_Ji7>190b5fagGd{oUi0_2s(TIu4TFy_Z`bD7i!Y zwYQH}?oRppueRP(N@u2mq9_<-^P+nxOweZ}PLe>$w-&3-*yI5t^XG<$$mM~`u)s9O zTq!{mDk&wmCb6(Zh88Qz7M7>_Hvy9s7#l<_Whua|k%&C_866z?NtfIBR|T5hjzN?s zVTyD@J(-Qn^1>n|l5=S@0%efrIlCT=O}KM3`VoXC<(P%(jmm;JagHZ5JFOr|5(aO- zH}Wqx+$DdUuz8N-lrx|`X)2|{IJX6348!h|*PHJ2f)aOmh>DDMp=l)*MxM<%f#~Z; z&`UQrRP)Bh^aA@k;I(hFc$K!Ps1D7@@mzsuyGLcs${`}?SL{LpopNYkp!ub1- fDeo5tzXcco8mBwCn}Flz00000NkvXXu0mjfQ0FG* literal 0 HcmV?d00001 diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-arrange-back.png b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-arrange-back.png new file mode 100644 index 0000000000000000000000000000000000000000..0effc3bee3a0080c5e4fc87fbccac302ef12cf55 GIT binary patch literal 646 zcmV;10(t$3P)C!Ypo5XYO-wS=wPAJ8$0izW2R1yX5?h8kkislz|X(39X9m9PGUsTI=hy=heeHl;}+La>YA% zdLdWCpvua`BG$W4{KA7LLA6Iv3T1e9JK3Jw=&;qb7h*Ik*>!BOFy;MTocCVed(^2= ztYps5-Mw1A)@^Gzbs|3{l`alTwy<=w6^mE(U;6m5eB}FW=n;6chw~$~&rO(_b{Ut7 zWhppPaNVHGDHc&d;P(lLP)e|b0|vASW)UDxB|>R|pfHSpqMxcWNh}e-F=zl;1P7?n z2E!%d86OZBMlJwQzA}bFkVq?$?m?@6Qt?H&kRYWwvidDphEXU2F;~iuI7bz7m<%Qi zu`)`*w%uJVAVI_kv?DH}SeRr@a5ibx^hq6(Dn&5ImK|qoKoG@;l6Hz5CN0>}QVxJb!7I-imnr&&JAa`g7?H6e~C5Z_QTz%*pXCcE6l;h14eY zdb2gM#XmgWynkg0j{+KReJr-#Jp6Ji@}Cmwj_vgeY7uw3Yb#%I%h5t3&ipu@nFH*9 gnZ5(G=&t|+0GQTnY3d6w0RR9107*qoM6N<$f}5NrM*si- literal 0 HcmV?d00001 diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-arrange.png b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-arrange.png new file mode 100644 index 0000000000000000000000000000000000000000..7bea99aac0b37a148a7f4b8f39ed1ac4b62cf500 GIT binary patch literal 639 zcmV-_0)YLAP)BXa{cvA2u6!aH(3jG6KiU?KkAP9Ppf(Z5CC3;Xx3RMc4gIYAZ z*(I|(Z^ri~E%eZ(K6uQ&`R4oH_l8-1_rWjbI1cOn?J|txm=`d8c5oz^AH;6e44SML z_2!mtpTE;M=2wj|x`@d+cfS2h(#1y~xfQ^}*J^I9)1GWMR$kD~sIYC-W68yHPIvyS zk2DhqDed9TjfG$`4B_+9z?%ZCvx3h2(}t?QT1)2IE%6owxEKzHgf(VQ9eMrbdm4Bp zF`+=qA_r$qmVPfkkETHf8p9D$G_ZiuS|O1sFov>7AV+(|Q4ks{5XX@PKpTyqK_Nqj ziUbHJP7X%n2#!dSbPOOl%Qedtu9$>o$^h;oh1q(i5ho6S8IK@kzGKa3iQY%pevqmR zmwg98Q9~ST#H;|i7>|GgQJSkkn&+tmMP$y$q+KDZ$tiJiZ5_D6bv+BlBb9B(5~k}u z%b@TI=nfchNFM+kQ7+dkAam+!AWAb)^UC&>>?cqXu1B2BAAc$mACd69Ll$ryM@-Zz z{muSB0O-nIHsA9-69xfs?mt{zm0Rz-{P5H~n_XD>di|;&v|8*9-Xj#*7cO_#*V&b4 zFO&G)U#UtYQyHgDZy+&yvNKWJd9zwxBgTU&gJ)iw!KF$0={{eO_l7&HAR ZzyO?TSf;@ad!qmV002ovPDHLkV1i(K8gl>u literal 0 HcmV?d00001 diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-stack-arrange-back.png b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-stack-arrange-back.png new file mode 100644 index 0000000000000000000000000000000000000000..3e56ba24ad07b64b5a7ee47c75dba407f1e885ad GIT binary patch literal 750 zcmVDigxo!N!u zp#tHd1dK`$jDG>ICLX*Q&)$vk^5Y z<0Cz}?XeO2^Zh6ORD%H2ChuH1dv(W`=+v-tR0!G8LK&AUb^c*#^ZSV-+0geZC?@C! zn*f_Cmi*((ZWXyfNVt%yIoV2SYOu?W2D>wQP~(Kbx$pak>?_-rKHQnJx;Of3sH4qH zL%R7-8Q~4DF6VxFL2tog5wLTiWEj>G0%xErlP<3MfoYJotsp{%sY|JpXs)2sG4*PV zAxK1wOT>VHgC|l-4L}B<0%FOyiVqbK9B3f|EQ$jmX5V9+N-EIeegK5Tgc(uzP%dRW z2Y`S{CCU*fMqD*wQz^SqfrKPkXHrzE0ud_`z;U33T@k4g&m;y`Y+3nTg1Dc`4iot> zVw9`MuS(mpP&MgcuMucThm8RPRk<|D%`b@4K(L$;gp|{*fb!l#7N;!yd)t>ivV!x? z6$q-(uM)Bs^9s#;)O+WIaD(!@TSN$<*CN5=se2*SootF{Gs^w{5_LM*>h9uyNX9Fb zS@GHGgUJ^F2T27QMn*o9TKl%<88A4rdHi_K4qa&3;x*i&Bxc?0@R2jUU7Q%<~`rW#Iz54yNc6lZSmzw gTsBy^kN*{50P}0H)fd=7#{d8T07*qoM6N<$f}sOjApigX literal 0 HcmV?d00001 diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-stack-arrange.png b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/layers-stack-arrange.png new file mode 100644 index 0000000000000000000000000000000000000000..db3286bb9a440c51d2a5ff2d9d776512a28ce95b GIT binary patch literal 739 zcmV<90v!E`P)#MKZ#F^FKPg<30OBVwJ_BAu085N&P6R3gR?C`J%Ok=U$F5)vbu6iGG^*7;<1 zcIN%OZ`dTOS-fz0!x%bW+eBt_IB#w`uwm1TL4$?;dj{vel&z!%FDsE*LRZ5LL zyfb=tpwG_2v+PufF(%c`pmFc%4@^5aUzuO?j?FIDy-vj$lkjq>@cTq5rw#InKsjGV zi{4`5oU@Ff0|o1#5VE&}Gp;#J{%vXN*I=I=NGS;gl^Zs(C&#+R2BuyoLqLZ6oby@4 zFPJEtSdjqG-^!uh8`Jfy-jhK5OmtM%kPPz@ohX;-3dd;Cwh!~fMwFIc=IS4=o zpaNkDr(_1KANp$_Ar?w$E)yjg>jEKn1U#hY0Z^YP26cl76@d^4Du6&qX%nQmF;}}> zA%sDLAk;5q1W1!fQQwY5HZ29TDB3&FCYqa=F^NGHCmrzCJWhj&Vi2<+;uLx(ra`FM z`6v)DlA*b<&{QEq3(M<{A4O4@=f3!| zwD#=1`!QObtsbv)r z!N@FTQya@0t_h1vx33?!&Y}K%9=L}mp3Ef9X3xXK!V>ekfw8-R9s)USQMKmFm_gI6=g%{{;U0XJi{zVh;sZoBm>C-Fys0RXJU Vu*V-}6czvg002ovPDHLkV1kx0Q)&PJ literal 0 HcmV?d00001 diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Translations.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Translations.cs index ebb196ca26..eca0f9ac3d 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Translations.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Translations.cs @@ -83,5 +83,15 @@ namespace ICSharpCode.WpfDesign.Designer return "Wrap in Border"; } } - } + + public virtual string FormatedTextEditor + { + get + { + return "Formated Text Editor"; + } + } + + + } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj index 8f612f1e35..70a098f32d 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj @@ -393,7 +393,22 @@ - + + + + + + + + + + + + + + + + @@ -407,4 +422,7 @@ + + + \ No newline at end of file diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionAttribute.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionAttribute.cs new file mode 100644 index 0000000000..2f321ae680 --- /dev/null +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionAttribute.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; + +namespace ICSharpCode.WpfDesign.Extensions +{ + /// + /// Attribute to specify Properties of the Extension. + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=false)] + public sealed class ExtensionAttribute : Attribute + { + //The Order in wich the Extensions are used + public int Order { get; set; } + } +} diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionManager.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionManager.cs index 21046f321e..676e2400da 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionManager.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionManager.cs @@ -65,12 +65,14 @@ namespace ICSharpCode.WpfDesign.Extensions internal readonly Type ExtensionType; internal readonly ExtensionServer Server; internal readonly Type OverriddenExtensionType; - - public ExtensionEntry(Type extensionType, ExtensionServer server, Type overriddenExtensionType) + internal readonly int Order; + + public ExtensionEntry(Type extensionType, ExtensionServer server, Type overriddenExtensionType, int Order) { this.ExtensionType = extensionType; this.Server = server; this.OverriddenExtensionType = overriddenExtensionType; + this.Order = Order; } } @@ -104,7 +106,7 @@ namespace ICSharpCode.WpfDesign.Extensions result.Add(entry); } } - return result; + return result.OrderBy(x => x.Order).ToList(); } /// @@ -184,7 +186,8 @@ namespace ICSharpCode.WpfDesign.Extensions foreach (ExtensionForAttribute designerFor in extensionForAttributes) { ExtensionServer server = GetServerForExtension(type); - AddExtensionEntry(designerFor.DesignedItemType, new ExtensionEntry(type, server, designerFor.OverrideExtension)); + ExtensionAttribute extensionAttribute = type.GetCustomAttributes(typeof(ExtensionAttribute), false).FirstOrDefault() as ExtensionAttribute; + AddExtensionEntry(designerFor.DesignedItemType, new ExtensionEntry(type, server, designerFor.OverrideExtension, extensionAttribute != null ? extensionAttribute.Order : 0)); } } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj index 4d2b74cf43..0159bd0b0f 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj @@ -74,6 +74,7 @@ +