public object BuildItem(object caller, Codon codon, ArrayList subItems) { string highlightingName = codon.Properties["name"]; string[] extensions = codon.Properties["extensions"].Split(';'); string resource = codon.Properties["resource"]; Runtime[] assemblies = new Runtime[codon.AddIn.Runtimes.Count]; int i = 0; foreach (Runtime library in codon.AddIn.Runtimes) { assemblies[i++] = library; } return new AddInTreeSyntaxMode(assemblies, resource, highlightingName, extensions); }
public AddInTreeSyntaxMode(Runtime[] runtimes, string fileName, string name, string[] extensions) : base(fileName, name, extensions) { this.runtimes = runtimes; }
internal static Runtime Read(AddIn addIn, XmlReader reader, string hintPath, Stack<ICondition> conditionStack) { if (reader.AttributeCount != 1) { throw new AddInLoadException("Import node requires ONE attribute."); } Runtime runtime = new Runtime(reader.GetAttribute(0), hintPath); if (conditionStack.Count > 0) { runtime.conditions = conditionStack.ToArray(); } if (!reader.IsEmptyElement) { while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.EndElement: if (reader.LocalName == "Import") { return runtime; } break; case XmlNodeType.Element: string nodeName = reader.LocalName; Properties properties = Properties.ReadFromAttributes(reader); switch (nodeName) { case "Doozer": if (!reader.IsEmptyElement) { throw new AddInLoadException("Doozer nodes must be empty!"); } runtime.definedDoozers.Add(new LazyLoadDoozer(addIn, properties)); break; case "ConditionEvaluator": if (!reader.IsEmptyElement) { throw new AddInLoadException("ConditionEvaluator nodes must be empty!"); } runtime.definedConditionEvaluators.Add(new LazyConditionEvaluator(addIn, properties)); break; default: throw new AddInLoadException("Unknown node in Import section:" + nodeName); } break; } } } runtime.definedDoozers = (runtime.definedDoozers as List<LazyLoadDoozer>).AsReadOnly(); runtime.definedConditionEvaluators = (runtime.definedConditionEvaluators as List<LazyConditionEvaluator>).AsReadOnly(); return runtime; }
public AddInHighlightingResource(Runtime[] runtimes) { this.runtimes = runtimes; }
public TextTemplatingAddInRuntime(Runtime runtime) { this.runtime = runtime; }