public void SetSchedule(SPSchedule schedule) { if (schedule == null) { schedule = DefaultValues.GetSchedule(); } this.Timerjob.Schedule = schedule; }
static void Main(string[] args) { const string SiteUrl = "site_url"; const string AssamblyName = "assambly_name"; const string ClassName = "tj_class_name"; Console.OutputEncoding = Encoding.GetEncoding(1251); using (SPSite site = new SPSite(SiteUrl)) { using (SPWeb web = site.OpenWeb()) { object[] TJCtorParams = DefaultValues.GetInputParams(site); SPJobDefinitionCollection jobsCollection = DefaultValues.GetAllJobs(site); Hashtable properties = DefaultValues.GetProperties(site, web); TimerJobCreater.Create(AssamblyName, ClassName, TJCtorParams, jobsCollection, properties); TimerServiceLogic.RestartTimerService(); } } Console.WriteLine("End"); Console.ReadKey(); }