From c8a60f2e4387b6a978c703586ea5451952d50e92 Mon Sep 17 00:00:00 2001 From: alcexhim Date: Fri, 26 Dec 2014 00:04:48 -0500 Subject: [PATCH] Really primitive indexer to fetch TemplateVariables by name --- CSharp/Plugins/UniversalEditor.Essential/Template.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CSharp/Plugins/UniversalEditor.Essential/Template.cs b/CSharp/Plugins/UniversalEditor.Essential/Template.cs index 758fb38d..6a20a21d 100644 --- a/CSharp/Plugins/UniversalEditor.Essential/Template.cs +++ b/CSharp/Plugins/UniversalEditor.Essential/Template.cs @@ -16,6 +16,17 @@ namespace UniversalEditor public class TemplateVariableCollection : System.Collections.ObjectModel.Collection { + public TemplateVariable this[string name] + { + get + { + foreach (TemplateVariable varr in this) + { + if (varr.Name == name) return varr; + } + return null; + } + } } private string mvarName = String.Empty;