예제 #1
0
파일: StateCapture.cs 프로젝트: fry/refw
        public static StateCapture CaptureState()
        {
            var stateCapture = new StateCapture();
            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {
                var types = assembly.GetExportedTypes();
                foreach (var reloadable in types.Where(t => t.IsSubclassOf(typeof(Reloadable)))) {
                    var state = (byte[])reloadable.GetMethod("SaveState", BindingFlags.Public | BindingFlags.Static).Invoke(null, null);
                    stateCapture.stateCapture.Add(new Tuple<string, byte[]>(reloadable.FullName, state));
                }
            }

            return stateCapture;
        }
예제 #2
0
        public static StateCapture CaptureState()
        {
            var stateCapture = new StateCapture();

            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
            {
                var types = assembly.GetExportedTypes();
                foreach (var reloadable in types.Where(t => t.IsSubclassOf(typeof(Reloadable))))
                {
                    var state = (byte[])reloadable.GetMethod("SaveState", BindingFlags.Public | BindingFlags.Static).Invoke(null, null);
                    stateCapture.stateCapture.Add(new Tuple <string, byte[]>(reloadable.FullName, state));
                }
            }

            return(stateCapture);
        }