Esempio n. 1
0
        // This will fire whenever account (login) status changes value.
        public void OnAccountStatus(SktAccount sender, SktEvents.OnAccountStatusArgs e)
        {
            textBox1.AppendText(e.value.ToString() + '\n');

            if (e.value == SktAccount.STATUS.LOGGED_IN)
            {
                textBox1.AppendText(String.Format("Hello {0}! You should see this account as online on Skype, in a few seconds.\n", username));
            }

            if (e.value == SktAccount.STATUS.LOGGED_OUT)
            {
                textBox1.AppendText("Login failed because of " + sender.P_LOGOUTREASON + '\n');
            }
        }
Esempio n. 2
0
        public void OnAccountStatus(SktAccount sender, SktEvents.OnAccountStatusArgs e)
        {
            feedbackLabel.Text = "Login in progress.. " + sender.P_STATUS.ToString();
            if (e.value == SktAccount.STATUS.LOGGED_IN)
            {
                feedbackLabel.Text = "";
                UpdateContactListBox();
            }

            if (e.value == SktAccount.STATUS.LOGGED_OUT)
            {
                DialogResult result = MessageBox.Show(this,
                    "Login failed because of " + sender.P_LOGOUTREASON.ToString(), "Login has failed",
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1,MessageBoxOptions.RightAlign);
            }
        }
