Ejemplo n.º 1
0
        private void EmailNext()
        {
            if (0 == EmailBox.Text.Length)
            {
                RunningDatas.ErrorNotify("注册邮箱不能为空");
                return;
            }

            if (!Utils.Utils.IsEmail(EmailBox.Text))
            {
                RunningDatas.ErrorNotify("注册邮箱无效");
                return;
            }

            RunningDatas.RequestTable.TryAdd(RequestID, this);
            if (RunningDatas.DataSender.RegistEmailReq
                (
                    RequestID,
                    new KXTNetStruct.RegistEmailReq
            {
                Email = EmailBox.Text
            }
                ))
            {
                NextButton.Visibility  = Visibility.Collapsed;
                RingControl.Visibility = Visibility.Visible;
                RingControl.IsActive   = true;

                OperationTimer.Start();
            }
            else
            {
                RunningDatas.InfoNotify("无法连接到网络");
            }
        }
Ejemplo n.º 2
0
        private void Operation_Trigger(object sender, ElapsedEventArgs args)
        {
            _ = Dispatcher.RunAsync
                (
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                new Windows.UI.Core.DispatchedHandler(() =>
            {
                OperationWaiting.IsIndeterminate = false;
            }));

            RunningDatas.InfoNotify("数据请求超时");
        }
Ejemplo n.º 3
0
        void IDataSender.FileStreamRes(StreamRes res)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Cloud,
                MessageType = CloudDatagramDefine.StreamRes,
                Datas       = res.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 4
0
        private void Trigger(object sender, ElapsedEventArgs args)
        {
            _ = Dispatcher.RunAsync
                (
                Windows.UI.Core.CoreDispatcherPriority.Normal,
                new Windows.UI.Core.DispatchedHandler(() =>
            {
                WaitingBar.IsIndeterminate = false;
                WaitingBar.Visibility      = Visibility.Collapsed;
                Next.Visibility            = Visibility.Visible;
            }));

            RunningDatas.InfoNotify("请求超时");
        }
Ejemplo n.º 5
0
        void IDataSender.UpdateGroupDescribe(UpdateGroupDescribe update)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Login,
                MessageType = LoginMessageType.UpdateGroupDescribe,
                Datas       = update.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 6
0
        void IDataSender.FileDownloadFinish(FileDownloadFinish finish)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Cloud,
                MessageType = CloudDatagramDefine.FileDownloadFinish,
                Datas       = finish.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 7
0
        void IDataSender.DeleteFile(DeleteFolderFile delete)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Cloud,
                MessageType = CloudDatagramDefine.DeleteFile,
                Datas       = delete.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 8
0
        void IDataSender.CreateFolder(CreateFolder create)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Cloud,
                MessageType = CloudDatagramDefine.CreateFolder,
                Datas       = create.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 9
0
        void IDataSender.DropGroup(DeleteUser delete)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Login,
                MessageType = LoginMessageType.DropGroup,
                Datas       = delete.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 10
0
        void IDataSender.ApplyUserRes(ApplyResponse response)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Login,
                MessageType = LoginMessageType.ApplyUserRes,
                Datas       = response.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 11
0
        void IDataSender.ChatsFinish(ChatsFinishPackage finish)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Chat,
                MessageType = ChatDatagramDefine.GroupChat,
                Datas       = finish.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 12
0
        void IDataSender.FileUploadCancel(FileUploadCancel cancel)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Cloud,
                MessageType = CloudDatagramDefine.FileUploadCancel,
                Datas       = cancel.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 13
0
        void IDataSender.GroupChatReq(Guid request_id, GroupChatsReq req)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Chat,
                MessageType = ChatDatagramDefine.GroupChatsReq,
                RequestID   = request_id,
                Datas       = req.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 14
0
        void IDataSender.FileDownload(Guid request_id, FileDownloadReq req)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Cloud,
                MessageType = CloudDatagramDefine.FileDownloadReq,
                RequestID   = request_id,
                Datas       = req.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 15
0
        private void LoginTimer_Tigger(object sender, System.Timers.ElapsedEventArgs args)
        {
            _ = Dispatcher.RunAsync
                    (Windows.UI.Core.CoreDispatcherPriority.Normal,
                    new Windows.UI.Core.DispatchedHandler(() =>
            {
                FlushFriendAndGroup.Visibility     = Visibility.Visible;
                FlushFriendAndGroupRing.IsActive   = false;
                FlushFriendAndGroupRing.Visibility = Visibility.Collapsed;
            }));

            RunningDatas.RequestTable.TryRemove(RequestID, out _);

            RunningDatas.InfoNotify("请求超时");
        }
