Exemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            if (!System.IO.File.Exists(tutorials.path + tutorials.keyfilename))
            {
                throw new Exception(String.Format(
                    "The keyfile (.pfx) path or filename {0} is incorrect?", tutorials.path + tutorials.keyfilename));
            }

            X509Certificate2 cert = new X509Certificate2(tutorials.path + tutorials.keyfilename, tutorials.keypassword);

            skype = new SktSkype(this, cert, false, false, 8963);

            skype.NewConversation   = (oid, skp) => { return new Conversation(oid, skp); };
            skype.NewMessage        = (oid, skp) => { return new Message(oid, skp); };

            skype.events.OnConnect += OnConnect;
            skype.events.OnAccountStatus += OnAccountStatus;
            skype.events.OnSkypeMessage += OnSkypeMessage;
            skype.events.OnSkypeConversationListChange += OnSkypeConversationListChange;

            skype.events.OnParticipantTextStatus += OnParticipantTextStatus;

            conversationListBox.SelectedIndexChanged += listBox1_SelectedIndexChanged;
            conversationListBox.MouseDoubleClick += conversationListBox_MouseDoubleClick;

            this.FormClosing += Form1_FormClosing;

            this.AcceptButton = sendButton;

            skype.LaunchRuntime(tutorials.path + tutorials.runtime, true);
            skype.Connect();
        }
Exemplo n.º 2
0
        public NewContacts()
        {
            InitializeComponent();
            feedbackLabel.Text = "";

            if (!System.IO.File.Exists(tutorials.path + tutorials.keyfilename))
            {
                throw new Exception(String.Format(
                    "The keyfile (.pfx) path or filename {0} is incorrect?", tutorials.path + tutorials.keyfilename));
            }

            X509Certificate2 cert = new X509Certificate2(tutorials.path + tutorials.keyfilename, tutorials.keypassword);
            skype = new SktSkype(this, cert, false, false, 8963);

            skype.NewContact = (oid, skp) => { return new MyContact(oid, skp); };

            skype.events.OnConnect += OnConnect;
            skype.events.OnAccountStatus += OnAccountStatus;
            skype.events.OnContactGroupChange += OnContactGroupChange;

            skype.events.OnContactSearchContactSearchStatus += OnContactSearchContactSearchStatus;
            skype.events.OnContactSearchNewResult += OnContactSearchNewResult;

            // Adding enter key to execute search for all the input lines
            skypeNameTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(SearchFieldKeyDown);
            fullNameTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(SearchFieldKeyDown);
            emailTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(SearchFieldKeyDown);

            this.FormClosing += Form1_FormClosing;
            skype.LaunchRuntime(tutorials.path + tutorials.runtime, true, "");

            skype.Connect();
        }
Exemplo n.º 3
0
        public Form1()
        {
            InitializeComponent();

            if (!System.IO.File.Exists(tutorials.path + tutorials.keyfilename))
            {
                throw new Exception(String.Format(
                    "The keyfile (.pfx) path or filename {0} is incorrect?", tutorials.path + tutorials.keyfilename));
            }

            X509Certificate2 cert = new X509Certificate2(tutorials.path + tutorials.keyfilename, tutorials.keypassword);

            skype = new SktSkype(this, cert, false, false, 8963);

            // Registration of our MyConversation class
            skype.NewConversation = (oid, skp) => { return new MyConversation(oid, skp); };

            // skype callbacks
            skype.events.OnConnect += OnConnect;
            skype.events.OnAccountStatus += OnAccountStatus;

            // other necessary callbacks
            conversationListBox.SelectedIndexChanged += listBox1_SelectedIndexChanged;
            this.FormClosing += Form1_FormClosing;

            // this will cause OnConnect to fire, some time later..
            skype.LaunchRuntime(tutorials.path + tutorials.runtime, true, "-d timezone");
            skype.Connect();
        }
Exemplo n.º 4
0
        public Form1()
        {
            InitializeComponent();
            LoadIcons();
            videoDeviceSelector.Enabled = false;

            if (!System.IO.File.Exists(tutorials.path + tutorials.keyfilename))
            {
                throw new Exception(String.Format(
                    "The keyfile (.pfx) path or filename {0} is incorrect?", tutorials.path + tutorials.keyfilename));
            }

            X509Certificate2 cert = new X509Certificate2(tutorials.path + tutorials.keyfilename, tutorials.keypassword);
            skype = new SktSkype(this, cert, false, false, 8963);

            // Note that MakeVideoRendererControl uses our skype field.
            // Thus it needs come after constructing skype.
            MakeVideoRendererControl();

            skype.events.OnConnect += OnConnect;
            skype.events.OnAccountStatus += OnAccountStatus;
            skype.events.OnSkypeAvailableVideoDeviceListChange += OnSkypeAvailableVideoDeviceListChange;

            this.FormClosing += Form1_FormClosing;

            skype.LaunchRuntime(tutorials.path + tutorials.runtime, true);
            skype.Connect();
        }
