コード例 #1
0
 private void AddNoteExecute(object sender)
 {
     CurrentPass = new PassContainer {
         Name = "", Resource = "", Login = "", Pass = "", Comment = "", DateUpdatePass = ""
     };
     MainWindowState = MainWindowState.AddingState;
 }
コード例 #2
0
        public void AddNewPass(PassContainer passContainer)
        {
            if (passContainer.DateUpdatePass == "")
            {
                passContainer.DateUpdatePass = DateTime.Today.ToShortDateString();
            }

            if (_dataModule.AddPassContainer(passContainer))
            {
                _currentPass = passContainer;
            }

            _isSaved = false;
        }
コード例 #3
0
        private PassContainer _ParseToPassContainer(XElement element)
        {
            PassContainer passContainer = new PassContainer();

            foreach (var property in typeof(PassContainer).GetProperties())
            {
                XElement xElement = element.Element(property.Name);
                if (xElement != null)
                {
                    property.SetValue(passContainer, xElement.Value);
                }
            }

            return(passContainer);
        }
コード例 #4
0
        public void SelectPass(int index)
        {
            if (_dataModule.Count == 0)
            {
                _currentPass = null;
                return;
            }

            if (index > _dataModule.Count - 1 || index < 0)
            {
                return;
            }

            _currentIndex = index;
            _currentPass  = new PassContainer
            {
                Name           = _dataModule[index].Name,
                Resource       = _dataModule[index].Resource,
                Login          = _dataModule[index].Login,
                Pass           = _dataModule[index].Pass,
                DateUpdatePass = _dataModule[index].DateUpdatePass,
                Comment        = _dataModule[index].Comment
            };
        }
コード例 #5
0
 public PassManager()
 {
     _dataModule  = new PassCollection();
     _currentPass = null;
 }