From 3585c66844e2a77ffc2874440b689b0c95a85a32 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 17 Nov 2022 13:04:59 +0100 Subject: [PATCH] [autoformat] Add common test files. (#16740) --- tests/common/ApiTest.cs | 8 +- tests/common/Assert.cs | 182 +++++++++--------- tests/common/AssertHelpers.cs | 18 +- tests/common/BundlerTest.cs | 6 +- tests/common/BundlerTool.cs | 17 +- tests/common/ProductTests.cs | 21 +- .../AppDelegate.cs | 9 +- .../AppWithExtraArgumentThatOverrides/Main.cs | 8 +- .../ViewController.cs | 6 +- .../TestProjects/AssemblyRegistration/Main.cs | 3 +- .../BasicPCLTest/BasicPCLTest/AppDelegate.cs | 6 +- .../BasicPCLTest/BasicPCLTest/Main.cs | 8 +- .../BasicPCLTest/MyLibrary/MyClass.cs | 16 +- .../TestProjects/Bug60536/AppDelegate.cs | 6 +- tests/common/TestProjects/Bug60536/Main.cs | 8 +- .../TestProjects/Bug60536/ViewController.cs | 6 +- .../TestProjects/My Spaced App/AppDelegate.cs | 6 +- .../common/TestProjects/My Spaced App/Main.cs | 8 +- .../MySpacedAppViewController.cs | 10 +- .../MyActionExtension/ActionViewController.cs | 14 +- .../MyAppWithPackageReference/AppDelegate.cs | 8 +- .../LibraryA/ApiDefinition.cs | 18 +- .../LibraryB/ApiDefinition.cs | 16 +- .../TestProjects/MyCatalystApp/AppDelegate.cs | 6 +- .../common/TestProjects/MyCatalystApp/Main.cs | 8 +- .../MySingleViewViewController.cs | 10 +- .../MyCatalystFormsApp/AppDelegate.cs | 6 +- .../TestProjects/MyCatalystFormsApp/Main.cs | 6 +- .../MyCatalystFormsAppNS/App.xaml.cs | 6 +- .../MyCatalystFormsAppNS/MainPage.xaml.cs | 6 +- .../MyCocoaCoreMLApp/AppDelegate.cs | 11 +- .../MyCocoaCoreMLApp/SqueezeNet.cs | 9 +- .../MyCocoaSceneKitApp/AppDelegate.cs | 11 +- .../TestProjects/MyCoreMLApp/AppDelegate.cs | 6 +- tests/common/TestProjects/MyCoreMLApp/Main.cs | 8 +- .../TestProjects/MyCoreMLApp/SqueezeNet.cs | 9 +- .../MyCoreMLApp/ViewController.cs | 6 +- .../DocumentPickerViewController.cs | 6 +- .../ActionViewController.cs | 6 +- .../MyIBToolLinkTest/AppDelegate.cs | 87 ++++----- .../TestProjects/MyIBToolLinkTest/Main.cs | 22 +-- .../MyIBToolLinkTest/ViewController.cs | 36 ++-- .../KeyboardViewController.cs | 6 +- .../MyLinkedAssets/AppDelegate.cs | 6 +- .../TestProjects/MyLinkedAssets/Main.cs | 8 +- .../MyLinkedAssets/ViewController.cs | 6 +- .../MyMasterDetailApp/AppDelegate.cs | 16 +- .../MyMasterDetailApp/DetailViewController.cs | 14 +- .../TestProjects/MyMasterDetailApp/Main.cs | 8 +- .../MyMasterDetailApp/MasterViewController.cs | 23 +-- .../TestProjects/MyMetalGame/AppDelegate.cs | 16 +- .../MyMetalGame/GameViewController.cs | 35 ++-- tests/common/TestProjects/MyMetalGame/Main.cs | 8 +- .../TestProjects/MyOpenGLApp/AppDelegate.cs | 16 +- .../TestProjects/MyOpenGLApp/EAGLView.cs | 92 +++++---- tests/common/TestProjects/MyOpenGLApp/Main.cs | 8 +- .../MyOpenGLApp/OpenGLViewController.cs | 14 +- .../PhotoEditingViewController.cs | 6 +- .../MyReleaseBuild/AppDelegate.cs | 6 +- .../TestProjects/MyReleaseBuild/Main.cs | 8 +- .../MyReleaseBuild/ViewController.cs | 6 +- .../TestProjects/MySceneKitApp/AppDelegate.cs | 5 +- .../TestProjects/MySceneKitLibrary/MyClass.cs | 14 +- .../MyShareExtension/ShareViewController.cs | 10 +- .../TestProjects/MySingleView/AppDelegate.cs | 6 +- .../common/TestProjects/MySingleView/Main.cs | 8 +- .../MySingleView/MyLibrary/TestFoo.cs | 6 +- .../MySingleViewViewController.cs | 10 +- .../MySpriteKitGame/AppDelegate.cs | 6 +- .../TestProjects/MySpriteKitGame/Main.cs | 8 +- .../TestProjects/MySpriteKitGame/MyScene.cs | 10 +- .../MySpriteKitGame/ViewController.cs | 8 +- .../TestProjects/MyTVApp/AppDelegate.cs | 6 +- tests/common/TestProjects/MyTVApp/Main.cs | 8 +- .../MyTVApp/MySingleViewViewController.cs | 6 +- .../MyTVMetalGame/GameViewController.cs | 16 +- .../MyTVServicesExtension/ServiceProvider.cs | 6 +- .../MyTabbedApplication/AppDelegate.cs | 16 +- .../FirstViewController.cs | 10 +- .../TestProjects/MyTabbedApplication/Main.cs | 8 +- .../SecondViewController.cs | 10 +- .../MyTodayExtension/TodayViewController.cs | 6 +- .../MyWatch2Container/AppDelegate.cs | 6 +- .../TestProjects/MyWatch2Container/Main.cs | 8 +- .../MyWatch2Container/ViewController.cs | 6 +- .../TestProjects/MyWatchApp/AppDelegate.cs | 10 +- tests/common/TestProjects/MyWatchApp/Main.cs | 8 +- .../InterfaceController.cs | 6 +- .../IntentHandler.cs | 16 +- .../MyWatchKitExtension/GlanceController.cs | 6 +- .../InterfaceController.cs | 6 +- .../NotificationController.cs | 6 +- .../TestProjects/MyWebViewApp/AppDelegate.cs | 6 +- .../MyWebViewApp/HybridViewController.cs | 6 +- .../common/TestProjects/MyWebViewApp/Main.cs | 8 +- .../MyWebViewApp/Models/Model1.cs | 6 +- .../MyXamarinFormsApp/AppDelegate.cs | 6 +- .../TestProjects/MyXamarinFormsApp/Main.cs | 6 +- .../MyXamarinFormsAppNS/App.xaml.cs | 6 +- .../MyXamarinFormsAppNS/MainPage.xaml.cs | 6 +- .../MyiOSAppWithBinding/AppDelegate.cs | 6 +- .../TestProjects/MyiOSAppWithBinding/Main.cs | 8 +- .../MyiOSAppWithBinding/ViewController.cs | 6 +- .../managed/ManagedContainer/AppDelegate.cs | 6 +- .../managed/ManagedContainer/Main.cs | 8 +- .../Properties/AssemblyInfo.cs | 24 +-- .../managed/ManagedContainer/SceneDelegate.cs | 6 +- .../ManagedContainer/ViewController.cs | 6 +- .../Protobuf_Test/AppDelegate.cs | 29 ++- .../Protobuf_Test/Protobuf_Test/Main.cs | 8 +- .../TestProjects/RoslynTestApp/Full/Main.cs | 10 +- .../Lib/Full/ReadOnlyTestMacLib/MyClass.cs | 6 +- .../Lib/Modern/ReadOnlyTestMacLib/MyClass.cs | 6 +- .../Lib/ReadOnlyTestLib/MyClass.cs | 8 +- .../TestProjects/RoslynTestApp/Modern/Main.cs | 10 +- .../ServiceModel_Test/AppDelegate.cs | 8 +- .../ServiceModel_Test/Main.cs | 8 +- .../SystemMemoryFromNetStandard2_0/Program.cs | 18 +- .../SystemMemoryReference/Program.cs | 18 +- tests/common/TestRuntime.cs | 2 +- tests/common/Tool.cs | 19 +- tests/common/mac/ApiDefinition.cs | 5 +- tests/common/mac/ConsoleProgram.cs | 12 +- tests/common/mac/Finder/FinderSync.cs | 24 +-- tests/common/mac/MyClass.cs | 6 +- tests/common/mac/NetStandard/Class1.cs | 22 +-- tests/common/mac/ProjectTestHelpers.cs | 68 +++---- tests/common/mac/Share/ShareViewController.cs | 8 +- tests/common/mac/StructsAndEnums.cs | 3 +- tests/common/mac/Today/TodayViewController.cs | 6 +- tools/autoformat.sh | 1 + 131 files changed, 697 insertions(+), 964 deletions(-) diff --git a/tests/common/ApiTest.cs b/tests/common/ApiTest.cs index 973ea74bd1..026479ca76 100644 --- a/tests/common/ApiTest.cs +++ b/tests/common/ApiTest.cs @@ -10,11 +10,9 @@ using Mono.Cecil; using Xamarin.Tests; -namespace Xamarin.ApiTest -{ +namespace Xamarin.ApiTest { [TestFixture] - public class ApiTest - { + public class ApiTest { [Test] #if MONOTOUCH [TestCase (Profile.iOS)] @@ -51,7 +49,7 @@ namespace Xamarin.ApiTest case "BlockLiteral": if (type == mr.DeclaringType) continue; // Calls within BlockLiteral without the optimizable attribute is allowed - + switch (mr.Name) { case "SetupBlock": case "SetupBlockUnsafe": diff --git a/tests/common/Assert.cs b/tests/common/Assert.cs index 7a1b3124d5..80f3fdd2c9 100644 --- a/tests/common/Assert.cs +++ b/tests/common/Assert.cs @@ -12,96 +12,96 @@ using NUnit.Framework; using NUnit.Framework.Constraints; namespace MonoTests { -/* - class CategoryAttribute : Attribute - { - public string Category { get; set; } - - public CategoryAttribute (string category) + /* + class CategoryAttribute : Attribute { - this.Category = category; + public string Category { get; set; } + + public CategoryAttribute (string category) + { + this.Category = category; + } } - } -/* - static class Assert - { - public static void AreEqual (object a, object b, string msg) + /* + static class Assert { - NUnit.Framework.Assert.That (a, Is.EqualTo (b), msg); + public static void AreEqual (object a, object b, string msg) + { + NUnit.Framework.Assert.That (a, Is.EqualTo (b), msg); + } + + public static void AreEqual (object a, object b) + { + NUnit.Framework.Assert.That (a, Is.EqualTo (b)); + } + + public static void IsNotNull (object o, string msg) + { + NUnit.Framework.Assert.That (o, Is.Not.Null, msg); + } + + public static void IsNotNull (object o) + { + NUnit.Framework.Assert.That (o, Is.Not.Null); + } + + public static void IsNull (object o, string msg) + { + NUnit.Framework.Assert.That (o, Is.Null, msg); + } + + public static void IsNull (object o) + { + NUnit.Framework.Assert.That (o, Is.Null); + } + + public static void IsTrue (object o, string msg) + { + NUnit.Framework.Assert.That (o, Is.True, msg); + } + + public static void IsTrue (object o) + { + NUnit.Framework.Assert.That (o, Is.True); + } + + public static void IsFalse (object o, string msg) + { + NUnit.Framework.Assert.That (o, Is.False, msg); + } + + public static void IsFalse (object o) + { + NUnit.Framework.Assert.That (o, Is.False); + } + + public static void AreSame (object a, object b) + { + NUnit.Framework.Assert.That (a, Is.SameAs (b)); + } + + public static void AreSame (object a, object b, string msg) + { + NUnit.Framework.Assert.That (a, Is.SameAs (b), msg); + } + + public static void Fail (string msg) + { + NUnit.Framework.Assert.Fail (msg); + } } - - public static void AreEqual (object a, object b) - { - NUnit.Framework.Assert.That (a, Is.EqualTo (b)); - } - - public static void IsNotNull (object o, string msg) - { - NUnit.Framework.Assert.That (o, Is.Not.Null, msg); - } - - public static void IsNotNull (object o) - { - NUnit.Framework.Assert.That (o, Is.Not.Null); - } - - public static void IsNull (object o, string msg) - { - NUnit.Framework.Assert.That (o, Is.Null, msg); - } - - public static void IsNull (object o) - { - NUnit.Framework.Assert.That (o, Is.Null); - } - - public static void IsTrue (object o, string msg) - { - NUnit.Framework.Assert.That (o, Is.True, msg); - } - - public static void IsTrue (object o) - { - NUnit.Framework.Assert.That (o, Is.True); - } - - public static void IsFalse (object o, string msg) - { - NUnit.Framework.Assert.That (o, Is.False, msg); - } - - public static void IsFalse (object o) - { - NUnit.Framework.Assert.That (o, Is.False); - } - - public static void AreSame (object a, object b) - { - NUnit.Framework.Assert.That (a, Is.SameAs (b)); - } - - public static void AreSame (object a, object b, string msg) - { - NUnit.Framework.Assert.That (a, Is.SameAs (b), msg); - } - - public static void Fail (string msg) - { - NUnit.Framework.Assert.Fail (msg); - } - } -*/ + */ // nunit 1.x compatibility public class TestCase { protected virtual void SetUp () { } - + public static void Assert (string msg, bool condition) { NUnit.Framework.Assert.True (condition, msg); } - + public static void AssertEquals (object a, object b) { NUnit.Framework.Assert.That (a, Is.EqualTo (b)); @@ -137,45 +137,45 @@ namespace MonoTests { NUnit.Framework.Assert.Fail (msg); } } - + public class Assertion : TestCase { } - + public class TestFixtureSetUpAttribute : SetUpAttribute { } public class StringAssert { #region StartsWith - static public void StartsWith(string expected, string actual, string message, params object[] args) + static public void StartsWith (string expected, string actual, string message, params object [] args) { - Assert.That(actual, new StartsWithConstraint(expected), message, args); + Assert.That (actual, new StartsWithConstraint (expected), message, args); } - static public void StartsWith(string expected, string actual, string message) + static public void StartsWith (string expected, string actual, string message) { - StartsWith(expected, actual, message, null); + StartsWith (expected, actual, message, null); } - static public void StartsWith(string expected, string actual) + static public void StartsWith (string expected, string actual) { - StartsWith(expected, actual, string.Empty, null); + StartsWith (expected, actual, string.Empty, null); } #endregion #region Contains - static public void Contains(string expected, string actual, string message, params object[] args) + static public void Contains (string expected, string actual, string message, params object [] args) { - Assert.That(actual, new SubstringConstraint(expected), message, args); + Assert.That (actual, new SubstringConstraint (expected), message, args); } - static public void Contains(string expected, string actual, string message) + static public void Contains (string expected, string actual, string message) { - Contains(expected, actual, message, null); + Contains (expected, actual, message, null); } - static public void Contains(string expected, string actual) + static public void Contains (string expected, string actual) { - Contains(expected, actual, string.Empty, null); + Contains (expected, actual, string.Empty, null); } #endregion } diff --git a/tests/common/AssertHelpers.cs b/tests/common/AssertHelpers.cs index f4585a8243..48c3d7e1f4 100644 --- a/tests/common/AssertHelpers.cs +++ b/tests/common/AssertHelpers.cs @@ -4,13 +4,11 @@ using System.Text.RegularExpressions; using NUnit.Framework; -namespace Xamarin.Tests -{ +namespace Xamarin.Tests { public delegate void Action (); - public static class Asserts - { - public static void Throws (Action action, string expectedExceptionMessage, string message = "") where T: Exception + public static class Asserts { + public static void Throws (Action action, string expectedExceptionMessage, string message = "") where T : Exception { try { action (); @@ -20,7 +18,7 @@ namespace Xamarin.Tests } } - public static void ThrowsPartial (Action action, string [] expectedExceptionMessages, string message = "") where T: Exception + public static void ThrowsPartial (Action action, string [] expectedExceptionMessages, string message = "") where T : Exception { try { action (); @@ -31,8 +29,8 @@ namespace Xamarin.Tests StartsWith (expectedExceptionMessages [i], actual [i], i.ToString ()); } } - - public static void ThrowsPattern (Action action, string expectedExceptionPattern, string message = "") where T: Exception + + public static void ThrowsPattern (Action action, string expectedExceptionPattern, string message = "") where T : Exception { try { action (); @@ -41,13 +39,13 @@ namespace Xamarin.Tests IsLike (expectedExceptionPattern, ex.Message, message); } } - + public static void StartsWith (string expectedStartsWith, string actual, string message) { if (!actual.StartsWith (expectedStartsWith, StringComparison.Ordinal)) throw new AssertionException (string.Format ("Expected '{0}' to start with '{1}'. {2}", actual, expectedStartsWith, message)); } - + public static void IsLike (string pattern, string actual, string message) { if (!Regex.IsMatch (actual, pattern, RegexOptions.CultureInvariant)) diff --git a/tests/common/BundlerTest.cs b/tests/common/BundlerTest.cs index 68c67b13de..31f85c6356 100644 --- a/tests/common/BundlerTest.cs +++ b/tests/common/BundlerTest.cs @@ -16,11 +16,9 @@ using BundlerTool = Xamarin.MTouchTool; using BundlerTool = Xamarin.MmpTool; #endif -namespace Xamarin -{ +namespace Xamarin { [TestFixture] - public class BundlerTests - { + public class BundlerTests { #if __MACOS__ // The cache doesn't work properly in mmp yet. // [TestCase (Profile.macOSMobile)] diff --git a/tests/common/BundlerTool.cs b/tests/common/BundlerTool.cs index 1d426a3918..9e157fe2fe 100644 --- a/tests/common/BundlerTool.cs +++ b/tests/common/BundlerTool.cs @@ -8,10 +8,8 @@ using NUnit.Framework; using Xamarin.Utils; -namespace Xamarin.Tests -{ - public enum LinkerOption - { +namespace Xamarin.Tests { + public enum LinkerOption { Unspecified, LinkAll, LinkSdk, @@ -19,16 +17,14 @@ namespace Xamarin.Tests LinkPlatform, // only applicable for XM } - public enum RegistrarOption - { + public enum RegistrarOption { Unspecified, Dynamic, Static, } [Flags] - enum I18N - { + enum I18N { None = 0, CJK = 1, @@ -42,8 +38,7 @@ namespace Xamarin.Tests } // This class represents options/logic that is identical between mtouch and mmp - abstract class BundlerTool : Tool - { + abstract class BundlerTool : Tool { public const string None = "None"; public bool AlwaysShowOutput; @@ -327,7 +322,7 @@ namespace Xamarin.Tests return; var errors = Messages.Where ((v) => v.IsError).ToList (); Assert.Fail ($"Expected execution to succeed, but exit code was {rv}, and there were {errors.Count} error(s).\nCommand: {ToolPath} {StringUtils.FormatArguments (ToolArguments)}\nMessage: {message}\n\t" + - string.Join ("\n\t", errors.Select ((v) => v.ToString ()))); + string.Join ("\n\t", errors.Select ((v) => v.ToString ()))); } public void AssertExecuteFailure (string message = null) diff --git a/tests/common/ProductTests.cs b/tests/common/ProductTests.cs index 2865504315..bd622dc6d8 100644 --- a/tests/common/ProductTests.cs +++ b/tests/common/ProductTests.cs @@ -13,11 +13,9 @@ using NUnit.Framework; using Xamarin; -namespace Xamarin.Tests -{ +namespace Xamarin.Tests { [TestFixture] - public class ProductTests - { + public class ProductTests { [Test] public void MonoVersion () { @@ -80,7 +78,7 @@ namespace Xamarin.Tests Version lc_min_version; var mincmd = lc as MinCommand; - if (mincmd != null){ + if (mincmd != null) { Assert.AreEqual (load_command, mincmd.Command, "Unexpected min load command"); lc_min_version = mincmd.Version; } else { @@ -101,7 +99,7 @@ namespace Xamarin.Tests alternativePlatform = MachO.Platform.WatchOS; break; } - Assert.That (buildver.Platform, Is.EqualTo (platform).Or.EqualTo (alternativePlatform) , $"Unexpected build version command in {machoFile} ({slice.Filename})"); + Assert.That (buildver.Platform, Is.EqualTo (platform).Or.EqualTo (alternativePlatform), $"Unexpected build version command in {machoFile} ({slice.Filename})"); lc_min_version = buildver.MinOS; } @@ -189,11 +187,10 @@ namespace Xamarin.Tests } } - static class VersionExtensions - { - public static Version WithBuild (this Version version) - { - return new Version (version.Major, version.Minor, version.Build < 0 ? 0 : version.Build); - } + static class VersionExtensions { + public static Version WithBuild (this Version version) + { + return new Version (version.Major, version.Minor, version.Build < 0 ? 0 : version.Build); + } } } diff --git a/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/AppDelegate.cs b/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/AppDelegate.cs index c5780480b6..84ea9e31d4 100644 --- a/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/AppDelegate.cs +++ b/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/AppDelegate.cs @@ -1,17 +1,14 @@ using Foundation; using UIKit; -namespace AppWithExtraArgumentThatOverrides -{ +namespace AppWithExtraArgumentThatOverrides { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { + public class AppDelegate : UIApplicationDelegate { // class-level declarations - public override UIWindow Window - { + public override UIWindow Window { get; set; } diff --git a/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/Main.cs b/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/Main.cs index df4a76cd30..71a337e59a 100644 --- a/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/Main.cs +++ b/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/Main.cs @@ -1,11 +1,9 @@ using UIKit; -namespace AppWithExtraArgumentThatOverrides -{ - public class Application - { +namespace AppWithExtraArgumentThatOverrides { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/ViewController.cs b/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/ViewController.cs index ea9ffd5548..bb46244bbf 100644 --- a/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/ViewController.cs +++ b/tests/common/TestProjects/AppWithExtraArgumentThatOverrides/ViewController.cs @@ -2,10 +2,8 @@ using System; using UIKit; -namespace AppWithExtraArgumentThatOverrides -{ - public partial class ViewController : UIViewController - { +namespace AppWithExtraArgumentThatOverrides { + public partial class ViewController : UIViewController { protected ViewController (IntPtr handle) : base (handle) { // Note: this .ctor should not contain any initialization logic. diff --git a/tests/common/TestProjects/AssemblyRegistration/Main.cs b/tests/common/TestProjects/AssemblyRegistration/Main.cs index 9ab9facc05..32ec95346d 100644 --- a/tests/common/TestProjects/AssemblyRegistration/Main.cs +++ b/tests/common/TestProjects/AssemblyRegistration/Main.cs @@ -7,8 +7,7 @@ using ObjCRuntime; static class MainClass { static int Main (string [] args) { - Runtime.AssemblyRegistration += (object sender, AssemblyRegistrationEventArgs ea) => - { + Runtime.AssemblyRegistration += (object sender, AssemblyRegistrationEventArgs ea) => { Console.WriteLine (ea.AssemblyName); switch (ea.AssemblyName.Name) { case "AssemblyRegistration": diff --git a/tests/common/TestProjects/BasicPCLTest/BasicPCLTest/AppDelegate.cs b/tests/common/TestProjects/BasicPCLTest/BasicPCLTest/AppDelegate.cs index 6ea9e449fc..b110d9ac39 100644 --- a/tests/common/TestProjects/BasicPCLTest/BasicPCLTest/AppDelegate.cs +++ b/tests/common/TestProjects/BasicPCLTest/BasicPCLTest/AppDelegate.cs @@ -4,10 +4,8 @@ using Foundation; using AppKit; using MyLibrary; -namespace BasicPCLTest -{ - public partial class AppDelegate : NSApplicationDelegate - { +namespace BasicPCLTest { + public partial class AppDelegate : NSApplicationDelegate { public AppDelegate () { } diff --git a/tests/common/TestProjects/BasicPCLTest/BasicPCLTest/Main.cs b/tests/common/TestProjects/BasicPCLTest/BasicPCLTest/Main.cs index d42ebec599..bf7ddedda2 100644 --- a/tests/common/TestProjects/BasicPCLTest/BasicPCLTest/Main.cs +++ b/tests/common/TestProjects/BasicPCLTest/BasicPCLTest/Main.cs @@ -2,11 +2,9 @@ using System; using AppKit; -namespace BasicPCLTest -{ - static class MainClass - { - static void Main (string[] args) +namespace BasicPCLTest { + static class MainClass { + static void Main (string [] args) { NSApplication.Init (); NSApplication.SharedApplication.Delegate = new AppDelegate (); diff --git a/tests/common/TestProjects/BasicPCLTest/MyLibrary/MyClass.cs b/tests/common/TestProjects/BasicPCLTest/MyLibrary/MyClass.cs index ee1d40e1fd..cd48802ac1 100644 --- a/tests/common/TestProjects/BasicPCLTest/MyLibrary/MyClass.cs +++ b/tests/common/TestProjects/BasicPCLTest/MyLibrary/MyClass.cs @@ -2,18 +2,16 @@ using System; using System.IO; using Newtonsoft.Json.Linq; -namespace MyLibrary -{ - public class MyClass - { +namespace MyLibrary { + public class MyClass { public static void DoIt () { - JArray array = new JArray(); - array.Add("Manual text"); - array.Add(new DateTime(2000, 5, 23)); + JArray array = new JArray (); + array.Add ("Manual text"); + array.Add (new DateTime (2000, 5, 23)); - JObject o = new JObject(); - o["MyArray"] = array; + JObject o = new JObject (); + o ["MyArray"] = array; var fileName = "../../../../../TestResult.txt"; if (File.Exists (fileName)) diff --git a/tests/common/TestProjects/Bug60536/AppDelegate.cs b/tests/common/TestProjects/Bug60536/AppDelegate.cs index 5d6f934387..215874dc06 100644 --- a/tests/common/TestProjects/Bug60536/AppDelegate.cs +++ b/tests/common/TestProjects/Bug60536/AppDelegate.cs @@ -25,13 +25,11 @@ using Foundation; using UIKit; -namespace Bug60536 -{ +namespace Bug60536 { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { + public class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { diff --git a/tests/common/TestProjects/Bug60536/Main.cs b/tests/common/TestProjects/Bug60536/Main.cs index 3630d3d469..b27ef55ec3 100644 --- a/tests/common/TestProjects/Bug60536/Main.cs +++ b/tests/common/TestProjects/Bug60536/Main.cs @@ -24,12 +24,10 @@ // THE SOFTWARE. using UIKit; -namespace Bug60536 -{ - public class Application - { +namespace Bug60536 { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/Bug60536/ViewController.cs b/tests/common/TestProjects/Bug60536/ViewController.cs index 3a490cfe63..0c66c971ea 100644 --- a/tests/common/TestProjects/Bug60536/ViewController.cs +++ b/tests/common/TestProjects/Bug60536/ViewController.cs @@ -26,10 +26,8 @@ using System; using UIKit; -namespace Bug60536 -{ - public partial class ViewController : UIViewController - { +namespace Bug60536 { + public partial class ViewController : UIViewController { protected ViewController (IntPtr handle) : base (handle) { // Note: this .ctor should not contain any initialization logic. diff --git a/tests/common/TestProjects/My Spaced App/AppDelegate.cs b/tests/common/TestProjects/My Spaced App/AppDelegate.cs index 60ae8a6269..4a8ef0dd76 100644 --- a/tests/common/TestProjects/My Spaced App/AppDelegate.cs +++ b/tests/common/TestProjects/My Spaced App/AppDelegate.cs @@ -4,14 +4,12 @@ using System.Linq; using Foundation; using UIKit; -namespace MySpacedApp -{ +namespace MySpacedApp { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { get; diff --git a/tests/common/TestProjects/My Spaced App/Main.cs b/tests/common/TestProjects/My Spaced App/Main.cs index 0fbb651b38..1ef9bd00e3 100644 --- a/tests/common/TestProjects/My Spaced App/Main.cs +++ b/tests/common/TestProjects/My Spaced App/Main.cs @@ -4,12 +4,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MySpacedApp -{ - public class Application - { +namespace MySpacedApp { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/My Spaced App/MySpacedAppViewController.cs b/tests/common/TestProjects/My Spaced App/MySpacedAppViewController.cs index a65d4c90ae..5e0e5d0ddd 100644 --- a/tests/common/TestProjects/My Spaced App/MySpacedAppViewController.cs +++ b/tests/common/TestProjects/My Spaced App/MySpacedAppViewController.cs @@ -3,10 +3,8 @@ using CoreGraphics; using Foundation; using UIKit; -namespace MySpacedApp -{ - public partial class MySpacedAppViewController : UIViewController - { +namespace MySpacedApp { + public partial class MySpacedAppViewController : UIViewController { public MySpacedAppViewController (IntPtr handle) : base (handle) { } @@ -15,7 +13,7 @@ namespace MySpacedApp { // Releases the view if it doesn't have a superview. base.DidReceiveMemoryWarning (); - + // Release any cached data, images, etc that aren't in use. } @@ -24,7 +22,7 @@ namespace MySpacedApp public override void ViewDidLoad () { base.ViewDidLoad (); - + // Perform any additional setup after loading the view, typically from a nib. } diff --git a/tests/common/TestProjects/MyActionExtension/ActionViewController.cs b/tests/common/TestProjects/MyActionExtension/ActionViewController.cs index 0e577e8345..5c98c4470c 100644 --- a/tests/common/TestProjects/MyActionExtension/ActionViewController.cs +++ b/tests/common/TestProjects/MyActionExtension/ActionViewController.cs @@ -5,10 +5,8 @@ using MobileCoreServices; using Foundation; using UIKit; -namespace MyActionExtension -{ - public partial class ActionViewController : UIViewController - { +namespace MyActionExtension { + public partial class ActionViewController : UIViewController { public ActionViewController (IntPtr handle) : base (handle) { } @@ -35,10 +33,12 @@ namespace MyActionExtension foreach (var itemProvider in item.Attachments) { if (itemProvider.HasItemConformingTo (UTType.Image)) { // This is an image. We'll load it, then place it in our image view. - itemProvider.LoadItem (UTType.Image, null, delegate (NSObject image, NSError error) { + itemProvider.LoadItem (UTType.Image, null, delegate (NSObject image, NSError error) + { if (image != null) { - NSOperationQueue.MainQueue.AddOperation (delegate { - imageView.Image = (UIImage)image; + NSOperationQueue.MainQueue.AddOperation (delegate + { + imageView.Image = (UIImage) image; }); } }); diff --git a/tests/common/TestProjects/MyAppWithPackageReference/AppDelegate.cs b/tests/common/TestProjects/MyAppWithPackageReference/AppDelegate.cs index 18841c2b13..819a00e226 100644 --- a/tests/common/TestProjects/MyAppWithPackageReference/AppDelegate.cs +++ b/tests/common/TestProjects/MyAppWithPackageReference/AppDelegate.cs @@ -5,18 +5,16 @@ using System.Collections.Generic; using Foundation; using UIKit; -namespace MyTabbedApplication -{ +namespace MyTabbedApplication { [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { public override UIWindow Window { get; set; } // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { Console.WriteLine (typeof (Newtonsoft.Json.JsonReader)); UIApplication.Main (args, null, "AppDelegate"); diff --git a/tests/common/TestProjects/MyBindingsReferences/LibraryA/ApiDefinition.cs b/tests/common/TestProjects/MyBindingsReferences/LibraryA/ApiDefinition.cs index 5482c54176..178be48732 100644 --- a/tests/common/TestProjects/MyBindingsReferences/LibraryA/ApiDefinition.cs +++ b/tests/common/TestProjects/MyBindingsReferences/LibraryA/ApiDefinition.cs @@ -1,9 +1,9 @@ -using Foundation; - -namespace LibraryA { - [BaseType(typeof(NSObject))] - interface A { - - } -} - +using Foundation; + +namespace LibraryA { + [BaseType (typeof (NSObject))] + interface A { + + } +} + diff --git a/tests/common/TestProjects/MyBindingsReferences/LibraryB/ApiDefinition.cs b/tests/common/TestProjects/MyBindingsReferences/LibraryB/ApiDefinition.cs index 1fc8e6f310..a97e35b207 100644 --- a/tests/common/TestProjects/MyBindingsReferences/LibraryB/ApiDefinition.cs +++ b/tests/common/TestProjects/MyBindingsReferences/LibraryB/ApiDefinition.cs @@ -1,11 +1,11 @@ using Foundation; using LibraryA; -namespace LibraryB { - [BaseType(typeof(NSObject))] - interface B { - [Export("a")] - A GetA(); - } -} - +namespace LibraryB { + [BaseType (typeof (NSObject))] + interface B { + [Export ("a")] + A GetA (); + } +} + diff --git a/tests/common/TestProjects/MyCatalystApp/AppDelegate.cs b/tests/common/TestProjects/MyCatalystApp/AppDelegate.cs index 89d025d9d8..c708592b35 100644 --- a/tests/common/TestProjects/MyCatalystApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyCatalystApp/AppDelegate.cs @@ -4,14 +4,12 @@ using System.Linq; using Foundation; using UIKit; -namespace MySingleView -{ +namespace MySingleView { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { get; diff --git a/tests/common/TestProjects/MyCatalystApp/Main.cs b/tests/common/TestProjects/MyCatalystApp/Main.cs index 1d6bbbe037..c580453b1e 100644 --- a/tests/common/TestProjects/MyCatalystApp/Main.cs +++ b/tests/common/TestProjects/MyCatalystApp/Main.cs @@ -4,12 +4,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MySingleView -{ - public class Application - { +namespace MySingleView { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyCatalystApp/MySingleViewViewController.cs b/tests/common/TestProjects/MyCatalystApp/MySingleViewViewController.cs index b7ece8e477..0c3ea4868a 100644 --- a/tests/common/TestProjects/MyCatalystApp/MySingleViewViewController.cs +++ b/tests/common/TestProjects/MyCatalystApp/MySingleViewViewController.cs @@ -3,10 +3,8 @@ using CoreGraphics; using Foundation; using UIKit; -namespace MySingleView -{ - public partial class MySingleViewViewController : UIViewController - { +namespace MySingleView { + public partial class MySingleViewViewController : UIViewController { public MySingleViewViewController (IntPtr handle) : base (handle) { } @@ -15,7 +13,7 @@ namespace MySingleView { // Releases the view if it doesn't have a superview. base.DidReceiveMemoryWarning (); - + // Release any cached data, images, etc that aren't in use. } @@ -24,7 +22,7 @@ namespace MySingleView public override void ViewDidLoad () { base.ViewDidLoad (); - + // Perform any additional setup after loading the view, typically from a nib. } diff --git a/tests/common/TestProjects/MyCatalystFormsApp/AppDelegate.cs b/tests/common/TestProjects/MyCatalystFormsApp/AppDelegate.cs index bb0d6abe70..f62dfa55eb 100644 --- a/tests/common/TestProjects/MyCatalystFormsApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyCatalystFormsApp/AppDelegate.cs @@ -5,14 +5,12 @@ using System.Linq; using Foundation; using UIKit; -namespace MyXamarinFormsApp.iOS -{ +namespace MyXamarinFormsApp.iOS { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate - { + public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate { // // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window diff --git a/tests/common/TestProjects/MyCatalystFormsApp/Main.cs b/tests/common/TestProjects/MyCatalystFormsApp/Main.cs index be5b7d07a5..05a501789c 100644 --- a/tests/common/TestProjects/MyCatalystFormsApp/Main.cs +++ b/tests/common/TestProjects/MyCatalystFormsApp/Main.cs @@ -5,10 +5,8 @@ using System.Linq; using Foundation; using UIKit; -namespace MyXamarinFormsApp.iOS -{ - public class Application - { +namespace MyXamarinFormsApp.iOS { + public class Application { // This is the main entry point of the application. static void Main (string [] args) { diff --git a/tests/common/TestProjects/MyCatalystFormsApp/MyCatalystFormsAppNS/App.xaml.cs b/tests/common/TestProjects/MyCatalystFormsApp/MyCatalystFormsAppNS/App.xaml.cs index 34b50fdf43..bea73cdbfe 100644 --- a/tests/common/TestProjects/MyCatalystFormsApp/MyCatalystFormsAppNS/App.xaml.cs +++ b/tests/common/TestProjects/MyCatalystFormsApp/MyCatalystFormsAppNS/App.xaml.cs @@ -2,10 +2,8 @@ using System; using Xamarin.Forms; using Xamarin.Forms.Xaml; -namespace MyXamarinFormsApp -{ - public partial class App : Application - { +namespace MyXamarinFormsApp { + public partial class App : Application { public App () { InitializeComponent (); diff --git a/tests/common/TestProjects/MyCatalystFormsApp/MyCatalystFormsAppNS/MainPage.xaml.cs b/tests/common/TestProjects/MyCatalystFormsApp/MyCatalystFormsAppNS/MainPage.xaml.cs index edead8f2df..9c457345f5 100644 --- a/tests/common/TestProjects/MyCatalystFormsApp/MyCatalystFormsAppNS/MainPage.xaml.cs +++ b/tests/common/TestProjects/MyCatalystFormsApp/MyCatalystFormsAppNS/MainPage.xaml.cs @@ -6,13 +6,11 @@ using System.Text; using System.Threading.Tasks; using Xamarin.Forms; -namespace MyXamarinFormsApp -{ +namespace MyXamarinFormsApp { // Learn more about making custom code visible in the Xamarin.Forms previewer // by visiting https://aka.ms/xamarinforms-previewer [DesignTimeVisible (false)] - public partial class MainPage : ContentPage - { + public partial class MainPage : ContentPage { public MainPage () { InitializeComponent (); diff --git a/tests/common/TestProjects/MyCocoaCoreMLApp/AppDelegate.cs b/tests/common/TestProjects/MyCocoaCoreMLApp/AppDelegate.cs index d42e7842d4..09d5879f53 100644 --- a/tests/common/TestProjects/MyCocoaCoreMLApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyCocoaCoreMLApp/AppDelegate.cs @@ -5,11 +5,9 @@ using CoreGraphics; using CoreVideo; using Foundation; -namespace MyCocoaCoreMLApp -{ - static class MainClass - { - static void Main (string[] args) +namespace MyCocoaCoreMLApp { + static class MainClass { + static void Main (string [] args) { NSApplication.Init (); NSApplication.SharedApplication.Delegate = new AppDelegate (); @@ -17,8 +15,7 @@ namespace MyCocoaCoreMLApp } } - public partial class AppDelegate : NSApplicationDelegate - { + public partial class AppDelegate : NSApplicationDelegate { NSWindow window; public override void DidFinishLaunching (NSNotification notification) { diff --git a/tests/common/TestProjects/MyCocoaCoreMLApp/SqueezeNet.cs b/tests/common/TestProjects/MyCocoaCoreMLApp/SqueezeNet.cs index 828f1e7631..ed1aa29e02 100644 --- a/tests/common/TestProjects/MyCocoaCoreMLApp/SqueezeNet.cs +++ b/tests/common/TestProjects/MyCocoaCoreMLApp/SqueezeNet.cs @@ -16,8 +16,7 @@ namespace MyCocoaCoreMLApp { /// /// Model Prediction Input Type /// - public class SqueezeNetInput : NSObject, IMLFeatureProvider - { + public class SqueezeNetInput : NSObject, IMLFeatureProvider { static readonly NSSet featureNames = new NSSet ( new NSString ("image") ); @@ -64,8 +63,7 @@ namespace MyCocoaCoreMLApp { /// /// Model Prediction Output Type /// - public class SqueezeNetOutput : NSObject, IMLFeatureProvider - { + public class SqueezeNetOutput : NSObject, IMLFeatureProvider { static readonly NSSet featureNames = new NSSet ( new NSString ("classLabelProbs"), new NSString ("classLabel") ); @@ -139,8 +137,7 @@ namespace MyCocoaCoreMLApp { /// /// Class for model loading and prediction /// - public class SqueezeNet : NSObject - { + public class SqueezeNet : NSObject { readonly MLModel model; public SqueezeNet () diff --git a/tests/common/TestProjects/MyCocoaSceneKitApp/AppDelegate.cs b/tests/common/TestProjects/MyCocoaSceneKitApp/AppDelegate.cs index 67ad1de285..b81c40aad5 100644 --- a/tests/common/TestProjects/MyCocoaSceneKitApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyCocoaSceneKitApp/AppDelegate.cs @@ -3,11 +3,9 @@ using CoreGraphics; using Foundation; using SceneKit; -namespace MyCocoaSceneKitApp -{ - static class MainClass - { - static void Main (string[] args) +namespace MyCocoaSceneKitApp { + static class MainClass { + static void Main (string [] args) { NSApplication.Init (); NSApplication.SharedApplication.Delegate = new AppDelegate (); @@ -15,8 +13,7 @@ namespace MyCocoaSceneKitApp } } - public partial class AppDelegate : NSApplicationDelegate - { + public partial class AppDelegate : NSApplicationDelegate { NSWindow window; public override void DidFinishLaunching (NSNotification notification) { diff --git a/tests/common/TestProjects/MyCoreMLApp/AppDelegate.cs b/tests/common/TestProjects/MyCoreMLApp/AppDelegate.cs index 99ea70941e..36f8101407 100644 --- a/tests/common/TestProjects/MyCoreMLApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyCoreMLApp/AppDelegate.cs @@ -25,13 +25,11 @@ using Foundation; using UIKit; -namespace MyCoreMLApp -{ +namespace MyCoreMLApp { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { + public class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { diff --git a/tests/common/TestProjects/MyCoreMLApp/Main.cs b/tests/common/TestProjects/MyCoreMLApp/Main.cs index 29cbcbd9b8..e61c944590 100644 --- a/tests/common/TestProjects/MyCoreMLApp/Main.cs +++ b/tests/common/TestProjects/MyCoreMLApp/Main.cs @@ -24,12 +24,10 @@ // THE SOFTWARE. using UIKit; -namespace MyCoreMLApp -{ - public class Application - { +namespace MyCoreMLApp { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyCoreMLApp/SqueezeNet.cs b/tests/common/TestProjects/MyCoreMLApp/SqueezeNet.cs index ac5e1ffce6..04f173dc4d 100644 --- a/tests/common/TestProjects/MyCoreMLApp/SqueezeNet.cs +++ b/tests/common/TestProjects/MyCoreMLApp/SqueezeNet.cs @@ -16,8 +16,7 @@ namespace MyCoreMLApp { /// /// Model Prediction Input Type /// - public class SqueezeNetInput : NSObject, IMLFeatureProvider - { + public class SqueezeNetInput : NSObject, IMLFeatureProvider { static readonly NSSet featureNames = new NSSet ( new NSString ("image") ); @@ -64,8 +63,7 @@ namespace MyCoreMLApp { /// /// Model Prediction Output Type /// - public class SqueezeNetOutput : NSObject, IMLFeatureProvider - { + public class SqueezeNetOutput : NSObject, IMLFeatureProvider { static readonly NSSet featureNames = new NSSet ( new NSString ("classLabelProbs"), new NSString ("classLabel") ); @@ -139,8 +137,7 @@ namespace MyCoreMLApp { /// /// Class for model loading and prediction /// - public class SqueezeNet : NSObject - { + public class SqueezeNet : NSObject { readonly MLModel model; public SqueezeNet () diff --git a/tests/common/TestProjects/MyCoreMLApp/ViewController.cs b/tests/common/TestProjects/MyCoreMLApp/ViewController.cs index 8aa833e219..1ae3289731 100644 --- a/tests/common/TestProjects/MyCoreMLApp/ViewController.cs +++ b/tests/common/TestProjects/MyCoreMLApp/ViewController.cs @@ -26,10 +26,8 @@ using System; using UIKit; -namespace MyCoreMLApp -{ - public partial class ViewController : UIViewController - { +namespace MyCoreMLApp { + public partial class ViewController : UIViewController { protected ViewController (IntPtr handle) : base (handle) { // Note: this .ctor should not contain any initialization logic. diff --git a/tests/common/TestProjects/MyDocumentPickerExtension/DocumentPickerViewController.cs b/tests/common/TestProjects/MyDocumentPickerExtension/DocumentPickerViewController.cs index 6d33a83434..77fa1377e1 100644 --- a/tests/common/TestProjects/MyDocumentPickerExtension/DocumentPickerViewController.cs +++ b/tests/common/TestProjects/MyDocumentPickerExtension/DocumentPickerViewController.cs @@ -4,10 +4,8 @@ using System.Drawing; using Foundation; using UIKit; -namespace MyDocumentPickerExtension -{ - public partial class DocumentPickerViewController : UIDocumentPickerExtensionViewController - { +namespace MyDocumentPickerExtension { + public partial class DocumentPickerViewController : UIDocumentPickerExtensionViewController { public DocumentPickerViewController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/MyExtensionWithPackageReference/ActionViewController.cs b/tests/common/TestProjects/MyExtensionWithPackageReference/ActionViewController.cs index 05fef91a1d..2638cb3caf 100644 --- a/tests/common/TestProjects/MyExtensionWithPackageReference/ActionViewController.cs +++ b/tests/common/TestProjects/MyExtensionWithPackageReference/ActionViewController.cs @@ -4,10 +4,8 @@ using System.Drawing; using Foundation; using UIKit; -namespace MyExtensionWithPackageReference -{ - public partial class ActionViewController : UIViewController - { +namespace MyExtensionWithPackageReference { + public partial class ActionViewController : UIViewController { public ActionViewController (IntPtr handle) : base (handle) { Console.WriteLine (typeof (Newtonsoft.Json.JsonReader)); diff --git a/tests/common/TestProjects/MyIBToolLinkTest/AppDelegate.cs b/tests/common/TestProjects/MyIBToolLinkTest/AppDelegate.cs index 9fc53e3d48..6dfeeb373e 100644 --- a/tests/common/TestProjects/MyIBToolLinkTest/AppDelegate.cs +++ b/tests/common/TestProjects/MyIBToolLinkTest/AppDelegate.cs @@ -1,57 +1,54 @@ using Foundation; using UIKit; -namespace MyIBToolLinkTest -{ - // The UIApplicationDelegate for the application. This class is responsible for launching the - // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. - [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { - // class-level declarations +namespace MyIBToolLinkTest { + // The UIApplicationDelegate for the application. This class is responsible for launching the + // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. + [Register ("AppDelegate")] + public class AppDelegate : UIApplicationDelegate { + // class-level declarations - public override UIWindow Window - { - get; set; - } + public override UIWindow Window { + get; set; + } - public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) - { - // Override point for customization after application launch. - // If not required for your application you can safely delete this method + public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions) + { + // Override point for customization after application launch. + // If not required for your application you can safely delete this method - return true; - } + return true; + } - public override void OnResignActivation (UIApplication application) - { - // Invoked when the application is about to move from active to inactive state. - // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) - // or when the user quits the application and it begins the transition to the background state. - // Games should use this method to pause the game. - } + public override void OnResignActivation (UIApplication application) + { + // Invoked when the application is about to move from active to inactive state. + // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) + // or when the user quits the application and it begins the transition to the background state. + // Games should use this method to pause the game. + } - public override void DidEnterBackground (UIApplication application) - { - // Use this method to release shared resources, save user data, invalidate timers and store the application state. - // If your application supports background execution this method is called instead of WillTerminate when the user quits. - } + public override void DidEnterBackground (UIApplication application) + { + // Use this method to release shared resources, save user data, invalidate timers and store the application state. + // If your application supports background execution this method is called instead of WillTerminate when the user quits. + } - public override void WillEnterForeground (UIApplication application) - { - // Called as part of the transition from background to active state. - // Here you can undo many of the changes made on entering the background. - } + public override void WillEnterForeground (UIApplication application) + { + // Called as part of the transition from background to active state. + // Here you can undo many of the changes made on entering the background. + } - public override void OnActivated (UIApplication application) - { - // Restart any tasks that were paused (or not yet started) while the application was inactive. - // If the application was previously in the background, optionally refresh the user interface. - } + public override void OnActivated (UIApplication application) + { + // Restart any tasks that were paused (or not yet started) while the application was inactive. + // If the application was previously in the background, optionally refresh the user interface. + } - public override void WillTerminate (UIApplication application) - { - // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground. - } - } + public override void WillTerminate (UIApplication application) + { + // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground. + } + } } diff --git a/tests/common/TestProjects/MyIBToolLinkTest/Main.cs b/tests/common/TestProjects/MyIBToolLinkTest/Main.cs index bfcbc940de..a18612b8c8 100644 --- a/tests/common/TestProjects/MyIBToolLinkTest/Main.cs +++ b/tests/common/TestProjects/MyIBToolLinkTest/Main.cs @@ -1,15 +1,13 @@ using UIKit; -namespace MyIBToolLinkTest -{ - public class Application - { - // This is the main entry point of the application. - static void Main (string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main (args, null, "AppDelegate"); - } - } +namespace MyIBToolLinkTest { + public class Application { + // This is the main entry point of the application. + static void Main (string [] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main (args, null, "AppDelegate"); + } + } } diff --git a/tests/common/TestProjects/MyIBToolLinkTest/ViewController.cs b/tests/common/TestProjects/MyIBToolLinkTest/ViewController.cs index fc2c8dbded..455e5bc47f 100644 --- a/tests/common/TestProjects/MyIBToolLinkTest/ViewController.cs +++ b/tests/common/TestProjects/MyIBToolLinkTest/ViewController.cs @@ -2,25 +2,23 @@ using System; using UIKit; -namespace MyIBToolLinkTest -{ - public partial class ViewController : UIViewController - { - protected ViewController (IntPtr handle) : base (handle) - { - // Note: this .ctor should not contain any initialization logic. - } +namespace MyIBToolLinkTest { + public partial class ViewController : UIViewController { + protected ViewController (IntPtr handle) : base (handle) + { + // Note: this .ctor should not contain any initialization logic. + } - public override void ViewDidLoad () - { - base.ViewDidLoad (); - // Perform any additional setup after loading the view, typically from a nib. - } + public override void ViewDidLoad () + { + base.ViewDidLoad (); + // Perform any additional setup after loading the view, typically from a nib. + } - public override void DidReceiveMemoryWarning () - { - base.DidReceiveMemoryWarning (); - // Release any cached data, images, etc that aren't in use. - } - } + public override void DidReceiveMemoryWarning () + { + base.DidReceiveMemoryWarning (); + // Release any cached data, images, etc that aren't in use. + } + } } diff --git a/tests/common/TestProjects/MyKeyboardExtension/KeyboardViewController.cs b/tests/common/TestProjects/MyKeyboardExtension/KeyboardViewController.cs index 73d63a40c5..c5d183402f 100644 --- a/tests/common/TestProjects/MyKeyboardExtension/KeyboardViewController.cs +++ b/tests/common/TestProjects/MyKeyboardExtension/KeyboardViewController.cs @@ -4,10 +4,8 @@ using ObjCRuntime; using Foundation; using UIKit; -namespace MyKeyboardExtension -{ - public partial class KeyboardViewController : UIInputViewController - { +namespace MyKeyboardExtension { + public partial class KeyboardViewController : UIInputViewController { UIButton nextKeyboardButton; public KeyboardViewController (IntPtr handle) : base (handle) diff --git a/tests/common/TestProjects/MyLinkedAssets/AppDelegate.cs b/tests/common/TestProjects/MyLinkedAssets/AppDelegate.cs index 6d03542cca..e472ff0da2 100644 --- a/tests/common/TestProjects/MyLinkedAssets/AppDelegate.cs +++ b/tests/common/TestProjects/MyLinkedAssets/AppDelegate.cs @@ -25,13 +25,11 @@ using Foundation; using UIKit; -namespace MyLinkedAssets -{ +namespace MyLinkedAssets { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { + public class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { diff --git a/tests/common/TestProjects/MyLinkedAssets/Main.cs b/tests/common/TestProjects/MyLinkedAssets/Main.cs index 67fc175fdb..fd95cc880a 100644 --- a/tests/common/TestProjects/MyLinkedAssets/Main.cs +++ b/tests/common/TestProjects/MyLinkedAssets/Main.cs @@ -24,12 +24,10 @@ // THE SOFTWARE. using UIKit; -namespace MyLinkedAssets -{ - public class Application - { +namespace MyLinkedAssets { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyLinkedAssets/ViewController.cs b/tests/common/TestProjects/MyLinkedAssets/ViewController.cs index 7a49801dbb..0630f91a66 100644 --- a/tests/common/TestProjects/MyLinkedAssets/ViewController.cs +++ b/tests/common/TestProjects/MyLinkedAssets/ViewController.cs @@ -26,10 +26,8 @@ using System; using UIKit; -namespace MyLinkedAssets -{ - public partial class ViewController : UIViewController - { +namespace MyLinkedAssets { + public partial class ViewController : UIViewController { protected ViewController (IntPtr handle) : base (handle) { // Note: this .ctor should not contain any initialization logic. diff --git a/tests/common/TestProjects/MyMasterDetailApp/AppDelegate.cs b/tests/common/TestProjects/MyMasterDetailApp/AppDelegate.cs index b08bf48c22..a52ca3c500 100644 --- a/tests/common/TestProjects/MyMasterDetailApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyMasterDetailApp/AppDelegate.cs @@ -3,14 +3,12 @@ using System; using Foundation; using UIKit; -namespace MyMasterDetailApp -{ +namespace MyMasterDetailApp { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { @@ -22,14 +20,14 @@ namespace MyMasterDetailApp { // Override point for customization after application launch. if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { - var splitViewController = (UISplitViewController)Window.RootViewController; + var splitViewController = (UISplitViewController) Window.RootViewController; // Get the UINavigationControllers containing our master & detail view controllers - var masterNavigationController = (UINavigationController)splitViewController.ViewControllers [0]; - var detailNavigationController = (UINavigationController)splitViewController.ViewControllers [1]; + var masterNavigationController = (UINavigationController) splitViewController.ViewControllers [0]; + var detailNavigationController = (UINavigationController) splitViewController.ViewControllers [1]; - var masterViewController = (MasterViewController)masterNavigationController.TopViewController; - var detailViewController = (DetailViewController)detailNavigationController.TopViewController; + var masterViewController = (MasterViewController) masterNavigationController.TopViewController; + var detailViewController = (DetailViewController) detailNavigationController.TopViewController; masterViewController.DetailViewController = detailViewController; diff --git a/tests/common/TestProjects/MyMasterDetailApp/DetailViewController.cs b/tests/common/TestProjects/MyMasterDetailApp/DetailViewController.cs index caa8e1ded3..77fb6d463f 100644 --- a/tests/common/TestProjects/MyMasterDetailApp/DetailViewController.cs +++ b/tests/common/TestProjects/MyMasterDetailApp/DetailViewController.cs @@ -5,10 +5,8 @@ using System.Collections.Generic; using Foundation; using UIKit; -namespace MyMasterDetailApp -{ - public partial class DetailViewController : UIViewController - { +namespace MyMasterDetailApp { + public partial class DetailViewController : UIViewController { UIPopoverController masterPopoverController; object detailItem; @@ -20,11 +18,11 @@ namespace MyMasterDetailApp { if (detailItem != newDetailItem) { detailItem = newDetailItem; - + // Update the view ConfigureView (); } - + if (masterPopoverController != null) masterPopoverController.Dismiss (true); } @@ -40,14 +38,14 @@ namespace MyMasterDetailApp { // Releases the view if it doesn't have a superview. base.DidReceiveMemoryWarning (); - + // Release any cached data, images, etc that aren't in use. } public override void ViewDidLoad () { base.ViewDidLoad (); - + // Perform any additional setup after loading the view, typically from a nib. ConfigureView (); } diff --git a/tests/common/TestProjects/MyMasterDetailApp/Main.cs b/tests/common/TestProjects/MyMasterDetailApp/Main.cs index c9d3d73519..cfe5c9f3bd 100644 --- a/tests/common/TestProjects/MyMasterDetailApp/Main.cs +++ b/tests/common/TestProjects/MyMasterDetailApp/Main.cs @@ -5,12 +5,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MyMasterDetailApp -{ - public class Application - { +namespace MyMasterDetailApp { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyMasterDetailApp/MasterViewController.cs b/tests/common/TestProjects/MyMasterDetailApp/MasterViewController.cs index be7f8adc52..0da7d97292 100644 --- a/tests/common/TestProjects/MyMasterDetailApp/MasterViewController.cs +++ b/tests/common/TestProjects/MyMasterDetailApp/MasterViewController.cs @@ -6,21 +6,19 @@ using CoreGraphics; using Foundation; using UIKit; -namespace MyMasterDetailApp -{ - public partial class MasterViewController : UITableViewController - { +namespace MyMasterDetailApp { + public partial class MasterViewController : UITableViewController { DataSource dataSource; public MasterViewController (IntPtr handle) : base (handle) { Title = NSBundle.MainBundle.GetLocalizedString ("Master", "Master"); - + if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { PreferredContentSize = new CGSize (320f, 600f); ClearsSelectionOnViewWillAppear = false; } - + // Custom initialization } @@ -34,14 +32,14 @@ namespace MyMasterDetailApp dataSource.Objects.Insert (0, DateTime.Now); using (var indexPath = NSIndexPath.FromRowSection (0, 0)) - TableView.InsertRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Automatic); + TableView.InsertRows (new NSIndexPath [] { indexPath }, UITableViewRowAnimation.Automatic); } public override void DidReceiveMemoryWarning () { // Releases the view if it doesn't have a superview. base.DidReceiveMemoryWarning (); - + // Release any cached data, images, etc that aren't in use. } @@ -58,8 +56,7 @@ namespace MyMasterDetailApp TableView.Source = dataSource = new DataSource (this); } - class DataSource : UITableViewSource - { + class DataSource : UITableViewSource { static readonly NSString CellIdentifier = new NSString ("Cell"); readonly List objects = new List (); readonly MasterViewController controller; @@ -87,7 +84,7 @@ namespace MyMasterDetailApp // Customize the appearance of table view cells. public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath) { - var cell = (UITableViewCell)tableView.DequeueReusableCell (CellIdentifier, indexPath); + var cell = (UITableViewCell) tableView.DequeueReusableCell (CellIdentifier, indexPath); cell.TextLabel.Text = objects [indexPath.Row].ToString (); @@ -105,7 +102,7 @@ namespace MyMasterDetailApp if (editingStyle == UITableViewCellEditingStyle.Delete) { // Delete the row from the data source. objects.RemoveAt (indexPath.Row); - controller.TableView.DeleteRows (new NSIndexPath[] { indexPath }, UITableViewRowAnimation.Fade); + controller.TableView.DeleteRows (new NSIndexPath [] { indexPath }, UITableViewRowAnimation.Fade); } else if (editingStyle == UITableViewCellEditingStyle.Insert) { // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. } @@ -140,7 +137,7 @@ namespace MyMasterDetailApp var indexPath = TableView.IndexPathForSelectedRow; var item = dataSource.Objects [indexPath.Row]; - ((DetailViewController)segue.DestinationViewController).SetDetailItem (item); + ((DetailViewController) segue.DestinationViewController).SetDetailItem (item); } } } diff --git a/tests/common/TestProjects/MyMetalGame/AppDelegate.cs b/tests/common/TestProjects/MyMetalGame/AppDelegate.cs index 7845ed7f90..d66476d209 100644 --- a/tests/common/TestProjects/MyMetalGame/AppDelegate.cs +++ b/tests/common/TestProjects/MyMetalGame/AppDelegate.cs @@ -5,39 +5,37 @@ using System.Collections.Generic; using Foundation; using UIKit; -namespace MyMetalGame -{ +namespace MyMetalGame { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations - + public override UIWindow Window { get; set; } - + // This method is invoked when the application is about to move from active to inactive state. // OpenGL applications should use this method to pause. public override void OnResignActivation (UIApplication application) { } - + // This method should be used to release shared resources and it should store the application state. // If your application supports background execution this method is called instead of WillTerminate // when the user quits. public override void DidEnterBackground (UIApplication application) { } - + // This method is called as part of the transition from background to active state. public override void WillEnterForeground (UIApplication application) { } - + // This method is called when the application is about to terminate. Save data, if needed. public override void WillTerminate (UIApplication application) { diff --git a/tests/common/TestProjects/MyMetalGame/GameViewController.cs b/tests/common/TestProjects/MyMetalGame/GameViewController.cs index c69cc5937e..0b6d6b3bc0 100644 --- a/tests/common/TestProjects/MyMetalGame/GameViewController.cs +++ b/tests/common/TestProjects/MyMetalGame/GameViewController.cs @@ -9,12 +9,9 @@ using OpenTK; using Metal; using UIKit; -namespace MyMetalGame -{ - public partial class GameViewController : UIViewController - { - struct Uniforms - { +namespace MyMetalGame { + public partial class GameViewController : UIViewController { + struct Uniforms { public Matrix4 ModelviewProjectionMatrix; public Matrix4 NormalMatrix; } @@ -25,7 +22,7 @@ namespace MyMetalGame // Max API memory buffer size const int max_bytes_per_frame = 1024 * 1024; - float[] cubeVertexData = { + float [] cubeVertexData = { // Data layout for each line below is: // positionX, positionY, positionZ, normalX, normalY, normalZ, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, @@ -165,7 +162,7 @@ namespace MyMetalGame IMTLFunction vertexProgram = defaultLibrary.CreateFunction ("lighting_vertex"); // Setup the vertex buffers - vertexBuffer = device.CreateBuffer (cubeVertexData, (MTLResourceOptions)0); + vertexBuffer = device.CreateBuffer (cubeVertexData, (MTLResourceOptions) 0); vertexBuffer.Label = "Vertices"; // Create a reusable pipeline state @@ -190,7 +187,7 @@ namespace MyMetalGame DepthCompareFunction = MTLCompareFunction.Less, DepthWriteEnabled = true }; - + depthState = device.CreateDepthStencilState (depthStateDesc); } @@ -244,7 +241,7 @@ namespace MyMetalGame renderEncoder.PushDebugGroup ("DrawCube"); renderEncoder.SetRenderPipelineState (pipelineState); renderEncoder.SetVertexBuffer (vertexBuffer, 0, 0); - renderEncoder.SetVertexBuffer (dynamicConstantBuffer, (nuint)(Marshal.SizeOf (typeof(Uniforms)) * constantDataBufferIndex), 1); + renderEncoder.SetVertexBuffer (dynamicConstantBuffer, (nuint) (Marshal.SizeOf (typeof (Uniforms)) * constantDataBufferIndex), 1); // Tell the render context we want to draw our primitives renderEncoder.DrawPrimitives (MTLPrimitiveType.Triangle, 0, 36, 1); @@ -258,7 +255,7 @@ namespace MyMetalGame drawable.Dispose (); inflightSemaphore.Release (); }); - + // Schedule a present once the framebuffer is complete commandBuffer.PresentDrawable (drawable); @@ -266,14 +263,14 @@ namespace MyMetalGame commandBuffer.Commit (); // The renderview assumes it can now increment the buffer index and that the previous index won't be touched until we cycle back around to the same index - constantDataBufferIndex = (byte)((constantDataBufferIndex + 1) % max_inflight_buffers); + constantDataBufferIndex = (byte) ((constantDataBufferIndex + 1) % max_inflight_buffers); } void Reshape () { // When reshape is called, update the view and projection matricies since this means the view orientation or size changed - var aspect = (float)(View.Bounds.Size.Width / View.Bounds.Size.Height); - projectionMatrix = CreateMatrixFromPerspective (65.0f * ((float)Math.PI / 180.0f), aspect, 0.1f, 100.0f); + var aspect = (float) (View.Bounds.Size.Width / View.Bounds.Size.Height); + projectionMatrix = CreateMatrixFromPerspective (65.0f * ((float) Math.PI / 180.0f), aspect, 0.1f, 100.0f); viewMatrix = Matrix4.Identity; } @@ -288,8 +285,8 @@ namespace MyMetalGame uniformBuffer.ModelviewProjectionMatrix = Matrix4.Transpose (Matrix4.Mult (projectionMatrix, modelViewMatrix)); // Copy uniformBuffer's content into dynamicConstantBuffer.Contents - int rawsize = Marshal.SizeOf (typeof(Uniforms)); - var rawdata = new byte[rawsize]; + int rawsize = Marshal.SizeOf (typeof (Uniforms)); + var rawdata = new byte [rawsize]; IntPtr ptr = Marshal.AllocHGlobal (rawsize); Marshal.StructureToPtr (uniformBuffer, ptr, false); Marshal.Copy (ptr, rawdata, 0, rawsize); @@ -352,7 +349,7 @@ namespace MyMetalGame static Matrix4 CreateMatrixFromPerspective (float fovY, float aspect, float nearZ, float farZ) { - float yscale = 1.0f / (float)Math.Tan (fovY * 0.5f); + float yscale = 1.0f / (float) Math.Tan (fovY * 0.5f); float xscale = yscale / aspect; float q = farZ / (farZ - nearZ); @@ -379,8 +376,8 @@ namespace MyMetalGame static Matrix4 CreateMatrixFromRotation (float radians, float x, float y, float z) { Vector3 v = Vector3.Normalize (new Vector3 (x, y, z)); - var cos = (float)Math.Cos (radians); - var sin = (float)Math.Sin (radians); + var cos = (float) Math.Cos (radians); + var sin = (float) Math.Sin (radians); float cosp = 1.0f - cos; var m = new Matrix4 { diff --git a/tests/common/TestProjects/MyMetalGame/Main.cs b/tests/common/TestProjects/MyMetalGame/Main.cs index 0a0f54e42a..da5f26b279 100644 --- a/tests/common/TestProjects/MyMetalGame/Main.cs +++ b/tests/common/TestProjects/MyMetalGame/Main.cs @@ -5,12 +5,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MyMetalGame -{ - public class Application - { +namespace MyMetalGame { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyOpenGLApp/AppDelegate.cs b/tests/common/TestProjects/MyOpenGLApp/AppDelegate.cs index 39d3d06ce7..892cc3526a 100644 --- a/tests/common/TestProjects/MyOpenGLApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyOpenGLApp/AppDelegate.cs @@ -5,39 +5,37 @@ using System.Collections.Generic; using Foundation; using UIKit; -namespace MyOpenGLApp -{ +namespace MyOpenGLApp { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations - + public override UIWindow Window { get; set; } - + // This method is invoked when the application is about to move from active to inactive state. // OpenGL applications should use this method to pause. public override void OnResignActivation (UIApplication application) { } - + // This method should be used to release shared resources and it should store the application state. // If your application supports background execution this method is called instead of WillTerminate // when the user quits. public override void DidEnterBackground (UIApplication application) { } - + // This method is called as part of the transition from background to active state. public override void WillEnterForeground (UIApplication application) { } - + // This method is called when the application is about to terminate. Save data, if needed. public override void WillTerminate (UIApplication application) { diff --git a/tests/common/TestProjects/MyOpenGLApp/EAGLView.cs b/tests/common/TestProjects/MyOpenGLApp/EAGLView.cs index 0aa3ffbc7e..eaa49575c6 100644 --- a/tests/common/TestProjects/MyOpenGLApp/EAGLView.cs +++ b/tests/common/TestProjects/MyOpenGLApp/EAGLView.cs @@ -12,11 +12,9 @@ using ObjCRuntime; using OpenGLES; using UIKit; -namespace MyOpenGLApp -{ +namespace MyOpenGLApp { [Register ("EAGLView")] - public class EAGLView : iPhoneOSGameView - { + public class EAGLView : iPhoneOSGameView { [Export ("initWithCoder:")] public EAGLView (NSCoder coder) : base (coder) { @@ -44,7 +42,7 @@ namespace MyOpenGLApp ContextRenderingApi = EAGLRenderingAPI.OpenGLES1; base.CreateFrameBuffer (); } - + if (ContextRenderingApi == EAGLRenderingAPI.OpenGLES2) LoadShaders (); } @@ -61,7 +59,7 @@ namespace MyOpenGLApp CADisplayLink displayLink; public bool IsAnimating { get; private set; } - + // How many display frames must pass between each time the display link fires. public int FrameInterval { get { @@ -82,12 +80,12 @@ namespace MyOpenGLApp { if (IsAnimating) return; - + CreateFrameBuffer (); displayLink = UIScreen.MainScreen.CreateDisplayLink (this, new Selector ("drawFrame")); displayLink.FrameInterval = frameInterval; displayLink.AddToRunLoop (NSRunLoop.Current, NSRunLoop.NSDefaultRunLoopMode); - + IsAnimating = true; } @@ -110,57 +108,57 @@ namespace MyOpenGLApp #endregion - static readonly float[] squareVertices = { + static readonly float [] squareVertices = { -0.5f, -0.33f, 0.5f, -0.33f, -0.5f, 0.33f, 0.5f, 0.33f, }; - - static readonly byte[] squareColors = { + + static readonly byte [] squareColors = { 255, 255, 0, 255, 0, 255, 255, 255, 0, 0, 0, 0, 255, 0, 255, 255, }; - + static float transY = 0.0f; - + const int UNIFORM_TRANSLATE = 0; const int UNIFORM_COUNT = 1; - - readonly int[] uniforms = new int [UNIFORM_COUNT]; - + + readonly int [] uniforms = new int [UNIFORM_COUNT]; + const int ATTRIB_VERTEX = 0; const int ATTRIB_COLOR = 1; const int ATTRIB_COUNT = 2; - + int program; protected override void OnRenderFrame (FrameEventArgs e) { base.OnRenderFrame (e); - + MakeCurrent (); - + // Replace the implementation of this method to do your own custom drawing. GL.ClearColor (0.5f, 0.5f, 0.5f, 1.0f); GL.Clear (ClearBufferMask.ColorBufferBit); - + if (ContextRenderingApi == EAGLRenderingAPI.OpenGLES2) { // Use shader program. GL.UseProgram (program); - + // Update uniform value. GL.Uniform1 (uniforms [UNIFORM_TRANSLATE], transY); transY += 0.075f; - + // Update attribute values. GL.VertexAttribPointer (ATTRIB_VERTEX, 2, VertexAttribPointerType.Float, false, 0, squareVertices); GL.EnableVertexAttribArray (ATTRIB_VERTEX); GL.VertexAttribPointer (ATTRIB_COLOR, 4, VertexAttribPointerType.UnsignedByte, true, 0, squareColors); GL.EnableVertexAttribArray (ATTRIB_COLOR); - + // Validate program before drawing. This is a good check, but only really necessary in a debug build. #if DEBUG if (!ValidateProgram (program)) { @@ -173,9 +171,9 @@ namespace MyOpenGLApp GL1.LoadIdentity (); GL1.MatrixMode (All1.Modelview); GL1.LoadIdentity (); - GL1.Translate (0.0f, (float)Math.Sin (transY) / 2.0f, 0.0f); + GL1.Translate (0.0f, (float) Math.Sin (transY) / 2.0f, 0.0f); transY += 0.075f; - + GL1.VertexPointer (2, All1.Float, 0, squareVertices); GL1.EnableClientState (All1.VertexArray); GL1.ColorPointer (4, All1.UnsignedByte, 0, squareColors); @@ -183,24 +181,24 @@ namespace MyOpenGLApp } GL.DrawArrays (BeginMode.TriangleStrip, 0, 4); - + SwapBuffers (); } bool LoadShaders () { int vertShader, fragShader; - + // Create shader program. program = GL.CreateProgram (); - + // Create and compile vertex shader. var vertShaderPathname = NSBundle.MainBundle.PathForResource ("Shader", "vsh"); if (!CompileShader (ShaderType.VertexShader, vertShaderPathname, out vertShader)) { Console.WriteLine ("Failed to compile vertex shader"); return false; } - + // Create and compile fragment shader. var fragShaderPathname = NSBundle.MainBundle.PathForResource ("Shader", "fsh"); if (!CompileShader (ShaderType.FragmentShader, fragShaderPathname, out fragShader)) { @@ -210,25 +208,25 @@ namespace MyOpenGLApp // Attach vertex shader to program. GL.AttachShader (program, vertShader); - + // Attach fragment shader to program. GL.AttachShader (program, fragShader); - + // Bind attribute locations. // This needs to be done prior to linking. GL.BindAttribLocation (program, ATTRIB_VERTEX, "position"); GL.BindAttribLocation (program, ATTRIB_COLOR, "color"); - + // Link program. if (!LinkProgram (program)) { Console.WriteLine ("Failed to link program: {0:x}", program); - + if (vertShader != 0) GL.DeleteShader (vertShader); - + if (fragShader != 0) GL.DeleteShader (fragShader); - + if (program != 0) { GL.DeleteProgram (program); program = 0; @@ -236,21 +234,21 @@ namespace MyOpenGLApp return false; } - + // Get uniform locations. uniforms [UNIFORM_TRANSLATE] = GL.GetUniformLocation (program, "translate"); - + // Release vertex and fragment shaders. if (vertShader != 0) { GL.DetachShader (program, vertShader); GL.DeleteShader (vertShader); } - + if (fragShader != 0) { GL.DetachShader (program, fragShader); GL.DeleteShader (fragShader); } - + return true; } @@ -269,9 +267,9 @@ namespace MyOpenGLApp string src = System.IO.File.ReadAllText (file); shader = GL.CreateShader (type); - GL.ShaderSource (shader, 1, new string[] { src }, (int[])null); + GL.ShaderSource (shader, 1, new string [] { src }, (int []) null); GL.CompileShader (shader); - + #if DEBUG int logLength; GL.GetShader (shader, ShaderParameter.InfoLogLength, out logLength); @@ -287,14 +285,14 @@ namespace MyOpenGLApp GL.DeleteShader (shader); return false; } - + return true; } static bool LinkProgram (int program) { GL.LinkProgram (program); - + #if DEBUG int logLength; GL.GetProgram (program, ProgramParameter.InfoLogLength, out logLength); @@ -308,14 +306,14 @@ namespace MyOpenGLApp GL.GetProgram (program, ProgramParameter.LinkStatus, out status); if (status == 0) return false; - + return true; } static bool ValidateProgram (int program) { GL.ValidateProgram (program); - + int logLength; GL.GetProgram (program, ProgramParameter.InfoLogLength, out logLength); if (logLength > 0) { @@ -323,12 +321,12 @@ namespace MyOpenGLApp GL.GetProgramInfoLog (program, logLength, out logLength, infoLog); Console.WriteLine ("Program validate log:\n{0}", infoLog); } - + int status; GL.GetProgram (program, ProgramParameter.LinkStatus, out status); if (status == 0) return false; - + return true; } diff --git a/tests/common/TestProjects/MyOpenGLApp/Main.cs b/tests/common/TestProjects/MyOpenGLApp/Main.cs index 575bb8381e..98b3cbb31d 100644 --- a/tests/common/TestProjects/MyOpenGLApp/Main.cs +++ b/tests/common/TestProjects/MyOpenGLApp/Main.cs @@ -5,12 +5,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MyOpenGLApp -{ - public class Application - { +namespace MyOpenGLApp { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyOpenGLApp/OpenGLViewController.cs b/tests/common/TestProjects/MyOpenGLApp/OpenGLViewController.cs index fcda8563d8..5a8e8d9367 100644 --- a/tests/common/TestProjects/MyOpenGLApp/OpenGLViewController.cs +++ b/tests/common/TestProjects/MyOpenGLApp/OpenGLViewController.cs @@ -11,21 +11,19 @@ using OpenGLES; using GLKit; using UIKit; -namespace MyOpenGLApp -{ +namespace MyOpenGLApp { [Register ("OpenGLViewController")] - public partial class OpenGLViewController : UIViewController - { + public partial class OpenGLViewController : UIViewController { public OpenGLViewController (IntPtr handle) : base (handle) { } - new EAGLView View { get { return (EAGLView)base.View; } } + new EAGLView View { get { return (EAGLView) base.View; } } public override void ViewDidLoad () { base.ViewDidLoad (); - + NSNotificationCenter.DefaultCenter.AddObserver (UIApplication.WillResignActiveNotification, a => { if (IsViewLoaded && View.Window != null) View.StopAnimating (); @@ -43,7 +41,7 @@ namespace MyOpenGLApp protected override void Dispose (bool disposing) { base.Dispose (disposing); - + NSNotificationCenter.DefaultCenter.RemoveObserver (this); } @@ -51,7 +49,7 @@ namespace MyOpenGLApp { // Releases the view if it doesn't have a superview. base.DidReceiveMemoryWarning (); - + // Release any cached data, images, etc that aren't in use. } diff --git a/tests/common/TestProjects/MyPhotoEditingExtension/PhotoEditingViewController.cs b/tests/common/TestProjects/MyPhotoEditingExtension/PhotoEditingViewController.cs index 971496840c..fcd5c37a55 100644 --- a/tests/common/TestProjects/MyPhotoEditingExtension/PhotoEditingViewController.cs +++ b/tests/common/TestProjects/MyPhotoEditingExtension/PhotoEditingViewController.cs @@ -6,10 +6,8 @@ using PhotosUI; using Photos; using UIKit; -namespace MyPhotoEditingExtension -{ - public partial class PhotoEditingViewController : UIViewController, IPHContentEditingController - { +namespace MyPhotoEditingExtension { + public partial class PhotoEditingViewController : UIViewController, IPHContentEditingController { PHContentEditingInput input; public PhotoEditingViewController (IntPtr handle) : base (handle) diff --git a/tests/common/TestProjects/MyReleaseBuild/AppDelegate.cs b/tests/common/TestProjects/MyReleaseBuild/AppDelegate.cs index dc9b74cb31..cd87416a1e 100644 --- a/tests/common/TestProjects/MyReleaseBuild/AppDelegate.cs +++ b/tests/common/TestProjects/MyReleaseBuild/AppDelegate.cs @@ -26,13 +26,11 @@ using Foundation; using UIKit; -namespace MyReleaseBuild -{ +namespace MyReleaseBuild { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { + public class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { diff --git a/tests/common/TestProjects/MyReleaseBuild/Main.cs b/tests/common/TestProjects/MyReleaseBuild/Main.cs index c086531b03..f7de2071f3 100644 --- a/tests/common/TestProjects/MyReleaseBuild/Main.cs +++ b/tests/common/TestProjects/MyReleaseBuild/Main.cs @@ -25,12 +25,10 @@ // using UIKit; -namespace MyReleaseBuild -{ - public class Application - { +namespace MyReleaseBuild { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyReleaseBuild/ViewController.cs b/tests/common/TestProjects/MyReleaseBuild/ViewController.cs index 04d1475bbf..34281a01a9 100644 --- a/tests/common/TestProjects/MyReleaseBuild/ViewController.cs +++ b/tests/common/TestProjects/MyReleaseBuild/ViewController.cs @@ -27,10 +27,8 @@ using System; using UIKit; -namespace MyReleaseBuild -{ - public partial class ViewController : UIViewController - { +namespace MyReleaseBuild { + public partial class ViewController : UIViewController { protected ViewController (IntPtr handle) : base (handle) { // Note: this .ctor should not contain any initialization logic. diff --git a/tests/common/TestProjects/MySceneKitApp/AppDelegate.cs b/tests/common/TestProjects/MySceneKitApp/AppDelegate.cs index a9b3a81be4..2158bac266 100644 --- a/tests/common/TestProjects/MySceneKitApp/AppDelegate.cs +++ b/tests/common/TestProjects/MySceneKitApp/AppDelegate.cs @@ -3,8 +3,7 @@ using UIKit; namespace MySceneKitApp { [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { + public class AppDelegate : UIApplicationDelegate { UIWindow window; UIViewController dvc; @@ -20,7 +19,7 @@ namespace MySceneKitApp { return true; } - + static void Main (string [] args) { UIApplication.Main (args, null, typeof (AppDelegate)); diff --git a/tests/common/TestProjects/MySceneKitLibrary/MyClass.cs b/tests/common/TestProjects/MySceneKitLibrary/MyClass.cs index 85e7405d8e..97c09cca4a 100644 --- a/tests/common/TestProjects/MySceneKitLibrary/MyClass.cs +++ b/tests/common/TestProjects/MySceneKitLibrary/MyClass.cs @@ -1,10 +1,8 @@ using System; -namespace MySceneKitLibrary -{ - public class MyClass - { - public MyClass() - { - } - } +namespace MySceneKitLibrary { + public class MyClass { + public MyClass () + { + } + } } diff --git a/tests/common/TestProjects/MyShareExtension/ShareViewController.cs b/tests/common/TestProjects/MyShareExtension/ShareViewController.cs index 12c9aecf39..65986dfcd1 100644 --- a/tests/common/TestProjects/MyShareExtension/ShareViewController.cs +++ b/tests/common/TestProjects/MyShareExtension/ShareViewController.cs @@ -5,10 +5,8 @@ using Foundation; using Social; using UIKit; -namespace MyShareExtension -{ - public partial class ShareViewController : SLComposeServiceViewController - { +namespace MyShareExtension { + public partial class ShareViewController : SLComposeServiceViewController { public ShareViewController (IntPtr handle) : base (handle) { } @@ -42,10 +40,10 @@ namespace MyShareExtension ExtensionContext.CompleteRequest (null, null); } - public override SLComposeSheetConfigurationItem[] GetConfigurationItems () + public override SLComposeSheetConfigurationItem [] GetConfigurationItems () { // To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here. - return new SLComposeSheetConfigurationItem[0]; + return new SLComposeSheetConfigurationItem [0]; } } } diff --git a/tests/common/TestProjects/MySingleView/AppDelegate.cs b/tests/common/TestProjects/MySingleView/AppDelegate.cs index 89d025d9d8..c708592b35 100644 --- a/tests/common/TestProjects/MySingleView/AppDelegate.cs +++ b/tests/common/TestProjects/MySingleView/AppDelegate.cs @@ -4,14 +4,12 @@ using System.Linq; using Foundation; using UIKit; -namespace MySingleView -{ +namespace MySingleView { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { get; diff --git a/tests/common/TestProjects/MySingleView/Main.cs b/tests/common/TestProjects/MySingleView/Main.cs index 19384c3a18..43021a2fc9 100644 --- a/tests/common/TestProjects/MySingleView/Main.cs +++ b/tests/common/TestProjects/MySingleView/Main.cs @@ -5,12 +5,10 @@ using Foundation; using UIKit; using MyLibrary; -namespace MySingleView -{ - public class Application - { +namespace MySingleView { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { new TestFoo (); // if you want to use a different Application Delegate class from "AppDelegate" diff --git a/tests/common/TestProjects/MySingleView/MyLibrary/TestFoo.cs b/tests/common/TestProjects/MySingleView/MyLibrary/TestFoo.cs index a371d961ce..2e38f8dd79 100644 --- a/tests/common/TestProjects/MySingleView/MyLibrary/TestFoo.cs +++ b/tests/common/TestProjects/MySingleView/MyLibrary/TestFoo.cs @@ -1,9 +1,7 @@ using System; -namespace MyLibrary -{ - public class TestFoo - { +namespace MyLibrary { + public class TestFoo { public TestFoo () { } diff --git a/tests/common/TestProjects/MySingleView/MySingleViewViewController.cs b/tests/common/TestProjects/MySingleView/MySingleViewViewController.cs index b7ece8e477..0c3ea4868a 100644 --- a/tests/common/TestProjects/MySingleView/MySingleViewViewController.cs +++ b/tests/common/TestProjects/MySingleView/MySingleViewViewController.cs @@ -3,10 +3,8 @@ using CoreGraphics; using Foundation; using UIKit; -namespace MySingleView -{ - public partial class MySingleViewViewController : UIViewController - { +namespace MySingleView { + public partial class MySingleViewViewController : UIViewController { public MySingleViewViewController (IntPtr handle) : base (handle) { } @@ -15,7 +13,7 @@ namespace MySingleView { // Releases the view if it doesn't have a superview. base.DidReceiveMemoryWarning (); - + // Release any cached data, images, etc that aren't in use. } @@ -24,7 +22,7 @@ namespace MySingleView public override void ViewDidLoad () { base.ViewDidLoad (); - + // Perform any additional setup after loading the view, typically from a nib. } diff --git a/tests/common/TestProjects/MySpriteKitGame/AppDelegate.cs b/tests/common/TestProjects/MySpriteKitGame/AppDelegate.cs index 50b9d8bb9b..c805a8dd6d 100644 --- a/tests/common/TestProjects/MySpriteKitGame/AppDelegate.cs +++ b/tests/common/TestProjects/MySpriteKitGame/AppDelegate.cs @@ -3,14 +3,12 @@ using System; using Foundation; using UIKit; -namespace MySpriteKitGame -{ +namespace MySpriteKitGame { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { diff --git a/tests/common/TestProjects/MySpriteKitGame/Main.cs b/tests/common/TestProjects/MySpriteKitGame/Main.cs index 63400892af..18219296e2 100644 --- a/tests/common/TestProjects/MySpriteKitGame/Main.cs +++ b/tests/common/TestProjects/MySpriteKitGame/Main.cs @@ -5,12 +5,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MySpriteKitGame -{ - public class Application - { +namespace MySpriteKitGame { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MySpriteKitGame/MyScene.cs b/tests/common/TestProjects/MySpriteKitGame/MyScene.cs index f8240d0fde..1da85d5c98 100644 --- a/tests/common/TestProjects/MySpriteKitGame/MyScene.cs +++ b/tests/common/TestProjects/MySpriteKitGame/MyScene.cs @@ -5,10 +5,8 @@ using Foundation; using SpriteKit; using UIKit; -namespace MySpriteKitGame -{ - public class MyScene : SKScene - { +namespace MySpriteKitGame { + public class MyScene : SKScene { public MyScene (CGSize size) : base (size) { // Setup your scene here @@ -27,7 +25,7 @@ namespace MySpriteKitGame { // Called when a touch begins foreach (var touch in touches) { - var location = ((UITouch)touch).LocationInNode (this); + var location = ((UITouch) touch).LocationInNode (this); var sprite = new SKSpriteNode ("Spaceship") { Position = location, @@ -35,7 +33,7 @@ namespace MySpriteKitGame YScale = 0.4f }; - var action = SKAction.RotateByAngle ((float)Math.PI, 1.0); + var action = SKAction.RotateByAngle ((float) Math.PI, 1.0); sprite.RunAction (SKAction.RepeatActionForever (action)); diff --git a/tests/common/TestProjects/MySpriteKitGame/ViewController.cs b/tests/common/TestProjects/MySpriteKitGame/ViewController.cs index 6266510183..d6e533daed 100644 --- a/tests/common/TestProjects/MySpriteKitGame/ViewController.cs +++ b/tests/common/TestProjects/MySpriteKitGame/ViewController.cs @@ -3,10 +3,8 @@ using System; using SpriteKit; using UIKit; -namespace MySpriteKitGame -{ - public partial class ViewController : UIViewController - { +namespace MySpriteKitGame { + public partial class ViewController : UIViewController { public ViewController (IntPtr handle) : base (handle) { } @@ -24,7 +22,7 @@ namespace MySpriteKitGame base.ViewDidLoad (); // Configure the view. - var skView = (SKView)View; + var skView = (SKView) View; skView.ShowsFPS = true; skView.ShowsNodeCount = true; diff --git a/tests/common/TestProjects/MyTVApp/AppDelegate.cs b/tests/common/TestProjects/MyTVApp/AppDelegate.cs index 381a8a1da7..236274c4b1 100644 --- a/tests/common/TestProjects/MyTVApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyTVApp/AppDelegate.cs @@ -4,14 +4,12 @@ using System.Linq; using Foundation; using UIKit; -namespace MySingleView -{ +namespace MySingleView { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { get; diff --git a/tests/common/TestProjects/MyTVApp/Main.cs b/tests/common/TestProjects/MyTVApp/Main.cs index 1d6bbbe037..c580453b1e 100644 --- a/tests/common/TestProjects/MyTVApp/Main.cs +++ b/tests/common/TestProjects/MyTVApp/Main.cs @@ -4,12 +4,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MySingleView -{ - public class Application - { +namespace MySingleView { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyTVApp/MySingleViewViewController.cs b/tests/common/TestProjects/MyTVApp/MySingleViewViewController.cs index cb1d0fb371..2459f672db 100644 --- a/tests/common/TestProjects/MyTVApp/MySingleViewViewController.cs +++ b/tests/common/TestProjects/MyTVApp/MySingleViewViewController.cs @@ -2,10 +2,8 @@ using System; using Foundation; using UIKit; -namespace MySingleView -{ - public partial class MySingleViewViewController : UIViewController - { +namespace MySingleView { + public partial class MySingleViewViewController : UIViewController { public MySingleViewViewController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/MyTVMetalGame/GameViewController.cs b/tests/common/TestProjects/MyTVMetalGame/GameViewController.cs index e6579cb8df..077fdc7659 100644 --- a/tests/common/TestProjects/MyTVMetalGame/GameViewController.cs +++ b/tests/common/TestProjects/MyTVMetalGame/GameViewController.cs @@ -175,7 +175,7 @@ namespace MyTVMetalGame { IMTLFunction vertexProgram = defaultLibrary.CreateFunction ("lighting_vertex"); // Setup the vertex buffers - vertexBuffer = device.CreateBuffer (cubeVertexData, (MTLResourceOptions)0); + vertexBuffer = device.CreateBuffer (cubeVertexData, (MTLResourceOptions) 0); vertexBuffer.Label = "Vertices"; // Create a reusable pipeline state @@ -253,7 +253,7 @@ namespace MyTVMetalGame { renderEncoder.PushDebugGroup ("DrawCube"); renderEncoder.SetRenderPipelineState (pipelineState); renderEncoder.SetVertexBuffer (vertexBuffer, 0, 0); - renderEncoder.SetVertexBuffer (dynamicConstantBuffer, (nuint)(Marshal.SizeOf (typeof (Uniforms)) * constantDataBufferIndex), 1); + renderEncoder.SetVertexBuffer (dynamicConstantBuffer, (nuint) (Marshal.SizeOf (typeof (Uniforms)) * constantDataBufferIndex), 1); // Tell the render context we want to draw our primitives renderEncoder.DrawPrimitives (MTLPrimitiveType.Triangle, 0, 36, 1); @@ -275,14 +275,14 @@ namespace MyTVMetalGame { commandBuffer.Commit (); // The renderview assumes it can now increment the buffer index and that the previous index won't be touched until we cycle back around to the same index - constantDataBufferIndex = (byte)((constantDataBufferIndex + 1) % max_inflight_buffers); + constantDataBufferIndex = (byte) ((constantDataBufferIndex + 1) % max_inflight_buffers); } void Reshape () { // When reshape is called, update the view and projection matricies since this means the view orientation or size changed - var aspect = (float)(View.Bounds.Size.Width / View.Bounds.Size.Height); - projectionMatrix = CreateMatrixFromPerspective (65.0f * ((float)Math.PI / 180.0f), aspect, 0.1f, 100.0f); + var aspect = (float) (View.Bounds.Size.Width / View.Bounds.Size.Height); + projectionMatrix = CreateMatrixFromPerspective (65.0f * ((float) Math.PI / 180.0f), aspect, 0.1f, 100.0f); viewMatrix = Matrix4.Identity; } @@ -340,7 +340,7 @@ namespace MyTVMetalGame { static Matrix4 CreateMatrixFromPerspective (float fovY, float aspect, float nearZ, float farZ) { - float yscale = 1.0f / (float)Math.Tan (fovY * 0.5f); + float yscale = 1.0f / (float) Math.Tan (fovY * 0.5f); float xscale = yscale / aspect; float q = farZ / (farZ - nearZ); @@ -367,8 +367,8 @@ namespace MyTVMetalGame { static Matrix4 CreateMatrixFromRotation (float radians, float x, float y, float z) { Vector3 v = Vector3.Normalize (new Vector3 (x, y, z)); - var cos = (float)Math.Cos (radians); - var sin = (float)Math.Sin (radians); + var cos = (float) Math.Cos (radians); + var sin = (float) Math.Sin (radians); float cosp = 1.0f - cos; var m = new Matrix4 ( diff --git a/tests/common/TestProjects/MyTVServicesExtension/ServiceProvider.cs b/tests/common/TestProjects/MyTVServicesExtension/ServiceProvider.cs index db98bdaf28..c845047d08 100644 --- a/tests/common/TestProjects/MyTVServicesExtension/ServiceProvider.cs +++ b/tests/common/TestProjects/MyTVServicesExtension/ServiceProvider.cs @@ -2,11 +2,9 @@ using System; using Foundation; using TVServices; -namespace MyTVServicesExtension -{ +namespace MyTVServicesExtension { [Register ("ServiceProvider")] - public class ServiceProvider : NSObject, ITVTopShelfProvider - { + public class ServiceProvider : NSObject, ITVTopShelfProvider { protected ServiceProvider (IntPtr handle) : base (handle) { // Note: this .ctor should not contain any initialization logic. diff --git a/tests/common/TestProjects/MyTabbedApplication/AppDelegate.cs b/tests/common/TestProjects/MyTabbedApplication/AppDelegate.cs index 8f29864d13..b5b897ca97 100644 --- a/tests/common/TestProjects/MyTabbedApplication/AppDelegate.cs +++ b/tests/common/TestProjects/MyTabbedApplication/AppDelegate.cs @@ -5,39 +5,37 @@ using System.Collections.Generic; using Foundation; using UIKit; -namespace MyTabbedApplication -{ +namespace MyTabbedApplication { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations - + public override UIWindow Window { get; set; } - + // This method is invoked when the application is about to move from active to inactive state. // OpenGL applications should use this method to pause. public override void OnResignActivation (UIApplication application) { } - + // This method should be used to release shared resources and it should store the application state. // If your application supports background execution this method is called instead of WillTerminate // when the user quits. public override void DidEnterBackground (UIApplication application) { } - + // This method is called as part of the transition from background to active state. public override void WillEnterForeground (UIApplication application) { } - + // This method is called when the application is about to terminate. Save data, if needed. public override void WillTerminate (UIApplication application) { diff --git a/tests/common/TestProjects/MyTabbedApplication/FirstViewController.cs b/tests/common/TestProjects/MyTabbedApplication/FirstViewController.cs index f1318cbba2..f9f588d19e 100644 --- a/tests/common/TestProjects/MyTabbedApplication/FirstViewController.cs +++ b/tests/common/TestProjects/MyTabbedApplication/FirstViewController.cs @@ -4,10 +4,8 @@ using System.Drawing; using Foundation; using UIKit; -namespace MyTabbedApplication -{ - public partial class FirstViewController : UIViewController - { +namespace MyTabbedApplication { + public partial class FirstViewController : UIViewController { static bool UserInterfaceIdiomIsPhone { get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; } } @@ -22,7 +20,7 @@ namespace MyTabbedApplication { // Releases the view if it doesn't have a superview. base.DidReceiveMemoryWarning (); - + // Release any cached data, images, etc that aren't in use. } @@ -31,7 +29,7 @@ namespace MyTabbedApplication public override void ViewDidLoad () { base.ViewDidLoad (); - + // Perform any additional setup after loading the view, typically from a nib. } diff --git a/tests/common/TestProjects/MyTabbedApplication/Main.cs b/tests/common/TestProjects/MyTabbedApplication/Main.cs index 5d70f26596..de9425bfb7 100644 --- a/tests/common/TestProjects/MyTabbedApplication/Main.cs +++ b/tests/common/TestProjects/MyTabbedApplication/Main.cs @@ -5,12 +5,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MyTabbedApplication -{ - public class Application - { +namespace MyTabbedApplication { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyTabbedApplication/SecondViewController.cs b/tests/common/TestProjects/MyTabbedApplication/SecondViewController.cs index 916316d4f4..a0ec3c6f57 100644 --- a/tests/common/TestProjects/MyTabbedApplication/SecondViewController.cs +++ b/tests/common/TestProjects/MyTabbedApplication/SecondViewController.cs @@ -4,10 +4,8 @@ using System.Drawing; using Foundation; using UIKit; -namespace MyTabbedApplication -{ - public partial class SecondViewController : UIViewController - { +namespace MyTabbedApplication { + public partial class SecondViewController : UIViewController { static bool UserInterfaceIdiomIsPhone { get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; } } @@ -22,7 +20,7 @@ namespace MyTabbedApplication { // Releases the view if it doesn't have a superview. base.DidReceiveMemoryWarning (); - + // Release any cached data, images, etc that aren't in use. } @@ -31,7 +29,7 @@ namespace MyTabbedApplication public override void ViewDidLoad () { base.ViewDidLoad (); - + // Perform any additional setup after loading the view, typically from a nib. } diff --git a/tests/common/TestProjects/MyTodayExtension/TodayViewController.cs b/tests/common/TestProjects/MyTodayExtension/TodayViewController.cs index e0590f2f74..9b239a6c17 100644 --- a/tests/common/TestProjects/MyTodayExtension/TodayViewController.cs +++ b/tests/common/TestProjects/MyTodayExtension/TodayViewController.cs @@ -6,10 +6,8 @@ using Foundation; using Social; using UIKit; -namespace MyTodayExtension -{ - public partial class TodayViewController : UIViewController, INCWidgetProviding - { +namespace MyTodayExtension { + public partial class TodayViewController : UIViewController, INCWidgetProviding { public TodayViewController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/MyWatch2Container/AppDelegate.cs b/tests/common/TestProjects/MyWatch2Container/AppDelegate.cs index 068b8f9fe5..7a6fba7287 100644 --- a/tests/common/TestProjects/MyWatch2Container/AppDelegate.cs +++ b/tests/common/TestProjects/MyWatch2Container/AppDelegate.cs @@ -1,13 +1,11 @@ using Foundation; using UIKit; -namespace MyWatch2Container -{ +namespace MyWatch2Container { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { + public class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { diff --git a/tests/common/TestProjects/MyWatch2Container/Main.cs b/tests/common/TestProjects/MyWatch2Container/Main.cs index d541d3bbea..6901398400 100644 --- a/tests/common/TestProjects/MyWatch2Container/Main.cs +++ b/tests/common/TestProjects/MyWatch2Container/Main.cs @@ -1,11 +1,9 @@ using UIKit; -namespace MyWatch2Container -{ - public class Application - { +namespace MyWatch2Container { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyWatch2Container/ViewController.cs b/tests/common/TestProjects/MyWatch2Container/ViewController.cs index 74b62a23b5..5b79148a2c 100644 --- a/tests/common/TestProjects/MyWatch2Container/ViewController.cs +++ b/tests/common/TestProjects/MyWatch2Container/ViewController.cs @@ -2,10 +2,8 @@ using System; using UIKit; -namespace MyWatch2Container -{ - public partial class ViewController : UIViewController - { +namespace MyWatch2Container { + public partial class ViewController : UIViewController { public ViewController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/MyWatchApp/AppDelegate.cs b/tests/common/TestProjects/MyWatchApp/AppDelegate.cs index a583a3dcf6..6627802e3f 100644 --- a/tests/common/TestProjects/MyWatchApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyWatchApp/AppDelegate.cs @@ -5,19 +5,17 @@ using System.Linq; using Foundation; using UIKit; -namespace MyWatchApp -{ +namespace MyWatchApp { [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { UIWindow window; public override bool FinishedLaunching (UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); - + window.MakeKeyAndVisible (); - + return true; } } diff --git a/tests/common/TestProjects/MyWatchApp/Main.cs b/tests/common/TestProjects/MyWatchApp/Main.cs index fcd9ec7b0a..5b492475ba 100644 --- a/tests/common/TestProjects/MyWatchApp/Main.cs +++ b/tests/common/TestProjects/MyWatchApp/Main.cs @@ -5,11 +5,9 @@ using System.Linq; using Foundation; using UIKit; -namespace MyWatchApp -{ - public class Application - { - static void Main (string[] args) +namespace MyWatchApp { + public class Application { + static void Main (string [] args) { UIApplication.Main (args, null, "AppDelegate"); } diff --git a/tests/common/TestProjects/MyWatchKit2Extension/InterfaceController.cs b/tests/common/TestProjects/MyWatchKit2Extension/InterfaceController.cs index 68afa702b3..2cd03af4d1 100644 --- a/tests/common/TestProjects/MyWatchKit2Extension/InterfaceController.cs +++ b/tests/common/TestProjects/MyWatchKit2Extension/InterfaceController.cs @@ -3,10 +3,8 @@ using System; using WatchKit; using Foundation; -namespace monotouchtestWatchKitExtension -{ - public partial class InterfaceController : WKInterfaceController - { +namespace monotouchtestWatchKitExtension { + public partial class InterfaceController : WKInterfaceController { public InterfaceController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/MyWatchKit2IntentsExtension/IntentHandler.cs b/tests/common/TestProjects/MyWatchKit2IntentsExtension/IntentHandler.cs index 724f817242..9c56c90dbf 100644 --- a/tests/common/TestProjects/MyWatchKit2IntentsExtension/IntentHandler.cs +++ b/tests/common/TestProjects/MyWatchKit2IntentsExtension/IntentHandler.cs @@ -4,8 +4,7 @@ using System.Collections.Generic; using Foundation; using Intents; -namespace MyWatchKit2IntentsExtension -{ +namespace MyWatchKit2IntentsExtension { // As an example, this class is set up to handle Message intents. // You will want to replace this or add other intents as appropriate. // The intents you wish to handle must be declared in the extension's Info.plist. @@ -15,8 +14,7 @@ namespace MyWatchKit2IntentsExtension // " John saying hello" // "Search for messages in " [Register ("IntentHandler")] - public class IntentHandler : INExtension, IINSendMessageIntentHandling, IINSearchForMessagesIntentHandling - { + public class IntentHandler : INExtension, IINSendMessageIntentHandling, IINSearchForMessagesIntentHandling { protected IntentHandler (IntPtr handle) : base (handle) { // Note: this .ctor should not contain any initialization logic. @@ -32,19 +30,19 @@ namespace MyWatchKit2IntentsExtension // Implement resolution methods to provide additional information about your intent (optional). [Export ("resolveRecipientsForSearchForMessages:withCompletion:")] - public void ResolveRecipients (INSearchForMessagesIntent intent, Action completion) + public void ResolveRecipients (INSearchForMessagesIntent intent, Action completion) { var recipients = intent.Recipients; // If no recipients were provided we'll need to prompt for a value. if (recipients.Length == 0) { - completion (new INPersonResolutionResult[] { INPersonResolutionResult.NeedsValue }); + completion (new INPersonResolutionResult [] { INPersonResolutionResult.NeedsValue }); return; } var resolutionResults = new List (); foreach (var recipient in recipients) { - var matchingContacts = new INPerson[] { recipient }; // Implement your contact matching logic here to create an array of matching contacts + var matchingContacts = new INPerson [] { recipient }; // Implement your contact matching logic here to create an array of matching contacts if (matchingContacts.Length > 1) { // We need Siri's help to ask user to pick one from the matches. resolutionResults.Add (INPersonResolutionResult.GetDisambiguation (matchingContacts)); @@ -104,8 +102,8 @@ namespace MyWatchKit2IntentsExtension // Initialize with found message's attributes var sender = new INPerson (new INPersonHandle ("sarah@example.com", INPersonHandleType.EmailAddress), null, "Sarah", null, null, null); var recipient = new INPerson (new INPersonHandle ("+1-415-555-5555", INPersonHandleType.PhoneNumber), null, "John", null, null, null); - var message = new INMessage ("identifier", "I am so excited about SiriKit!", NSDate.Now, sender, new INPerson[] { recipient }); - response.Messages = new INMessage[] { message }; + var message = new INMessage ("identifier", "I am so excited about SiriKit!", NSDate.Now, sender, new INPerson [] { recipient }); + response.Messages = new INMessage [] { message }; completion (response); } } diff --git a/tests/common/TestProjects/MyWatchKitExtension/GlanceController.cs b/tests/common/TestProjects/MyWatchKitExtension/GlanceController.cs index 0fbcd47fe6..75f1a0432f 100644 --- a/tests/common/TestProjects/MyWatchKitExtension/GlanceController.cs +++ b/tests/common/TestProjects/MyWatchKitExtension/GlanceController.cs @@ -3,10 +3,8 @@ using System; using WatchKit; using Foundation; -namespace WatchExtension -{ - public partial class GlanceController : WKInterfaceController - { +namespace WatchExtension { + public partial class GlanceController : WKInterfaceController { public GlanceController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/MyWatchKitExtension/InterfaceController.cs b/tests/common/TestProjects/MyWatchKitExtension/InterfaceController.cs index 4a8f5263e1..a01d4bb80f 100644 --- a/tests/common/TestProjects/MyWatchKitExtension/InterfaceController.cs +++ b/tests/common/TestProjects/MyWatchKitExtension/InterfaceController.cs @@ -3,10 +3,8 @@ using System; using WatchKit; using Foundation; -namespace WatchExtension -{ - public partial class InterfaceController : WKInterfaceController - { +namespace WatchExtension { + public partial class InterfaceController : WKInterfaceController { public InterfaceController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/MyWatchKitExtension/NotificationController.cs b/tests/common/TestProjects/MyWatchKitExtension/NotificationController.cs index ddc73e5e10..cdf3490499 100644 --- a/tests/common/TestProjects/MyWatchKitExtension/NotificationController.cs +++ b/tests/common/TestProjects/MyWatchKitExtension/NotificationController.cs @@ -3,10 +3,8 @@ using System; using WatchKit; using Foundation; -namespace WatchExtension -{ - public partial class NotificationController : WKUserNotificationInterfaceController - { +namespace WatchExtension { + public partial class NotificationController : WKUserNotificationInterfaceController { public NotificationController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/MyWebViewApp/AppDelegate.cs b/tests/common/TestProjects/MyWebViewApp/AppDelegate.cs index 4fdc2354cc..d09c86de3c 100644 --- a/tests/common/TestProjects/MyWebViewApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyWebViewApp/AppDelegate.cs @@ -5,14 +5,12 @@ using System.Collections.Generic; using Foundation; using UIKit; -namespace MyWebViewApp -{ +namespace MyWebViewApp { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : UIApplicationDelegate - { + public partial class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { get; diff --git a/tests/common/TestProjects/MyWebViewApp/HybridViewController.cs b/tests/common/TestProjects/MyWebViewApp/HybridViewController.cs index a670f8e99a..0f6ca7b3c1 100644 --- a/tests/common/TestProjects/MyWebViewApp/HybridViewController.cs +++ b/tests/common/TestProjects/MyWebViewApp/HybridViewController.cs @@ -4,10 +4,8 @@ using System.Drawing; using Foundation; using UIKit; -namespace MyWebViewApp -{ - public partial class HybridViewController : UIViewController - { +namespace MyWebViewApp { + public partial class HybridViewController : UIViewController { static bool UserInterfaceIdiomIsPhone { get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; } } diff --git a/tests/common/TestProjects/MyWebViewApp/Main.cs b/tests/common/TestProjects/MyWebViewApp/Main.cs index dcca44150d..cf02be3b65 100644 --- a/tests/common/TestProjects/MyWebViewApp/Main.cs +++ b/tests/common/TestProjects/MyWebViewApp/Main.cs @@ -5,12 +5,10 @@ using System.Linq; using Foundation; using UIKit; -namespace MyWebViewApp -{ - public class Application - { +namespace MyWebViewApp { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyWebViewApp/Models/Model1.cs b/tests/common/TestProjects/MyWebViewApp/Models/Model1.cs index 616c2aca01..a9ced7ea2b 100644 --- a/tests/common/TestProjects/MyWebViewApp/Models/Model1.cs +++ b/tests/common/TestProjects/MyWebViewApp/Models/Model1.cs @@ -1,9 +1,7 @@ using System; -namespace MyWebViewApp -{ - public class Model1 - { +namespace MyWebViewApp { + public class Model1 { public string Text { get; set; } } } diff --git a/tests/common/TestProjects/MyXamarinFormsApp/AppDelegate.cs b/tests/common/TestProjects/MyXamarinFormsApp/AppDelegate.cs index 310888bf33..fdbc68f342 100644 --- a/tests/common/TestProjects/MyXamarinFormsApp/AppDelegate.cs +++ b/tests/common/TestProjects/MyXamarinFormsApp/AppDelegate.cs @@ -5,14 +5,12 @@ using System.Linq; using Foundation; using UIKit; -namespace MyXamarinFormsApp.iOS -{ +namespace MyXamarinFormsApp.iOS { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to // application events from iOS. [Register ("AppDelegate")] - public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate - { + public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate { // // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window diff --git a/tests/common/TestProjects/MyXamarinFormsApp/Main.cs b/tests/common/TestProjects/MyXamarinFormsApp/Main.cs index be5b7d07a5..05a501789c 100644 --- a/tests/common/TestProjects/MyXamarinFormsApp/Main.cs +++ b/tests/common/TestProjects/MyXamarinFormsApp/Main.cs @@ -5,10 +5,8 @@ using System.Linq; using Foundation; using UIKit; -namespace MyXamarinFormsApp.iOS -{ - public class Application - { +namespace MyXamarinFormsApp.iOS { + public class Application { // This is the main entry point of the application. static void Main (string [] args) { diff --git a/tests/common/TestProjects/MyXamarinFormsApp/MyXamarinFormsAppNS/App.xaml.cs b/tests/common/TestProjects/MyXamarinFormsApp/MyXamarinFormsAppNS/App.xaml.cs index 34b50fdf43..bea73cdbfe 100644 --- a/tests/common/TestProjects/MyXamarinFormsApp/MyXamarinFormsAppNS/App.xaml.cs +++ b/tests/common/TestProjects/MyXamarinFormsApp/MyXamarinFormsAppNS/App.xaml.cs @@ -2,10 +2,8 @@ using System; using Xamarin.Forms; using Xamarin.Forms.Xaml; -namespace MyXamarinFormsApp -{ - public partial class App : Application - { +namespace MyXamarinFormsApp { + public partial class App : Application { public App () { InitializeComponent (); diff --git a/tests/common/TestProjects/MyXamarinFormsApp/MyXamarinFormsAppNS/MainPage.xaml.cs b/tests/common/TestProjects/MyXamarinFormsApp/MyXamarinFormsAppNS/MainPage.xaml.cs index edead8f2df..9c457345f5 100644 --- a/tests/common/TestProjects/MyXamarinFormsApp/MyXamarinFormsAppNS/MainPage.xaml.cs +++ b/tests/common/TestProjects/MyXamarinFormsApp/MyXamarinFormsAppNS/MainPage.xaml.cs @@ -6,13 +6,11 @@ using System.Text; using System.Threading.Tasks; using Xamarin.Forms; -namespace MyXamarinFormsApp -{ +namespace MyXamarinFormsApp { // Learn more about making custom code visible in the Xamarin.Forms previewer // by visiting https://aka.ms/xamarinforms-previewer [DesignTimeVisible (false)] - public partial class MainPage : ContentPage - { + public partial class MainPage : ContentPage { public MainPage () { InitializeComponent (); diff --git a/tests/common/TestProjects/MyiOSAppWithBinding/AppDelegate.cs b/tests/common/TestProjects/MyiOSAppWithBinding/AppDelegate.cs index 59c3294d38..00acdabea4 100644 --- a/tests/common/TestProjects/MyiOSAppWithBinding/AppDelegate.cs +++ b/tests/common/TestProjects/MyiOSAppWithBinding/AppDelegate.cs @@ -3,13 +3,11 @@ using System; using Foundation; using UIKit; -namespace MyiOSAppWithBinding -{ +namespace MyiOSAppWithBinding { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. [Register ("AppDelegate")] - public class AppDelegate : UIApplicationDelegate - { + public class AppDelegate : UIApplicationDelegate { // class-level declarations public override UIWindow Window { diff --git a/tests/common/TestProjects/MyiOSAppWithBinding/Main.cs b/tests/common/TestProjects/MyiOSAppWithBinding/Main.cs index da46c5e593..29948d3f62 100644 --- a/tests/common/TestProjects/MyiOSAppWithBinding/Main.cs +++ b/tests/common/TestProjects/MyiOSAppWithBinding/Main.cs @@ -1,11 +1,9 @@ using UIKit; -namespace MyiOSAppWithBinding -{ - public class Application - { +namespace MyiOSAppWithBinding { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/MyiOSAppWithBinding/ViewController.cs b/tests/common/TestProjects/MyiOSAppWithBinding/ViewController.cs index 8cde65e34e..f3923e0922 100644 --- a/tests/common/TestProjects/MyiOSAppWithBinding/ViewController.cs +++ b/tests/common/TestProjects/MyiOSAppWithBinding/ViewController.cs @@ -2,10 +2,8 @@ using System; using UIKit; -namespace MyiOSAppWithBinding -{ - public partial class ViewController : UIViewController - { +namespace MyiOSAppWithBinding { + public partial class ViewController : UIViewController { public ViewController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/AppDelegate.cs b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/AppDelegate.cs index a5023d4181..5337747af4 100644 --- a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/AppDelegate.cs +++ b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/AppDelegate.cs @@ -1,13 +1,11 @@ using Foundation; using UIKit; -namespace ManagedContainer -{ +namespace ManagedContainer { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. [Register ("AppDelegate")] - public class AppDelegate : UIResponder, IUIApplicationDelegate - { + public class AppDelegate : UIResponder, IUIApplicationDelegate { [Export ("window")] public UIWindow Window { get; set; } diff --git a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/Main.cs b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/Main.cs index 521e23e695..91cf6ccfc0 100644 --- a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/Main.cs +++ b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/Main.cs @@ -1,11 +1,9 @@ using UIKit; -namespace ManagedContainer -{ - public class Application - { +namespace ManagedContainer { + public class Application { // This is the main entry point of the application. - static void Main (string[] args) + static void Main (string [] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. diff --git a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/Properties/AssemblyInfo.cs b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/Properties/AssemblyInfo.cs index 9037d51ae6..a89be71390 100644 --- a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/Properties/AssemblyInfo.cs +++ b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/Properties/AssemblyInfo.cs @@ -5,22 +5,22 @@ using System.Runtime.InteropServices; // 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("ManagedContainer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ManagedContainer")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +[assembly: AssemblyTitle ("ManagedContainer")] +[assembly: AssemblyDescription ("")] +[assembly: AssemblyConfiguration ("")] +[assembly: AssemblyCompany ("")] +[assembly: AssemblyProduct ("ManagedContainer")] +[assembly: AssemblyCopyright ("Copyright © 2017")] +[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 // COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] +[assembly: ComVisible (false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")] +[assembly: Guid ("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")] // Version information for an assembly consists of the following four values: // @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 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("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion ("1.0.0.0")] +[assembly: AssemblyFileVersion ("1.0.0.0")] diff --git a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/SceneDelegate.cs b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/SceneDelegate.cs index 47dd89d697..82420b0d50 100644 --- a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/SceneDelegate.cs +++ b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/SceneDelegate.cs @@ -2,11 +2,9 @@ using System; using Foundation; using UIKit; -namespace NewSingleViewTemplate -{ +namespace NewSingleViewTemplate { [Register ("SceneDelegate")] - public class SceneDelegate : UIResponder, IUIWindowSceneDelegate - { + public class SceneDelegate : UIResponder, IUIWindowSceneDelegate { [Export ("window")] public UIWindow Window { get; set; } diff --git a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/ViewController.cs b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/ViewController.cs index 581eb6d49b..1895153341 100644 --- a/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/ViewController.cs +++ b/tests/common/TestProjects/NativeExtensionEmbedding/managed/ManagedContainer/ViewController.cs @@ -2,10 +2,8 @@ using Foundation; using System; using UIKit; -namespace ManagedContainer -{ - public partial class ViewController : UIViewController - { +namespace ManagedContainer { + public partial class ViewController : UIViewController { public ViewController (IntPtr handle) : base (handle) { } diff --git a/tests/common/TestProjects/Protobuf_Test/Protobuf_Test/AppDelegate.cs b/tests/common/TestProjects/Protobuf_Test/Protobuf_Test/AppDelegate.cs index d1252ca0e0..95ae7b0fec 100644 --- a/tests/common/TestProjects/Protobuf_Test/Protobuf_Test/AppDelegate.cs +++ b/tests/common/TestProjects/Protobuf_Test/Protobuf_Test/AppDelegate.cs @@ -5,10 +5,8 @@ using AppKit; using ProtoBuf; using System.IO; -namespace Protobuf_Test -{ - public partial class AppDelegate : NSApplicationDelegate - { +namespace Protobuf_Test { + public partial class AppDelegate : NSApplicationDelegate { public AppDelegate () { } @@ -22,25 +20,26 @@ namespace Protobuf_Test static class ProtoTest { [ProtoContract] class Person { - [ProtoMember(1)] - public int Id {get;set;} - [ProtoMember(2)] - public string Name { get; set;} - [ProtoMember(3)] - public Address Address {get;set;} + [ProtoMember (1)] + public int Id { get; set; } + [ProtoMember (2)] + public string Name { get; set; } + [ProtoMember (3)] + public Address Address { get; set; } } [ProtoContract] class Address { - [ProtoMember(1)] - public string Line1 {get;set;} - [ProtoMember(2)] - public string Line2 {get;set;} + [ProtoMember (1)] + public string Line1 { get; set; } + [ProtoMember (2)] + public string Line2 { get; set; } } public static void DoTest () { var person = new Person { - Id = 12345, Name = "Fred", + Id = 12345, + Name = "Fred", Address = new Address { Line1 = "Flat 1", Line2 = "The Meadows" diff --git a/tests/common/TestProjects/Protobuf_Test/Protobuf_Test/Main.cs b/tests/common/TestProjects/Protobuf_Test/Protobuf_Test/Main.cs index 768655e9a4..a8b36dbd1e 100644 --- a/tests/common/TestProjects/Protobuf_Test/Protobuf_Test/Main.cs +++ b/tests/common/TestProjects/Protobuf_Test/Protobuf_Test/Main.cs @@ -2,11 +2,9 @@ using System; using AppKit; -namespace Protobuf_Test -{ - static class MainClass - { - static void Main (string[] args) +namespace Protobuf_Test { + static class MainClass { + static void Main (string [] args) { NSApplication.Init (); NSApplication.SharedApplication.Delegate = new AppDelegate (); diff --git a/tests/common/TestProjects/RoslynTestApp/Full/Main.cs b/tests/common/TestProjects/RoslynTestApp/Full/Main.cs index f5942a040d..ba6b21200f 100644 --- a/tests/common/TestProjects/RoslynTestApp/Full/Main.cs +++ b/tests/common/TestProjects/RoslynTestApp/Full/Main.cs @@ -3,11 +3,9 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace RoslynTestApp -{ - static class MainClass - { - static void Main (string[] args) +namespace RoslynTestApp { + static class MainClass { + static void Main (string [] args) { NSApplication.IgnoreMissingAssembliesDuringRegistration = true; NSApplication.Init (); @@ -29,7 +27,7 @@ namespace HelloWorld } }"); - var root = (CompilationUnitSyntax)tree.GetRoot (); + var root = (CompilationUnitSyntax) tree.GetRoot (); System.Console.WriteLine (root); } } diff --git a/tests/common/TestProjects/RoslynTestApp/Lib/Full/ReadOnlyTestMacLib/MyClass.cs b/tests/common/TestProjects/RoslynTestApp/Lib/Full/ReadOnlyTestMacLib/MyClass.cs index 047efcb9fc..19df6f377a 100644 --- a/tests/common/TestProjects/RoslynTestApp/Lib/Full/ReadOnlyTestMacLib/MyClass.cs +++ b/tests/common/TestProjects/RoslynTestApp/Lib/Full/ReadOnlyTestMacLib/MyClass.cs @@ -1,8 +1,6 @@ using System; -namespace ReadOnlyTestMacLib -{ - public class MyClass - { +namespace ReadOnlyTestMacLib { + public class MyClass { public MyClass () { } diff --git a/tests/common/TestProjects/RoslynTestApp/Lib/Modern/ReadOnlyTestMacLib/MyClass.cs b/tests/common/TestProjects/RoslynTestApp/Lib/Modern/ReadOnlyTestMacLib/MyClass.cs index 047efcb9fc..19df6f377a 100644 --- a/tests/common/TestProjects/RoslynTestApp/Lib/Modern/ReadOnlyTestMacLib/MyClass.cs +++ b/tests/common/TestProjects/RoslynTestApp/Lib/Modern/ReadOnlyTestMacLib/MyClass.cs @@ -1,8 +1,6 @@ using System; -namespace ReadOnlyTestMacLib -{ - public class MyClass - { +namespace ReadOnlyTestMacLib { + public class MyClass { public MyClass () { } diff --git a/tests/common/TestProjects/RoslynTestApp/Lib/ReadOnlyTestLib/MyClass.cs b/tests/common/TestProjects/RoslynTestApp/Lib/ReadOnlyTestLib/MyClass.cs index c17c241582..69703c3056 100644 --- a/tests/common/TestProjects/RoslynTestApp/Lib/ReadOnlyTestLib/MyClass.cs +++ b/tests/common/TestProjects/RoslynTestApp/Lib/ReadOnlyTestLib/MyClass.cs @@ -1,17 +1,15 @@ using System; using System.Collections.Generic; -namespace ReadOnlyTestLib -{ - public class MyClass - { +namespace ReadOnlyTestLib { + public class MyClass { static IReadOnlyCollection Test () { var dict = new Dictionary { ["foo"] = "bar" }; - return (IReadOnlyCollection)dict.Values; + return (IReadOnlyCollection) dict.Values; } } } diff --git a/tests/common/TestProjects/RoslynTestApp/Modern/Main.cs b/tests/common/TestProjects/RoslynTestApp/Modern/Main.cs index f5942a040d..ba6b21200f 100644 --- a/tests/common/TestProjects/RoslynTestApp/Modern/Main.cs +++ b/tests/common/TestProjects/RoslynTestApp/Modern/Main.cs @@ -3,11 +3,9 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; -namespace RoslynTestApp -{ - static class MainClass - { - static void Main (string[] args) +namespace RoslynTestApp { + static class MainClass { + static void Main (string [] args) { NSApplication.IgnoreMissingAssembliesDuringRegistration = true; NSApplication.Init (); @@ -29,7 +27,7 @@ namespace HelloWorld } }"); - var root = (CompilationUnitSyntax)tree.GetRoot (); + var root = (CompilationUnitSyntax) tree.GetRoot (); System.Console.WriteLine (root); } } diff --git a/tests/common/TestProjects/ServiceModel_Test/ServiceModel_Test/AppDelegate.cs b/tests/common/TestProjects/ServiceModel_Test/ServiceModel_Test/AppDelegate.cs index ed9b6663f4..f00ad0bf14 100644 --- a/tests/common/TestProjects/ServiceModel_Test/ServiceModel_Test/AppDelegate.cs +++ b/tests/common/TestProjects/ServiceModel_Test/ServiceModel_Test/AppDelegate.cs @@ -4,10 +4,8 @@ using Foundation; using AppKit; using System.IO; -namespace ServiceModel_Test -{ - public partial class AppDelegate : NSApplicationDelegate - { +namespace ServiceModel_Test { + public partial class AppDelegate : NSApplicationDelegate { public AppDelegate () { } @@ -17,7 +15,7 @@ namespace ServiceModel_Test var fileName = "../../../../../TestResult.txt"; if (File.Exists (fileName)) File.Delete (fileName); - + using (TextWriter writer = File.CreateText (fileName)) { var x = new System.ServiceModel.CommunicationException (); writer.WriteLine ("Test Passed: " + x.ToString ()); diff --git a/tests/common/TestProjects/ServiceModel_Test/ServiceModel_Test/Main.cs b/tests/common/TestProjects/ServiceModel_Test/ServiceModel_Test/Main.cs index 5a7e3872f2..a6d2a7cfb3 100644 --- a/tests/common/TestProjects/ServiceModel_Test/ServiceModel_Test/Main.cs +++ b/tests/common/TestProjects/ServiceModel_Test/ServiceModel_Test/Main.cs @@ -2,11 +2,9 @@ using System; using AppKit; -namespace ServiceModel_Test -{ - static class MainClass - { - static void Main (string[] args) +namespace ServiceModel_Test { + static class MainClass { + static void Main (string [] args) { NSApplication.Init (); NSApplication.SharedApplication.Delegate = new AppDelegate (); diff --git a/tests/common/TestProjects/SystemMemoryFromNetStandard2_0/Program.cs b/tests/common/TestProjects/SystemMemoryFromNetStandard2_0/Program.cs index 0e9fe2c38b..5e750cc972 100644 --- a/tests/common/TestProjects/SystemMemoryFromNetStandard2_0/Program.cs +++ b/tests/common/TestProjects/SystemMemoryFromNetStandard2_0/Program.cs @@ -1,13 +1,11 @@ using System; -namespace app -{ - class Program - { - static void Main(string[] args) - { - System.Console.WriteLine (typeof (UIKit.UIWindow)); - C.DoIt (); - } - } +namespace app { + class Program { + static void Main (string [] args) + { + System.Console.WriteLine (typeof (UIKit.UIWindow)); + C.DoIt (); + } + } } diff --git a/tests/common/TestProjects/SystemMemoryReference/Program.cs b/tests/common/TestProjects/SystemMemoryReference/Program.cs index 01fc1e8c1f..56c0099e6f 100644 --- a/tests/common/TestProjects/SystemMemoryReference/Program.cs +++ b/tests/common/TestProjects/SystemMemoryReference/Program.cs @@ -1,13 +1,11 @@ using System; -namespace app -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine (typeof(ReadOnlySpan).Assembly.FullName); - System.Console.WriteLine (typeof (UIKit.UIWindow)); - } - } +namespace app { + class Program { + static void Main (string [] args) + { + Console.WriteLine (typeof (ReadOnlySpan).Assembly.FullName); + System.Console.WriteLine (typeof (UIKit.UIWindow)); + } + } } diff --git a/tests/common/TestRuntime.cs b/tests/common/TestRuntime.cs index 7f0450dee1..bcca37fcae 100644 --- a/tests/common/TestRuntime.cs +++ b/tests/common/TestRuntime.cs @@ -142,7 +142,7 @@ partial class TestRuntime { #if NET // error CS1061: 'AppDomain' does not contain a definition for 'DefineDynamicAssembly' and no accessible extension method 'DefineDynamicAssembly' accepting a first argument of type 'AppDomain' could be found (are you missing a using directive or an assembly reference?) #else - static AssemblyName assemblyName = new AssemblyName ("DynamicAssemblyExample"); + static AssemblyName assemblyName = new AssemblyName ("DynamicAssemblyExample"); public static bool CheckExecutingWithInterpreter () { // until System.Runtime.CompilerServices.RuntimeFeature.IsSupported("IsDynamicCodeCompiled") returns a valid result, atm it diff --git a/tests/common/Tool.cs b/tests/common/Tool.cs index f27fedbe1d..2d1345d024 100644 --- a/tests/common/Tool.cs +++ b/tests/common/Tool.cs @@ -8,10 +8,8 @@ using System.Text.RegularExpressions; using NUnit.Framework; using Xamarin.Utils; -namespace Xamarin.Tests -{ - class ToolMessage - { +namespace Xamarin.Tests { + class ToolMessage { public bool IsError; public bool IsWarning { get { return !IsError; } } public string Prefix; @@ -31,8 +29,7 @@ namespace Xamarin.Tests } } - abstract class Tool - { + abstract class Tool { StringBuilder output = new StringBuilder (); List output_lines; @@ -70,7 +67,7 @@ namespace Xamarin.Tests return Execute (ToolPath, arguments, false); } - public int Execute (IList arguments, bool always_show_output) + public int Execute (IList arguments, bool always_show_output) { return Execute (ToolPath, arguments, always_show_output); } @@ -121,7 +118,7 @@ namespace Xamarin.Tests if (start >= 0) { // we want to get the space before `[` too. if (start > 0 && line [start - 1] == ' ') - start --; + start--; line = line.Substring (0, start); return line; @@ -288,7 +285,7 @@ namespace Xamarin.Tests public static void AssertWarningCount (IEnumerable messages, int count, string message = "warnings") { if (count != GetWarningCount (messages)) - Assert.Fail ($"{message}\nExpected: {count}\nBut was: { GetWarningCount (messages)}\nWarnings:\n\t{string.Join ("\n\t", messages.Where ((v) => v.IsWarning).Select ((v) => v.ToString ()))}"); + Assert.Fail ($"{message}\nExpected: {count}\nBut was: {GetWarningCount (messages)}\nWarnings:\n\t{string.Join ("\n\t", messages.Where ((v) => v.IsWarning).Select ((v) => v.ToString ()))}"); } public void AssertErrorCount (int count, string message = "errors") @@ -330,8 +327,8 @@ namespace Xamarin.Tests var matches = messages.Where ((msg) => msg.Message == message); if (!matches.Any ()) { var details = messages. - Where ((msg) => msg.Prefix == prefix && msg.Number == number && msg.Message != message). - Select ((msg) => string.Format ("\tMessage #{2} did not match:\n\t\tactual: '{0}'\n\t\texpected: '{1}'", msg.Message, message, messages.IndexOf (msg) + 1)); + Where ((msg) => msg.Prefix == prefix && msg.Number == number && msg.Message != message). + Select ((msg) => string.Format ("\tMessage #{2} did not match:\n\t\tactual: '{0}'\n\t\texpected: '{1}'", msg.Message, message, messages.IndexOf (msg) + 1)); Assert.Fail (string.Format ("The error '{0}{1:0000}: {2}' was not found in the output:\n{3}", prefix, number, message, string.Join ("\n", details.ToArray ()))); } diff --git a/tests/common/mac/ApiDefinition.cs b/tests/common/mac/ApiDefinition.cs index 688fcd16ff..b09b5cf406 100644 --- a/tests/common/mac/ApiDefinition.cs +++ b/tests/common/mac/ApiDefinition.cs @@ -5,8 +5,7 @@ using Foundation; using ObjCRuntime; using CoreGraphics; -namespace ExampleBinding -{ +namespace ExampleBinding { // The first step to creating a binding is to add your native library ("libNativeLibrary.a") // to the project by right-clicking (or Control-clicking) the folder containing this source // file and clicking "Add files..." and then simply select the native library (or libraries) @@ -63,5 +62,5 @@ namespace ExampleBinding // // For more information, see http://developer.xamarin.com/guides/ios/advanced_topics/binding_objective-c/ // -REPLACE_CODE_REPLACE + REPLACE_CODE_REPLACE } diff --git a/tests/common/mac/ConsoleProgram.cs b/tests/common/mac/ConsoleProgram.cs index 1732e3713c..f531ee8e5e 100644 --- a/tests/common/mac/ConsoleProgram.cs +++ b/tests/common/mac/ConsoleProgram.cs @@ -2,15 +2,13 @@ using System; using System.IO; using System.Reflection; -namespace ConsoleXMApp -{ - class MainClass - { - public static void Main (string[] args) +namespace ConsoleXMApp { + class MainClass { + public static void Main (string [] args) { var xm = Assembly.LoadFile (Path.Combine (Path.GetDirectoryName (typeof (MainClass).Assembly.Location), "Stuff", "Xamarin.Mac.dll")); - xm.GetType ("AppKit.NSApplication").GetMethod ("Init").Invoke (null, new object[] { }); - var o = xm.GetType ("Foundation.NSObject").GetConstructor (new Type[] { }).Invoke (new object[] { }); + xm.GetType ("AppKit.NSApplication").GetMethod ("Init").Invoke (null, new object [] { }); + var o = xm.GetType ("Foundation.NSObject").GetConstructor (new Type [] { }).Invoke (new object [] { }); Console.WriteLine (o != null); } } diff --git a/tests/common/mac/Finder/FinderSync.cs b/tests/common/mac/Finder/FinderSync.cs index 1a75d63a8d..59094f69e7 100644 --- a/tests/common/mac/Finder/FinderSync.cs +++ b/tests/common/mac/Finder/FinderSync.cs @@ -3,11 +3,9 @@ using FinderSync; using Foundation; using Social; -namespace FinderExtensionTest -{ +namespace FinderExtensionTest { [Register ("FinderSync")] - public partial class FinderSync : FIFinderSync - { + public partial class FinderSync : FIFinderSync { public override void BeginRequestWithExtensionContext (NSExtensionContext context) { } @@ -19,26 +17,20 @@ namespace FinderExtensionTest return menu; } - public override string ToolbarItemName - { - get - { + public override string ToolbarItemName { + get { return "FinderExtension"; } } - public override string ToolbarItemToolTip - { - get - { + public override string ToolbarItemToolTip { + get { return "FinderExtension: Click the toolbar item for a menu."; } } - public override NSImage ToolbarItemImage - { - get - { + public override NSImage ToolbarItemImage { + get { return NSImage.ImageNamed (NSImageName.Caution); } } diff --git a/tests/common/mac/MyClass.cs b/tests/common/mac/MyClass.cs index a2642ca8b8..2c6eeb7f71 100644 --- a/tests/common/mac/MyClass.cs +++ b/tests/common/mac/MyClass.cs @@ -1,9 +1,7 @@ using System; -namespace Library -{ - public class MyClass - { +namespace Library { + public class MyClass { public MyClass () { } diff --git a/tests/common/mac/NetStandard/Class1.cs b/tests/common/mac/NetStandard/Class1.cs index 97b2b6176f..a16fd16baf 100644 --- a/tests/common/mac/NetStandard/Class1.cs +++ b/tests/common/mac/NetStandard/Class1.cs @@ -1,12 +1,10 @@ -using System; - -namespace NetStandardLib -{ - public class Class1 - { - public string TestMethod() - { - return "Hello World"; - } - } -} +using System; + +namespace NetStandardLib { + public class Class1 { + public string TestMethod () + { + return "Hello World"; + } + } +} diff --git a/tests/common/mac/ProjectTestHelpers.cs b/tests/common/mac/ProjectTestHelpers.cs index 834c32340d..33eaace2da 100644 --- a/tests/common/mac/ProjectTestHelpers.cs +++ b/tests/common/mac/ProjectTestHelpers.cs @@ -10,8 +10,7 @@ using System.Reflection; using Xamarin.Utils; using Xamarin.Tests; -namespace Xamarin.MMP.Tests -{ +namespace Xamarin.MMP.Tests { internal class MessageTool : Tool { public MessageTool () { @@ -27,8 +26,7 @@ namespace Xamarin.MMP.Tests protected override string MessagePrefix => "MM"; } - public class OutputText - { + public class OutputText { public BuildResult BuildResult { get; private set; } public string RunOutput { get; private set; } @@ -93,8 +91,7 @@ namespace Xamarin.MMP.Tests } } - static class FrameworkBuilder - { + static class FrameworkBuilder { public static string CreateFatFramework (string tmpDir) { return Path.Combine (Configuration.RootPath, "tests", "test-libraries", "frameworks", ".libs", "MmpTestFramework.xcframework", "macos-arm64_x86_64", "MmpTestFramework.framework"); ; @@ -107,10 +104,8 @@ namespace Xamarin.MMP.Tests } // Hide the hacks and provide a nice interface for writting tests that build / run XM projects - static class TI - { - public class UnifiedTestConfig - { + static class TI { + public class UnifiedTestConfig { public string TmpDir { get; set; } // Not necessarly required @@ -128,7 +123,7 @@ namespace Xamarin.MMP.Tests public string ItemGroup { get; set; } = ""; public string SystemMonoVersion { get; set; } = ""; public string TargetFrameworkVersion { get; set; } = ""; - public Dictionary PlistReplaceStrings { get; set; } = new Dictionary(); + public Dictionary PlistReplaceStrings { get; set; } = new Dictionary (); public Tuple CustomProjectReplacement { get; set; } = null; // Binding project specific @@ -147,7 +142,7 @@ namespace Xamarin.MMP.Tests } public string BundlePath { - get { return Path.Combine (TmpDir, "bin", Release ? "Release" : "Debug", BundleName + ".app"); } + get { return Path.Combine (TmpDir, "bin", Release ? "Release" : "Debug", BundleName + ".app"); } } public string ExecutablePath { @@ -164,8 +159,8 @@ namespace Xamarin.MMP.Tests { string output = RunAndAssert ("/Library/Frameworks/Mono.framework/Commands/mono", new [] { "--version" }, "FindMonoVersion"); - Regex versionRegex = new Regex("compiler version \\d+.\\d+.\\d+(.\\d+)?", RegexOptions.IgnoreCase); - return new Version (versionRegex.Match (output).Value.Split (' ')[2]); + Regex versionRegex = new Regex ("compiler version \\d+.\\d+.\\d+(.\\d+)?", RegexOptions.IgnoreCase); + return new Version (versionRegex.Match (output).Value.Split (' ') [2]); } public static string RunAndAssert (string exe, params string [] args) @@ -224,7 +219,7 @@ namespace Xamarin.MMP.Tests buildArgs.Add (csprojTarget); - Func getBuildProjectErrorInfo = () => { + Func getBuildProjectErrorInfo = () => { string csprojText = "\n\n\n\tCSProj: \n" + File.ReadAllText (csprojTarget); string csprojLocation = Path.GetDirectoryName (csprojTarget); string fileList = "\n\n\tFiles: " + String.Join (" ", Directory.GetFiles (csprojLocation).Select (x => x.Replace (csprojLocation + "/", ""))); @@ -257,7 +252,7 @@ namespace Xamarin.MMP.Tests string output = RunAndAssert (path, Array.Empty (), "Run"); string guidPath = Path.Combine (tmpDir, guid.ToString ()); - Assert.IsTrue(File.Exists (guidPath), "Generated program did not create expected guid file: " + output); + Assert.IsTrue (File.Exists (guidPath), "Generated program did not create expected guid file: " + output); // Let's delete the guid file so re-runs inside same tests are accurate File.Delete (guidPath); @@ -270,8 +265,7 @@ namespace Xamarin.MMP.Tests string sourceDir = FindSourceDirectory (); - if (config.AssetIcons) - { + if (config.AssetIcons) { RunAndAssert ("/bin/cp", new [] { "-R", Path.Combine (sourceDir, "Icons/Assets.xcassets"), config.TmpDir }, "Copy Asset Icons"); config.ItemGroup += @" @@ -295,10 +289,9 @@ namespace Xamarin.MMP.Tests return text; }); - return CopyFileWithSubstitutions (Path.Combine (sourceDir, config.ProjectName), Path.Combine (config.TmpDir, config.ProjectName), text => - { - return ProjectTextReplacement (config, text); - }); + return CopyFileWithSubstitutions (Path.Combine (sourceDir, config.ProjectName), Path.Combine (config.TmpDir, config.ProjectName), text => { + return ProjectTextReplacement (config, text); + }); } public static string GenerateBindingLibraryProject (UnifiedTestConfig config) @@ -318,10 +311,10 @@ namespace Xamarin.MMP.Tests } return CopyFileWithSubstitutions (Path.Combine (sourceDir, config.ProjectName), Path.Combine (config.TmpDir, config.ProjectName), text => { - if (linkWithName != null) - text = text.Replace ("%ITEMGROUP%", $@"%ITEMGROUP%"); - return ProjectTextReplacement (config, text); - }); + if (linkWithName != null) + text = text.Replace ("%ITEMGROUP%", $@"%ITEMGROUP%"); + return ProjectTextReplacement (config, text); + }); } public static string GenerateUnifiedLibraryProject (UnifiedTestConfig config) @@ -418,7 +411,7 @@ namespace Xamarin.MMP.Tests if (shouldFail) return new OutputText (buildOutput, ""); - string exePath = Path.Combine (config.TmpDir, "bin", config.Release ? "Release" : "Debug", projectName + ".app", "Contents", "MacOS", projectName); + string exePath = Path.Combine (config.TmpDir, "bin", config.Release ? "Release" : "Debug", projectName + ".app", "Contents", "MacOS", projectName); string runOutput = RunEXEAndVerifyGUID (config.TmpDir, config.guid, exePath); return new OutputText (buildOutput, runOutput); } @@ -436,10 +429,9 @@ namespace Xamarin.MMP.Tests string sourceDir = FindSourceDirectory (); File.Copy (Path.Combine (sourceDir, "Info-Unified.plist"), Path.Combine (config.TmpDir, "Info.plist"), true); - return CopyFileWithSubstitutions (Path.Combine (sourceDir, config.ProjectName), Path.Combine (config.TmpDir, config.ProjectName), text => - { - return ProjectTextReplacement (config, text.Replace ("%TARGETFRAMEWORKVERSION%", GetTargetFrameworkValue (config))); - }); + return CopyFileWithSubstitutions (Path.Combine (sourceDir, config.ProjectName), Path.Combine (config.TmpDir, config.ProjectName), text => { + return ProjectTextReplacement (config, text.Replace ("%TARGETFRAMEWORKVERSION%", GetTargetFrameworkValue (config))); + }); } public static string TestDirectory => Path.Combine (Configuration.RootPath, "tests"); @@ -454,7 +446,7 @@ namespace Xamarin.MMP.Tests Assert.AreEqual (0, ExecutionHelper.Execute ("/bin/cp", new [] { "-r", src, target })); } - public static string CopyFileWithSubstitutions (string src, string target, Func replacementAction) + public static string CopyFileWithSubstitutions (string src, string target, Func replacementAction) { string text = replacementAction (System.IO.File.ReadAllText (src)); System.IO.File.WriteAllText (target, text); @@ -497,7 +489,7 @@ namespace TestCase string currentTemplate = fsharp ? FSharpMainTemplate : MainTemplate; string testCase = currentTemplate.Replace ("REPLACE_CODE_REPLACE", content).Replace ("%DECL%", decl); using (StreamWriter s = new StreamWriter (location)) - s.Write(testCase); + s.Write (testCase); } public static string FindRootDirectory () @@ -507,13 +499,13 @@ namespace TestCase static string GenerateOutputCommand (string tmpDir, Guid guid) { - return string.Format ("System.IO.File.Create(\"{0}\").Dispose();", Path.Combine (tmpDir, guid.ToString ())); + return string.Format ("System.IO.File.Create(\"{0}\").Dispose();", Path.Combine (tmpDir, guid.ToString ())); } public static bool TryNugetRestore (string project, out StringBuilder output) { output = new StringBuilder (); - var rv = ExecutionHelper.Execute (Configuration.XIBuildPath, new [] { $"--", "/t:Restore", project}, stdout: output, stderr: output, environmentVariables: Configuration.GetBuildEnvironment (ApplePlatform.MacOSX)); + var rv = ExecutionHelper.Execute (Configuration.XIBuildPath, new [] { $"--", "/t:Restore", project }, stdout: output, stderr: output, environmentVariables: Configuration.GetBuildEnvironment (ApplePlatform.MacOSX)); return rv == 0; } @@ -526,8 +518,7 @@ namespace TestCase } } - public static bool InJenkins - { + public static bool InJenkins { get { var buildRev = Environment.GetEnvironmentVariable ("BUILD_REVISION"); return !string.IsNullOrEmpty (buildRev) && buildRev == "jenkins"; @@ -535,8 +526,7 @@ namespace TestCase } } - static class PlatformHelpers - { + static class PlatformHelpers { // Yes, this is a copy of the one in PlatformAvailability.cs. However, right now // we don't depend on Xamarin.Mac.dll, so moving to it was too painful. If we start // using XM, we can revisit. diff --git a/tests/common/mac/Share/ShareViewController.cs b/tests/common/mac/Share/ShareViewController.cs index 77bc64be15..95a23c5e0d 100644 --- a/tests/common/mac/Share/ShareViewController.cs +++ b/tests/common/mac/Share/ShareViewController.cs @@ -7,10 +7,8 @@ using Social; using AppKit; using System.Linq; -namespace ShareExtensionTest -{ - public partial class ShareViewController : NSViewController - { +namespace ShareExtensionTest { + public partial class ShareViewController : NSViewController { public ShareViewController (IntPtr handle) : base (handle) { } @@ -26,7 +24,7 @@ namespace ShareExtensionTest partial void Cancel (Foundation.NSObject sender) { NSExtensionItem outputItem = new NSExtensionItem (); - var outputItems = new[] { outputItem }; + var outputItems = new [] { outputItem }; ExtensionContext.CompleteRequest (outputItems, null); } diff --git a/tests/common/mac/StructsAndEnums.cs b/tests/common/mac/StructsAndEnums.cs index 015edca2c5..06c1ff7e7c 100644 --- a/tests/common/mac/StructsAndEnums.cs +++ b/tests/common/mac/StructsAndEnums.cs @@ -1,6 +1,5 @@ using System; -namespace ExampleBinding -{ +namespace ExampleBinding { REPLACE_CODE_REPLACE } diff --git a/tests/common/mac/Today/TodayViewController.cs b/tests/common/mac/Today/TodayViewController.cs index 092313c330..ba656b4800 100644 --- a/tests/common/mac/Today/TodayViewController.cs +++ b/tests/common/mac/Today/TodayViewController.cs @@ -6,10 +6,8 @@ using Foundation; using Social; using AppKit; -namespace TodayExtensionTest -{ - public partial class TodayViewController : NSViewController, INCWidgetProviding - { +namespace TodayExtensionTest { + public partial class TodayViewController : NSViewController, INCWidgetProviding { public TodayViewController (IntPtr handle) : base (handle) { } diff --git a/tools/autoformat.sh b/tools/autoformat.sh index b5f78573ba..9a69236b34 100755 --- a/tools/autoformat.sh +++ b/tools/autoformat.sh @@ -38,6 +38,7 @@ dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/u2ignore/u2ignore.csproj" dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/u2todo/u2todo.csproj" dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/xtro-report/xtro-report.csproj" dotnet format whitespace "$SRC_DIR/tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj" +dotnet format whitespace --folder "$SRC_DIR/tests/common" dotnet format whitespace --folder "$SRC_DIR/tests/monotouch-test" dotnet format whitespace --folder "$SRC_DIR/tests/msbuild" dotnet format whitespace --folder "$SRC_DIR/tests/xtro-sharpie"