public virtual void SendMessage(string contact, string message) { _initService.Initialize(() => { Mouse.Instance.Click(_initService.GetMainWindow().FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.ClassNameProperty, "TSearchControl")).GetClickablePoint()); SelectAllAndRemove(); Keyboard.Instance.Send(contact); Mouse.Instance.Click(_initService.GetMainWindow().GetElementByName("Contacts") .FindFirst(TreeScope.Children, Condition.TrueCondition).GetClickablePoint()); Point point = _initService.GetMainWindow().GetElementByName("Insert emoticon").GetClickablePoint(); point.X -= 50; Mouse.Instance.Click(point); SelectAllAndRemove(); Keyboard.Instance.Send(message); Keyboard.Instance.PressSpecialKey(KeyboardInput.SpecialKeys.RETURN); }); }
public void InitSkype() { _initService.Initialize(() => { _rmqListener.Initialize(); _skypeListener.Initialize(); _rmqListener.SkypeMessageReceived += _rmqListener_SkypeMessageReceived; _skypeListener.SkypeMessageReceived += _skypeListener_SkypeMessageReceived; _skypeListener.FoundNewContact += _skypeListener_FoundNewContact; _processTimer = new Timer(ProcessQueue, null, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1)); }); }