/// <summary> /// Take some action based on the command that came from Merlin. /// </summary> private void TakeAction(object obj) { //progressRing.IsActive = true; SysOps ops = new SysOps(); IntegrationProvider _provider = new IntegrationProvider("http://merlinserver.jit.su", codeBox.Password); Command command = _provider.GetCommand(); if (command.id == 0) //means there is not command to execute. { //_timer.Change(3, 10000); Console.WriteLine("No command received."); } else { switch (command.command_text) { case "lock": ops.LockComputer(); _provider.SendConfirmation(command.id, true); Console.WriteLine("Locked Computer now changing timer"); //_timer.Change(System.Threading.Timeout.Infinite, 5000); break; case "send mailjohn\n": ops.SendMail(null, null, null, command.file); _provider.SendConfirmation(command.id, true); Console.WriteLine("Mail Sent now changing timer"); //_timer.Change(System.Threading.Timeout.Infinite, 5000); break; default: Console.WriteLine("Invalid Command Saeen! :{)"); break; } } }
public RestIntegrationManager(IntegrationProvider manager) { Id = manager.Id; SPSiteId = manager.SPSiteID; SPWebId = manager.SPWebID; SPSiteUrl = manager.SPSiteURL; SPSiteName = manager.SPSiteName; TEGroupId = manager.TEGroupId; TEGroupName = manager.TEGroupName; IsDefault = manager.IsDefault; }
private void UpdateCurrentProvider(string spSiteUrl, Authentication auth) { if (pageMode == PageMode.Add) { currentProvider = new IntegrationProvider(spSiteUrl, 0, auth); } else { currentProvider.SPSiteURL = spSiteUrl; currentProvider.TEGroupId = 0; currentProvider.Authentication = auth; currentProvider.Initialize(); } currentProvider.IsDefault = CbIsDefault.Checked; const string script = @"setTimeout(function(){{CloseWindow('{0}');}},100);"; CSControlUtility.Instance().RegisterClientScriptBlock(this, typeof(Configuration), "closechildwindow", string.Format(script, JavaScript.Encode(currentProvider.ToXml())), true); }
protected override void OnInit(EventArgs e) { base.OnInit(e); allProviders = FromTempStore(); pageMode = Request.QueryString["mode"] == "add" ? PageMode.Add : PageMode.Edit; if (pageMode == PageMode.Add) { Page.Header.Title = AddPageTitleText; currentProvider = new IntegrationProvider(); CtAuth.Controls.Add(AuthenticationHelper.GetPropertyControls()); } else { Page.Header.Title = EditPageTitleText; currentProvider = allProviders.GetById(Request.QueryString["id"]); CtAuth.Controls.Add(AuthenticationHelper.SetPropertyControls(currentProvider.Authentication)); } TbSPSiteUrl.Text = currentProvider.SPSiteURL; CbIsDefault.Checked = currentProvider.IsDefault; SPSiteRequiredFieldValidator.ErrorMessage = EmptySPUrlErrorMsg; SPSiteRequiredFieldValidator.ToolTip = SPSiteRequiredFieldValidator.ErrorMessage; }
protected Integration(ILogger logger, IntegrationProvider integrationType) { _logger = logger; IntegrationType = integrationType; }
public IntegrationManagerPresenter(IntegrationProvider instance, string key, string url) { provider = instance; providersKey = key; baseUrl = url; }
protected EldProvider(IntegrationProvider integrationType) { IntegrationType = integrationType; Name = integrationType.ToString(); }
private void InsertProvider(IntegrationProviders providers, string data) { var provider = new IntegrationProvider(data); providers.Insert(provider); }