Exemplo n.º 5
0
        public Form1()
        {
            InitializeComponent();
            LoadImages();
            UiToWaitingMode();
            this.AcceptButton = sendButton;

            if (!System.IO.File.Exists(tutorials.path + tutorials.keyfilename))
            {
                throw new Exception(String.Format(
                    "The keyfile (.pfx) path or filename {0} is incorrect?", tutorials.path + tutorials.keyfilename));
            }

            X509Certificate2 cert = new X509Certificate2(tutorials.path + tutorials.keyfilename, tutorials.keypassword);
            skype = new SktSkype(this, cert, true, false, 8963);

            skype.NewVideo = (oid, skp) => { return new Video(oid, skp); };
            skype.NewParticipant = (oid, skp) => { return new Participant(oid, skp); };
            skype.NewConversation = (oid, skp) => { return new Conversation(oid, skp); };
            skype.NewMessage = (oid, skp) => { return new Message(oid, skp); };

            skype.events.OnConnect += OnConnect;
            skype.events.OnAccountStatus += OnAccountStatus;
            skype.events.OnParticipantSoundLevel += OnParticipantSoundLevel;
            skype.events.OnParticipantVoiceStatus += OnParticipantVoiceStatus;
            skype.events.OnSkypeMessage += OnSkypeMessage;
            skype.events.OnConversationLocalLivestatus += OnConversationLocalLiveStatus;
            skype.events.OnConversationSpawnConference += OnConversationSpawnConference;
            skype.events.OnSkypeConversationListChange += OnSkypeConversationListChange;
            skype.events.OnSkypeAvailableDeviceListChange += OnSkypeAvailableDeviceListChange;
            skype.events.OnSkypeAvailableVideoDeviceListChange += OnSkypeAvailableVideoDeviceListChange;
            skype.events.OnParticipantVideoStatus += OnParticipantVideoStatus;
            skype.events.OnVideoStatus += OnVideoStatus;

            convListBox.SelectedIndexChanged += listBox1_SelectedIndexChanged;
            this.FormClosing += Form1_FormClosing;
            sendButton.Click += sendButton_Click;
            callButton.Click += callButton_Click;

            skype.LaunchRuntime(tutorials.path + tutorials.runtime, true);
            skype.Connect();

            convUpdateTimer = new System.Windows.Forms.Timer();
            convUpdateTimer.Interval = 300;
            convUpdateTimer.Tick += OnDelayedUpdate;

            //tutorials_common.tutorials.ShowLogWindow(this, skype);
        }
Exemplo n.º 6
0
        public PublicChatBlobs()
        {
            InitializeComponent();
            feedbackLabel.Text = "";

            if (!System.IO.File.Exists(tutorials.path + tutorials.keyfilename))
            {
                throw new Exception(String.Format(
                    "The keyfile (.pfx) path or filename {0} is incorrect?", tutorials.path + tutorials.keyfilename));
            }

            X509Certificate2 cert = new X509Certificate2(tutorials.path + tutorials.keyfilename, tutorials.keypassword);
            skype = new SktSkype(this, cert, false, false, 8963);

            skype.events.OnConnect += OnConnect;
            skype.events.OnAccountStatus += OnAccountStatus;

            this.FormClosing += Form1_FormClosing;
            skype.LaunchRuntime(tutorials.path + tutorials.runtime, true, "");

            skype.Connect();
        }
Exemplo n.º 7
0
        public Form1()
        {
            InitializeComponent();

            if (!System.IO.File.Exists(tutorials.path + tutorials.keyfilename))
            {
                throw new Exception(String.Format(
                    "The keyfile (.pfx) path or filename {0} is incorrect?", tutorials.path + tutorials.keyfilename));
            }

            X509Certificate2 cert = new X509Certificate2(tutorials.path + tutorials.keyfilename, tutorials.keypassword);

            skype = new SktSkype(this, cert, true, true, 8963);
            skype.events.OnConnect += OnConnect;
            skype.events.OnAccountStatus += OnAccountStatus;

            this.FormClosing += Form1_FormClosing;

            skype.LaunchRuntime(tutorials.path + tutorials.runtime, true, "-x");

            // Once connection happens, OnConnect will fire
            skype.Connect();
        }
