プロパティ: Toolbars を Commands として (読み取り専用)
ディスパッチ ID: 1005
詳細:
このプロパティは、XMLSpyControl ツールバーの構造の情報 を Command オブジェクトとして与えます。 Command オブジェクトには、 XMLSpy の使用することのできる全てのツールバー が含まれています。 ツールバーにアクセスするには、 Toolbars プロパティの SubCommands プロパティを使用します。各ツールバー は、 Command オブジェクトでもあります。 各ツールバーのために、コマンドを使用するために SubCommands プロパティを更に反復します (例えば、アプリケーションの ツールバー プログラム的に作成するためなどにこのテクニックは使用される場合があります)。
public void GetXmlSpyToolbars()
{
// Get the application toolbars from the StyleVision ActiveX control assigned to the current form
XMLSpyControlLib.XMLSpyCommands toolbars = this.axXMLSpyControl1.Toolbars;
// Iterate through all toolbars
for (int i = 0; i < toolbars.Count; i++)
{
XMLSpyControlLib.XMLSpyCommand toolbar = toolbars[i];
Console.WriteLine();
Console.WriteLine("The toolbar \"{0}\" has the following commands:", toolbar.Label);
// Iterate through all commands of this toolbar
for (int j = 0; j < toolbar.SubCommands.Count; j++)
{
XMLSpyControlLib.XMLSpyCommand cmd = toolbar.SubCommands[j];
// Output only command objects that are not separators
if (!cmd.IsSeparator)
{
Console.WriteLine("{0}, {1}, {2}", cmd.ID, cmd.Name, cmd.Label.Replace("&", ""));
}
}
}
}
|
C# サンプル