本文整理汇总了C#中ICSharpCode.Core.AddIn类的典型用法代码示例。如果您正苦于以下问题:C# AddIn类的具体用法?C# AddIn怎么用?C# AddIn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AddIn类属于ICSharpCode.Core命名空间,在下文中一共展示了AddIn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoSetUp
void DoSetUp(XmlReader reader, string endElement, AddIn addIn)
{
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, addIn));
} else if (elementName == "ComplexCondition") {
conditionStack.Push(Condition.ReadComplexCondition(reader, addIn));
} 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, addIn);
}
}
break;
}
}
if (innerCodons.Count > 0)
this.codons.Add(innerCodons);
}
示例2: Codon
public Codon(AddIn addIn, string name, Properties properties, ICondition[] conditions)
{
this.addIn = addIn;
this.name = name;
this.properties = properties;
this.conditions = conditions;
}
示例3: GetExtensions
void GetExtensions(AddIn ai, TreeNode treeNode)
{
foreach (ExtensionPath ext in ai.Paths.Values) {
string[] name = ext.Name.Split('/');
TreeNode currentNode = treeNode;
if (name.Length < 1) {
continue;
}
for (int i = 1; i < name.Length; ++i) {
bool found = false;
foreach (TreeNode n in currentNode.Nodes) {
if (n.Text == name[i]) {
currentNode = n;
found = true;
break;
}
}
if (found) {
if (i == name.Length - 1 && currentNode.Tag == null)
currentNode.Tag = ext;
} else {
TreeNode newNode = new TreeNode(name[i]);
newNode.ImageIndex = 3;
newNode.SelectedImageIndex = 4;
if (i == name.Length - 1) {
newNode.Tag = ext;
}
currentNode.Nodes.Add(newNode);
currentNode = newNode;
}
}
}
}
示例4: ReadComplexCondition
public static ICondition ReadComplexCondition(XmlReader reader, AddIn addIn)
{
Properties properties = Properties.ReadFromAttributes(reader);
reader.Read();
ICondition condition = null;
while (reader.Read()) {
switch (reader.NodeType) {
case XmlNodeType.Element:
switch (reader.LocalName) {
case "And":
condition = AndCondition.Read(reader, addIn);
goto exit;
case "Or":
condition = OrCondition.Read(reader, addIn);
goto exit;
case "Not":
condition = NegatedCondition.Read(reader, addIn);
goto exit;
default:
throw new AddInLoadException("Invalid element name '" + reader.LocalName
+ "', the first entry in a ComplexCondition " +
"must be <And>, <Or> or <Not>");
}
}
}
exit:
if (condition != null) {
ConditionFailedAction action = properties.Get("action", ConditionFailedAction.Exclude);
condition.Action = action;
}
return condition;
}
示例5: Condition
public Condition(string name, Properties properties, AddIn addIn)
{
this.AddIn = addIn;
this.name = name;
this.properties = properties;
action = properties.Get("action", ConditionFailedAction.Exclude);
}
示例6: CreateAddIns
private void CreateAddIns()
{
// Create AddIn objects from *.addin files available in this assembly's output directory
FakeAddInTree _addInTree = new FakeAddInTree();
using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test.addin"))
{
_addIn1 = AddIn.Load(_addInTree, streamReader);
}
using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test_New.addin"))
{
_addIn1_new = AddIn.Load(_addInTree, streamReader);
}
using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test_2.addin"))
{
_addIn2 = AddIn.Load(_addInTree, streamReader);
}
using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test_2_New.addin"))
{
_addIn2_new = AddIn.Load(_addInTree, streamReader);
}
using (StreamReader streamReader = new StreamReader(@"TestResources\AddInManager2Test_noVersion.addin"))
{
_addIn_noVersion = AddIn.Load(_addInTree, streamReader);
}
}
示例7: LazyLoadDoozer
public LazyLoadDoozer(AddIn addIn, Properties properties)
{
this.addIn = addIn;
this.name = properties["name"];
this.className = properties["class"];
}
示例8: DefaultOptionPanelDescriptor
public DefaultOptionPanelDescriptor(string id, string label, AddIn addin, object owner, string optionPanelPath)
: this(id, label)
{
this.addin = addin;
this.owner = owner;
this.optionPanelPath = optionPanelPath;
}
示例9: LazyConditionEvaluator
public LazyConditionEvaluator(AddIn addIn, Properties properties)
{
if (addIn == null)
throw new ArgumentNullException("addIn");
this.addIn = addIn;
this.name = properties["name"];
this.className = properties["class"];
}
示例10: GetCodon
/// <summary>
/// Gets the codon with the specified extension path and name.
/// </summary>
public static Codon GetCodon(AddIn addin, string extensionPath, string name)
{
if (addin.Paths.ContainsKey(extensionPath)) {
ExtensionPath path = addin.Paths[extensionPath];
return GetCodon(path.Codons, name);
}
return null;
}
示例11: PadDescriptor
/// <summary>
/// Creates a new pad descriptor from the AddIn tree.
/// </summary>
public PadDescriptor(Codon codon)
{
addIn = codon.AddIn;
shortcut = codon.Properties["shortcut"];
category = codon.Properties["category"];
icon = codon.Properties["icon"];
title = codon.Properties["title"];
@class = codon.Properties["class"];
}
示例12: AddToTree
public void AddToTree(AddIn addIn)
{
if (addIn != null)
{
SD.Log.DebugFormatted(
"[AddInManager2.SD] Added {0} AddIn {1} to tree.", ((addIn.Action == AddInAction.Update) ? "updated" : "new"), addIn.Name);
((AddInTreeImpl)SD.AddInTree).InsertAddIn(addIn);
}
}
示例13: ManagedAddIn
public ManagedAddIn(AddIn addIn)
{
if (addIn == null)
{
throw new ArgumentNullException("addIn");
}
_addIn = addIn;
InstallationSource = AddInInstallationSource.Offline;
}
示例14: Codon
public Codon(AddIn addIn, string name, Properties properties, IReadOnlyList<ICondition> conditions)
{
if (name == null)
throw new ArgumentNullException("name");
if (properties == null)
throw new ArgumentNullException("properties");
this.addIn = addIn;
this.name = name;
this.properties = properties;
this.conditions = conditions;
}
示例15: PlugInProperties
public PlugInProperties(AddIn addIn)
{
m_AddIn = addIn;
InitializeComponent();
treeView1.Nodes[0].Tag = new PiGeneral(addIn);
Text = addIn.Name + " Properties";
if (addIn.Properties["required"] == "true")
button3.Enabled = false;
}