コード例 #1
0
ファイル: App.xaml.cs プロジェクト: hexagon06/MediaManager
        protected override void OnStartup(StartupEventArgs e)
        {
            IoCKernel.Initialize(
                new StandardModule(DbContextString),
                new BusinessModule());

            string folderName = ConfigurationManager.AppSettings["applicationDataDirectoryName"];

            if (folderName == null)
            {
                throw new ConfigurationErrorsException("Missing appsetting applicationDataDirectoryName");
            }
            var completePath = System.IO.Path.Combine(
                Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                folderName);

            if (Directory.Exists(completePath) == false)
            {
                Directory.CreateDirectory(completePath);
            }

            AppDomain.CurrentDomain.SetData("DataDirectory", completePath);

            base.OnStartup(e);
        }
コード例 #2
0
        public ExplorerWindow()
        {
            InitializeComponent();

            var types      = ApplicationConfig.MediaTypes;
            var mediatypes = new MediaTypes(types);

            DataContext = Model = IoCKernel.Get <IExplorerViewModel>(new ConstructorArgument("mediaTypes", mediatypes, true));
        }
コード例 #3
0
        public MainWindow()
        {
            InitializeComponent();

            DataContext = Model = IoCKernel.Get <ILibraryViewModel>();
        }