Reformat using statements
authorChris King <kingces95@gmail.com>
Fri, 25 Mar 2016 20:53:19 +0000 (13:53 -0700)
committerChris King <kingces95@gmail.com>
Fri, 25 Mar 2016 20:53:19 +0000 (13:53 -0700)
40 files changed:
Xamarin.Forms.Build.Tasks/XamlCTask.cs
Xamarin.Forms.Build.Tasks/XamlGTask.cs
Xamarin.Forms.Platform.Android/AppCompat/ButtonRenderer.cs
Xamarin.Forms.Platform.Android/AppCompat/FormsAppCompatActivity.cs
Xamarin.Forms.Platform.Android/AppCompat/NavigationPageRenderer.cs
Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs
Xamarin.Forms.Platform.Android/CellAdapter.cs
Xamarin.Forms.Platform.Android/Cells/BaseCellView.cs
Xamarin.Forms.Platform.Android/Cells/EntryCellView.cs
Xamarin.Forms.Platform.Android/ColorExtensions.cs
Xamarin.Forms.Platform.Android/ContextExtensions.cs
Xamarin.Forms.Platform.Android/Deserializer.cs
Xamarin.Forms.Platform.Android/Forms.cs
Xamarin.Forms.Platform.Android/KeyboardManager.cs
Xamarin.Forms.Platform.Android/Platform.cs
Xamarin.Forms.Platform.Android/Renderers/ActionSheetRenderer.cs
Xamarin.Forms.Platform.Android/Renderers/ButtonDrawable.cs
Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs
Xamarin.Forms.Platform.Android/Renderers/ImageLoaderSourceHandler.cs
Xamarin.Forms.Platform.Android/Renderers/ListViewAdapter.cs
Xamarin.Forms.Platform.Android/Renderers/StreamImagesourceHandler.cs
Xamarin.Forms.Platform.Android/Renderers/TableViewModelRenderer.cs
Xamarin.Forms.Platform.Android/Renderers/ToolbarRenderer.cs
Xamarin.Forms.Platform.Android/ResourcesProvider.cs
Xamarin.Forms.Platform.Android/ViewExtensions.cs
Xamarin.Forms.Platform.WP8/Deserializer.cs
Xamarin.Forms.Platform.WP8/ImageRenderer.cs
Xamarin.Forms.Platform.WP8/WebViewRenderer.cs
Xamarin.Forms.Platform.WinRT/ImageLoaderSourceHandler.cs
Xamarin.Forms.Platform.WinRT/StreamImagesourceHandler.cs
Xamarin.Forms.Platform.WinRT/WindowsBasePlatformServices.cs
Xamarin.Forms.Platform.WinRT/WindowsSerializer.cs
Xamarin.Forms.Platform.iOS/Deserializer.cs
Xamarin.Forms.Platform.iOS/Forms.cs
Xamarin.Forms.Platform.iOS/Renderers/BoxRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/ImageRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/NavigationMenuRenderer.cs
Xamarin.Forms.UITest.TestCloud/Mono.Options/StringCoda.cs
Xamarin.Forms.Xaml.Xamlg/Mono.Options/Options.cs
Xamarin.Forms.Xaml/XamlLoader.cs

index 81f0642..7c429d3 100644 (file)
@@ -301,7 +301,7 @@ namespace Xamarin.Forms.Build.Tasks
                                                var filepath = Path.Combine(Path.GetDirectoryName(Assembly), typeDef.FullName + ".decompiled.cs");
                                                Log(2, "   Decompiling {0} into {1}...", typeDef.FullName, filepath);
                                                var decompilerContext = new DecompilerContext(module);
