public SkypePicker() { InitializeComponent(); this.skypeClient = new SkypeClient(); this.user = null; this.lastUser = this.txtEmail.Text; this.EventsEnabled = false; }
static void Main(string[] args) { Console.Write("user: "******"pass: "******"Fetching friends list"); var friends = client.GetFriends(); foreach (var friend in friends) { Console.WriteLine(friend.FullName + " (" + friend.SkypeName + ")"); } Console.WriteLine("Fetching auth requests"); var authRequests = client.GetAuthRequests(); foreach (var authRequest in authRequests) { Console.WriteLine("Accepting auth request from " + authRequest.Sender); client.AcceptAuthRequest(authRequest.Sender); } Console.WriteLine("Setting up subscription"); int subscription = client.CreateSubscription(); for (;;) { Console.WriteLine("Polling subscription"); var poll = client.PollSubscription(subscription); if (poll != null && poll.EventMessages != null) { foreach (var msg in poll.EventMessages) { if (msg.ResourceType == "NewMessage") { string from = msg.Resource.From.Substring(msg.Resource.From.LastIndexOf("8:") + 2); if (from != client.UserName) { Console.WriteLine("Message from {0}: {1}", from, msg.Resource.Content); string conversation = msg.Resource.ConversationLink.Substring( msg.Resource.ConversationLink.LastIndexOf('/') + 1); client.SendMessage(conversation, msg.Resource.Content); } } } } } }
/// <summary> /// Stars the command line logic. /// </summary> private void Run() { var skypeClient = new SkypeClient(new ConsoleLogger()); string readLine = string.Empty; while (readLine != TerminateLine) { readLine = Console.ReadLine(); if (string.Compare(readLine, UpdateProjectsInfoLine, StringComparison.OrdinalIgnoreCase) == 0) { skypeClient.UpdateProjectsInfo(); } } }