예제 #1
0
        public static void Delete(ZObject obj)
        {
            var co = GetCycleObjectByObj(obj);

            if (co == null)
            {
                ZLogger.Warning($"{obj.GetType().Name} is not a cycle object");
                return;
            }

            co.Use = false;
        }
예제 #2
0
            private Dictionary <string, ReadJsonDelegate> GetReadJsonDelegates(ZObject obj)
            {
                var type   = obj.GetType();
                var result = new Dictionary <string, ReadJsonDelegate>();

                while (type != typeof(ZObject))
                {
                    var readJsonMethod = type.GetMethod("ReadJson", readJsonArgumentTypes);

                    if (!(readJsonMethod is null) && readJsonMethod.DeclaringType == type)
                    {
                        result.Add(type.FullName, (ReadJsonDelegate)Delegate.CreateDelegate(typeof(ReadJsonDelegate), obj, readJsonMethod));
                    }

                    type = type.BaseType;
                }

                return(result);
            }