コード例 #1
0
ファイル: Program.cs プロジェクト: peterchen/CodeBuilder
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                InitializeTraceLevel();

                AppContainer container = new AppContainer();
                MainForm form = new MainForm();
                container.Add(form);

                logger.Info("Starting CodeBuilder");
                Application.Run(form);
                logger.Info("CodeBuilder Exit");
            }
            catch (Exception ex)
            {
                logger.Error("Startup", ex);
                MessageBoxHelper.DisplayFailure(ex.Message);
            }

            InternalTrace.Close();
        }
コード例 #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public Windows8MailHelper()
        {
            AppList = PINetworkIsolationEnumAppContainers();
            AppListConfig = PINetworkIsolationGetAppContainerConfig();
            foreach (InetFirewallAppContainer PIApp in AppList)
            {
                AppContainer app = new AppContainer(PIApp.AppContainerName, PIApp.DisplayName, PIApp.WorkingDirectory, PIApp.AppContainerSid);

                List<SidAndAttributes> AppCapabilities = GetCapabilites(PIApp.Capabilities);

                app.LoopbackEnabled = CheckLoopback(PIApp.AppContainerSid);
                Apps.Add(app);
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: peterchen/gaopincai
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                AppContainer container = new AppContainer();
                MainForm form = new MainForm();
                container.Add(form);

                //Logger.Instance.Write("程序启动", LogLevel.Info);
                Application.Run(form);
                //Logger.Instance.Write("程序退出", LogLevel.Info);
            }
            catch (Exception ex)
            {
                //Logger.Instance.Write(ex.ToString(), LogLevel.Error);
                MessageBoxHelper.DisplayFailure(ex.Message);
            }
        }
コード例 #4
0
ファイル: LoopbackUtil.cs プロジェクト: t-andre/Emby
        public void LoadApps()
        {
            Apps.Clear();
            _pACs = IntPtr.Zero;
            //Full List of Apps
            _AppList = PI_NetworkIsolationEnumAppContainers();
            //List of Apps that have LoopUtil enabled.
            _AppListConfig = PI_NetworkIsolationGetAppContainerConfig();
            foreach (var PI_app in _AppList)
            {
                AppContainer app = new AppContainer(PI_app.appContainerName, PI_app.displayName, PI_app.workingDirectory, PI_app.appContainerSid);

                var app_capabilities = LoopUtil.getCapabilites(PI_app.capabilities);
                if (app_capabilities.Count > 0)
                {
                    //var sid = new SecurityIdentifier(app_capabilities[0], 0);

                    IntPtr arrayValue = IntPtr.Zero;
                    //var b = LoopUtil.ConvertStringSidToSid(app_capabilities[0].Sid, out arrayValue);
                    //string mysid;
                    //var b = LoopUtil.ConvertSidToStringSid(app_capabilities[0].Sid, out mysid);
                }
                app.LoopUtil = CheckLoopback(PI_app.appContainerSid);
                Apps.Add(app);
            }
        }
コード例 #5
0
ファイル: Bootstrapper.cs プロジェクト: kennyup/Batman
 public override void Register <T>(T Object)
 {
     AppContainer.Register <T>(() => Object);
 }
コード例 #6
0
ファイル: Bootstrapper.cs プロジェクト: kennyup/Batman
 public override void Register <T>(Func <T> Function)
 {
     AppContainer.Register <T>(Function);
 }
コード例 #7
0
 protected override async void OnStart()
 {
     var navigationService = AppContainer.Resolve <INavigationService>();
     await navigationService.NavigateToAsync <SimpleDrumSequencerViewModel>();
 }
コード例 #8
0
ファイル: MainViewModel.cs プロジェクト: vaesniels/KahootQuiz
 public MainViewModel()
 {
     StudentQuizzesListViewModel = AppContainer.Resolve <StudentQuizzesListViewModel>();
     NavigationListViewModel     = AppContainer.Resolve <NavigationListViewModel>();
 }
コード例 #9
0
 public MealsHistoryView()
 {
     InitializeComponent();
     BindingContext = AppContainer.Resolve <MealHistoryViewModel>();
 }
