コード例 #1
0
        public void MethodWithStringArrayParameterIsPreferredToMethodWithNoParameters()
        {
            MethodBase method = ApplicationChooser.GetEntryPoint(typeof(TypeHasMultipleMainMethods));

            Assert.IsNotNull(method);
            Assert.AreEqual(1, method.GetParameters().Length);
            Assert.AreEqual(typeof(string[]), method.GetParameters()[0].ParameterType);
        }
コード例 #2
0
        public void GenericMethodsCanCoexistAndAreIgnored()
        {
            MethodBase method = ApplicationChooser.GetEntryPoint(typeof(TypeWithMainMethodsOverloadedByTypeParameterNumber));

            Assert.IsNotNull(method);
            Assert.IsFalse(method.IsGenericMethod);
            Assert.IsFalse(method.IsGenericMethodDefinition);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            DirectoryInfo dir = new DirectoryInfo(Application.ExecutablePath);

            // Navigate all the way up to the top of the example code tree
            dir = dir.Parent.Parent.Parent.Parent.Parent;
            string databasesDirectory = Path.Combine(dir.FullName, "Databases");

            AppDomain.CurrentDomain.SetData("DataDirectory", databasesDirectory);

            ApplicationChooser.Run(typeof(Program), args);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: ktotsuka/c_sharp_in_depth
 static void Main(string[] args) => ApplicationChooser.Run();
コード例 #5
0
 static void Main(string[] args)
 {
     ApplicationChooser.Run(typeof(Program), args);
 }
コード例 #6
0
        static void Main(string[] args)
        {
            //DirectoryInfo dir = new DirectoryInfo(Application.ExecutablePath);

            ApplicationChooser.Run(typeof(Program), args);
        }
コード例 #7
0
 static void Main() => ApplicationChooser.Run();
コード例 #8
0
 private static void Main(string[] args)
 {
     ApplicationChooser.Run(typeof(ProgramSelector), args);
 }
コード例 #9
0
 public void MethodCannotTakeOtherParameters()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(MainMethodWithInt32Parameter)));
 }
コード例 #10
0
 public void MethodCannotBeGeneric()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(TypeWithGenericMainMethod)));
 }
コード例 #11
0
 public void TypeCannotBeClosedGeneric()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(GenericTypeWithMainMethod <int>)));
 }
コード例 #12
0
 public void MainMethodCannotHaveStringArrayParameterByRef()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(MainMethodWithStringArrayParameterByRef)));
 }
コード例 #13
0
 public void BothMethodAndTypeCanBePublic()
 {
     Assert.IsNotNull(ApplicationChooser.GetEntryPoint(typeof(PublicClassAndPublicMainMethod)));
 }
コード例 #14
0
 public void NoMainMethodTypeIsRejected()
 {
     Assert.IsNull(ApplicationChooser.GetEntryPoint(typeof(NoMainMethod)));
 }