Revision 422c9598 trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs

b/trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs
79 79
		//Logging in the Pithos client is provided by log4net
80 80
		private static readonly log4net.ILog Log = log4net.LogManager.GetLogger("Pithos");
81 81

  
82
        //Lazily initialized File Version info. This is done once and lazily to avoid blocking the UI
83
        private Lazy<FileVersionInfo> _fileVersion;
84

  
82 85
		///<summary>
83 86
		/// The Shell depends on MEF to provide implementations for windowManager, events, the status checker service and the settings
84 87
		///</summary>
......
103 106

  
104 107
				StatusMessage = "In Synch";
105 108

  
109
                _fileVersion=  new Lazy<FileVersionInfo>(() =>
110
                {
111
                    Assembly assembly = Assembly.GetExecutingAssembly();
112
                    var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);
113
                    return fileVersion;
114
                });
106 115
				_accounts.CollectionChanged += (sender, e) =>
107 116
												   {
108 117
													   NotifyOfPropertyChange(() => OpenFolderCaption);
......
473 482
			}.ToDictionary(s => s.Status);
474 483

  
475 484
		readonly IWindowManager _windowManager;
476

  
485
	    
477 486

  
478 487
		///<summary>
479 488
		/// Updates the visual status indicators of the application depending on status changes, e.g. icon, stat		
......
487 496
				var info = _iconNames[pithosStatus];
488 497
				StatusIcon = String.Format(@"../Images/{0}.ico", info.IconName);
489 498

  
490
				Assembly assembly = Assembly.GetExecutingAssembly();                               
491
				var fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location);
492 499

  
493 500

  
494
				StatusMessage = String.Format("Pithos {0}\r\n{1}", fileVersion.FileVersion,info.StatusText);
501
				StatusMessage = String.Format("Pithos {0}\r\n{1}", _fileVersion.Value.FileVersion,info.StatusText);
495 502
			}
496 503
			
497 504
			//_events.Publish(new Notification { Title = "Start", Message = "Start Monitoring", Level = TraceLevel.Info});

Also available in: Unified diff