本文整理汇总了C#中ICSharpCode.Core.Codon类的典型用法代码示例。如果您正苦于以下问题:C# Codon类的具体用法?C# Codon怎么用?C# Codon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Codon类属于ICSharpCode.Core命名空间,在下文中一共展示了Codon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildItem
/// <summary>
/// Creates an item with the specified sub items. And the current
/// Condition status for this item.
/// </summary>
public object BuildItem(object caller, Codon codon, ArrayList subItems)
{
// if (subItems == null || subItems.Count > 0) {
// throw new ApplicationException("Tried to buil a command with sub commands, please check the XML definition.");
// }
return new DisplayBindingDescriptor(codon);
}
示例2: SchemeExtensionDescriptor
public SchemeExtensionDescriptor(Codon codon)
{
this.codon = codon;
schemeName = codon.Properties["scheme"];
if (schemeName == null || schemeName.Length == 0)
schemeName = codon.Id;
}
示例3: DisplayBindingDescriptor
public DisplayBindingDescriptor(Codon codon)
{
isSecondary = codon.Properties["type"] == "Secondary";
if (!isSecondary && codon.Properties["type"] != "" && codon.Properties["type"] != "Primary")
MessageService.ShowWarning("Unknown display binding type: " + codon.Properties["type"]);
this.codon = codon;
}
示例4: ToolbarItemDescriptor
public ToolbarItemDescriptor(object caller, Codon codon, IList subItems, IEnumerable<ICondition> conditions)
{
this.Caller = caller;
this.Codon = codon;
this.SubItems = subItems;
this.Conditions = conditions;
}
示例5: BuildItem
public object BuildItem(object caller, Codon codon, ArrayList subItems)
{
string type = codon.Properties.Contains("type") ? codon.Properties["type"] : "Item";
bool createCommand = codon.Properties["loadclasslazy"] == "false";
switch (type) {
case "Separator":
return new ToolBarSeparator(codon, caller);
case "CheckBox":
return new ToolBarCheckBox(codon, caller);
case "Item":
return new ToolBarCommand(codon, caller, createCommand);
case "ComboBox":
return new ToolBarComboBox(codon, caller);
case "TextBox":
return new ToolBarTextBox(codon, caller);
case "Label":
return new ToolBarLabel(codon, caller);
case "DropDownButton":
return new ToolBarDropDownButton(codon, caller, subItems);
case "SplitButton":
return new ToolBarSplitButton(codon, caller, subItems);
case "Builder":
return codon.AddIn.CreateObject(codon.Properties["class"]);
default:
throw new System.NotSupportedException("unsupported menu item type : " + type);
}
}
示例6: ToolbarItemDescriptor
public ToolbarItemDescriptor(object parameter, Codon codon, IList subItems, IReadOnlyCollection<ICondition> conditions)
{
this.Parameter = parameter;
this.Codon = codon;
this.SubItems = subItems;
this.Conditions = conditions;
}
示例7: AddNextPathChainString
private static string AddNextPathChainString(Codon codon)
{
if (codon.Properties.Contains("label"))
return StringParser.Parse(codon.Properties["label"]).Replace("&", "");
else
return codon.Id;
}
示例8: BuildItem
public object BuildItem(object caller, Codon codon, ArrayList subItems)
{
return new Tool {
ToolTipText = codon.Properties["tooltiptext"],
Command = codon.AddIn.CreateObject(codon.Properties["class"]) as AbstractCommand
};
}
示例9: DoSetUp
void DoSetUp(XmlReader reader, string endElement)
{
Stack<ICondition> conditionStack = new Stack<ICondition>();
List<Codon> innerCodons = new List<Codon>();
while (reader.Read()) {
switch (reader.NodeType) {
case XmlNodeType.EndElement:
if (reader.LocalName == "Condition" || reader.LocalName == "ComplexCondition") {
conditionStack.Pop();
} else if (reader.LocalName == endElement) {
if (innerCodons.Count > 0)
this.codons.Add(innerCodons);
return;
}
break;
case XmlNodeType.Element:
string elementName = reader.LocalName;
if (elementName == "Condition") {
conditionStack.Push(Condition.Read(reader));
} else if (elementName == "ComplexCondition") {
conditionStack.Push(Condition.ReadComplexCondition(reader));
} else {
Codon newCodon = new Codon(this.AddIn, elementName, Properties.ReadFromAttributes(reader), conditionStack.ToArray());
innerCodons.Add(newCodon);
if (!reader.IsEmptyElement) {
ExtensionPath subPath = this.AddIn.GetExtensionPath(this.Name + "/" + newCodon.Id);
subPath.DoSetUp(reader, elementName);
}
}
break;
}
}
if (innerCodons.Count > 0)
this.codons.Add(innerCodons);
}
示例10: BuildItem
public object BuildItem(object caller, Codon codon, ArrayList subItems)
{
return new FileFilterDescriptor {
Name = StringParser.Parse(codon.Properties["name"]),
Extensions = codon.Properties["extensions"]
};
}
示例11: MenuCheckBox
public MenuCheckBox(Codon codon, object caller)
{
this.RightToLeft = RightToLeft.Inherit;
this.caller = caller;
this.codon = codon;
UpdateText();
}
示例12: CommandWrapper
private CommandWrapper(Codon codon, IReadOnlyCollection<ICondition> conditions)
{
if (conditions == null)
throw new ArgumentNullException("conditions");
this.codon = codon;
this.conditions = conditions;
this.canExecuteChangedHandlersToRegisterOnCommand = new WeakCollection<EventHandler>();
}
示例13: CreateCommand
/// <summary>
/// Creates a non-lazy command.
/// </summary>
public static ICommand CreateCommand(Codon codon, IReadOnlyCollection<ICondition> conditions)
{
ICommand command = CreateCommand(codon);
if (command != null && conditions.Count == 0)
return command;
else
return new CommandWrapper(command, conditions);
}
示例14: BuildItem
public object BuildItem(object caller, Codon codon, ArrayList subItems)
{
string id = codon.Id;
string resource = codon.Properties["resource"];
ImageProxy proxy = ResourceImageProxy.FromResource(id,resource);
TextureManager.BuiltinTextures.Add(proxy);
return proxy;
}
示例15: ContextActionOptionPanelDescriptor
public ContextActionOptionPanelDescriptor(Codon codon)
{
this.id = codon.Id;
this.path = codon.Properties["path"];
this.label = codon.Properties["label"];
if (string.IsNullOrEmpty(label))
label = "Context Actions"; // TODO: Translate
}