示例#1
0
        public void NewFileOpened(object sender, EventArg <string> e)
        {
            BeforeOpeningNewFile(sender, e);

            string path = e.Data;

            if (string.IsNullOrEmpty(path))
            {
                path = _view.DisplayOpenDialog();
            }

            if (!string.IsNullOrEmpty(path))
            {
                string ext = System.IO.Path.GetExtension(path);
                if (ext != ".vcf")
                {
                    _view.DisplayMessage("Only vcf extension accepted!", "Error");
                    return;
                }

                FixedList MRUList = ConfigRepository.Instance.Paths;
                if (!MRUList.Contains(path))
                {
                    MRUList.Enqueue(path);
                    _view.UpdateMRUMenu(MRUList);
                }

                _repository.LoadContacts(path);
                _view.DisplayContacts(_repository.Contacts);
            }
        }
示例#2
0
        public void NewFileOpened(object sender, EventArg <string> e)
        {
            string path = e.Data;

            if (!string.IsNullOrEmpty(path))
            {
                FixedList MRUList = ConfigRepository.Instance.Paths;

                if (!MRUList.Contains(path))
                {
                    MRUList.Enqueue(path);
                    // ConfigRepository.Instance.Paths.Clear();
                    _view.UpdateMRUMenu(MRUList);
                }

                _repository.LoadContacts(path);
                _view.DisplayContacts(_repository.Contacts);
            }
        }