Revision 759bd3c4 trunk/Pithos.Client.WPF/AppBootstrapper.cs

b/trunk/Pithos.Client.WPF/AppBootstrapper.cs
67 67
	{
68 68
		CompositionContainer container;
69 69

  
70
	    public AppBootstrapper()
71
	    {
72
            LogManager.GetLog = type => new log4netLogger(type);
73
	        UpgradeSettings();
74

  
75
	    }
76

  
77
	    private void UpgradeSettings()
78
	    {
79
            if (Settings.Default.MustUpgrade)
80
            {
81
                Settings.Default.Upgrade();
82
                Settings.Default.MustUpgrade = false;
83
                Settings.Default.Save();
84
            }
85
	    }
86

  
87
	    /// <summary>
70
		public AppBootstrapper()
71
		{
72
			LogManager.GetLog = type => new log4netLogger(type);
73
			UpgradeSettings();
74

  
75
		}
76

  
77
		private void UpgradeSettings()
78
		{
79
			if (Settings.Default.MustUpgrade)
80
			{
81
				Settings.Default.Upgrade();
82
				Settings.Default.MustUpgrade = false;
83
				Settings.Default.Save();
84
			}
85
		}
86

  
87
		/// <summary>
88 88
		/// By default, we are configured to use MEF
89 89
		/// </summary>
90 90
		protected override void Configure() {
91
		    var catalog = new AggregateCatalog(
92
		        AssemblySource.Instance.Select(x => new AssemblyCatalog(x)).OfType<ComposablePartCatalog>()
93
		        );
91
			var catalog = new AggregateCatalog(
92
				AssemblySource.Instance.Select(x => new AssemblyCatalog(x)).OfType<ComposablePartCatalog>()
93
				);
94 94

  
95
            Type[] types = { typeof(PithosMonitor), typeof(CloudFilesClient) };
96
            foreach (var type in types)
97
            {
98
                catalog.Catalogs.Add(new AssemblyCatalog(type.Assembly));
99
            }
95
			Type[] types = { typeof(PithosMonitor), typeof(CloudFilesClient) };
96
			foreach (var type in types)
97
			{
98
				catalog.Catalogs.Add(new AssemblyCatalog(type.Assembly));
99
			}
100 100

  
101 101
			container = new CompositionContainer(catalog,true);
102 102

  
......
105 105
			batch.AddExportedValue<IWindowManager>(new WindowManager());
106 106
			batch.AddExportedValue<IEventAggregator>(new EventAggregator());
107 107
			batch.AddExportedValue(container);
108
		    batch.AddExportedValue(catalog);
108
			batch.AddExportedValue(catalog);
109 109

  
110 110

  
111 111
			container.Compose(batch);
112

  
113
            ConventionManager.AddElementConvention<MenuItem>(ItemsControl.ItemsSourceProperty, "DataContext", "Click");
114
	        ConventionManager.AddElementConvention<IntegerUpDown>(IntegerUpDown.ValueProperty, "Value", "ValueChanged");
112
		    
113
			ConventionManager.AddElementConvention<MenuItem>(ItemsControl.ItemsSourceProperty, "DataContext", "Click");
114
			ConventionManager.AddElementConvention<IntegerUpDown>(IntegerUpDown.ValueProperty, "Value", "ValueChanged");
115
		    ConventionManager.AddElementConvention<BusyIndicator>(BusyIndicator.IsBusyProperty, "IsBusy", "DataContextChanged");
115 116
		}
116 117

  
117 118
		protected override object GetInstance(Type serviceType, string key)

Also available in: Unified diff