8
public class OpenFileCondition: ConditionType
10
public OpenFileCondition ()
12
// It's important to notify changes in the status of a condition,
13
// to make sure the extension points are properly updated.
14
TextEditorApp.OpenFileChanged += delegate {
19
public override bool Evaluate (NodeElement conditionNode)
21
// Get the required extension value from an attribute,
22
// and check againts the extension of the currently open document
23
string val = conditionNode.GetAttribute ("extension");
25
string ext = Path.GetExtension (TextEditorApp.OpenFileName);
26
foreach (string requiredExtension in val.Split (','))
27
if (ext == "." + requiredExtension)