private void AddNoteExecute(object sender) { CurrentPass = new PassContainer { Name = "", Resource = "", Login = "", Pass = "", Comment = "", DateUpdatePass = "" }; MainWindowState = MainWindowState.AddingState; }
public void AddNewPass(PassContainer passContainer) { if (passContainer.DateUpdatePass == "") { passContainer.DateUpdatePass = DateTime.Today.ToShortDateString(); } if (_dataModule.AddPassContainer(passContainer)) { _currentPass = passContainer; } _isSaved = false; }
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); }
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 }; }
public PassManager() { _dataModule = new PassCollection(); _currentPass = null; }