Exemplo n.º 8
0
 internal void FireOnSkypeProxyAuthFailure(SktSkype sender, OnSkypeProxyAuthFailureArgs e)
 {
     if (OnSkypeProxyAuthFailure == null) return; // No event assigned
     if (gui == null) { FireCallbackInSeparateThread(e, OnSkypeProxyAuthFailureInNewThread); return; }
     gui.BeginInvoke(OnSkypeProxyAuthFailure, new object[] { sender, e }); // Synchronizing to gui thread
 }
Exemplo n.º 9
0
 internal void FireOnSkypeH264Activated(SktSkype sender, OnSkypeH264ActivatedArgs e)
 {
     if (OnSkypeH264Activated == null) return; // No event assigned
     if (gui == null) { FireCallbackInSeparateThread(e, OnSkypeH264ActivatedInNewThread); return; }
     gui.BeginInvoke(OnSkypeH264Activated, new object[] { sender, e }); // Synchronizing to gui thread
 }
Exemplo n.º 10
0
 internal void FireOnSkypeContactOnlineAppearance(SktSkype sender, OnSkypeContactOnlineAppearanceArgs e)
 {
     if (OnSkypeContactOnlineAppearance == null) return; // No event assigned
     if (gui == null) { FireCallbackInSeparateThread(e, OnSkypeContactOnlineAppearanceInNewThread); return; }
     gui.BeginInvoke(OnSkypeContactOnlineAppearance, new object[] { sender, e }); // Synchronizing to gui thread
 }
Exemplo n.º 11
0
 internal void FireOnParticipantLiveType(SktParticipant sender, SktSkype.IDENTITYTYPE value)
 {
     if (OnParticipantLiveType == null) return; // Event not assigned
     OnParticipantLiveTypeArgs args = new OnParticipantLiveTypeArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnParticipantLiveTypeInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnParticipantLiveType, new object[] { sender, args }); // Syncing to GUI thread
 }
Exemplo n.º 12
0
 public SktEvents(Form form, SktSkype skype)
     : base(form, skype)
 {
 }
Exemplo n.º 13
0
 /** All derived classes should call this base from their own constructors.
 <b>Warning!</b> You cannot access class properties from within constructors.
  */
 public SktConversation(uint ObjectID, SktSkype Skype)
     : base(ObjectID, Skype)
 {
     cache = new BitArray(32);
 }
Exemplo n.º 14
0
 internal SktSms DefaultNewSms(uint oid, SktSkype skype)
 {
     return new SktSms(oid, skype);
 }
Exemplo n.º 15
0
 internal SktParticipant DefaultNewParticipant(uint oid, SktSkype skype)
 {
     return new SktParticipant(oid, skype);
 }
Exemplo n.º 16
0
 /** All derived classes should call this base from their own constructors.
 <b>Warning!</b> You cannot access class properties from within constructors.
  */
 public SktContactGroup(uint ObjectID, SktSkype Skype)
     : base(ObjectID, Skype)
 {
     cache = new BitArray(5);
 }
Exemplo n.º 17
0
 /** All derived classes should call this base from their own constructors.
 <b>Warning!</b> You cannot access class properties from within constructors.
  */
 public SktContactSearch(uint ObjectID, SktSkype Skype)
     : base(ObjectID, Skype)
 {
     cache = new BitArray(1);
 }
Exemplo n.º 18
0
 internal SktTransfer DefaultNewTransfer(uint oid, SktSkype skype)
 {
     return new SktTransfer(oid, skype);
 }
Exemplo n.º 19
0
 /**  Takes a list of fully-qualified filenames and initiates corresponding file transfers in the conversation.
   From the remote side, incoming file transfers will appear as a conversation message with type POSTED_FILES.
   Once such a message is detected, the list of file transfer objects can be retrieved with SktMessage.GetTransfers.
   At that point, remote participants will need to accept or decline those transfers.
 @param [out] error_code Error code, possible values come from the TRANSFER_SENDFILE_ERROR enumerator. This will be set for the first failed fail. The failed file is identified in the error_file return argument.
 @param [out] error_file Filename of the file that triggered error.
 @param [in] paths - list of fully-qualified filenames to be transferred
 @param [in] body - Optional BODY_XML property for POSTED_FILES type messages that show up in remote UI.
  */
 public void PostFiles(
 out SktSkype.TRANSFER_SENDFILE_ERROR error_code,
 out String        error_file,
 List<String>      paths,
 String            body)
 {
     if (skypeRef.logging) skypeRef.Log("Executing Conversation.PostFiles");
     uint RequestId = skypeRef.encoder.AddMethodHeader(ClassId, 21, OID);
     skypeRef.encoder.AddFilenameListParam(1, paths);
     skypeRef.encoder.AddStringParam(2, body);
     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] = "";
     skypeRef.decoder.DecodeMethodResponseArguments(2, ref args, new uint[2]{0,0}, ref tagMap, "SktConversation.PostFiles");
     error_code = (SktSkype.TRANSFER_SENDFILE_ERROR)args[0];
     error_file = (String)args[1];
 }
