This commit is contained in:
Martijn van Dijk 2015-11-25 16:34:43 +01:00
Родитель 62ab36146f
Коммит cc1b4b6705
445 изменённых файлов: 2126 добавлений и 2143 удалений

Просмотреть файл

@ -4,10 +4,9 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using Cirrious.CrossCore;
using Cirrious.CrossCore.Plugins;

Просмотреть файл

@ -1,8 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MvvmCross.Plugins.Accelerometer.Touch")]
@ -14,8 +13,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@ -25,9 +24,9 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]

Просмотреть файл

@ -4,68 +4,68 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using System;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore.Exceptions;
using System;
using UIKit;
namespace MvvmCross.Plugins.Accelerometer.Touch
{
public class MvxAccelerometer
: IMvxAccelerometer
{
bool _initialized = false;
: IMvxAccelerometer
{
private bool _initialized = false;
public void Start()
{
if (_initialized)
{
if (_initialized)
{
throw new MvxException("Accelerometer already started");
}
}
_initialized = true;
UIAccelerometer.SharedAccelerometer.UpdateInterval = 0.1;
UIAccelerometer.SharedAccelerometer.Acceleration += HandleAccelerationChange;
}
_initialized = true;
UIAccelerometer.SharedAccelerometer.UpdateInterval = 0.1;
UIAccelerometer.SharedAccelerometer.Acceleration += HandleAccelerationChange;
}
void HandleAccelerationChange (object sender, UIAccelerometerEventArgs e)
{
var reading = ToReading(e.Acceleration.X, e.Acceleration.Y, e.Acceleration.Z);
LastReading = reading.Clone();
var handler = ReadingAvailable;
if (handler == null)
return;
handler(this, new MvxValueEventArgs<MvxAccelerometerReading>(reading));
}
private void HandleAccelerationChange(object sender, UIAccelerometerEventArgs e)
{
var reading = ToReading(e.Acceleration.X, e.Acceleration.Y, e.Acceleration.Z);
LastReading = reading.Clone();
var handler = ReadingAvailable;
if (handler == null)
return;
handler(this, new MvxValueEventArgs<MvxAccelerometerReading>(reading));
}
public void Stop()
{
if (!_initialized)
{
throw new MvxException("Accelerometer not started");
}
_initialized = false;
UIAccelerometer.SharedAccelerometer.Acceleration -= HandleAccelerationChange;
}
_initialized = false;
UIAccelerometer.SharedAccelerometer.Acceleration -= HandleAccelerationChange;
}
private static MvxAccelerometerReading ToReading(double x, double y, double z)
{
var reading = new MvxAccelerometerReading
{
X = x,
Y = y,
Z = z,
};
var reading = new MvxAccelerometerReading
{
X = x,
Y = y,
Z = z,
};
return reading;
}

Просмотреть файл

@ -4,13 +4,11 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using System;
using Windows.Devices.Sensors;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore.Exceptions;
namespace MvvmCross.Plugins.Accelerometer.WindowsCommon
{
@ -61,12 +59,12 @@ namespace MvvmCross.Plugins.Accelerometer.WindowsCommon
private static MvxAccelerometerReading ToReading(AccelerometerReading sensorReading)
{
var reading = new MvxAccelerometerReading
{
X = sensorReading.AccelerationX,
Y = sensorReading.AccelerationY,
Z = sensorReading.AccelerationZ,
};
var reading = new MvxAccelerometerReading
{
X = sensorReading.AccelerationX,
Y = sensorReading.AccelerationY,
Z = sensorReading.AccelerationZ,
};
return reading;
}

Просмотреть файл

@ -4,12 +4,9 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using Cirrious.CrossCore;
using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.Accelerometer.WindowsCommon
{
public class Plugin

Просмотреть файл

@ -1,9 +1,7 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Resources;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cirrious.MvvmCross.Plugins.Accelerometer.WindowsCommon")]
@ -19,12 +17,12 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]

Просмотреть файл

@ -4,13 +4,13 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using System;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore.Exceptions;
using Microsoft.Devices.Sensors;
using System;
namespace MvvmCross.Plugins.Accelerometer.WindowsPhone
{
@ -55,12 +55,12 @@ namespace MvvmCross.Plugins.Accelerometer.WindowsPhone
private static MvxAccelerometerReading ToReading(AccelerometerReading sensorReading)
{
var reading = new MvxAccelerometerReading
{
X = sensorReading.Acceleration.X,
Y = sensorReading.Acceleration.Y,
Z = sensorReading.Acceleration.Z,
};
var reading = new MvxAccelerometerReading
{
X = sensorReading.Acceleration.X,
Y = sensorReading.Acceleration.Y,
Z = sensorReading.Acceleration.Z,
};
return reading;
}

Просмотреть файл

@ -4,7 +4,7 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using Cirrious.CrossCore;

Просмотреть файл

@ -4,14 +4,14 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -24,8 +24,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@ -37,11 +37,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]

Просмотреть файл

@ -4,12 +4,12 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using System;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore.Exceptions;
using System;
using Windows.Devices.Sensors;
namespace MvvmCross.Plugins.Accelerometer.WindowsStore
@ -61,12 +61,12 @@ namespace MvvmCross.Plugins.Accelerometer.WindowsStore
private static MvxAccelerometerReading ToReading(AccelerometerReading sensorReading)
{
var reading = new MvxAccelerometerReading
{
X = sensorReading.AccelerationX,
Y = sensorReading.AccelerationY,
Z = sensorReading.AccelerationZ,
};
var reading = new MvxAccelerometerReading
{
X = sensorReading.AccelerationX,
Y = sensorReading.AccelerationY,
Z = sensorReading.AccelerationZ,
};
return reading;
}

Просмотреть файл

@ -4,7 +4,7 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using Cirrious.CrossCore;

Просмотреть файл

@ -1,8 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cirrious.MvvmCross.Plugins.Accelerometer.WinRT")]
@ -17,11 +16,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]

Просмотреть файл

@ -4,10 +4,9 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using Cirrious.CrossCore;
using Cirrious.CrossCore.Plugins;

Просмотреть файл

@ -1,8 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cirrious.MvvmCross.Plugins.Accelerometer.Wpf")]
@ -14,8 +13,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@ -25,12 +24,12 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]

