示例#1
0
        static void Main(string[] args)
        {
            InitializeIoC();

            Task.Factory.StartNew(() =>
            {
                while (true)
                {
                    Console.WriteLine("Enter input:"); // Prompt
                    string input = Console.ReadLine(); // Get string from user

                    _IStringIntegerCalculator = Res365Container.Instance.Resolve <IStringIntegerCalculator>();

                    int result = _IStringIntegerCalculator.CalculatorString(input, upBound: 2000, allowNegative: true);

                    Console.WriteLine($"Fomural: {_IStringIntegerCalculator.Formular}");
                    Console.WriteLine($"Result: {result}");
                }
            });
            Console.CancelKeyPress += new ConsoleCancelEventHandler(OnExit);
            _closing.WaitOne();
        }
 public void InitilizeTest()
 {
     InitializeIoC();
     _StringIntegerCalculator = Res365Container.Instance.Resolve <IStringIntegerCalculator> ();
 }