Esempio n. 3
0
        // Logging account status, and when it goes LOGGED_IN, populate our listbox.
        public void OnAccountStatus(SktAccount sender, SktEvents.OnAccountStatusArgs e)
        {
            this.messageLog.AppendText(e.value.ToString() + "\r\n");

            if (e.value == SktAccount.STATUS.LOGGED_IN)
            {
                this.messageLog.AppendText("Retrieving conversation list..\r\n");

                conversationList = skype.GetConversationList(SktConversation.LIST_TYPE.INBOX_CONVERSATIONS);

                foreach (SktConversation conversation in conversationList)
                {
                    // Because we overrided SktConverstaion.ToString, we can add
                    // Conversation objects directly, to a standard ListBox.
                    this.conversationListBox.Items.Add(conversation);
                }
            }

            if (e.value == SktAccount.STATUS.LOGGED_OUT)
            {
                this.messageLog.AppendText("Login failed because of " + sender.P_LOGOUTREASON + "\r\n");
            }
        }
 /**  Returns state of a given account capability. Takes Contact class CAPABILITY property as input argument
   and returns its state and expiration timestamp where appropriate. For example (C++ wrapper, with other
   wrappers the syntax may vary but the idea is the same) SktMyAccount.GetCapabilityStatus(Contact.CAPABILITY_SKYPEOUT,
   Cap, T); will return SktAccount.CAPABILITY_EXISTS if local account has SkypeOut enabled.
 @param [out] status
 @param [out] expiryTimestamp
 @param [in] capability
  */
 public void GetCapabilityStatus(
 out SktAccount.CAPABILITYSTATUS status,
 out DateTime               expiryTimestamp,
 SktContact.CAPABILITY      capability)
 {
     if (skypeRef.logging) skypeRef.Log("Executing Account.GetCapabilityStatus");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 21, OID);
     skypeRef.encoder.AddEnumParam(1, (uint)capability);
     skypeRef.transport.SubmitMethodRequest (RequestId);
     Dictionary<uint, uint> tagMap = new Dictionary<uint, uint> { {1, 1}, {2, 2} };
     object[] args = new object[2];
     args[0] = 0;
     args[1] = 0;
     skypeRef.decoder.DecodeMethodResponseArguments(2, ref args, new uint[2]{0,0}, ref tagMap, "SktAccount.GetCapabilityStatus");
     status = (SktAccount.CAPABILITYSTATUS)args[0];
     expiryTimestamp = (DateTime)args[1];
 }
 internal void FireOnAccountTimezone(SktAccount sender, uint value)
 {
     if (OnAccountTimezone == null) return; // Event not assigned
     OnAccountTimezoneArgs args = new OnAccountTimezoneArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnAccountTimezoneInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnAccountTimezone, new object[] { sender, args }); // Syncing to GUI thread
 }
 internal void FireOnAccountServiceProviderInfo(SktAccount sender, String value)
 {
     if (OnAccountServiceProviderInfo == null) return; // Event not assigned
     OnAccountServiceProviderInfoArgs args = new OnAccountServiceProviderInfoArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnAccountServiceProviderInfoInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnAccountServiceProviderInfo, new object[] { sender, args }); // Syncing to GUI thread
 }
 internal void FireOnAccountPwdchangestatus(SktAccount sender, SktAccount.PWDCHANGESTATUS value)
 {
     if (OnAccountPwdchangestatus == null) return; // Event not assigned
     OnAccountPwdchangestatusArgs args = new OnAccountPwdchangestatusArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnAccountPwdchangestatusInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnAccountPwdchangestatus, new object[] { sender, args }); // Syncing to GUI thread
 }
 internal void FireOnAccountAvailability(SktAccount sender, SktContact.AVAILABILITY value)
 {
     if (OnAccountAvailability == null) return; // Event not assigned
     OnAccountAvailabilityArgs args = new OnAccountAvailabilityArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnAccountAvailabilityInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnAccountAvailability, new object[] { sender, args }); // Syncing to GUI thread
 }
 public OnAccountWebpresencePolicyArgs(SktAccount sender, SktAccount.WEBPRESENCEPOLICY newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountSkypeCallPolicyArgs(SktAccount sender, SktAccount.SKYPECALLPOLICY newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountServiceProviderInfoArgs(SktAccount sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountRichMoodTextArgs(SktAccount sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountRegistrationTimestampArgs(SktAccount sender, DateTime newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountPwdchangestatusArgs(SktAccount sender, SktAccount.PWDCHANGESTATUS newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountPstnCallPolicyArgs(SktAccount sender, SktAccount.PSTNCALLPOLICY newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountTimezonePolicyArgs(SktAccount sender, SktAccount.TIMEZONEPOLICY newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountVoicemailPolicyArgs(SktAccount sender, SktAccount.VOICEMAILPOLICY newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public OnAccountSkypeinNumbersArgs(SktAccount sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 public void Add(SktAccount item)
 {
     base.Add((SktAccount)item);
 }
 public OnAccountSkypeoutBalanceArgs(SktAccount sender, uint newValue)
 {
     this.sender = sender;  value = newValue;
 }
 internal void FireOnAccountLogoutreason(SktAccount sender, SktAccount.LOGOUTREASON value)
 {
     if (OnAccountLogoutreason == null) return; // Event not assigned
     OnAccountLogoutreasonArgs args = new OnAccountLogoutreasonArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnAccountLogoutreasonInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnAccountLogoutreason, new object[] { sender, args }); // Syncing to GUI thread
 }
 public OnAccountSkypeoutBalanceCurrencyArgs(SktAccount sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 internal void FireOnAccountRegistrationTimestamp(SktAccount sender, DateTime value)
 {
     if (OnAccountRegistrationTimestamp == null) return; // Event not assigned
     OnAccountRegistrationTimestampArgs args = new OnAccountRegistrationTimestampArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnAccountRegistrationTimestampInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnAccountRegistrationTimestamp, new object[] { sender, args }); // Syncing to GUI thread
 }
 public OnAccountSkypeoutPrecisionArgs(SktAccount sender, uint newValue)
 {
     this.sender = sender;  value = newValue;
 }
 internal void FireOnAccountSkypeoutBalanceCurrency(SktAccount sender, String value)
 {
     if (OnAccountSkypeoutBalanceCurrency == null) return; // Event not assigned
     OnAccountSkypeoutBalanceCurrencyArgs args = new OnAccountSkypeoutBalanceCurrencyArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnAccountSkypeoutBalanceCurrencyInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnAccountSkypeoutBalanceCurrency, new object[] { sender, args }); // Syncing to GUI thread
 }
 public OnAccountStatusArgs(SktAccount sender, SktAccount.STATUS newValue)
 {
     this.sender = sender;  value = newValue;
 }
 internal void FireOnAccountWebpresencePolicy(SktAccount sender, SktAccount.WEBPRESENCEPOLICY value)
 {
     if (OnAccountWebpresencePolicy == null) return; // Event not assigned
     OnAccountWebpresencePolicyArgs args = new OnAccountWebpresencePolicyArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnAccountWebpresencePolicyInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnAccountWebpresencePolicy, new object[] { sender, args }); // Syncing to GUI thread
 }
 public OnAccountSuggestedSkypenameArgs(SktAccount sender, String newValue)
 {
     this.sender = sender;  value = newValue;
 }
 /* SktAccount class methods */
 /**
 @param [out] status Current value of this account's P_STATUS property
 @param [out] progress This argument returns 0.
  */
 public void GetStatusWithProgress(out SktAccount.STATUS status, out uint progress)
 {
     if (skypeRef.logging) skypeRef.Log("Executing Account.GetStatusWithProgress");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 1, OID);
     skypeRef.transport.SubmitMethodRequest (RequestId);
     Dictionary<uint, uint> tagMap = new Dictionary<uint, uint> { {1, 1}, {2, 2} };
     object[] args = new object[2];
     args[0] = 0;
     args[1] = 0;
     skypeRef.decoder.DecodeMethodResponseArguments(2, ref args, new uint[2]{0,0}, ref tagMap, "SktAccount.GetStatusWithProgress");
     status = (SktAccount.STATUS)args[0];
     progress = (uint)args[1];
 }
 public OnAccountTimezoneArgs(SktAccount sender, uint newValue)
 {
     this.sender = sender;  value = newValue;
 }