Просмотреть файл

@ -4,12 +4,12 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using System;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore.Exceptions;
using System;
namespace MvvmCross.Plugins.Accelerometer.Wpf
{
@ -41,6 +41,7 @@ namespace MvvmCross.Plugins.Accelerometer.Wpf
_accelerometer = null;
*/
}
/*
private void AccelerometerOnReadingChanged(Windows.Devices.Sensors.Accelerometer sender, AccelerometerReadingChangedEventArgs args)
{

Просмотреть файл

@ -4,20 +4,23 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using System;
using Cirrious.CrossCore.Core;
using System;
namespace MvvmCross.Plugins.Accelerometer
{
public interface IMvxAccelerometer
{
void Start();
void Start();
void Stop();
bool Started { get; }
MvxAccelerometerReading LastReading { get; }
MvxAccelerometerReading LastReading { get; }
event EventHandler<MvxValueEventArgs<MvxAccelerometerReading>> ReadingAvailable;
}
}

Просмотреть файл

@ -4,7 +4,7 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
namespace MvvmCross.Plugins.Accelerometer
@ -17,7 +17,7 @@ namespace MvvmCross.Plugins.Accelerometer
public MvxAccelerometerReading Clone()
{
return new MvxAccelerometerReading {X = X, Y = Y, Z = Z};
return new MvxAccelerometerReading { X = X, Y = Y, Z = Z };
}
}
}

Просмотреть файл

@ -4,7 +4,7 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using Cirrious.CrossCore;

Просмотреть файл

@ -4,13 +4,13 @@
// Please see license.txt on http://opensource.org/licenses/ms-pl.html
// All other rights reserved.
// </copyright>
//
//
// Project Lead - Stuart Lodge, Cirrious. http://www.cirrious.com - Hire me - I'm worth it!
using System.Reflection;
using System.Resources;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -27,11 +27,11 @@ using System.Resources;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,16 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using System.Collections.Generic;
using System.Linq;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Platform;
using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.All
{

Просмотреть файл

@ -1,9 +1,7 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Resources;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cirrious.MvvmCross.Plugins.All")]
@ -19,12 +17,12 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]

Просмотреть файл

@ -2,23 +2,23 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using System.Collections.Generic;
using System.Linq;
using Cirrious.CrossCore;
using Cirrious.MvvmCross.ViewModels;
using Cirrious.MvvmCross.WindowsPhone.Platform;
using Cirrious.MvvmCross.WindowsPhone.Views;
using Microsoft.Phone.Shell;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MvvmCross.Plugins.Bookmarks.WindowsPhone
{
public class MvxWindowsPhoneLiveTileBookmarkLibrarian
: IMvxBookmarkLibrarian
: IMvxBookmarkLibrarian
{
private const string UniqueIdParameterName = "_id";
@ -64,7 +64,7 @@ namespace MvvmCross.Plugins.Bookmarks.WindowsPhone
return true;
}
#endregion
#endregion IMvxBookmarkLibrarian Members
private static ShellTile FindShellTileFor(string uniqueName)
{
@ -80,15 +80,15 @@ namespace MvvmCross.Plugins.Bookmarks.WindowsPhone
private static StandardTileData ToTileData(MvxBookmarkMetadata metadata)
{
var liveTileData = new StandardTileData
{
BackgroundImage = metadata.BackgroundImageUri,
Title = metadata.Title,
BackTitle = metadata.BackTitle,
BackContent = metadata.BackContent,
BackBackgroundImage = metadata.BackBackgroundImageUri,
Count = metadata.Count
};
var liveTileData = new StandardTileData
{
BackgroundImage = metadata.BackgroundImageUri,
Title = metadata.Title,
BackTitle = metadata.BackTitle,
BackContent = metadata.BackContent,
BackBackgroundImage = metadata.BackBackgroundImageUri,
Count = metadata.Count
};
return liveTileData;
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -11,8 +11,8 @@ using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.Bookmarks.WindowsPhone
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -2,14 +2,14 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -22,8 +22,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@ -35,11 +35,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;

Просмотреть файл

@ -2,14 +2,15 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
namespace MvvmCross.Plugins.Bookmarks
{
#warning this bookmark code may be too wp7 sepcific?
#warning this bookmark code may be too wp7 sepcific?
public class MvxBookmarkMetadata
{
public Uri BackgroundImageUri { get; set; }

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -11,7 +11,7 @@ using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.Bookmarks
{
public class PluginLoader
: IMvxPluginLoader
: IMvxPluginLoader
{
public static readonly PluginLoader Instance = new PluginLoader();

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -23,11 +23,11 @@ using System.Reflection;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Globalization;
using NUnit.Framework;
using System.Globalization;
namespace MvvmCross.Plugins.Color.Test
{

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Globalization;
using NUnit.Framework;
using System.Globalization;
namespace MvvmCross.Plugins.Color.Test
{
@ -45,19 +45,19 @@ namespace MvvmCross.Plugins.Color.Test
for (var i = 0; i < tests.Length; i++)
{
var converter = new MvxRGBAValueConverter();
var actual = converter.Convert(tests[i], typeof (object), null, CultureInfo.CurrentUICulture);
var actual = converter.Convert(tests[i], typeof(object), null, CultureInfo.CurrentUICulture);
var wrapped = actual as WrappedColor;
Assert.IsNotNull(wrapped);
Assert.AreEqual(results[i], (uint) wrapped.Color.ARGB);
Assert.AreEqual(results[i], (uint)wrapped.Color.ARGB);
}
for (var i = 0; i < tests.Length; i++)
{
var converter = new MvxRGBAValueConverter();
var actual = converter.Convert("#" + tests[i], typeof (object), null, CultureInfo.CurrentUICulture);
var actual = converter.Convert("#" + tests[i], typeof(object), null, CultureInfo.CurrentUICulture);
var wrapped = actual as WrappedColor;
Assert.IsNotNull(wrapped);
Assert.AreEqual(results[i], (uint) wrapped.Color.ARGB);
Assert.AreEqual(results[i], (uint)wrapped.Color.ARGB);
}
}
@ -116,4 +116,4 @@ namespace MvvmCross.Plugins.Color.Test
RunTests(tests, results);
}
}
}
}

Просмотреть файл

@ -1,8 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cirrious.MvvmCross.Plugins.Color.Test")]
@ -14,8 +13,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@ -25,12 +24,12 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;
@ -18,8 +18,8 @@ namespace MvvmCross.Plugins.Color.Touch
}
public static UIColor ToUIColor(MvxColor mvxColor)
{
return new UIColor(mvxColor.R/255.0f, mvxColor.G/255.0f, mvxColor.B/255.0f, mvxColor.A/255.0f);
{
return new UIColor(mvxColor.R / 255.0f, mvxColor.G / 255.0f, mvxColor.B / 255.0f, mvxColor.A / 255.0f);
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -12,8 +12,8 @@ using Cirrious.CrossCore.UI;
namespace MvvmCross.Plugins.Color.Touch
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -23,11 +23,11 @@ using System.Reflection;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Windows.UI.Xaml.Media;
using Cirrious.CrossCore.UI;
using Windows.UI.Xaml.Media;
namespace MvvmCross.Plugins.Color.WindowsCommon
{

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;
@ -13,10 +13,10 @@ namespace MvvmCross.Plugins.Color.WindowsCommon
{
public static Windows.UI.Color ToNativeColor(this MvxColor mvxColor)
{
var color = Windows.UI.Color.FromArgb((byte) mvxColor.A,
(byte) mvxColor.R,
(byte) mvxColor.G,
(byte) mvxColor.B);
var color = Windows.UI.Color.FromArgb((byte)mvxColor.A,
(byte)mvxColor.R,
(byte)mvxColor.G,
(byte)mvxColor.B);
return color;
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -12,8 +12,8 @@ using Cirrious.CrossCore.UI;
namespace MvvmCross.Plugins.Color.WindowsCommon
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -1,9 +1,7 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Resources;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cirrious.MvvmCross.Plugins.Color.WindowsCommon")]
@ -19,12 +17,12 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Windows.Media;
using Cirrious.CrossCore.UI;
using System.Windows.Media;
namespace MvvmCross.Plugins.Color.WindowsPhone
{
@ -20,8 +20,8 @@ namespace MvvmCross.Plugins.Color.WindowsPhone
public static System.Windows.Media.Color ToNativeColor(MvxColor mvxColor)
{
return System.Windows.Media.Color.FromArgb((byte) mvxColor.A, (byte) mvxColor.R, (byte) mvxColor.G,
(byte) mvxColor.B);
return System.Windows.Media.Color.FromArgb((byte)mvxColor.A, (byte)mvxColor.R, (byte)mvxColor.G,
(byte)mvxColor.B);
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -12,8 +12,8 @@ using Cirrious.CrossCore.UI;
namespace MvvmCross.Plugins.Color.WindowsPhone
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -2,14 +2,14 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -22,8 +22,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@ -35,11 +35,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;
@ -13,10 +13,10 @@ namespace MvvmCross.Plugins.Color.WindowsStore
{
public static Windows.UI.Color ToNativeColor(this MvxColor mvxColor)
{
var color = Windows.UI.Color.FromArgb((byte) mvxColor.A,
(byte) mvxColor.R,
(byte) mvxColor.G,
(byte) mvxColor.B);
var color = Windows.UI.Color.FromArgb((byte)mvxColor.A,
(byte)mvxColor.R,
(byte)mvxColor.G,
(byte)mvxColor.B);
return color;
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -12,8 +12,8 @@ using Cirrious.CrossCore.UI;
namespace MvvmCross.Plugins.Color.WindowsStore
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -2,13 +2,13 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -24,11 +24,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Windows.Media;
using Cirrious.CrossCore.UI;
using System.Windows.Media;
namespace MvvmCross.Plugins.Color.Wpf
{
@ -20,8 +20,8 @@ namespace MvvmCross.Plugins.Color.Wpf
public static System.Windows.Media.Color ToNativeColor(MvxColor mvxColor)
{
return System.Windows.Media.Color.FromArgb((byte) mvxColor.A, (byte) mvxColor.R, (byte) mvxColor.G,
(byte) mvxColor.B);
return System.Windows.Media.Color.FromArgb((byte)mvxColor.A, (byte)mvxColor.R, (byte)mvxColor.G,
(byte)mvxColor.B);
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -12,8 +12,8 @@ using Cirrious.CrossCore.UI;
namespace MvvmCross.Plugins.Color.Wpf
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -2,13 +2,13 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -21,8 +21,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@ -34,11 +34,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;
using System;
using System.Globalization;
using Cirrious.CrossCore.UI;
namespace MvvmCross.Plugins.Color
{

Просмотреть файл

@ -2,18 +2,18 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using Cirrious.CrossCore.Converters;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Converters;
using Cirrious.CrossCore.UI;
using System;
namespace MvvmCross.Plugins.Color
{
public abstract class MvxColorValueConverter
: MvxValueConverter
: MvxValueConverter
{
private IMvxNativeColor _nativeColor;
@ -37,16 +37,16 @@ namespace MvvmCross.Plugins.Color
{
return NativeColor.ToNative(Convert(value, parameter, culture));
}
}
public abstract class MvxColorValueConverter<T>
: MvxColorValueConverter
{
protected sealed override MvxColor Convert(object value, object parameter, System.Globalization.CultureInfo culture)
{
return Convert((T)value, parameter, culture);
}
protected abstract MvxColor Convert(T value, object parameter, System.Globalization.CultureInfo culture);
}
public abstract class MvxColorValueConverter<T>
: MvxColorValueConverter
{
protected sealed override MvxColor Convert(object value, object parameter, System.Globalization.CultureInfo culture)
{
return Convert((T)value, parameter, culture);
}
protected abstract MvxColor Convert(T value, object parameter, System.Globalization.CultureInfo culture);
}
}

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Globalization;
using Cirrious.CrossCore.UI;
using System.Globalization;
namespace MvvmCross.Plugins.Color
{

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
namespace MvvmCross.Plugins.Color

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Globalization;
using Cirrious.CrossCore.UI;
using System.Globalization;
namespace MvvmCross.Plugins.Color
{

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.UI;
using System;
using System.Globalization;
using Cirrious.CrossCore.UI;
namespace MvvmCross.Plugins.Color
{
@ -26,10 +26,13 @@ namespace MvvmCross.Plugins.Color
{
case 3:
return Parse3DigitColor(value);
case 6:
return Parse6DigitColor(value);
case 8:
return Parse8DigitColor(value);
default:
return new MvxColor(0);
}

Просмотреть файл

@ -2,10 +2,9 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Converters;
using Cirrious.CrossCore.Plugins;

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -23,11 +23,11 @@ using System.Reflection;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Android.Graphics;

Просмотреть файл

@ -2,29 +2,29 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Threading.Tasks;
using Android.Graphics;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Droid;
using Cirrious.CrossCore.Platform;
using Cirrious.MvvmCross.Binding;
using MvvmCross.Plugins.File;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MvvmCross.Plugins.DownloadCache.Droid
{
public class MvxAndroidLocalFileImageLoader
: IMvxLocalFileImageLoader<Bitmap>
{
private const string ResourcePrefix = "res:";
private const string ResourcePrefix = "res:";
private readonly IDictionary<CacheKey, WeakReference<Bitmap>> _memCache =
new Dictionary<CacheKey, WeakReference<Bitmap>>();
public async Task<MvxImage<Bitmap>> Load(string localPath, bool shouldCache, int maxWidth, int maxHeight)
{
Bitmap bitmap;
@ -51,7 +51,8 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
return (MvxImage<Bitmap>)new MvxAndroidImage(bitmap);
}
private IMvxAndroidGlobals _androidGlobals;
private IMvxAndroidGlobals _androidGlobals;
protected IMvxAndroidGlobals AndroidGlobals
{
get
@ -75,7 +76,7 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
return
await BitmapFactory.DecodeResourceAsync(resources, id,
new BitmapFactory.Options {InPurgeable = true}).ConfigureAwait(false);
new BitmapFactory.Options { InPurgeable = true }).ConfigureAwait(false);
}
private static async Task<Bitmap> LoadBitmapAsync(string localPath, int maxWidth, int maxHeight)
@ -83,7 +84,7 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
if (maxWidth > 0 || maxHeight > 0)
{
// load thumbnail - see: http://developer.android.com/training/displaying-bitmaps/load-bitmap.html
var options = new BitmapFactory.Options {InJustDecodeBounds = true};
var options = new BitmapFactory.Options { InJustDecodeBounds = true };
await BitmapFactory.DecodeFileAsync(localPath, options).ConfigureAwait(false);
// Calculate inSampleSize
@ -97,7 +98,6 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
}
else
{
var fileStore = Mvx.Resolve<IMvxFileStore>();
byte[] contents;
if (!fileStore.TryReadBinaryFile(localPath, out contents))
@ -111,7 +111,6 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
.ConfigureAwait(false);
return image;
}
}
private static int CalculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight)
@ -123,7 +122,6 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
if (height > reqHeight || width > reqWidth)
{
int halfHeight = height / 2;
int halfWidth = width / 2;
@ -142,8 +140,8 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
private bool TryGetCachedBitmap(string localPath, int maxWidth, int maxHeight, out Bitmap bitmap)
{
var key = new CacheKey(localPath, maxWidth, maxHeight);
WeakReference<Bitmap> reference;
WeakReference<Bitmap> reference;
if (_memCache.TryGetValue(key, out reference))
{
Bitmap target;
@ -151,9 +149,9 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
{
bitmap = target;
return true;
}
_memCache.Remove(key);
}
_memCache.Remove(key);
}
bitmap = null;
@ -162,8 +160,8 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
private void AddToCache(string localPath, int maxWidth, int maxHeight, Bitmap bitmap)
{
if (bitmap == null) return;
if (bitmap == null) return;
var key = new CacheKey(localPath, maxWidth, maxHeight);
_memCache[key] = new WeakReference<Bitmap>(bitmap);
}

Просмотреть файл

@ -2,12 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using System.Runtime.InteropServices;
using Cirrious.CrossCore.Plugins;
using System;
namespace MvvmCross.Plugins.DownloadCache.Droid
{

Просмотреть файл

@ -2,20 +2,19 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using Android.Graphics;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore.Platform;
using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.DownloadCache.Droid
{
public class Plugin
: IMvxConfigurablePlugin
: IMvxConfigurablePlugin
{
private MvxDownloadCacheConfiguration _configuration;
@ -28,7 +27,8 @@ namespace MvvmCross.Plugins.DownloadCache.Droid
_configuration = (MvxDownloadCacheConfiguration)configuration;
}
#warning One day I would like to decouple this implementation from the FileStore plugin
#warning One day I would like to decouple this implementation from the FileStore plugin
public void Load()
{
Mvx.RegisterSingleton<IMvxHttpFileDownloader>(() => CreateHttpFileDownloader());

Просмотреть файл

@ -2,13 +2,13 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -25,11 +25,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using Cirrious.CrossCore.Plugins;
using System;
namespace MvvmCross.Plugins.DownloadCache.Touch
{

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using UIKit;
@ -23,7 +23,7 @@ namespace MvvmCross.Plugins.DownloadCache.Touch
return 0;
var cg = RawImage.CGImage;
return (int)(cg.BytesPerRow*cg.Height);
return (int)(cg.BytesPerRow * cg.Height);
}
}
}

Просмотреть файл

@ -2,28 +2,29 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Threading.Tasks;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Core;
using MvvmCross.Plugins.File;
using System.Threading.Tasks;
using UIKit;
namespace MvvmCross.Plugins.DownloadCache.Touch
{
public class MvxTouchLocalFileImageLoader
{
public class MvxTouchLocalFileImageLoader
: MvxAllThreadDispatchingObject
, IMvxLocalFileImageLoader<UIImage>
{
private const string ResourcePrefix = "res:";
public Task<MvxImage<UIImage>> Load(string localPath, bool shouldCache, int width, int height)
{
, IMvxLocalFileImageLoader<UIImage>
{
private const string ResourcePrefix = "res:";
public Task<MvxImage<UIImage>> Load(string localPath, bool shouldCache, int width, int height)
{
var tcs = new TaskCompletionSource<MvxImage<UIImage>>();
InvokeOnMainThread(() => {
InvokeOnMainThread(() =>
{
UIImage uiImage;
if (localPath.StartsWith(ResourcePrefix))
@ -34,21 +35,21 @@ namespace MvvmCross.Plugins.DownloadCache.Touch
var result = (MvxImage<UIImage>)new MvxTouchImage(uiImage);
tcs.TrySetResult(result);
});
return tcs.Task;
}
private static UIImage LoadUiImage(string localPath)
{
var file = Mvx.Resolve<IMvxFileStore>();
var nativePath = file.NativePath(localPath);
return UIImage.FromFile(nativePath);
}
private static UIImage LoadResourceImage(string resourcePath)
{
return UIImage.FromBundle(resourcePath);
}
});
return tcs.Task;
}
private static UIImage LoadUiImage(string localPath)
{
var file = Mvx.Resolve<IMvxFileStore>();
var nativePath = file.NativePath(localPath);
return UIImage.FromFile(nativePath);
}
private static UIImage LoadResourceImage(string resourcePath)
{
return UIImage.FromBundle(resourcePath);
}
}
}

Просмотреть файл

@ -2,18 +2,19 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore.Platform;
using Cirrious.CrossCore.Plugins;
using UIKit;
namespace MvvmCross.Plugins.DownloadCache.Touch
{
#warning One day I would like to decouple this plugin from the FileStore plugin
#warning One day I would like to decouple this plugin from the FileStore plugin
public class Plugin
: IMvxConfigurablePlugin
{

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -23,11 +23,11 @@ using System.Reflection;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
@ -11,8 +11,10 @@ namespace MvvmCross.Plugins.DownloadCache
{
public interface IMvxFileDownloadCache
{
void RequestLocalFilePath(string httpSource, Action<string> success, Action<Exception> error);
void ClearAll();
void RequestLocalFilePath(string httpSource, Action<string> success, Action<Exception> error);
void ClearAll();
void Clear(string httpSource);
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Threading.Tasks;

Просмотреть файл

@ -2,10 +2,9 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using System.Threading.Tasks;
namespace MvvmCross.Plugins.DownloadCache

Просмотреть файл

@ -2,15 +2,15 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using System.Threading.Tasks;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore.Platform;
using System;
using System.Threading.Tasks;
namespace MvvmCross.Plugins.DownloadCache
{
@ -27,7 +27,7 @@ namespace MvvmCross.Plugins.DownloadCache
HttpImageShown
}
#endregion
#endregion ImageState enum
private ImageState _currentImageState = ImageState.DefaultShown;
@ -84,7 +84,7 @@ namespace MvvmCross.Plugins.DownloadCache
GC.SuppressFinalize(this);
}
#endregion
#endregion IDisposable Members
~MvxDynamicImageHelper()
{
@ -92,6 +92,7 @@ namespace MvvmCross.Plugins.DownloadCache
}
public event EventHandler<MvxValueEventArgs<T>> ImageChanged;
public int MaxWidth { get; set; }
public int MaxHeight { get; set; }
@ -158,6 +159,7 @@ namespace MvvmCross.Plugins.DownloadCache
{
case ImageState.ErrorShown:
return ShowErrorImage();
default:
return ShowDefaultImage();
}
@ -191,7 +193,8 @@ namespace MvvmCross.Plugins.DownloadCache
FireImageChanged(localImage);
}
catch (Exception ex) {
catch (Exception ex)
{
Mvx.Error(ex.Message);
}
}
@ -222,6 +225,8 @@ namespace MvvmCross.Plugins.DownloadCache
FireImageChanged(image);
}
protected virtual void Dispose(bool isDisposing) { }
protected virtual void Dispose(bool isDisposing)
{
}
}
}

Просмотреть файл

@ -2,18 +2,18 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore.Platform;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Platform;
namespace MvvmCross.Plugins.DownloadCache
{
@ -25,7 +25,8 @@ namespace MvvmCross.Plugins.DownloadCache
private static readonly TimeSpan PeriodSaveInterval = TimeSpan.FromSeconds(1.0);
private IMvxTextSerializer _textConvert;
private bool _textConvertTried;
private bool _textConvertTried;
protected IMvxTextSerializer TextConvert
{
get
@ -181,7 +182,7 @@ namespace MvvmCross.Plugins.DownloadCache
return new Dictionary<string, Entry>();
}
#endregion
#endregion Constructor helper methods
#region Periodic Tasks
@ -242,8 +243,8 @@ namespace MvvmCross.Plugins.DownloadCache
RunSyncWithLock(() =>
{
List<Entry> toSave = _entriesByHttpUrl.Values.ToList();
_indexNeedsSaving = false;
_indexNeedsSaving = false;
try
{
var textConvert = TextConvert;
@ -262,7 +263,7 @@ namespace MvvmCross.Plugins.DownloadCache
});
}
#endregion
#endregion Periodic Tasks
public void RequestLocalFilePath(string httpSource, Action<string> success, Action<Exception> error)
{
@ -401,13 +402,15 @@ namespace MvvmCross.Plugins.DownloadCache
Task.Run(() => tuple.Item1(tuple.Item2));
await Task.Delay(period);
}
}, Tuple.Create(callback, state), CancellationToken.None,
TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.OnlyOnRanToCompletion,
TaskScheduler.Default);
}
public new void Dispose() { base.Cancel(); }
public new void Dispose()
{
base.Cancel();
}
}
}
}

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.Core;
using System;
using System.Net;
using Cirrious.CrossCore.Core;
namespace MvvmCross.Plugins.DownloadCache
{
@ -22,7 +22,8 @@ namespace MvvmCross.Plugins.DownloadCache
public string DownloadPath { get; private set; }
public string Url { get; private set; }
public event EventHandler<MvxFileDownloadedEventArgs> DownloadComplete;
public event EventHandler<MvxFileDownloadedEventArgs> DownloadComplete;
public event EventHandler<MvxValueEventArgs<Exception>> DownloadFailed;
public void Start()
@ -31,13 +32,13 @@ namespace MvvmCross.Plugins.DownloadCache
{
var request = WebRequest.Create(new Uri(Url));
request.BeginGetResponse((result) => ProcessResponse(request, result), null);
}
//#if !NETFX_CORE
// catch (ThreadAbortException)
// {
// throw;
// }
//#endif
}
//#if !NETFX_CORE
// catch (ThreadAbortException)
// {
// throw;
// }
//#endif
catch (Exception e)
{
FireDownloadFailed(e);
@ -58,7 +59,7 @@ namespace MvvmCross.Plugins.DownloadCache
fileService.WriteFile(tempFilePath,
fileStream =>
{
var buffer = new byte[4*1024];
var buffer = new byte[4 * 1024];
int count;
while ((count = s.Read(buffer, 0, buffer.Length)) > 0)
{
@ -68,13 +69,13 @@ namespace MvvmCross.Plugins.DownloadCache
}
}
fileService.TryMove(tempFilePath, DownloadPath, true);
}
//#if !NETFX_CORE
// catch (ThreadAbortException)
// {
// throw;
// }
//#endif
}
//#if !NETFX_CORE
// catch (ThreadAbortException)
// {
// throw;
// }
//#endif
catch (Exception exception)
{
FireDownloadFailed(exception);

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;

Просмотреть файл

@ -2,11 +2,11 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Exceptions;
using MvvmCross.Plugins.File;
namespace MvvmCross.Plugins.DownloadCache

Просмотреть файл

@ -2,13 +2,13 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using Cirrious.CrossCore.Core;
namespace MvvmCross.Plugins.DownloadCache
{
@ -54,7 +54,7 @@ namespace MvvmCross.Plugins.DownloadCache
});
}
#endregion
#endregion IMvxHttpFileDownloader Members
private void OnRequestFinished(MvxFileDownloadRequest request)
{

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
namespace MvvmCross.Plugins.DownloadCache
@ -14,7 +14,8 @@ namespace MvvmCross.Plugins.DownloadCache
RawImage = rawImage;
}
public T RawImage { get; private set; }
public T RawImage { get; private set; }
public abstract int GetSizeInBytes();
}
}

Просмотреть файл

@ -2,15 +2,15 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
using Cirrious.CrossCore.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Cirrious.CrossCore.Core;
using Cirrious.CrossCore;
namespace MvvmCross.Plugins.DownloadCache
{
@ -39,7 +39,8 @@ namespace MvvmCross.Plugins.DownloadCache
{
var tcs = new TaskCompletionSource<T>();
Task.Run(() => {
Task.Run(() =>
{
Entry entry;
if (_entriesByHttpUrl.TryGetValue(url, out entry))
{
@ -50,18 +51,21 @@ namespace MvvmCross.Plugins.DownloadCache
try
{
_fileDownloadCache.RequestLocalFilePath(url,
async s => {
_fileDownloadCache.RequestLocalFilePath(url,
async s =>
{
var image = await Parse(s).ConfigureAwait(false);
lock(_entriesByHttpUrl)
{
if(!_entriesByHttpUrl.ContainsKey(url)) {
_entriesByHttpUrl.Add(url, new Entry(url, image));
}
lock (_entriesByHttpUrl)
{
if (!_entriesByHttpUrl.ContainsKey(url))
{
_entriesByHttpUrl.Add(url, new Entry(url, image));
}
}
tcs.TrySetResult(image.RawImage);
},
exception => {
exception =>
{
tcs.TrySetException(exception);
});
}
@ -74,7 +78,7 @@ namespace MvvmCross.Plugins.DownloadCache
return tcs.Task;
}
#endregion
#endregion IMvxImageCache<T> Members
private void ReduceSizeIfNecessary()
{
@ -100,9 +104,9 @@ namespace MvvmCross.Plugins.DownloadCache
currentSizeInBytes -= toRemove.Image.GetSizeInBytes();
currentCountFiles--;
if (_disposeOnRemove)
toRemove.Image.RawImage.DisposeIfDisposable();
if (_disposeOnRemove)
toRemove.Image.RawImage.DisposeIfDisposable();
_entriesByHttpUrl.Remove(toRemove.Url);
}
});
@ -138,6 +142,6 @@ namespace MvvmCross.Plugins.DownloadCache
public DateTime WhenLastAccessedUtc { get; set; }
}
#endregion
#endregion Nested type: Entry
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -11,7 +11,7 @@ using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.DownloadCache
{
public class PluginLoader
: IMvxPluginLoader
: IMvxPluginLoader
{
public static readonly PluginLoader Instance = new PluginLoader();

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -23,11 +23,11 @@ using System.Reflection;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,19 +2,19 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
using System.Collections.Generic;
using System.Linq;
using Cirrious.CrossCore;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore.Touch.Platform;
using Cirrious.CrossCore.Touch.Views;
using MessageUI;
using UIKit;
using Foundation;
using MessageUI;
using System;
using System.Collections.Generic;
using System.Linq;
using UIKit;
namespace MvvmCross.Plugins.Email.Touch
{
@ -33,8 +33,8 @@ namespace MvvmCross.Plugins.Email.Touch
public void ComposeEmail(string to, string cc = null, string subject = null, string body = null,
bool isHtml = false, string dialogTitle = null)
{
var toArray = to == null ? null : new[] {to};
var ccArray = cc == null ? null : new[] {cc};
var toArray = to == null ? null : new[] { to };
var ccArray = cc == null ? null : new[] { cc };
ComposeEmail(
toArray,
ccArray,
@ -55,7 +55,7 @@ namespace MvvmCross.Plugins.Email.Touch
_mail.SetMessageBody(body ?? string.Empty, isHtml);
_mail.SetSubject(subject ?? string.Empty);
if(cc != null)
if (cc != null)
_mail.SetCcRecipients(cc.ToArray());
_mail.SetToRecipients(to == null ? new[] { string.Empty } : to.ToArray());
@ -100,4 +100,4 @@ namespace MvvmCross.Plugins.Email.Touch
_modalHost.NativeModalViewControllerDisappearedOnItsOwn();
}
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -11,7 +11,7 @@ using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.Email.Touch
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -2,12 +2,12 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -23,11 +23,11 @@ using System.Reflection;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
@ -10,18 +10,18 @@ using Windows.System;
namespace MvvmCross.Plugins.Email.WindowsCommon
{
// IMvxComposeEmailTaskEx not supported currently in WinStore
// IMvxComposeEmailTaskEx not supported currently in WinStore
// to support this we'd need to experiment with multiple addresses (e.g. see http://www.sightspecific.com/~mosh/www_faq/multrec.html)
public class MvxComposeEmailTask
public class MvxComposeEmailTask
: IMvxComposeEmailTask
{
public void ComposeEmail(string to, string cc = null, string subject = null, string body = null, bool isHtml = false, string dialogTitle = null)
{
// this is the best I can do so far...
// this is the best I can do so far...
// see - http://stackoverflow.com/questions/10674193/winrt-how-to-email-a-message-to-a-specific-person
var url = new MvxMailToUrlBuilder().Build(to, cc, subject, body);
var uri = new Uri(url, UriKind.Absolute);
Launcher.LaunchUriAsync(uri);
Launcher.LaunchUriAsync(uri);
}
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -11,7 +11,7 @@ using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.Email.WindowsCommon
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -1,9 +1,7 @@
using System.Resources;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Resources;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cirrious.MvvmCross.Plugins.Email.WindowsCommon")]
@ -19,12 +17,12 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]

Просмотреть файл

@ -2,14 +2,14 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Linq;
using Cirrious.CrossCore.Exceptions;
using Cirrious.CrossCore.WindowsPhone.Tasks;
using Microsoft.Phone.Tasks;
using System.Collections.Generic;
using System.Linq;
namespace MvvmCross.Plugins.Email.WindowsPhone
{
@ -21,8 +21,8 @@ namespace MvvmCross.Plugins.Email.WindowsPhone
bool isHtml = false, string dialogTitle = null)
{
ComposeEmail(
new[] {to},
new[] {cc},
new[] { to },
new[] { cc },
subject,
body,
isHtml);
@ -36,7 +36,7 @@ namespace MvvmCross.Plugins.Email.WindowsPhone
if (attachments != null && attachments.Any())
throw new MvxException("Don't know how to send attachments in WP");
var task = new EmailComposeTask {Subject = subject, Body = body};
var task = new EmailComposeTask { Subject = subject, Body = body };
if (to != null)
task.To = string.Join(";", to);
if (cc != null)
@ -61,4 +61,4 @@ namespace MvvmCross.Plugins.Email.WindowsPhone
}
}
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -11,7 +11,7 @@ using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.Email.WindowsPhone
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -2,14 +2,14 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -22,8 +22,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@ -35,11 +35,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System;
@ -10,19 +10,19 @@ using Windows.System;
namespace MvvmCross.Plugins.Email.WindowsStore
{
// IMvxComposeEmailTaskEx not supported currently in WinStore
// IMvxComposeEmailTaskEx not supported currently in WinStore
// to support this we'd need to experiment with multiple addresses (e.g. see http://www.sightspecific.com/~mosh/www_faq/multrec.html)
public class MvxComposeEmailTask
public class MvxComposeEmailTask
: IMvxComposeEmailTask
{
public void ComposeEmail(string to, string cc = null, string subject = null, string body = null,
bool isHtml = false, string dialogTitle = null)
{
// this is the best I can do so far...
// this is the best I can do so far...
// see - http://stackoverflow.com/questions/10674193/winrt-how-to-email-a-message-to-a-specific-person
var url = new MvxMailToUrlBuilder().Build(to, cc, subject, body);
var uri = new Uri(url, UriKind.Absolute);
Launcher.LaunchUriAsync(uri);
Launcher.LaunchUriAsync(uri);
}
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using Cirrious.CrossCore;
@ -11,7 +11,7 @@ using Cirrious.CrossCore.Plugins;
namespace MvvmCross.Plugins.Email.WindowsStore
{
public class Plugin
: IMvxPlugin
: IMvxPlugin
{
public void Load()
{

Просмотреть файл

@ -1,8 +1,7 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cirrious.MvvmCross.Plugins.Email.WindowsStore")]
@ -17,11 +16,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]

Просмотреть файл

@ -2,7 +2,7 @@
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
// Contributions and inspirations noted in readme.md and license.txt
//
//
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
using System.Diagnostics;
@ -19,4 +19,4 @@ namespace MvvmCross.Plugins.Email.Wpf
Process.Start(new ProcessStartInfo(url));
}
}
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше