Esempio n. 1
0
        public void UploadVideo()
        {
            OpenFileDialog op = new OpenFileDialog();

            op.Title  = "Select a video";
            op.Filter = "MPEG4 (*.mp4)|*.mp4";

            FakeLoadingBubble bubble = new FakeLoadingBubble();

            if (op.ShowDialog() == true)
            {
                List <string> paths = op.FileNames.ToList();
                var           app   = MainWindow.chatApplication;
                FileAPI.UploadMedia(app.model.currentSelectedConversation,
                                    paths, bubble.OnVideoUploadCompleted, OnVideoUploadError);
                AddFakeLoadingBubble(bubble);
            }
        }
Esempio n. 2
0
        public void UploadImage()
        {
            OpenFileDialog op = new OpenFileDialog();

            op.Title  = "Select a picture";
            op.Filter = "All supported graphics|*.jpg;*.jpeg;*.png;*.mp4|" +
                        "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" +
                        "Portable Network Graphic (*.png)|*.png|" +
                        "MPEG4 (*.mp4)|*.mp4";

            FakeLoadingBubble bubble = new FakeLoadingBubble();

            if (op.ShowDialog() == true)
            {
                List <string> paths = op.FileNames.ToList();
                var           app   = MainWindow.chatApplication;
                FileAPI.UploadMedia(app.model.currentSelectedConversation,
                                    paths, bubble.OnImageUploadCompleted, OnImageUploadError);
                AddFakeLoadingBubble(bubble);
            }
        }