コード例 #10
0
 public ShoppingBagView()
 {
     InitializeComponent();
     this.BindingContext = AppContainer.Resolve <ShoppingBagViewModel>();
 }
コード例 #11
0
        protected override void OnExit(ExitEventArgs e)
        {
            base.OnExit(e);

            AppContainer.Stop();
        }
コード例 #12
0
 public App()
 {
     AppContainer.Start();
 }
コード例 #13
0
ファイル: AppEntry.cs プロジェクト: stantoxt/nunitv2
        public static int Main(string[] args)
        {
            // Create SettingsService early so we know the trace level right at the start
            SettingsService settingsService = new SettingsService();

            InternalTrace.Initialize("nunit-gui_%p.log", (InternalTraceLevel)settingsService.GetSetting("Options.InternalTraceLevel", InternalTraceLevel.Default));

            log.Info("Starting NUnit GUI");

            GuiOptions guiOptions = new GuiOptions(args);

            GuiAttachedConsole attachedConsole = null;

            if (guiOptions.console)
            {
                log.Info("Creating attached console");
                attachedConsole = new GuiAttachedConsole();
            }

            if (guiOptions.help)
            {
                MessageDisplay.Display(guiOptions.GetHelpText());
                return(0);
            }

            if (!guiOptions.Validate())
            {
                string message = "Error in command line";
                MessageDisplay.Error(message + Environment.NewLine + Environment.NewLine + guiOptions.GetHelpText());
                log.Error(message);
                return(2);
            }

            if (guiOptions.cleanup)
            {
                log.Info("Performing cleanup of shadow copy cache");
                DomainManager.DeleteShadowCopyPath();
                return(0);
            }

            if (!guiOptions.NoArgs)
            {
                if (guiOptions.lang != null)
                {
                    log.Info("Setting culture to " + guiOptions.lang);
                    Thread.CurrentThread.CurrentUICulture =
                        new CultureInfo(guiOptions.lang);
                }
            }

            try
            {
                // Add Standard Services to ServiceManager
                log.Info("Adding Services");
                ServiceManager.Services.AddService(settingsService);
                ServiceManager.Services.AddService(new DomainManager());
                ServiceManager.Services.AddService(new RecentFilesService());
                ServiceManager.Services.AddService(new ProjectService());
                ServiceManager.Services.AddService(new TestLoader(new GuiTestEventDispatcher()));
                ServiceManager.Services.AddService(new AddinRegistry());
                ServiceManager.Services.AddService(new AddinManager());
                ServiceManager.Services.AddService(new TestAgency());

                // Initialize Services
                log.Info("Initializing Services");
                ServiceManager.Services.InitializeServices();
            }
            catch (Exception ex)
            {
                MessageDisplay.FatalError("Service initialization failed.", ex);
                log.Error("Service initialization failed", ex);
                return(2);
            }

            // Create container in order to allow ambient properties
            // to be shared across all top-level forms.
            log.Info("Initializing AmbientProperties");
            AppContainer      c       = new AppContainer();
            AmbientProperties ambient = new AmbientProperties();

            c.Services.AddService(typeof(AmbientProperties), ambient);

            log.Info("Constructing Form");
            NUnitForm form = new NUnitForm(guiOptions);

            c.Add(form);

            try
            {
                log.Info("Starting Gui Application");
                Application.Run(form);
                log.Info("Application Exit");
            }
            catch (Exception ex)
            {
                log.Error("Gui Application threw an excepion", ex);
                throw;
            }
            finally
            {
                log.Info("Stopping Services");
                ServiceManager.Services.StopAllServices();
            }

            if (attachedConsole != null)
            {
                Console.WriteLine("Press Enter to exit");
                Console.ReadLine();
                attachedConsole.Close();
            }

            log.Info("Exiting NUnit GUI");
            InternalTrace.Close();

            return(0);
        }
 public RegisterPage()
 {
     InitializeComponent();
     BindingContext = this.viewModel = new RegisterViewModel(AppContainer.Resolve <IBackendService>());
 }
