コード例 #1
0
ファイル: EntryPoint.cs プロジェクト: 8/MFilesImporter
    static int Main(string[] args)
    {
      TinyIoC.TinyIoCContainer container = new TinyIoC.TinyIoCContainer();
      container.Register<ArgumentsModel>(new ArgumentsModel(args));
      container.RegisterInterfaceImplementations("MFilesImporter.Service", TinyIoCExtensions.RegisterOptions.AsSingleton, TinyIoCExtensions.RegisterTypes.AsInterfaceTypes);
      container.RegisterInterfaceImplementations("MFilesImporter.Factory", TinyIoCExtensions.RegisterOptions.AsSingleton, TinyIoCExtensions.RegisterTypes.AsInterfaceTypes);

      var program = container.Resolve<Program>();
      return program.Run();
    }
コード例 #2
0
ファイル: EntryPoint.cs プロジェクト: 8/CopyOnChange
    static int Main(string[] args)
    {
      var container = new TinyIoC.TinyIoCContainer();
      container.RegisterInterfaceImplementations("CopyOnChange");
      container.RegisterInterfaceImplementations("CopyOnChange.Factory");

      var program = container.Resolve<IProgram>();
      try { return program.Run(args); }
      catch (Exception ex)
      {
        Console.WriteLine("The following error occurred:{0}{1}", Environment.NewLine, ex);
        return 1;
      }
    }
コード例 #3
0
ファイル: EntryPoint.cs プロジェクト: Deeptwix/MFilesDeleter
        static int Main(string[] args)
        {
            TinyIoC.TinyIoCContainer container = new TinyIoC.TinyIoCContainer();
            container.Register <ArgumentsModel>(new ArgumentsModel(args));
            container.RegisterInterfaceImplementations("MFilesDeleter.Service", TinyIoCExtensions.RegisterOptions.AsSingleton, TinyIoCExtensions.RegisterTypes.AsInterfaceTypes);
            container.RegisterInterfaceImplementations("MFilesDeleter.Factory", TinyIoCExtensions.RegisterOptions.AsSingleton, TinyIoCExtensions.RegisterTypes.AsInterfaceTypes);

            try
            {
                var program = container.Resolve <Program>();
                return(program.Run());
            }
            catch (Exception ex)
            {
                Console.WriteLine(string.Format("The following error occurred:{0}{1}", ex, Environment.NewLine));
                return(1);
            }
        }
コード例 #4
0
ファイル: EntryPoint.cs プロジェクト: 8/MFilesDeleter
        static int Main(string[] args)
        {
            TinyIoC.TinyIoCContainer container = new TinyIoC.TinyIoCContainer();
              container.Register<ArgumentsModel>(new ArgumentsModel(args));
              container.RegisterInterfaceImplementations("MFilesDeleter.Service", TinyIoCExtensions.RegisterOptions.AsSingleton, TinyIoCExtensions.RegisterTypes.AsInterfaceTypes);
              container.RegisterInterfaceImplementations("MFilesDeleter.Factory", TinyIoCExtensions.RegisterOptions.AsSingleton, TinyIoCExtensions.RegisterTypes.AsInterfaceTypes);

              try
              {
            var program = container.Resolve<Program>();
            return program.Run();
              }
              catch (Exception ex)
              {
            Console.WriteLine(string.Format("The following error occurred:{0}{1}", ex, Environment.NewLine));
            return 1;
              }
        }