diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2016-05-04 07:08:54 -0600 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2016-05-04 14:08:54 +0100 |
commit | 5b9094241b1d3da5419ed21be30bdcc07c469dbe (patch) | |
tree | cd22a4b646a7002c61e4b7fe0714c0f64e483d38 /Xamarin.Forms.Core | |
parent | a2148444bafd728090c39c1f40700b43baded1e4 (diff) | |
download | xamarin-forms-5b9094241b1d3da5419ed21be30bdcc07c469dbe.tar.gz xamarin-forms-5b9094241b1d3da5419ed21be30bdcc07c469dbe.tar.bz2 xamarin-forms-5b9094241b1d3da5419ed21be30bdcc07c469dbe.zip |
Prep StreamImageSource for removal of InternalsVisibleTo
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r-- | Xamarin.Forms.Core/IStreamImageSource.cs | 11 | ||||
-rw-r--r-- | Xamarin.Forms.Core/StreamImageSource.cs | 6 | ||||
-rw-r--r-- | Xamarin.Forms.Core/Xamarin.Forms.Core.csproj | 1 |
3 files changed, 15 insertions, 3 deletions
diff --git a/Xamarin.Forms.Core/IStreamImageSource.cs b/Xamarin.Forms.Core/IStreamImageSource.cs new file mode 100644 index 00000000..92a7e958 --- /dev/null +++ b/Xamarin.Forms.Core/IStreamImageSource.cs @@ -0,0 +1,11 @@ +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace Xamarin.Forms +{ + public interface IStreamImageSource + { + Task<Stream> GetStreamAsync(CancellationToken userToken = default(CancellationToken)); + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Core/StreamImageSource.cs b/Xamarin.Forms.Core/StreamImageSource.cs index ae59ea3c..06926749 100644 --- a/Xamarin.Forms.Core/StreamImageSource.cs +++ b/Xamarin.Forms.Core/StreamImageSource.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; namespace Xamarin.Forms { - public class StreamImageSource : ImageSource + public class StreamImageSource : ImageSource, IStreamImageSource { public static readonly BindableProperty StreamProperty = BindableProperty.Create("Stream", typeof(Func<CancellationToken, Task<Stream>>), typeof(StreamImageSource), default(Func<CancellationToken, Task<Stream>>)); @@ -21,9 +21,9 @@ namespace Xamarin.Forms if (propertyName == StreamProperty.PropertyName) OnSourceChanged(); base.OnPropertyChanged(propertyName); - } + } - internal async Task<Stream> GetStreamAsync(CancellationToken userToken = default(CancellationToken)) + async Task<Stream> IStreamImageSource.GetStreamAsync(CancellationToken userToken) { if (Stream == null) return null; diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj index e5a1b640..32cd9b88 100644 --- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj +++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj @@ -140,6 +140,7 @@ <Compile Include="IRootObjectProvider.cs" /> <Compile Include="IScrollViewController.cs" /> <Compile Include="ISearchBarController.cs" /> + <Compile Include="IStreamImageSource.cs" /> <Compile Include="ItemTappedEventArgs.cs" /> <Compile Include="ItemVisibilityEventArgs.cs" /> <Compile Include="IValueConverterProvider.cs" /> |