コード例 #1
0
        private SavePassRepository(string filepath, string password)
        {
            FilePath = filepath;

            aes = new AESWrapper(password);

            byte[] data = File.ReadAllBytes(FilePath);
            string xml  = aes.Decrypt(data);

            items = new ObservableCollection <SavePassItem>(xml.FromXml <SavePassFile>().Items);
            Items = new ReadOnlyObservableCollection <SavePassItem>(items);

            items.CollectionChanged += OnCollectionChanged;
            foreach (SavePassItem item in items)
            {
                item.PropertyChanged += OnEntitiesPropertyChanged;
            }
        }