Esempio n. 1
0
        } // SaveTo

        public static string SaveAsString(this RecordTask task)
        {
            var buffer = new StringBuilder();

            task.SaveTo(buffer);
            return(buffer.ToString());
        } // SaveAsString
Esempio n. 2
0
        } // SaveAsString

        public static void SaveTo(this RecordTask task, StringBuilder buffer)
        {
            using (var writer = XmlWriter.Create(buffer, new XmlWriterSettings()
            {
                Indent = true
            }))
            {
                task.SaveTo(writer);
            } // using
        }     // SaveTo
Esempio n. 3
0
        } // GetDbSaveCommand

        private static SqlCeCommand GetDbSaveCommand(RecordTask task)
        {
            var cmd = GetDbSaveCommand();

            cmd.Parameters["@TaskId"].Value          = task.TaskId;
            cmd.Parameters["@TaskName"].Value        = task.Description.Name;
            cmd.Parameters["@SchedulerName"].Value   = task.Description.TaskSchedulerName;
            cmd.Parameters["@SchedulerFolder"].Value = task.AdvancedSettings.TaskSchedulerFolder;

            return(cmd);
        } // GetDbLoadCommand
Esempio n. 4
0
        } // AdvancedSettings

        public static RecordTask CreateWithDefaultValues(RecordChannel channel)
        {
            RecordTask task;

            task = new RecordTask()
            {
                Channel          = channel ?? new RecordChannel(),
                Schedule         = RecordSchedule.CreateWithDefaultValues(RecordScheduleKind.OneTime),
                Duration         = RecordDuration.CreateWithDefaultValues(),
                Description      = RecordDescription.CreateWithDefaultValues(),
                Action           = RecordAction.CreateWithDefaultValues(),
                AdvancedSettings = RecordAdvancedSettings.CreateWithDefaultValues(),
            };

            return(task);
        } // CreateWithDefaultValues
Esempio n. 5
0
        }     // SaveTo

        public static void SaveTo(this RecordTask task, XmlWriter writer)
        {
            XmlSerialization.Serialize(writer, task);
        } // SaveTo
Esempio n. 6
0
        } // SaveToXmlFile

        public static void SaveTo(this RecordTask task, Stream stream)
        {
            XmlSerialization.Serialize(stream, task);
        } // SaveTo
Esempio n. 7
0
        } // SaveTo

        public static void SaveToXmlFile(this RecordTask task, string filename)
        {
            XmlSerialization.Serialize(filename, task);
        } // SaveToXmlFile
Esempio n. 8
0
        } // Save

        public static void SaveTo(this RecordTask task, SqlCeConnection cn)
        {
            var saveCmd = GetDbSaveCommand(task);

            DbServices.Save(cn, saveCmd, "@XmlData", task);
        } // SaveTo
Esempio n. 9
0
        } // LoadFromXmlFile

        #endregion

        #region Save methods

        public static void SaveToDatabase(this RecordTask task, string dbFile)
        {
            var saveCmd = GetDbSaveCommand(task);

            DbServices.Save(dbFile, saveCmd, "@XmlData", task);
        } // Save