コード例 #1
0
ファイル: CommandManager.cs プロジェクト: aBothe/monodevelop
		/// <summary>
		/// Creates a command entry set.
		/// </summary>
		/// <returns>
		/// The command entry set.
		/// </returns>
		/// <param name='ctx'>
		/// Extension context to use to query the extension path
		/// </param>
		/// <param name='addinPath'>
		/// Extension path with the command definitions
		/// </param>
		public CommandEntrySet CreateCommandEntrySet (ExtensionContext ctx, string addinPath)
		{
			CommandEntrySet cset = new CommandEntrySet ();
			object[] items = ctx.GetExtensionObjects (addinPath, false);
			foreach (CommandEntry e in items)
				cset.Add (e);
			return cset;
		}
コード例 #2
0
ファイル: TestEvents.cs プロジェクト: wanglehui/mono-addins
        void CheckWriters(string test, ExtensionContext ctx, string path, params string[] values)
        {
            IWriter[] nodes;
            if (ctx != null)
                nodes = (IWriter[]) ctx.GetExtensionObjects (path, typeof(IWriter));
            else
                nodes = (IWriter[]) AddinManager.GetExtensionObjects (path, typeof(IWriter));

            Assert.AreEqual (nodes.Length, values.Length, test + " (count)");
            for (int n=0; n<values.Length; n++) {
                Assert.AreEqual (values[n], nodes[n].Write(), test + " (result #" + n + ")");
            }
        }