Exemple #1
0
        protected override void ProcessRecord()
        {
            var setting = new Class.MemoryDump.MemoryDumpSetting();

            setting.Load();

            WriteObject(setting);
        }
        protected override void ProcessRecord()
        {
            Class.MemoryDump.MemoryDumpSetting setting = null;

            if (MemoryDump == null)
            {
                setting = new Class.MemoryDump.MemoryDumpSetting();
                setting.Load();

                string dumpTypeString = _dictionary[PARAM_DUMPTYPE].Value as string;
                if (!string.IsNullOrEmpty(dumpTypeString))
                {
                    setting.Type =
                        Enum.TryParse(dumpTypeString, out Class.MemoryDump.DumpType tempDumpType) ?
                        tempDumpType :
                        Class.MemoryDump.DumpType.None;
                }
                if (!string.IsNullOrEmpty(DumpFilePath))
                {
                    setting.DumpFilePath = DumpFilePath;
                }
                if (!string.IsNullOrEmpty(MiniDumpDir))
                {
                    setting.MiniDumpDir = MiniDumpDir;
                }
                if (WriteSystemLog != null)
                {
                    setting.WriteSystemLog = (bool)WriteSystemLog;
                }
                if (AutoReboot != null)
                {
                    setting.AutoReboot = (bool)AutoReboot;
                }
                if (OverwriteExistingFile != null)
                {
                    setting.OverwriteExistingFile = (bool)OverwriteExistingFile;
                }
                if (DisableAutomaticDelation != null)
                {
                    setting.DisableAutomaticDelation = (bool)DisableAutomaticDelation;
                }
            }
            else
            {
                setting = MemoryDump;
            }

            setting.Save();
        }