public TdlMethod AddMethod(string identifier) { if (MethodIdentifierLookup.ContainsKey(identifier)) { return(null); } TdlMethod method = new TdlMethod(identifier, this); _Methods.Add(method); MethodLookup.Add(method.FieldId, method); MethodIdentifierLookup.Add(identifier, method); AddField(method); return(method); }
private static void RegisterMethod <T>(EventType e, MethodLookup <T> lookup, T method, bool scheduled) where T : FlowMethod { FlowMethodSet <T> methods; if (!lookup.TryGetValue(e, out methods)) { methods = new FlowMethodSet <T>(); lookup.Add(e, methods); } if (scheduled) { methods.ScheduledMethods.Write.Add(method); } else { methods.Methods.Write.Add(method); } }