コード例 #1
0
        private void Run()
        {
            Sections sections = new Sections();

            sections.Add(CommandLineArguments, Entries.MakeEntries(this.args));
            sections.Add(InputLines, this.InputGetter());
            sections.Add(SystemValues, this.GetSystemValues());
            sections.Add(EnvironmentVariables, this.EnvironmentVariablesGetter());
            sections.Add(CoreSiteSettings, this.CoreSiteGetter());
            sections.Add(HiveSiteSettings, this.HiveSiteGetter());
            sections.Add(MapRedSiteSettings, this.MapRedSiteGetter());
            sections.Add(Errors, this.errors);
            var ser = new SectionsSerializer();

            Console.Write(ser.Serialize(sections));
        }
コード例 #2
0
        public void ICanSerializeAndDeserializeProcDetailData()
        {
            Sections procData = new Sections();
            string[] args = new string[] { "a", "b", "c" };
            IDictionary<string, string> vars = new Dictionary<string, string>() { { "a", "1" }, { "b", "2" }, { "c", "3" } };
            ProcDetails procDetails = new ProcDetails(args);
            procData.Add(ProcDetails.CommandLineArguments, Entries.MakeEntries(args));
            procData.Add(ProcDetails.EnvironmentVariables, new Entries(vars));
            procData.Add(ProcDetails.CoreSiteSettings, new Entries(vars));
            procData.Add(ProcDetails.HiveSiteSettings, new Entries(vars));
            procData.Add(ProcDetails.MapRedSiteSettings, new Entries(vars));

            SectionsSerializer ser = new SectionsSerializer();
            var content = ser.Serialize(procData);
            Sections deserialized = ser.Deserialize(content);
            Help.DoNothing(deserialized);
            Help.DoNothing(procDetails);
        }
コード例 #3
0
 private void Run()
 {
     Sections sections = new Sections();
     sections.Add(CommandLineArguments, Entries.MakeEntries(this.args));
     sections.Add(InputLines, this.InputGetter());
     sections.Add(SystemValues, this.GetSystemValues());
     sections.Add(EnvironmentVariables, this.EnvironmentVariablesGetter());
     sections.Add(CoreSiteSettings, this.CoreSiteGetter());
     sections.Add(HiveSiteSettings, this.HiveSiteGetter());
     sections.Add(MapRedSiteSettings, this.MapRedSiteGetter());
     sections.Add(Errors, this.errors);
     var ser = new SectionsSerializer();
     Console.Write(ser.Serialize(sections));
 }