Пример #1
0
 static TestRandoPort()
 {
     if (_instance == null)
     {
         lock (objLock)
         {
             if (_instance == null)
             {
                 _instance = new TestRandoPort();
             }
         }
     }
 }
Пример #2
0
        private static void TestType()
        {
            string TypenName = System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName;

            TypenName = System.Reflection.MethodBase.GetCurrentMethod().Name;

            Type type = typeof(Program);

            Console.WriteLine(TypenName);

            TestRandoPort obj = Activator.CreateInstance(typeof(TestRandoPort)) as TestRandoPort;

            Console.WriteLine(obj.PortIsUsed().Count);
        }