Exemplo n.º 20
0
 internal SktVideo DefaultNewVideo(uint oid, SktSkype skype)
 {
     return new SktVideo(oid, skype);
 }
Exemplo n.º 21
0
 internal void FireOnParticipantLastLeavereason(SktParticipant sender, SktSkype.LEAVE_REASON value)
 {
     if (OnParticipantLastLeavereason == null) return; // Event not assigned
     OnParticipantLastLeavereasonArgs args = new OnParticipantLastLeavereasonArgs(sender, value);
     if (gui == null) { FireCallbackInSeparateThread(args, OnParticipantLastLeavereasonInNewThread); return; } // No gui firing in separate thread
     gui.BeginInvoke(OnParticipantLastLeavereason, new object[] { sender, args }); // Syncing to GUI thread
 }
Exemplo n.º 22
0
 internal SktVoicemail DefaultNewVoicemail(uint oid, SktSkype skype)
 {
     return new SktVoicemail(oid, skype);
 }
Exemplo n.º 23
0
 internal void FireOnSkypeApp2AppDatagram(SktSkype sender, OnSkypeApp2AppDatagramArgs e)
 {
     if (OnSkypeApp2AppDatagram == null) return; // No event assigned
     if (gui == null) { FireCallbackInSeparateThread(e, OnSkypeApp2AppDatagramInNewThread); return; }
     gui.BeginInvoke(OnSkypeApp2AppDatagram, new object[] { sender, e }); // Synchronizing to gui thread
 }
Exemplo n.º 24
0
 /** All derived classes should call this base from their own constructors.
 <b>Warning!</b> You cannot access class properties from within constructors.
  */
 public SktSms(uint ObjectID, SktSkype Skype)
     : base(ObjectID, Skype)
 {
     cache = new BitArray(14);
 }
Exemplo n.º 25
0
 internal void FireOnSkypeConversationListChange(SktSkype sender, OnSkypeConversationListChangeArgs e)
 {
     if (OnSkypeConversationListChange == null) return; // No event assigned
     if (gui == null) { FireCallbackInSeparateThread(e, OnSkypeConversationListChangeInNewThread); return; }
     gui.BeginInvoke(OnSkypeConversationListChange, new object[] { sender, e }); // Synchronizing to gui thread
 }
Exemplo n.º 26
0
 /** All derived classes should call this base from their own constructors.
 <b>Warning!</b> You cannot access class properties from within constructors.
  */
 public SktTransfer(uint ObjectID, SktSkype Skype)
     : base(ObjectID, Skype)
 {
     cache = new BitArray(15);
 }
Exemplo n.º 27
0
 internal void FireOnSkypeNewCustomContactGroup(SktSkype sender, OnSkypeNewCustomContactGroupArgs e)
 {
     if (OnSkypeNewCustomContactGroup == null) return; // No event assigned
     if (gui == null) { FireCallbackInSeparateThread(e, OnSkypeNewCustomContactGroupInNewThread); return; }
     gui.BeginInvoke(OnSkypeNewCustomContactGroup, new object[] { sender, e }); // Synchronizing to gui thread
 }
Exemplo n.º 28
0
 /** All derived classes should call this base from their own constructors.
 <b>Warning!</b> You cannot access class properties from within constructors.
  */
 public SktVideo(uint ObjectID, SktSkype Skype)
     : base(ObjectID, Skype)
 {
     cache = new BitArray(7);
 }
Exemplo n.º 29
0
 internal void FireOnSkypeQualityTestResult(SktSkype sender, OnSkypeQualityTestResultArgs e)
 {
     if (OnSkypeQualityTestResult == null) return; // No event assigned
     if (gui == null) { FireCallbackInSeparateThread(e, OnSkypeQualityTestResultInNewThread); return; }
     gui.BeginInvoke(OnSkypeQualityTestResult, new object[] { sender, e }); // Synchronizing to gui thread
 }
Exemplo n.º 30
0
 /** All derived classes should call this base from their own constructors.
 <b>Warning!</b> You cannot access class properties from within constructors.
  */
 public SktVoicemail(uint ObjectID, SktSkype Skype)
     : base(ObjectID, Skype)
 {
     cache = new BitArray(12);
 }