public bool MatchResource(IResource res, IActionParameterStore actionStore) { string pattern = actionStore.ParameterAsString(); stream.Init(); Core.PluginLoader.InvokeResourceTextProviders(res, stream); return(stream.Body.IndexOf(pattern) != -1); }
public void Exec(IResource res, IActionParameterStore actionStore) { string val = actionStore.ParameterAsString().ToLower(); ResourceProxy proxy = new ResourceProxy(res); proxy.BeginUpdate(); if (val == "1" || val == "-1") { proxy.SetProp(STR.Importance, Int32.Parse(val)); } else { proxy.DeleteProp(STR.Importance); } proxy.EndUpdate(); }
public void Exec(IResource res, IActionParameterStore actionStore) { Guard.NullArgument(res, "res"); Guard.NullArgument(actionStore, "actionStore"); if (res.Type != "RSSItem") { throw new ArgumentException("EnclosureDownloadRuleAction was registered for RSSItem only but there resource with type = '" + res.Type + "'"); } Tracer._Trace("Execute rule: EnclosureDownloadRuleAction"); if (res.HasProp(Props.EnclosureURL)) { string folder = actionStore.ParameterAsString(); EnclosureDownloadManager.PlanToDownload(res, folder); } }
public void Exec(IResource res, IActionParameterStore actionStore) { string fileName = actionStore.ParameterAsString(); Process process = new Process(); Trace.WriteLine("RunApplcationAction - starting " + fileName); try { process.StartInfo.FileName = fileName; process.StartInfo.WorkingDirectory = "."; process.StartInfo.CreateNoWindow = true; process.StartInfo.UseShellExecute = false; if (!process.Start()) { throw(new Exception("RunApplcationAction - Aplication did not managed to" + "call Start for the process with filename: " + fileName)); } } catch (Exception e) { Trace.WriteLine("RunApplcationAction - failed to start application with reason: " + e.Message); } }
public void Exec(IResource res, IActionParameterStore actionStore) { string message = actionStore.ParameterAsString(); DelayedExec(res, message); }
public void Exec(IResource res, IActionParameterStore actionStore) { string soundFileName = actionStore.ParameterAsString(); WindowsMultiMedia.PlaySound(soundFileName, (IntPtr)0, WindowsMultiMedia.SND_FILENAME); }