From 3901422a54a6cca6b04c97a961f2e6c46a8f8eb5 Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Mon, 6 Jan 2014 19:03:20 +0800 Subject: [PATCH] Add missed changes --- .../ThirdpartyPluginIndicator.cs | 61 ++++++++++++++++++ WinAlfred/Commands/BaseCommand.cs | 29 +++++++++ WinAlfred/Images/close.png | Bin 0 -> 139 bytes WinAlfred/Images/cmd.png | Bin 0 -> 1633 bytes WinAlfred/Images/exit.png | Bin 0 -> 2724 bytes WinAlfred/Images/logoff.png | Bin 0 -> 613 bytes WinAlfred/Images/work.png | Bin 0 -> 4841 bytes WinAlfred/MainWindow.xaml.cs | 3 + WinAlfred/WinAlfred.csproj | 3 + 9 files changed, 96 insertions(+) create mode 100644 WinAlfred.Plugin.System/ThirdpartyPluginIndicator.cs create mode 100644 WinAlfred/Commands/BaseCommand.cs create mode 100644 WinAlfred/Images/close.png create mode 100644 WinAlfred/Images/cmd.png create mode 100644 WinAlfred/Images/exit.png create mode 100644 WinAlfred/Images/logoff.png create mode 100644 WinAlfred/Images/work.png diff --git a/WinAlfred.Plugin.System/ThirdpartyPluginIndicator.cs b/WinAlfred.Plugin.System/ThirdpartyPluginIndicator.cs new file mode 100644 index 0000000000..ca10dfa486 --- /dev/null +++ b/WinAlfred.Plugin.System/ThirdpartyPluginIndicator.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WinAlfred.Plugin.System +{ + public class ThirdpartyPluginIndicator : ISystemPlugin + { + private List allPlugins = new List(); + private Action changeQuery; + + public List Query(Query query) + { + List results = new List(); + if (string.IsNullOrEmpty(query.RawQuery)) return results; + + foreach (PluginMetadata metadata in allPlugins.Select(o=>o.Metadata)) + { + if (metadata.ActionKeyword.StartsWith(query.RawQuery)) + { + PluginMetadata metadataCopy = metadata; + Result result = new Result + { + Title = metadata.ActionKeyword, + SubTitle = string.Format("press space to active {0} workflow",metadata.Name), + Score = 50, + IcoPath = "Images/work.png", + Action = () => changeQuery(metadataCopy.ActionKeyword + " "), + DontHideWinAlfredAfterAction = true + }; + results.Add(result); + } + } + return results; + } + + public void Init(PluginInitContext context) + { + allPlugins = context.Plugins; + changeQuery = context.ChangeQuery; + } + + public string Name { + get + { + return "ThirdpartyPluginIndicator"; + } + } + + public string Description + { + get + { + return "ThirdpartyPluginIndicator"; + } + } + + + } +} diff --git a/WinAlfred/Commands/BaseCommand.cs b/WinAlfred/Commands/BaseCommand.cs new file mode 100644 index 0000000000..aa3dfbdb75 --- /dev/null +++ b/WinAlfred/Commands/BaseCommand.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WinAlfred.Plugin; + +namespace WinAlfred.Commands +{ + public abstract class BaseCommand + { + private MainWindow window; + + public abstract void Dispatch(Query query); + + //TODO:Ugly, we should subscribe events here, instead of just use usercontrol as the parameter + protected BaseCommand(MainWindow window) + { + this.window = window; + } + + protected void UpdateResultView(List results) + { + if (results.Count > 0) + { + window.OnUpdateResultView(results); + } + } + } +} diff --git a/WinAlfred/Images/close.png b/WinAlfred/Images/close.png new file mode 100644 index 0000000000000000000000000000000000000000..5ddfe20b8f3f9541bad8e9a6be5e208eba50244b GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`L7py-Ar`&K2@|z=9CLhAz6IL1a->h*YA2k~jgAU^{-zNWm$}Th{q$$7=!YgH|p8br|O5BHzfdY0B~KGjEsy-PEAey zWLcJNjDa!c<7P^B)2h{K(f#}Pze=T2f3#XH!vR2RO)8a2CYem0t<`GI*47r3Qa#Au zC(DD3bB=sI565x*jZ$e;O8FeXJ^&>pgb;Loex5EYEI>*L08mPGz;ru5Y8_v9uM>#` zu3o*0OP4MY5JD-X=#&5e3;-!5eBVbHhA0#Y*xA`ZyWNKG`v`)d1FAc~Vds7zsZ1?!a|jT)%!D=gyr2A*9D)x8wLY zYR?!0&N-WynD}C2W8?Eiy-s@=&|MFXkB?(!W(Gq;L%4VE9@f^@005NIo*)O&eONiP z)&M}2Qe<;;bG^}M^p>C-bvm8K{QNv#zI=&xyA7>1a=9Eh=a5pO(P*I2Xdn#3zomg# z%t|Q}hM_K(%YXVopnF6Z2M>Y(ckkW>00<#KDaFN$7cn0%AWFc`uS#d2Y_O+NVC~&(HKJyaux@UhtOeT_%J{{t*De~ zHJh7J6q$VnJdY+4iL)I5doRZIJ!twJ7W6me4g62T{Hltl#)y)1K0B)q6nrp1@z~26bt=( zi9`bFbQ*jA0Vcl3hqGDA7%NIC31`gAUA|0aXJ?_i+N|R+24eOo-QSIG9wI*i%i_ke zZM0i0Bc<#-$ZNHlezv?!gCM9FV2A*eF-93v9>5Mhlg<+u)o*MiD@O zDD+XUR`BgNUmGFC*0pQbW@@$C^H!@B?Q*j(5<&F{jQmOQ&Q-UtR7-NiyqDV(kBmsl~ntRwv<#PG=m6a9B7~_mFn=v-P7&|eP z$&7tEI$CsHw-~eLdfwPbE;oEK`w3^1Qp>WaQcAC_t*r_n{9bi@fW@rYwoNU|Vw6&g zbDm_3rILxn$y_dXW;CBK7Cdi!WMstqb#d{RrKP1GtJP}sQ2-o=jdM;c%VL~!W{k14 z)=CKBM^U8zp}7A+`wL@BoR9x#)=mHb03~!qSaf7zbY(hYa%Ew3WdJfTF)%GKGA%JN zR536*Gch_fI4v+XIxsLq5ff(s001R)MObuXVRU6WZEs|0W_bWIFfceRFfuJNH&ih= fIyE#pG&C(RHaajcNaF4900000NkvXXu0mjfN!jGN literal 0 HcmV?d00001 diff --git a/WinAlfred/Images/exit.png b/WinAlfred/Images/exit.png new file mode 100644 index 0000000000000000000000000000000000000000..523c3d5197db3825be40fa89af1c943ec37dbcbd GIT binary patch literal 2724 zcmV;V3S0GwP)yt5dvX`KvN%sn06G!T3WQ#NEJ(}Qc_SWH5eO_#zb2aznPX; zA5CMynAS7|+c2rEVtJJs%ZLO;6ryc;4Ud6gP=?`gXXeg*?%faPanEz++V+c^Z1z2S zud~+wzxG=DaX^eQe345E;P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A8+@3 e@f^ literal 0 HcmV?d00001 diff --git a/WinAlfred/Images/logoff.png b/WinAlfred/Images/logoff.png new file mode 100644 index 0000000000000000000000000000000000000000..73c1379b2e233a3f3cdeb8d62dfcfa9db43e1be6 GIT binary patch literal 613 zcmV-r0-F7aP)i&;aWI*Ri`asL#i^wz4kCiM=^zwW7ad$Wv|y)# z9W;uI3T?zeLQ^C41*sU5l4@dVnukLvdTGhMA=WH8<2m0s|KE4c<(^OA=6sbVnyQ)N zEr1q43jjblhNw9LyFp8!%SNtPVs`1vj(9+{ za=riK_HRIQ!MW+b*A6R^%Dno%~cAa=toq~O#e1d zyBVXVwnWVie8?84RI40vn9!?L{3=%@@r7iTyRSY;e8V1*c9V|hpVt_gj`Fi4&8Z7u zePffwWR~Om+c>)5}!+?m`kK2zF@bVx0xJ6(@}E8a!qlN8-XBjXL0L>lVLZa zSua~~`{qi-3udL}Wq8304pat+7vlFRrw4{x100000NkvXXu0mjfH;)=D literal 0 HcmV?d00001 diff --git a/WinAlfred/Images/work.png b/WinAlfred/Images/work.png new file mode 100644 index 0000000000000000000000000000000000000000..aa447afd8df40dca7123ee13c89f8016cc83b14c GIT binary patch literal 4841 zcmVKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpi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zMj5-#*6f@JoXyF4mOQC)o5KJfUo&P+?B z@1c|;QfyLWCm8B?NsMVKE)TN!hbxK9-%sk~YpM3;!L6?A|HQP+{H#i|^MnW73+z&g zd(d2M+R~JMo`7YtU~v&jniPpB|B``Ylr`w`ov zum7DG39c`xh^(_ic0(?w<{O4>hQel|3*jJOm>G^T0HF7MY}p8t0MqZSetJgpw% P00000NkvXXu0mjfuuw*Q literal 0 HcmV?d00001 diff --git a/WinAlfred/MainWindow.xaml.cs b/WinAlfred/MainWindow.xaml.cs index 02dea99755..4a12ba4f75 100644 --- a/WinAlfred/MainWindow.xaml.cs +++ b/WinAlfred/MainWindow.xaml.cs @@ -100,6 +100,9 @@ namespace WinAlfred Plugins.Init(this); cmdDispatcher = new Command(this); InitialTray(); + + //var engine = new Jurassic.ScriptEngine(); + //MessageBox.Show(engine.Evaluate("5 * 10 + 2").ToString()); } private void TbQuery_OnPreviewKeyDown(object sender, KeyEventArgs e) diff --git a/WinAlfred/WinAlfred.csproj b/WinAlfred/WinAlfred.csproj index f77fec5eab..722066c294 100644 --- a/WinAlfred/WinAlfred.csproj +++ b/WinAlfred/WinAlfred.csproj @@ -59,6 +59,9 @@ + + C:\Users\Scott\Desktop\Jurassic.dll + ..\packages\log4net.2.0.3\lib\net35-full\log4net.dll