예제 #1
0
        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);
        }
예제 #2
0
        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);
            }
        }