コード例 #15
0
        public RoundOverviewPage()
        {
            InitializeComponent();

            viewModel = new RoundOverviewViewModel(AppContainer.Resolve <INavigationService>(), AppContainer.Resolve <IRoundRepository>());

            BindingContext = viewModel;
        }
コード例 #16
0
 public Handler(AppContainer appContainer)
 {
     _appContainer = appContainer;
 }
コード例 #17
0
ファイル: HomeView.xaml.cs プロジェクト: NielsVervloesem/kbc
 public HomeView()
 {
     InitializeComponent();
     BindingContext = AppContainer.Resolve <HomeViewModel>();
 }
コード例 #18
0
 private async Task InitializeNavigation()
 {
     //Resolve : casos em que eh necessario instancia, e nao ha injecao de dependencia no construtor(casos VM)
     var navigationService = AppContainer.Resolve <INavigationService>();
     await navigationService.InitializeAsync();// Inicia a pagina Inicial
 }
コード例 #19
0
 public PedidoController()
 {
     bll = AppContainer.ObterPedidoBLL();
 }
コード例 #20
0
ファイル: App.xaml.cs プロジェクト: kevintraets/myToddlerScan
 /// <summary>
 /// Initializes the singleton application object.  This is the first line of authored code
 /// executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     AppContainer.RegisterDependencies();
     this.InitializeComponent();
     this.Suspending += OnSuspending;
 }
コード例 #21
0
 public ScanResultView()
 {
     InitializeComponent();
     BindingContext = AppContainer.Resolve <ScanResultViewModel>();
 }
コード例 #22
0
        static void Main(string[] args)
        {
            AppContainer.ConfigureContainer();

            new EarthCalculatorUI().StartCalculation();
        }
コード例 #23
0
ファイル: LogHandlerUI.cs プロジェクト: Yurusalova/RJL.UIP.HW
 public LogHandlerUI()
 {
     FileStorage = AppContainer.Resolve <IFileStorage>();
 }
コード例 #24
0
 public MainWindow()
 {
     InitializeComponent();
     this.dbConnection = AppContainer.GetDatabaseConnection();
 }
コード例 #25
0
 private void InitializeApp()
 {
     AppContainer.RegisterDependencies();
 }
コード例 #26
0
        public QuestionOverviewPage()
        {
            InitializeComponent();

            viewModel = new QuestionOverviewViewModel(AppContainer.Resolve <IQuestionRepository>(), AppContainer.Resolve <IAnswerRepository>(), AppContainer.Resolve <IBackendService>());

            BindingContext = viewModel;
        }
コード例 #27
0
ファイル: Bootstrapper.cs プロジェクト: kennyup/Batman
 public override void Register <T>(string Name)
 {
     AppContainer.Register <T>();
 }
コード例 #28
0
        public RoundStartPage(int id = 0)
        {
            InitializeComponent();

            viewModel = new RoundStartViewModel(AppContainer.Resolve <INavigationService>(), AppContainer.Resolve <IBackendService>(), id);

            BindingContext = viewModel;
        }
コード例 #29
0
ファイル: Bootstrapper.cs プロジェクト: kennyup/Batman
 public override void Register <T>()
 {
     AppContainer.Register <T>();
 }
コード例 #30
0
 private async Task InitializeNavigation()
 {
     var navigationManager = AppContainer.Resolve <INavigationManager>();
     await navigationManager.InitializeAsync();
 }
コード例 #31
0
 private async void InitializeNavigation()
 {
     var _navigationService = AppContainer.Resolve <INavigationService>();
     await _navigationService.InitializeAsync();
 }
コード例 #32
0
ファイル: App.xaml.cs プロジェクト: arditmezini/api-core
        private void InitializeApp()
        {
            AppContainer.RegisterDependencies();

            RegisterDeviceInternetAlertCallback();
        }
コード例 #33
0
 public EmployeeHelpView()
 {
     InitializeComponent();
     BindingContext = AppContainer.Resolve <EmployeeHelpViewModel>();
 }
コード例 #34
0
 private void InitializeApp()
 {
     Akavache.Registrations.Start("TopMovies"); //Necessario para que akavache faca seu trabalho
     AppContainer.RegisterDependencies();       // Registro VM, Interfaces e Servicos
 }