Exemplo n.º 1
0
        public static TriggerXml LoadFile(string filename)
        {
            XmlSerializer xs = new XmlSerializer(typeof(TriggerXml));
            TriggerXml    p  = null;

            using (StreamReader rd = new StreamReader(filename))
            {
                p = xs.Deserialize(rd) as TriggerXml;
            }

            return(p);
        }
Exemplo n.º 2
0
        public static void SaveSample(string filename)
        {
            var obj = new TriggerXml()
            {
                Description  = "description",
                GroupName    = "GroupName",
                JobGroupName = "JobGroupName",
                JobName      = "JobName",
                Name         = "Name",
                RepeatCount  = 0,
                ScheduleIntervaleInSeconds = 180
            };

            XmlSerializer xs = new XmlSerializer(typeof(TriggerXml));

            using (StreamWriter wr = new StreamWriter(filename))
            {
                xs.Serialize(wr, obj);
            }
        }