Ejemplo n.º 16
0
        void IDataSender.GroupMemberReq(Guid request_id, GroupMemberReq req)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Login,
                MessageType = LoginMessageType.GroupMemberReq,
                RequestID   = request_id,
                Datas       = req.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 17
0
        void IDataSender.AppliesRequest(Guid request_id, FriendGroupApplyRequest request)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Login,
                MessageType = LoginMessageType.AppliesRequest,
                RequestID   = request_id,
                Datas       = request.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
Ejemplo n.º 18
0
        void IDataSender.Regist(Guid request_id)
        {
            Datagram datagram = new Datagram
            {
                DataType    = DatagramType.Main,
                MessageType = MainMessageType.RegistReq,
                RequestID   = request_id,
                Datas       = new MainRegistReq
                {
                    UserID = IKXTServer.DataConvert.GetGuid(RunningDatas.UserID)
                }.ToByteArray()
            };

            if (!Send(datagram))
            {
                RunningDatas.InfoNotify("网络连接失败 请重启软件后重试");
            }
        }
 private void SenderButton_Tapped(object sender, TappedRoutedEventArgs e)
 {
     MessageEnter.TextDocument.GetText(Windows.UI.Text.TextGetOptions.None, out string message);
     if (RunningDatas.DataSender.FriendChat(new ChatMessage
     {
         Message = message,
         Sender = RunningDatas.UserID,
         Target = FriendID
     }))
     {
         MessageEnter.TextDocument.SetText(Windows.UI.Text.TextSetOptions.None, "");
         ChatPanel.Items.Add(new UserMessageMagnets
         {
             Text = message,
             Time = DateTime.Now.ToString(),
             HorizontalAlignment = HorizontalAlignment.Right,
             Photo = Utils.Utils.GetPhoto(RunningDatas.UserPhoto)
         });
     }
     else
     {
         RunningDatas.InfoNotify("发送失败 网络错误");
     }
 }
Ejemplo n.º 20
0
 private void Timer_Trigger(object sender, ElapsedEventArgs args)
 {
     IsActive = false;
     RunningDatas.InfoNotify("文件请求超时:" + File.FileName);
 }
Ejemplo n.º 21
0
        private async void DownloadButton_Click(object sender, RoutedEventArgs e)
        {
            if (!OperationWaiting.IsIndeterminate)
            {
                if (ListViewSelectionMode.Single == FilesGridView.SelectionMode)
                {
                    if (-1 != FilesGridView.SelectedIndex)
                    {
                        TemporaryFilesList file = FilesGridView.SelectedItem as TemporaryFilesList;
                        if (FileType.Folder == file.Type)
                        {
                            RunningDatas.ErrorNotify("不能下载文件夹");
                            return;
                        }

                        StorageFolder folder = await GetFolder();

                        if (null == folder)
                        {
                            return;
                        }

                        RunningDatas.FileWaiting.Add
                        (
                            FolderPath.Text,
                            file.Name,
                            new FileReqPackage
                        {
                            FileName = file.Name,
                            Path     = folder,
                            Size     = file.Size,
                            Type     = StreamType.Download
                        }
                        );
                    }
                    else
                    {
                        RunningDatas.ErrorNotify("请选择需要下载的文件");
                    }
                }
                else
                {
                    if (0 != FilesGridView.SelectedItems.Count)
                    {
                        StorageFolder folder = await GetFolder();

                        if (null == folder)
                        {
                            return;
                        }

                        foreach (var i in FilesGridView.SelectedItems)
                        {
                            TemporaryFilesList item = i as TemporaryFilesList;

                            if (FileType.Folder == item.Type)
                            {
                                RunningDatas.InfoNotify("不能下载文件夹:" + item.Name);
                                return;
                            }

                            RunningDatas.FileWaiting.Add
                            (
                                FolderPath.Text,
                                item.Name,
                                new FileReqPackage
                            {
                                FileName = item.Name,
                                Path     = folder,
                                Size     = item.Size,
                                Type     = StreamType.Download
                            }
                            );
                        }
                    }
                    else
                    {
                        RunningDatas.ErrorNotify("请选择需要下载的文件");
                    }
                }
            }
        }