Exemplo n.º 1
0
        public override void Load(SuperDao dao)
        {
            string path = GetDictoryFile(this.GetType().Name, null, this.GetType().Name);
            FileOperator fileOp = new FileOperator(path);

            List<Contact> contacts = new List<Contact>();
            fileOp.ReadAll().ForEach(s => contacts.Add(new Contact(s)));
            (this.Ctrl as UC.ucContacts).LoadContacts(contacts);
        }
Exemplo n.º 2
0
        public override void Load(SuperDao dao)
        {
            string path = GetDictoryFile(typeof(ClientPackage).Name, null, typeof(ClientPackage).Name);
            fileOp = new FileOperator(path);

            ReqWebSocket.Instance.ReceivedHandler += new ReceivedEventHandler(ReceivedPackage);
            ReqWebSocket.Instance.SendResultHandler += new SendResultEventHandler(SendResultHandler);
            ReqWebSocket.Instance.Connected();
            Ctrl.Init(null);
            Ctrl.Show();
        }
Exemplo n.º 3
0
        public override void Load(SuperDao dao)
        {
            ucChatting ChattingCtrl = Ctrl as UC.ucChatting;
            ChattingCtrl.Init(dao);
            ChattingCtrl.OnSendPackage = new OnSendPackageEventHandler(AfterSendPackage);

            string path = GetDictoryFile(typeof(ClientPackage).Name, null, typeof(ClientPackage).Name);
            fileOp = new FileOperator(path);

            List<ClientPackage> packages = new List<ClientPackage>();
            fileOp.ReadAll().ForEach(delegate(string s)
            {
                var ps = s.Split(new char[] { '|' });
                var cp = new ClientPackage(ps[0], ps[1], ps[2], ps[3], ps[4], ps[5], ps[6], ps[7], ps[8]);
                if ((cp.PS == dao.Account && cp.PR == AppSettings.Instance.Account) || cp.PR == dao.Account)
                    packages.Add(cp);
            });

            ChattingCtrl.LoadClientPackage(packages.OrderBy(p => p.PD).ToList());
        }