コード例 #1
0
        /// <summary>
        /// Adds a new location to the set of repositories
        /// </summary>
        /// <param name="location">The absolute path to the root of the repository location</param>
        public void AddLocation(string location)
        {
            var repo = new MediaRepository {DateAdded = DateTime.Now, Location = location, Id = Guid.NewGuid()};
            Repository.MediaRepositories.InsertOnSubmit(repo);
            Repository.SubmitChanges();

            UpdateLocations();
        }
コード例 #2
0
        public LibraryLocation(LibraryWindow window, MediaRepository repository)
        {
            InitializeComponent();
            Controller = new LibraryLocationController(this);
            MediaRepository = repository;
            Window = window;

            LocationLabel.Content = repository.Location;

            var size = repository.MediaFiles.Sum(x => x.Size);
            SizeLabel.Content = size.FormatBytes();

            CountLabel.Content = repository.MediaFiles.Count.ToString("N");

            RemoveLocationButton.Click += RemoveLocationButtonClick;
        }
コード例 #3
0
 partial void DeleteMediaRepository(MediaRepository instance);
コード例 #4
0
 partial void UpdateMediaRepository(MediaRepository instance);
コード例 #5
0
 partial void InsertMediaRepository(MediaRepository instance);
コード例 #6
0
 public void RemoveRepository(MediaRepository mediaRepository)
 {
     Repository.MediaRepositories.DeleteOnSubmit(mediaRepository);
     Repository.SubmitChanges();
 }