Esempio 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);
        }
Esempio n. 2
0
 public void SaveOne(SuperDao dao)
 {
     CheckFile();
     using (StreamWriter sw = new StreamWriter(_filePath, true, Encoding.UTF8))
     {
         sw.WriteLine(dao.ToFileLine());
         sw.Flush();
         sw.Close();
     }
 }
Esempio n. 3
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();
        }
Esempio n. 4
0
        public ChattingItem(IPackage package, SuperDao dao, bool state = true)
        {
            _defColor = BackColor;
            Text = string.Format("{0} - {1}", AppSettings.Instance.Account == package.PS ? "ME" : package.PR, package.GetContent<string>());

            UID = package.UID;

            ToolTipText = package.PD.ToString("yyyy-MM-dd HH:mm:ss");
            if (!state)
                BackColor = Color.LightGray;
        }
Esempio n. 5
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());
        }
 public virtual void Init(SuperDao dao)
 {
     this.Dock = DockStyle.Fill;
 }
Esempio n. 7
0
 public override void Init(SuperDao dao)
 {
     base.Init(dao);
     this.lbAccountName.Text = AppSettings.Instance.Account;
 }
Esempio n. 8
0
 public override void Load(SuperDao dao)
 {
 }
Esempio n. 9
0
 public abstract void Load(SuperDao dao);
Esempio n. 10
0
 public override void Init(SuperDao dao)
 {
     this.Dock = DockStyle.Fill;
 }