// -----------------------------------------------------------------------
// <copyright file="DebugLogger.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="log4netLogger.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="PithosSettings.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="FilePropertiesViewModel.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="PithosAccount.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="PreferencesViewModel.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="StatusService.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="AboutViewModel.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
- using System;\r
-// -----------------------------------------------------------------------\r
-// <copyright file="BalloonIconConverter.cs" company="Microsoft">\r
-// TODO: Update copyright text.\r
++// -----------------------------------------------------------------------\r
++// <copyright file="NetworkAgent.cs" company="GRNET">\r
++// Copyright 2011-2012 GRNET S.A. All rights reserved.\r
++// \r
++// Redistribution and use in source and binary forms, with or\r
++// without modification, are permitted provided that the following\r
++// conditions are met:\r
++// \r
++// 1. Redistributions of source code must retain the above\r
++// copyright notice, this list of conditions and the following\r
++// disclaimer.\r
++// \r
++// 2. Redistributions in binary form must reproduce the above\r
++// copyright notice, this list of conditions and the following\r
++// disclaimer in the documentation and/or other materials\r
++// provided with the distribution.\r
++// \r
++// THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS\r
++// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
++// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
++// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR\r
++// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF\r
++// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\r
++// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
++// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
++// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
++// POSSIBILITY OF SUCH DAMAGE.\r
++// \r
++// The views and conclusions contained in the software and\r
++// documentation are those of the authors and should not be\r
++// interpreted as representing official policies, either expressed\r
++// or implied, of GRNET S.A.\r
+ // </copyright>\r
+ // -----------------------------------------------------------------------\r
+ \r
++\r
++using System;\r
+using System.Collections.Generic;\r
using System.Globalization;\r
using System.Windows.Data;\r
using System.Windows.Media.Imaging;\r
\r
namespace Pithos.Client.WPF.Shell\r
{\r
- using System;\r
- using System.Collections.Generic;\r
- using System.Linq;\r
- using System.Text;\r
-\r
- /// <summary>\r
- /// Convert a BalloonIcon value to an Image\r
- /// </summary>\r
- public class BalloonIconConverter:IValueConverter\r
+ class BalloonIconConverter:IValueConverter\r
{\r
+\r
+ Dictionary<BalloonIcon,BitmapImage> _iconCache=new Dictionary<BalloonIcon,BitmapImage>();\r
+\r
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)\r
{\r
+ BitmapImage image;\r
+ \r
+ var icon = (BalloonIcon) value;\r
+ if (icon == BalloonIcon.None)\r
+ return null;\r
\r
- var balloon = (BalloonIcon) value;\r
- var balloonName = Enum.GetName(typeof (BalloonIcon), balloon);\r
- var imageUrl = new Uri(String.Format("/Pithos.Client.WPF;component:/{0}.png", balloonName),UriKind.Relative);\r
- var image = new BitmapImage(imageUrl);\r
+ if (!_iconCache.TryGetValue(icon, out image))\r
+ {\r
+ var imagePath = String.Format("/Pithos.Client.WPF;component/Images/{0}.png", Enum.GetName(typeof(BalloonIcon), value));\r
+ var uri = new Uri(imagePath, UriKind.Relative);\r
+ image=new BitmapImage(uri);\r
+ _iconCache[icon] = image;\r
+ }\r
return image;\r
- \r
}\r
\r
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\r
// -----------------------------------------------------------------------
// <copyright file="FeedbackViewModel.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------\r
// <copyright file="ExtensionTests.cs" company="GRNet">\r
--// Copyright 2011 GRNET S.A. All rights reserved.\r
++// Copyright 2011-2012 GRNET S.A. All rights reserved.\r
// \r
// Redistribution and use in source and binary forms, with or\r
// without modification, are permitted provided that the following\r
// -----------------------------------------------------------------------
// <copyright file="FileInfoExtensions.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------\r
// <copyright file="CollectionExtensions.cs" company="GRNET">\r
--// Copyright 2011 GRNET S.A. All rights reserved.\r
++// Copyright 2011-2012 GRNET S.A. All rights reserved.\r
// \r
// Redistribution and use in source and binary forms, with or\r
// without modification, are permitted provided that the following\r
// -----------------------------------------------------------------------\r
// <copyright file="FileInfoExtensions.cs" company="GRNET">\r
--// Copyright 2011 GRNET S.A. All rights reserved.\r
++// Copyright 2011-2012 GRNET S.A. All rights reserved.\r
// \r
// Redistribution and use in source and binary forms, with or\r
// without modification, are permitted provided that the following\r
// -----------------------------------------------------------------------\r
// <copyright file="FileInfoExtensions.cs" company="GRNET">\r
--// Copyright 2011 GRNET S.A. All rights reserved.\r
++// Copyright 2011-2012 GRNET S.A. All rights reserved.\r
// \r
// Redistribution and use in source and binary forms, with or\r
// without modification, are permitted provided that the following\r
// -----------------------------------------------------------------------
// <copyright file="NetworkAgent.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="WorkflowAgent.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="FileState.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="IStatusService.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="JobQueue.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="NetworkGate.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="AccountSettings.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="PithosSettingsData.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="CloudFilesClient.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="RestClient.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="FileContext.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="IoC.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="LogCategories.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="DisplayFlags.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="FileContextMenu.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="AddedIcodOverlay.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="UnversionedIconOverlay.cs" company="GRNET">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="PithosHost.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="ShellSettings.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following
// -----------------------------------------------------------------------
// <copyright file="ShellStatusChecker.cs" company="GRNet">
--// Copyright 2011 GRNET S.A. All rights reserved.
++// Copyright 2011-2012 GRNET S.A. All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following