|
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel.Design;
namespace SundbySoft.Controls.Design
{
/// <summary>
/// Provides a user interface that can edit a <see cref="ApplicationCommandCollection"/> at design time.
/// </summary>
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
class ApplicationCommandCollectionEditor : CollectionEditor
{
/// <summary>
/// Initializes a new instance of the <see cref="CollectionEditor"/> class using the specified collection type.
/// </summary>
/// <param name="type">The type of the collection for this editor to edit.</param>
public ApplicationCommandCollectionEditor(Type type)
: base(type)
{
}
/// <summary>
/// Creates a new instance of the specified collection item type.
/// </summary>
/// <param name="itemType">The type of item to create.</param>
/// <returns>A new instance of the specified object.</returns>
protected override object CreateInstance(Type itemType)
{
ApplicationCommand applicationCommand = base.CreateInstance(itemType) as ApplicationCommand;
UISwitchboard UISwitchboard = Context.Instance as UISwitchboard;
applicationCommand.UISwitchboard = UISwitchboard;
return applicationCommand;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Bjørn has developed software since 1984 mainly in C, C++ and C#.
Bjørn lives in Ormåsen, Buskerud in Norway. To contact Bjørn, email him at bjsundby@online.no. He also has a web site at http://www.sundbysoft.com.