private void OnAttach(TAttachmentStatus status) { Log(String.Format("Call Stats Changed: {0}", status.ToString())); switch (status) { case TAttachmentStatus.apiAttachSuccess: loggedAsLbl.Text = string.Format("{0} ({1})", skype.CurrentUser.FullName, skype.CurrentUser.Handle); attachedBtn.Enabled = false; break; case TAttachmentStatus.apiAttachNotAvailable: case TAttachmentStatus.apiAttachUnknown: case TAttachmentStatus.apiAttachPendingAuthorization: case TAttachmentStatus.apiAttachRefused: case TAttachmentStatus.apiAttachAvailable: loggedAsLbl.Text = "Please allow skype access"; attachedBtn.Enabled = true; break; } }
public void OurAttachmentStatus(TAttachmentStatus status) { Attached = false; // Write Attachment Status to Window this.textBox1.AppendText("Attachment Status: " + cSkype.Convert.AttachmentStatusToText(status)); this.textBox1.AppendText(" - " + status.ToString() + Environment.NewLine); this.textBox1.ScrollToCaret(); if (status == TAttachmentStatus.apiAttachAvailable) { try { // This attaches to the Skype4COM class statement cSkype.Attach(7, true); } catch (Exception) { // All Skype Logic uses TRY for safety } } else if (status == TAttachmentStatus.apiAttachSuccess) { try { // This attaches to the Skype using reference. We already sent an attach request // for the Skype class in the initialization procedure, which is how this // Attachment success was created. So now that we know we are connected // to the Skype Client, we need to Attach to the Skype Class as well. // If we don't attach to both the Skype using reference and the Skype class // reference we will never get User, Call, or Message events. This can best // be seen by starting Skype and then this Example application. You can see // that when you change your User status, Make a Call, Send or receive chat // Messages, that none of those events will be processed if this was commented // out. // It should be noted that this does cause a slight delay with the GUI when // you start this example program without the DoEvents below. System.Windows.Forms.Application.DoEvents(); skype.Attach(7, false); } catch (Exception) { // All Skype Logic uses TRY for safety } Attached = true; WasAttached = true; // If we have a queued Silent Mode request, We are attached, process it now if (PendingSilentModeStartup) { PendingSilentModeStartup = false; try { if (!skype.SilentMode) skype.SilentMode = true; } catch (Exception) { // All Skype Logic uses TRY for safety } } } else if ((status == TAttachmentStatus.apiAttachNotAvailable) && (Properties.Settings.Default.StopAtLogoffOrExit) && (WasAttached)) { this.Close(); } }
public void OurAttachmentStatus(TAttachmentStatus status) { Attached = false; // Write Attachment Status to Window this.textBox1.AppendText("Attachment Status: " + cSkype.Convert.AttachmentStatusToText(status)); this.textBox1.AppendText(" - " + status.ToString() + Environment.NewLine); this.textBox1.ScrollToCaret(); if (status == TAttachmentStatus.apiAttachAvailable) { try { // This attaches to the Skype4COM class statement cSkype.Attach(7, true); } catch (Exception) { // All Skype Logic uses TRY for safety } } else if (status == TAttachmentStatus.apiAttachSuccess) { try { // This attaches to the Skype using reference. We already sent an attach request // for the Skype class in the initialization procedure, which is how this // Attachment success was created. So now that we know we are connected // to the Skype Client, we need to Attach to the Skype Class as well. // If we don't attach to both the Skype using reference and the Skype class // reference we will never get User, Call, or Message events. This can best // be seen by starting Skype and then this Example application. You can see // that when you change your User status, Make a Call, Send or receive chat // Messages, that none of those events will be processed if this was commented // out. // It should be noted that this does cause a slight delay with the GUI when // you start this example program without the DoEvents below. System.Windows.Forms.Application.DoEvents(); skype.Attach(7, false); } catch (Exception) { // All Skype Logic uses TRY for safety } Attached = true; WasAttached = true; // If we have a queued Silent Mode request, We are attached, process it now if (PendingSilentModeStartup) { PendingSilentModeStartup = false; try { if (!skype.SilentMode) { skype.SilentMode = true; } } catch (Exception) { // All Skype Logic uses TRY for safety } } } else if ((status == TAttachmentStatus.apiAttachNotAvailable) && (Properties.Settings.Default.StopAtLogoffOrExit) && (WasAttached)) { this.Close(); } }
private void Skype_AttachmentStatus(TAttachmentStatus status) { switch (status) { case TAttachmentStatus.apiAttachPendingAuthorization: break; case TAttachmentStatus.apiAttachRefused: break; case TAttachmentStatus.apiAttachSuccess: break; default: this.Logger.Debug(status.ToString()); break; } }