Ejemplo n.º 1
0
        public async void JoinSecuredDrawSession(string joinningImageID, string pwd)
        {
            GalleryControl.GalleryItem info = GalleryItems.Find(x => x.id == joinningImageID);
            if (info.protection != pwd)
            {
                MessageBox.Show((Localization == "fr") ? "Informations de connexion invalides" : "Wrong login informations", "Error");
                return;
            }
            SwitchView = 5;

            var format = new
            {
                sessionId = SessionId,
                username  = Username,
                imageId   = joinningImageID
            };

            SocketManager.UserName = Username;
            SocketManager.JoinDrawingSession(joinningImageID);

            string shapes = await networkManager.LoadShapesAsync(Username, SessionId, joinningImageID);

            string data = await networkManager.LoadImageData(Username, SessionId, joinningImageID);

            editeur.LoadFromServer(shapes, data); // TODO : Verify it works
        }
Ejemplo n.º 2
0
        public async System.Threading.Tasks.Task <bool> JoinDrawSession(string joinningImageID)
        {
            GalleryControl.GalleryItem info = GalleryItems.Find(x => x.id == joinningImageID);

            if (info.protection != "")
            {
                return(false);
            }
            this.IsOffline = false;
            SwitchView     = 5;
            var format = new
            {
                sessionId = SessionId,
                username  = Username,
                imageId   = joinningImageID
            };

            SocketManager.UserName = Username;
            SocketManager.JoinDrawingSession(joinningImageID);

            string shapes = await networkManager.LoadShapesAsync(Username, SessionId, joinningImageID);

            string data = await networkManager.LoadImageData(Username, SessionId, joinningImageID);

            this.editeur.LoadFromServer(shapes, data);
            //LoadLocally(shapes); // TODO : Verify it works
            return(true);
        }