本文整理汇总了C#中Codon类的典型用法代码示例。如果您正苦于以下问题:C# Codon类的具体用法?C# Codon怎么用?C# Codon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Codon类属于命名空间,在下文中一共展示了Codon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToolBarCheckBox
public ToolBarCheckBox(Codon codon, object caller)
{
ToolTipService.SetShowOnDisabled(this, true);
this.codon = codon;
this.caller = caller;
this.Command = CommandWrapper.GetCommand(codon, caller, true);
CommandWrapper wrapper = this.Command as CommandWrapper;
if (wrapper != null) {
ICheckableMenuCommand cmd = wrapper.GetAddInCommand() as ICheckableMenuCommand;
if (cmd != null) {
isCheckedBinding = SetBinding(IsCheckedProperty, new Binding("IsChecked") { Source = cmd, Mode = BindingMode.OneWay });
}
}
if (codon.Properties.Contains("icon")) {
var image = PresentationResourceService.GetImage(StringParser.Parse(codon.Properties["icon"]));
image.Height = 16;
image.SetResourceReference(StyleProperty, ToolBarService.ImageStyleKey);
this.Content = image;
} else {
this.Content = codon.Id;
}
UpdateText();
SetResourceReference(FrameworkElement.StyleProperty, ToolBar.CheckBoxStyleKey);
}
示例2: CommandWrapper
public CommandWrapper(Codon codon, object caller, ICommand command)
{
this.codon = codon;
this.caller = caller;
this.addInCommand = command;
commandCreated = true;
}
示例3: MenuCheckBox
public MenuCheckBox(Codon codon, object caller)
{
this.RightToLeft = RightToLeft.Inherit;
this.caller = caller;
this.codon = codon;
UpdateText();
}
示例4: MenuSeparator
public MenuSeparator(Codon codon, object caller, IEnumerable<ICondition> conditions)
{
this.RightToLeft = RightToLeft.Inherit;
this.caller = caller;
this.codon = codon;
this.conditions = conditions;
}
示例5: ToolBarSplitButton
public ToolBarSplitButton(Codon codon, object caller, ArrayList subItems, IEnumerable<ICondition> conditions)
{
this.RightToLeft = RightToLeft.Inherit;
this.caller = caller;
this.codon = codon;
this.subItems = subItems;
this.conditions = conditions;
if (codon.Properties.Contains("label")){
Text = StringParser.Parse(codon.Properties["label"]);
}
if (imgButtonEnabled == null && codon.Properties.Contains("icon")) {
imgButtonEnabled = WinFormsResourceService.GetBitmap(StringParser.Parse(codon.Properties["icon"]));
}
if (imgButtonDisabled == null && codon.Properties.Contains("disabledIcon")) {
imgButtonDisabled = WinFormsResourceService.GetBitmap(StringParser.Parse(codon.Properties["disabledIcon"]));
}
if (imgButtonDisabled == null) {
imgButtonDisabled = imgButtonEnabled;
}
menuCommand = codon.AddIn.CreateObject(codon.Properties["class"]) as ICommand;
menuCommand.Owner = this;
UpdateStatus();
UpdateText();
}
示例6: ToolBarCheckBox
public ToolBarCheckBox(Codon codon, object caller, IEnumerable<ICondition> conditions)
{
ToolTipService.SetShowOnDisabled(this, true);
this.codon = codon;
this.caller = caller;
this.conditions = conditions;
this.Command = CommandWrapper.GetCommand(codon, caller, true, conditions);
CommandWrapper wrapper = this.Command as CommandWrapper;
if (wrapper != null) {
ICheckableMenuCommand cmd = wrapper.GetAddInCommand() as ICheckableMenuCommand;
if (cmd != null) {
#if ModifiedForAltaxo
isCheckedBinding = SetBinding(IsCheckedProperty, new Binding("IsChecked") { Source = cmd, Mode = BindingMode.TwoWay });
#else
isCheckedBinding = SetBinding(IsCheckedProperty, new Binding("IsChecked") { Source = cmd, Mode = BindingMode.OneWay });
#endif
}
}
this.Content = ToolBarService.CreateToolBarItemContent(codon);
if (codon.Properties.Contains("name")) {
this.Name = codon.Properties["name"];
}
UpdateText();
SetResourceReference(FrameworkElement.StyleProperty, ToolBar.CheckBoxStyleKey);
}
示例7: ToolBarButton
public ToolBarButton(UIElement inputBindingOwner, Codon codon, object caller, bool createCommand, IReadOnlyCollection<ICondition> conditions)
{
ToolTipService.SetShowOnDisabled(this, true);
this.codon = codon;
this.caller = caller;
if (createCommand)
this.Command = CommandWrapper.CreateCommand(codon, conditions);
else
this.Command = CommandWrapper.CreateLazyCommand(codon, conditions);
this.CommandParameter = caller;
this.Content = ToolBarService.CreateToolBarItemContent(codon);
this.conditions = conditions;
if (codon.Properties.Contains("name")) {
this.Name = codon.Properties["name"];
}
if (!string.IsNullOrEmpty(codon.Properties["shortcut"])) {
KeyGesture kg = MenuService.ParseShortcut(codon.Properties["shortcut"]);
MenuCommand.AddGestureToInputBindingOwner(inputBindingOwner, kg, this.Command, GetFeatureName());
this.inputGestureText = MenuService.GetDisplayStringForShortcut(kg);
}
UpdateText();
SetResourceReference(FrameworkElement.StyleProperty, ToolBar.ButtonStyleKey);
}
示例8: BuildItem
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems)
{
ServerStartup server = new ServerStartup();
server.Startup();
return server;
}
示例9: MenuCheckBox
public MenuCheckBox(Codon codon, object caller, IEnumerable<ICondition> conditions)
{
this.RightToLeft = RightToLeft.Inherit;
this.caller = caller;
this.codon = codon;
this.conditions = conditions;
UpdateText();
}
示例10: ConditionalSeparator
public ConditionalSeparator(Codon codon, object caller, bool inToolbar)
{
this.codon = codon;
this.caller = caller;
if (inToolbar) {
SetResourceReference(FrameworkElement.StyleProperty, ToolBar.SeparatorStyleKey);
}
}
示例11: CommandWrapper
public CommandWrapper(Codon codon, object caller, ICommand command, IEnumerable<ICondition> conditions)
{
if (conditions == null)
throw new ArgumentNullException("conditions");
this.codon = codon;
this.caller = caller;
this.addInCommand = command;
this.conditions = conditions;
commandCreated = true;
}
示例12: Menu
public Menu(Codon codon, object caller, IList subItems)
{
if (subItems == null) subItems = new ArrayList(); // don't crash when item has no children
this.codon = codon;
this.caller = caller;
this.subItems = subItems;
this.RightToLeft = RightToLeft.Inherit;
UpdateText();
}
示例13: ToolBarComboBox
public ToolBarComboBox(Codon codon, object caller)
{
if (codon == null)
throw new ArgumentNullException("codon");
this.IsEditable = false;
menuCommand = (IComboBoxCommand)codon.AddIn.CreateObject(codon.Properties["class"]);
menuCommand.ComboBox = this;
menuCommand.Owner = caller;
SetResourceReference(FrameworkElement.StyleProperty, ToolBar.ComboBoxStyleKey);
}
示例14: BuildItem
public object BuildItem(object caller, Codon codon, System.Collections.ArrayList subItems)
{
IMsgReceiver receiver = MsgMonitor.GetReceiver(codon.ID);
if (receiver == null)
{
receiver = new GameConnecter(codon.ID);
}
return receiver;
}
示例15: MenuCommand
public MenuCommand(UIElement inputBindingOwner, Codon codon, object caller, string activationMethod, IReadOnlyCollection<ICondition> conditions) : base(codon, caller, conditions)
{
this.ActivationMethod = activationMethod;
this.Command = CommandWrapper.CreateLazyCommand(codon, conditions);
this.CommandParameter = caller;
if (!string.IsNullOrEmpty(codon.Properties["shortcut"])) {
KeyGesture kg = MenuService.ParseShortcut(codon.Properties["shortcut"]);
AddGestureToInputBindingOwner(inputBindingOwner, kg, this.Command, GetFeatureName());
this.InputGestureText = MenuService.GetDisplayStringForShortcut(kg);
}
}