-                                               using(var writer = new StreamWriter(filepath))
+                                               using (var writer = new StreamWriter(filepath))
                                                {
                                                        var output = new PlainTextOutput(writer);
 
@@ -358,7 +358,7 @@ namespace Xamarin.Forms.Build.Tasks
                static ILRootNode ParseXaml(Stream stream, TypeReference typeReference)
                {
                        ILRootNode rootnode = null;
-                       using(var reader = XmlReader.Create(stream))
+                       using (var reader = XmlReader.Create(stream))
                        {
                                while (reader.Read())
                                {
@@ -388,7 +388,7 @@ namespace Xamarin.Forms.Build.Tasks
                        if (!resource.Name.EndsWith(".xaml", StringComparison.InvariantCulture))
                                return false;
 
-                       using(var resourceStream = resource.GetResourceStream())
+                       using (var resourceStream = resource.GetResourceStream())
                        {
                                var xmlDoc = new XmlDocument();
                                xmlDoc.Load(resourceStream);
index 28158e6..72375d6 100644 (file)
@@ -171,7 +171,7 @@ namespace Xamarin.Forms.Build.Tasks
                                initcomp.Statements.Add(assign);
                        }
 
-                       using(var writer = new StreamWriter(outFile))
+                       using (var writer = new StreamWriter(outFile))
                                Provider.GenerateCodeFromCompileUnit(ccu, writer, new CodeGeneratorOptions());
                }
 
@@ -180,7 +180,7 @@ namespace Xamarin.Forms.Build.Tasks
                        string rootType, rootNs;
                        CodeTypeReference baseType;
                        IDictionary<string, CodeTypeReference> namesAndTypes;
-                       using(StreamReader reader = File.OpenText(xamlFile))
+                       using (StreamReader reader = File.OpenText(xamlFile))
                                ParseXaml(reader, out rootType, out rootNs, out baseType, out namesAndTypes);
                        GenerateCode(rootType, rootNs, baseType, namesAndTypes, outFile);
                }
index c6e31e1..c7df08e 100644 (file)
@@ -121,7 +121,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                                        int id = GlobalResource.Attribute.ButtonTint;
                                        unchecked
                                        {
-                                               using(var value = new TypedValue())
+                                               using (var value = new TypedValue())
                                                {
                                                        try
                                                        {
index 916f185..b7c0220 100644 (file)
@@ -293,7 +293,7 @@ namespace Xamarin.Forms.Platform.Android
                {
                        FormsAppCompatActivity context = this;
                        int id = global::Android.Resource.Attribute.ColorPrimaryDark;
-                       using(var value = new TypedValue())
+                       using (var value = new TypedValue())
                        {
                                try
                                {
index fd4cb72..7edbffb 100644 (file)
@@ -320,7 +320,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                        int attr = Resource.Attribute.actionBarSize;
 
                        int actionBarHeight;
-                       using(var tv = new TypedValue())
+                       using (var tv = new TypedValue())
                        {
                                actionBarHeight = 0;
                                if (Context.Theme.ResolveAttribute(attr, tv, true))
index d59d9f6..dd7fb85 100644 (file)
@@ -87,7 +87,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
                void OnClick()
                {
                        Picker model = Element;
-                       using(var builder = new AlertDialog.Builder(Context))
+                       using (var builder = new AlertDialog.Builder(Context))
                        {
                                builder.SetTitle(model.Title ?? "");
                                string[] items = model.Items.ToArray();
index 9f43915..58c35a8 100644 (file)
@@ -159,7 +159,7 @@ namespace Xamarin.Forms.Platform.Android
                protected void SetSelectedBackground(AView view, bool isContextTarget = false)
                {
                        int attribute = isContextTarget ? global::Android.Resource.Attribute.ColorLongPressedHighlight : global::Android.Resource.Attribute.ColorActivatedHighlight;
-                       using(var value = new TypedValue())
+                       using (var value = new TypedValue())
                        {
                                if (_context.Theme.ResolveAttribute(attribute, value, true))
                                        view.SetBackgroundResource(value.ResourceId);
index 7855b01..46959c0 100644 (file)
@@ -46,7 +46,7 @@ namespace Xamarin.Forms.Platform.Android
                                RightMargin = 0,
                                Gravity = GravityFlags.Center
                        };
-                       using(imageParams)
+                       using (imageParams)
                                AddView(_imageView, imageParams);
 
                        var textLayout = new LinearLayout(context) { Orientation = Orientation.Vertical };
@@ -56,7 +56,7 @@ namespace Xamarin.Forms.Platform.Android
                        _mainText.Ellipsize = TextUtils.TruncateAt.End;
                        _mainText.SetPadding((int)context.ToPixels(15), padding, padding, padding);
                        _mainText.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItem);
-                       using(var lp = new LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent))
+                       using (var lp = new LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent))
                                textLayout.AddView(_mainText, lp);
 
                        _detailText = new TextView(context);
@@ -65,12 +65,12 @@ namespace Xamarin.Forms.Platform.Android
                        _detailText.SetPadding((int)context.ToPixels(15), padding, padding, padding);
                        _detailText.Visibility = ViewStates.Gone;
                        _detailText.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItemSmall);
-                       using(var lp = new LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent))
+                       using (var lp = new LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent))
                                textLayout.AddView(_detailText, lp);
 
                        var layoutParams = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent) { Width = 0, Weight = 1, Gravity = GravityFlags.Center };
 
-                       using(layoutParams)
+                       using (layoutParams)
                                AddView(textLayout, layoutParams);
 
                        SetMinimumHeight((int)context.ToPixels(DefaultMinHeight));
@@ -118,7 +118,7 @@ namespace Xamarin.Forms.Platform.Android
 
                        if (view != null)
                        {
-                               using(var layout = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.FillParent))
+                               using (var layout = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.FillParent))
                                        AddView(view, layout);
 
                                AccessoryView = view;
index c0206f1..f94709d 100644 (file)
@@ -32,7 +32,7 @@ namespace Xamarin.Forms.Platform.Android
                        _label.SetTextAppearance(context, global::Android.Resource.Attribute.TextAppearanceListItem);
 
                        var layoutParams = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent) { Gravity = GravityFlags.CenterVertical };
-                       using(layoutParams)
+                       using (layoutParams)
                                AddView(_label, layoutParams);
 
                        EditText = new EntryCellEditText(context);
@@ -43,7 +43,7 @@ namespace Xamarin.Forms.Platform.Android
                        EditText.BackButtonPressed += OnBackButtonPressed;
                        //editText.SetBackgroundDrawable (null);
                        layoutParams = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent) { Width = 0, Weight = 1, Gravity = GravityFlags.FillHorizontal | GravityFlags.Center };
-                       using(layoutParams)
+                       using (layoutParams)
                                AddView(EditText, layoutParams);
                }
 
index afe7286..707363e 100644 (file)
@@ -16,7 +16,7 @@ namespace Xamarin.Forms.Platform.Android
                {
                        if (self == Color.Default)
                        {
-                               using(Resources resources = Resources.System)
+                               using (Resources resources = Resources.System)
                                        return resources.GetColor(defaultColorResourceId);
                        }
 
index 9a22c57..b3a219f 100644 (file)
@@ -34,7 +34,7 @@ namespace Xamarin.Forms.Platform.Android
 
                internal static double GetThemeAttributeDp(this Context self, int resource)
                {
-                       using(var value = new TypedValue())
+                       using (var value = new TypedValue())
                        {
                                if (!self.Theme.ResolveAttribute(resource, value, true))
                                        return -1;
@@ -51,7 +51,7 @@ namespace Xamarin.Forms.Platform.Android
                        if (s_displayDensity != float.MinValue)
                                return;
 
-                       using(DisplayMetrics metrics = context.Resources.DisplayMetrics)
+                       using (DisplayMetrics metrics = context.Resources.DisplayMetrics)
                                s_displayDensity = metrics.Density;
                }
        }
index 4c62ad1..b1eafa8 100644 (file)
@@ -18,9 +18,9 @@ namespace Xamarin.Forms.Platform.Android
                        // Make sure to use Internal
                        return Task.Run(() =>
                        {
-                               using(IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
-                               using(IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile, System.IO.FileMode.OpenOrCreate))
-                               using(XmlDictionaryReader reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max))
+                               using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile, System.IO.FileMode.OpenOrCreate))
+                               using (XmlDictionaryReader reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max))
                                {
                                        if (stream.Length == 0)
                                                return null;
@@ -49,9 +49,9 @@ namespace Xamarin.Forms.Platform.Android
                        return Task.Run(() =>
                        {
                                var success = false;
-                               using(IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
-                               using(IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile + ".tmp", System.IO.FileMode.OpenOrCreate))
-                               using(XmlDictionaryWriter writer = XmlDictionaryWriter.CreateBinaryWriter(stream))
+                               using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile + ".tmp", System.IO.FileMode.OpenOrCreate))
+                               using (XmlDictionaryWriter writer = XmlDictionaryWriter.CreateBinaryWriter(stream))
                                {
                                        try
                                        {
@@ -69,7 +69,7 @@ namespace Xamarin.Forms.Platform.Android
 
                                if (!success)
                                        return;
-                               using(IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
                                {
                                        try
                                        {
index 8eb5038..b2ded24 100644 (file)
@@ -161,7 +161,7 @@ namespace Xamarin.Forms
                                CheckOrientationChanged(_formsActivity.Resources.Configuration.Orientation);
                                formsActivity.ConfigurationChanged += ConfigurationChanged;
 
-                               using(DisplayMetrics display = formsActivity.Resources.DisplayMetrics)
+                               using (DisplayMetrics display = formsActivity.Resources.DisplayMetrics)
                                {
                                        _scalingFactor = display.Density;
                                        _pixelScreenSize = new Size(display.WidthPixels, display.HeightPixels);
@@ -352,8 +352,8 @@ namespace Xamarin.Forms
 
                        public async Task<Stream> GetStreamAsync(Uri uri, CancellationToken cancellationToken)
                        {
-                               using(var client = new HttpClient())
-                               using(HttpResponseMessage response = await client.GetAsync(uri, cancellationToken))
+                               using (var client = new HttpClient())
+                               using (HttpResponseMessage response = await client.GetAsync(uri, cancellationToken))
                                        return await response.Content.ReadAsStreamAsync();
                        }
 
@@ -366,8 +366,8 @@ namespace Xamarin.Forms
                        {
                                get
                                {
-                                       using(Looper my = Looper.MyLooper())
-                                       using(Looper main = Looper.MainLooper)
+                                       using (Looper my = Looper.MyLooper())
+                                       using (Looper main = Looper.MainLooper)
                                                return my != main;
                                }
                        }
@@ -415,13 +415,13 @@ namespace Xamarin.Forms
                                val = 0;
                                try
                                {
-                                       using(var value = new TypedValue())
+                                       using (var value = new TypedValue())
                                        {
                                                if (Context.Theme.ResolveAttribute(appearance, value, true))
                                                {
                                                        var textSizeAttr = new[] { Resource.Attribute.TextSize };
                                                        const int indexOfAttrTextSize = 0;
-                                                       using(TypedArray array = Context.ObtainStyledAttributes(value.Data, textSizeAttr))
+                                                       using (TypedArray array = Context.ObtainStyledAttributes(value.Data, textSizeAttr))
                                                        {
                                                                val = Context.FromPixels(array.GetDimensionPixelSize(indexOfAttrTextSize, -1));
                                                                return true;
index 649c99b..db47857 100644 (file)
@@ -11,7 +11,7 @@ namespace Xamarin.Forms.Platform.Android
        {
                internal static void HideKeyboard(this AView inputView, bool overrideValidation = false)
                {
-                       using(var inputMethodManager = (InputMethodManager)Forms.Context.GetSystemService(Context.InputMethodService))
+                       using (var inputMethodManager = (InputMethodManager)Forms.Context.GetSystemService(Context.InputMethodService))
                        {
                                IBinder windowToken = null;
 
@@ -26,7 +26,7 @@ namespace Xamarin.Forms.Platform.Android
 
                internal static void ShowKeyboard(this AView inputView)
                {
-                       using(var inputMethodManager = (InputMethodManager)Forms.Context.GetSystemService(Context.InputMethodService))
+                       using (var inputMethodManager = (InputMethodManager)Forms.Context.GetSystemService(Context.InputMethodService))
                        {
                                if (inputView is EditText || inputView is TextView || inputView is SearchView)
                                {
index 1de13b4..baf7fa4 100644 (file)
@@ -463,7 +463,7 @@ namespace Xamarin.Forms.Platform.Android
                                else if (CurrentNavigationPage.BarBackgroundColor != Color.Default)
                                        colorToUse = CurrentNavigationPage.BarBackgroundColor;
                        }
-                       using(Drawable drawable = colorToUse == Color.Default ? GetActionBarBackgroundDrawable() : new ColorDrawable(colorToUse.ToAndroid()))
+                       using (Drawable drawable = colorToUse == Color.Default ? GetActionBarBackgroundDrawable() : new ColorDrawable(colorToUse.ToAndroid()))
                                ((Activity)_context).ActionBar.SetBackgroundDrawable(drawable);
                }
 
@@ -663,7 +663,7 @@ namespace Xamarin.Forms.Platform.Android
                {
                        int[] backgroundDataArray = { global::Android.Resource.Attribute.Background };
 
-                       using(var outVal = new TypedValue())
+                       using (var outVal = new TypedValue())
                        {
                                _context.Theme.ResolveAttribute(global::Android.Resource.Attribute.ActionBarStyle, outVal, true);
                                TypedArray actionBarStyle = _context.Theme.ObtainStyledAttributes(outVal.ResourceId, backgroundDataArray);
index ca51a70..8495d80 100644 (file)
@@ -49,7 +49,7 @@ namespace Xamarin.Forms.Platform.Android
 
                        _layout.Orientation = Orientation.Vertical;
 
-                       using(var layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent))
+                       using (var layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent))
                                SetContentView(_layout, layoutParams);
 
                        if (_arguments.Destruction != null)
index f25f930..62eaecb 100644 (file)
@@ -101,7 +101,7 @@ namespace Xamarin.Forms.Platform.Android
                Bitmap CreateBitmap(bool pressed, int width, int height)
                {
                        Bitmap bitmap = Bitmap.CreateBitmap(width, height, Bitmap.Config.Argb8888);
-                       using(var canvas = new Canvas(bitmap))
+                       using (var canvas = new Canvas(bitmap))
                        {
                                DrawBackground(canvas, width, height, pressed);
                                DrawOutline(canvas, width, height);
@@ -129,8 +129,8 @@ namespace Xamarin.Forms.Platform.Android
                        if (Button.BorderWidth <= 0)
                                return;
 
-                       using(var paint = new Paint { AntiAlias = true })
-                       using(var path = new Path())
+                       using (var paint = new Paint { AntiAlias = true })
+                       using (var path = new Path())
                        {
                                float borderWidth = Forms.Context.ToPixels(Button.BorderWidth);
                                float inset = borderWidth / 2;
index 63fb5da..a0cbd4d 100644 (file)
@@ -86,7 +86,7 @@ namespace Xamarin.Forms.Platform.Android
                                        _normalBitmap = CreateBitmap(false, width, height);
                                }
                                Bitmap bitmap = _normalBitmap;
-                               using(var paint = new Paint())
+                               using (var paint = new Paint())
                                        canvas.DrawBitmap(bitmap, 0, 0, paint);
                        }
 
@@ -122,10 +122,10 @@ namespace Xamarin.Forms.Platform.Android
                        Bitmap CreateBitmap(bool pressed, int width, int height)
                        {
                                Bitmap bitmap;
-                               using(Bitmap.Config config = Bitmap.Config.Argb8888)
+                               using (Bitmap.Config config = Bitmap.Config.Argb8888)
                                        bitmap = Bitmap.CreateBitmap(width, height, config);
 
-                               using(var canvas = new ACanvas(bitmap))
+                               using (var canvas = new ACanvas(bitmap))
                                {
                                        DrawBackground(canvas, width, height, pressed);
                                        DrawOutline(canvas, width, height);
@@ -136,11 +136,11 @@ namespace Xamarin.Forms.Platform.Android
 
                        void DrawBackground(ACanvas canvas, int width, int height, bool pressed)
                        {
-                               using(var paint = new Paint { AntiAlias = true })
-                               using(var path = new Path())
-                               using(Path.Direction direction = Path.Direction.Cw)
-                               using(Paint.Style style = Paint.Style.Fill)
-                               using(var rect = new RectF(0, 0, width, height))
+                               using (var paint = new Paint { AntiAlias = true })
+                               using (var path = new Path())
+                               using (Path.Direction direction = Path.Direction.Cw)
+                               using (Paint.Style style = Paint.Style.Fill)
+                               using (var rect = new RectF(0, 0, width, height))
                                {
                                        float rx = Forms.Context.ToPixels(5);
                                        float ry = Forms.Context.ToPixels(5);
@@ -157,11 +157,11 @@ namespace Xamarin.Forms.Platform.Android
 
                        void DrawOutline(ACanvas canvas, int width, int height)
                        {
-                               using(var paint = new Paint { AntiAlias = true })
-                               using(var path = new Path())
-                               using(Path.Direction direction = Path.Direction.Cw)
-                               using(Paint.Style style = Paint.Style.Stroke)
-                               using(var rect = new RectF(0, 0, width, height))
+                               using (var paint = new Paint { AntiAlias = true })
+                               using (var path = new Path())
+                               using (Path.Direction direction = Path.Direction.Cw)
+                               using (Paint.Style style = Paint.Style.Stroke)
+                               using (var rect = new RectF(0, 0, width, height))
                                {
                                        float rx = Forms.Context.ToPixels(5);
                                        float ry = Forms.Context.ToPixels(5);
@@ -179,7 +179,7 @@ namespace Xamarin.Forms.Platform.Android
                        {
                                if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName || e.PropertyName == Frame.OutlineColorProperty.PropertyName)
                                {
-                                       using(var canvas = new ACanvas(_normalBitmap))
+                                       using (var canvas = new ACanvas(_normalBitmap))
                                        {
                                                int width = Bounds.Width();
                                                int height = Bounds.Height();
index 541dbea..8d0ae3d 100644 (file)
@@ -13,7 +13,7 @@ namespace Xamarin.Forms.Platform.Android
                        var imageLoader = imagesource as UriImageSource;
                        if (imageLoader != null && imageLoader.Uri != null)
                        {
-                               using(Stream imageStream = await imageLoader.GetStreamAsync(cancelationToken).ConfigureAwait(false))
+                               using (Stream imageStream = await imageLoader.GetStreamAsync(cancelationToken).ConfigureAwait(false))
                                        return await BitmapFactory.DecodeStreamAsync(imageStream).ConfigureAwait(false);
                        }
                        return null;
index 28f1696..5342664 100644 (file)
@@ -289,7 +289,7 @@ namespace Xamarin.Forms.Platform.Android
                        {
                                if (s_dividerHorizontalDarkId == int.MinValue)
                                {
-                                       using(var value = new TypedValue())
+                                       using (var value = new TypedValue())
                                        {
                                                int id = global::Android.Resource.Drawable.DividerHorizontalDark;
                                                if (_context.Theme.ResolveAttribute(global::Android.Resource.Attribute.ListDivider, value, true))
index 708ed66..4406697 100644 (file)
@@ -13,7 +13,7 @@ namespace Xamarin.Forms.Platform.Android
                        var streamsource = imagesource as StreamImageSource;
                        if (streamsource != null && streamsource.Stream != null)
                        {
-                               using(Stream stream = await streamsource.GetStreamAsync(cancelationToken).ConfigureAwait(false))
+                               using (Stream stream = await streamsource.GetStreamAsync(cancelationToken).ConfigureAwait(false))
                                        return await BitmapFactory.DecodeStreamAsync(stream).ConfigureAwait(false);
                        }
                        return null;
index a7659ed..ea07dbf 100644 (file)
@@ -123,7 +123,7 @@ namespace Xamarin.Forms.Platform.Android
                                bline.SetBackgroundColor(global::Android.Graphics.Color.Transparent);
                        else
                        {
-                               using(var value = new TypedValue())
+                               using (var value = new TypedValue())
                                {
                                        int id = global::Android.Resource.Drawable.DividerHorizontalDark;
                                        if (Context.Theme.ResolveAttribute(global::Android.Resource.Attribute.ListDivider, value, true))
index f40b75f..92a774e 100644 (file)
@@ -57,7 +57,7 @@ namespace Xamarin.Forms.Platform.Android
                                else
                                        view = new AButton(Context);
 
-                               using(var param = new LinearLayout.LayoutParams(LayoutParams.WrapContent, (int)Context.ToPixels(48), 1))
+                               using (var param = new LinearLayout.LayoutParams(LayoutParams.WrapContent, (int)Context.ToPixels(48), 1))
                                        ((LinearLayout)Control).AddView(view, param);
                        }
                }
index 334ef56..5c7e1de 100644 (file)
@@ -27,12 +27,12 @@ namespace Xamarin.Forms.Platform.Android
                        global::Android.Graphics.Color androidColor = defaultColor;
 
                        Context context = Forms.Context;
-                       using(var value = new TypedValue())
+                       using (var value = new TypedValue())
                        {
                                if (context.Theme.ResolveAttribute(style, value, true))
                                {
                                        var styleattrs = new[] { global::Android.Resource.Attribute.TextSize, global::Android.Resource.Attribute.FontFamily, global::Android.Resource.Attribute.TextColor };
-                                       using(TypedArray array = context.ObtainStyledAttributes(value.ResourceId, styleattrs))
+                                       using (TypedArray array = context.ObtainStyledAttributes(value.ResourceId, styleattrs))
                                        {
                                                fontSize = context.FromPixels(array.GetDimensionPixelSize(0, -1));
                                                fontFamily = array.GetString(1);
index 04a80ef..12faa1e 100644 (file)
@@ -38,7 +38,7 @@ namespace Xamarin.Forms.Platform.Android
                public static void SetWindowBackground(this AView view)
                {
                        Context context = view.Context;
-                       using(var background = new TypedValue())
+                       using (var background = new TypedValue())
                        {
                                if (context.Theme.ResolveAttribute(global::Android.Resource.Attribute.WindowBackground, background, true))
                                {
@@ -50,7 +50,7 @@ namespace Xamarin.Forms.Platform.Android
                                                        view.SetBackgroundColor(color);
                                                        break;
                                                case "drawable":
-                                                       using(Drawable drawable = context.Resources.GetDrawable(background.ResourceId))
+                                                       using (Drawable drawable = context.Resources.GetDrawable(background.ResourceId))
                                                                view.SetBackgroundDrawable(drawable);
                                                        break;
                                        }
index a0c2de0..29c0e37 100644 (file)
@@ -18,9 +18,9 @@ namespace Xamarin.Forms.Platform.WinPhone
                        // Make sure to use Internal
                        return Task.Run(() =>
                        {
-                               using(IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
-                               using(IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile, System.IO.FileMode.OpenOrCreate))
-                               using(XmlDictionaryReader reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max))
+                               using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile, System.IO.FileMode.OpenOrCreate))
+                               using (XmlDictionaryReader reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max))
                                {
                                        if (stream.Length == 0)
                                                return null;
@@ -48,9 +48,9 @@ namespace Xamarin.Forms.Platform.WinPhone
                        return Task.Run(() =>
                        {
                                var success = false;
-                               using(IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
-                               using(IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile + ".tmp", System.IO.FileMode.OpenOrCreate))
-                               using(XmlDictionaryWriter writer = XmlDictionaryWriter.CreateBinaryWriter(stream))
+                               using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (IsolatedStorageFileStream stream = store.OpenFile(PropertyStoreFile + ".tmp", System.IO.FileMode.OpenOrCreate))
+                               using (XmlDictionaryWriter writer = XmlDictionaryWriter.CreateBinaryWriter(stream))
                                {
                                        try
                                        {
@@ -67,7 +67,7 @@ namespace Xamarin.Forms.Platform.WinPhone
 
                                if (!success)
                                        return;
-                               using(IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
                                {
                                        try
                                        {
index 8be9c15..ba0649f 100644 (file)
@@ -133,7 +133,7 @@ namespace Xamarin.Forms.Platform.WinPhone
                        var streamsource = imagesource as StreamImageSource;
                        if (streamsource != null && streamsource.Stream != null)
                        {
-                               using(Stream stream = await streamsource.GetStreamAsync(cancelationToken))
+                               using (Stream stream = await streamsource.GetStreamAsync(cancelationToken))
                                {
                                        bitmapimage = new BitmapImage();
                                        bitmapimage.SetSource(stream);
@@ -151,7 +151,7 @@ namespace Xamarin.Forms.Platform.WinPhone
                        var imageLoader = imagesoure as UriImageSource;
                        if (imageLoader != null && imageLoader.Uri != null)
                        {
-                               using(Stream streamimage = await imageLoader.GetStreamAsync(cancelationToken))
+                               using (Stream streamimage = await imageLoader.GetStreamAsync(cancelationToken))
                                {
                                        if (streamimage != null && streamimage.CanRead)
                                        {
index 4b3151b..364babe 100644 (file)
@@ -109,7 +109,7 @@ namespace Xamarin.Forms.Platform.WinPhone
                async Task SaveToIsoStore(string fileName, string html)
                {
                        IIsolatedStorageFile store = Device.PlatformServices.GetUserStoreForApplication();
-                       using(Stream file = await store.OpenFileAsync(fileName, FileMode.CreateNew, FileAccess.Write).ConfigureAwait(false))
+                       using (Stream file = await store.OpenFileAsync(fileName, FileMode.CreateNew, FileAccess.Write).ConfigureAwait(false))
                        {
                                byte[] bytes = Encoding.UTF8.GetBytes(html);
                                await file.WriteAsync(bytes, 0, bytes.Length).ConfigureAwait(false);
index c9c711e..d2b223b 100644 (file)
@@ -28,7 +28,7 @@ namespace Xamarin.Forms.Platform.WinRT
                                return null;
                        }
 
-                       using(IRandomAccessStream stream = streamImage.AsRandomAccessStream())
+                       using (IRandomAccessStream stream = streamImage.AsRandomAccessStream())
                        {
                                try
                                {
index ecf8c0d..faaa498 100644 (file)
@@ -21,7 +21,7 @@ namespace Xamarin.Forms.Platform.WinRT
                        var streamsource = imagesource as StreamImageSource;
                        if (streamsource != null && streamsource.Stream != null)
                        {
-                               using(Stream stream = await streamsource.GetStreamAsync(cancellationToken))
+                               using (Stream stream = await streamsource.GetStreamAsync(cancellationToken))
                                {
                                        if (stream == null)
                                                return null;
index bff32b7..dcda2c2 100644 (file)
@@ -115,7 +115,7 @@ namespace Xamarin.Forms.Platform.WinRT
 
                public async Task<Stream> GetStreamAsync(Uri uri, CancellationToken cancellationToken)
                {
-                       using(var client = new HttpClient())
+                       using (var client = new HttpClient())
                        {
                                HttpResponseMessage streamResponse = await client.GetAsync(uri.AbsoluteUri).ConfigureAwait(false);
                                return await streamResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
index 4e0ad79..0eeb2f8 100644 (file)
@@ -23,7 +23,7 @@ namespace Xamarin.Forms.Platform.WinRT
                        try
                        {
                                StorageFile file = await ApplicationData.Current.RoamingFolder.GetFileAsync(PropertyStoreFile).DontSync();
-                               using(Stream stream = (await file.OpenReadAsync().DontSync()).AsStreamForRead())
+                               using (Stream stream = (await file.OpenReadAsync().DontSync()).AsStreamForRead())
                                {
                                        if (stream.Length == 0)
                                                return new Dictionary<string, object>(4);
@@ -41,7 +41,7 @@ namespace Xamarin.Forms.Platform.WinRT
                public async Task SerializePropertiesAsync(IDictionary<string, object> properties)
                {
                        StorageFile file = await ApplicationData.Current.RoamingFolder.CreateFileAsync(PropertyStoreFile, CreationCollisionOption.ReplaceExisting).DontSync();
-                       using(StorageStreamTransaction transaction = await file.OpenTransactedWriteAsync().DontSync())
+                       using (StorageStreamTransaction transaction = await file.OpenTransactedWriteAsync().DontSync())
                        {
                                try
                                {
index bdab44d..8665757 100644 (file)
@@ -18,9 +18,9 @@ namespace Xamarin.Forms.Platform.iOS
                        // Make sure to use Internal
                        return Task.Run(() =>
                        {
-                               using(var store = IsolatedStorageFile.GetUserStoreForApplication())
-                               using(var stream = store.OpenFile(PropertyStoreFile, System.IO.FileMode.OpenOrCreate))
-                               using(var reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max))
+                               using (var store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (var stream = store.OpenFile(PropertyStoreFile, System.IO.FileMode.OpenOrCreate))
+                               using (var reader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max))
                                {
                                        if (stream.Length == 0)
                                                return null;
@@ -49,9 +49,9 @@ namespace Xamarin.Forms.Platform.iOS
                        return Task.Run(() =>
                        {
                                var success = false;
-                               using(var store = IsolatedStorageFile.GetUserStoreForApplication())
-                               using(var stream = store.OpenFile(PropertyStoreFile + ".tmp", System.IO.FileMode.OpenOrCreate))
-                               using(var writer = XmlDictionaryWriter.CreateBinaryWriter(stream))
+                               using (var store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (var stream = store.OpenFile(PropertyStoreFile + ".tmp", System.IO.FileMode.OpenOrCreate))
+                               using (var writer = XmlDictionaryWriter.CreateBinaryWriter(stream))
                                {
                                        try
                                        {
@@ -69,7 +69,7 @@ namespace Xamarin.Forms.Platform.iOS
 
                                if (!success)
                                        return;
-                               using(var store = IsolatedStorageFile.GetUserStoreForApplication())
+                               using (var store = IsolatedStorageFile.GetUserStoreForApplication())
                                {
                                        try
                                        {
index b7a4182..b0d581c 100644 (file)
@@ -238,8 +238,8 @@ namespace Xamarin.Forms
 
                        public async Task<Stream> GetStreamAsync(Uri uri, CancellationToken cancellationToken)
                        {
-                               using(var client = GetHttpClient())
-                               using(var response = await client.GetAsync(uri, cancellationToken))
+                               using (var client = GetHttpClient())
+                               using (var response = await client.GetAsync(uri, cancellationToken))
                                        return await response.Content.ReadAsStreamAsync();
                        }
 
index f60ed6c..ad408c1 100644 (file)
@@ -28,7 +28,7 @@ namespace Xamarin.Forms.Platform.iOS
 
                public override void Draw(RectangleF rect)
                {
-                       using(var context = UIGraphics.GetCurrentContext())
+                       using (var context = UIGraphics.GetCurrentContext())
                        {
                                _colorToRenderer.SetFill();
                                context.FillRect(rect);
index f227f9a..aa6ce91 100644 (file)
@@ -197,7 +197,7 @@ namespace Xamarin.Forms.Platform.iOS
                        var imageLoader = imagesource as UriImageSource;
                        if (imageLoader != null && imageLoader.Uri != null)
                        {
-                               using(var streamImage = await imageLoader.GetStreamAsync(cancelationToken).ConfigureAwait(false))
+                               using (var streamImage = await imageLoader.GetStreamAsync(cancelationToken).ConfigureAwait(false))
                                {
                                        if (streamImage != null)
                                                image = UIImage.LoadFromData(NSData.FromStream(streamImage), scale);
index 7136a61..b326992 100644 (file)
@@ -43,7 +43,7 @@ namespace Xamarin.Forms.Platform.iOS
                                        MinimumLineSpacing = margin
                                }) { DataSource = new DataSource((NavigationMenu)Element), BackgroundColor = UIColor.White };
 
-                       using(var navigationCellId = new NSString("NavigationCell"))
+                       using (var navigationCellId = new NSString("NavigationCell"))
                                _collectionView.RegisterClassForCell(typeof(NavigationCell), navigationCellId);
 
                        SetNativeControl(_collectionView);
index 76eaf57..ae8b59b 100644 (file)
@@ -167,7 +167,7 @@ namespace Mono.Options
                                yield return string.Empty;
                                yield break;
                        }
-                       using(IEnumerator<int> ewidths = widths.GetEnumerator())
+                       using (IEnumerator<int> ewidths = widths.GetEnumerator())
                        {
                                bool? hw = null;
                                int width = GetNextWidth(ewidths, int.MaxValue, ref hw);
index d74ebf6..454f01a 100644 (file)
@@ -173,7 +173,7 @@ namespace Mono.Options
                                yield return string.Empty;
                                yield break;
                        }
-                       using(IEnumerator<int> ewidths = widths.GetEnumerator())
+                       using (IEnumerator<int> ewidths = widths.GetEnumerator())
                        {
                                bool? hw = null;
                                int width = GetNextWidth(ewidths, int.MaxValue, ref hw);
index 6d7674b..8bf08f6 100644 (file)
@@ -49,7 +49,7 @@ namespace Xamarin.Forms.Xaml
 
                public static void Load(BindableObject view, string xaml)
                {
-                       using(var reader = XmlReader.Create(new StringReader(xaml)))
+                       using (var reader = XmlReader.Create(new StringReader(xaml)))
                        {
                                while (reader.Read())
                                {
@@ -167,8 +167,8 @@ namespace Xamarin.Forms.Xaml
 
                static string ReadResourceAsXaml(Type type, Assembly assembly, string likelyTargetName, bool validate = false)
                {
-                       using(var stream = assembly.GetManifestResourceStream(likelyTargetName))
-                       using(var reader = new StreamReader(stream))
+                       using (var stream = assembly.GetManifestResourceStream(likelyTargetName))
+                       using (var reader = new StreamReader(stream))
                        {
                                if (validate)
                                {