Beispiel #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var isDebug = ParseArgs(e.Args, out var map, out var ants);
            var main    = new StartupWindow(map, ants, isDebug);

            main.Show();
        }
        public MainWindowViewModel(
            )     //
        {
            var startupWindow = new StartupWindow();

            startupWindow.Show();
            try
            {
                InitializeDatabase();
                LoadFromDB();
                InitializeFolder();
                //InitializeTempFileFolder();
                CreateProcesserForTesters();
                CreateViewModels();
                //以下三个函数只用调用一次即可
                //UpdateStatus();
                //UpdateTime();
                //UpdateEditable();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            finally
            {
                startupWindow.Close();
            }
        }
Beispiel #3
0
        public MainWindow()
        {
            InitializeComponent();

            var dispatcher = System.Windows.Application.Current.MainWindow.Dispatcher;

            Panel parentPanel = (Panel)menuFile.Parent;

            parentPanel.Children.Remove(menuFile);
            expander.Content = menuFile;

            eventHandlerRenamed = (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { Task_TaskRenamed(sender, args); }));
            eventHandlerDescriptionChanged = (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { Task_TaskDescriptionChanged(sender, args); }));
            eventHandlerDateDueChanged = (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { Task_TaskDateDueChanged(sender, args); }));

            sideWindowControls = new Control[] { textBoxTaskName, textBoxTaskDescription, datePickerDue, toggleButtonFolder };
            SideWindowEnable(false);

            webClient = new TaskWebClient(tasks);
            webClient.RecievedTasks += (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { HandleTasksRecieve(sender, args); }));
            webClient.RecievedTask += (sender, args) => dispatcher.BeginInvoke(
                new Action(() => { HandleTaskRecieve(sender, args); }));
            webClient.Connect("185.16.95.101");

            gridSplitter.DragDelta += SplitterNameDragDelta;

            //If firsttime setup
            StartupWindow startupWindow = new StartupWindow();

            startupWindow.Show();
        }
Beispiel #4
0
        IEnumerator Start()
        {
            /* Create a window container */
            WindowContainer winContainer = WindowContainer.Create("MAIN");

            yield return(null);

            IUIViewLocator locator = Context.GetApplicationContext().GetService <IUIViewLocator>();
            StartupWindow  window  = locator.LoadWindow <StartupWindow>(winContainer, "UI/Startup.prefab");

            window.Create();
            ITransition transition = window.Show().OnStateChanged((w, state) =>
            {
                //log.DebugFormat("Window:{0} State{1}",w.Name,state);
            });

            yield return(transition.WaitForDone());


            //ApplicationContext context = ApplicationContext.GetApplicationContext();
            //ISession session = context.GetService<ISession>();
            //session.Send(10001, -1, new Login() { DriveId = "default" });

            //ApplicationContext context = Context.GetApplicationContext();
            //ISession session = context.GetService<ISession>();
            //session.Connect("127.0.0.1", 10001);
        }
Beispiel #5
0
        private void openForm_Click(object sender, RoutedEventArgs e)
        {
            StartupWindow startup = new StartupWindow();

            startup.Show();
            this.Close();
        }
Beispiel #6
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            StartupWindow startupWindow = new StartupWindow();

            startupWindow.Show();

            FilesControlObject      = new FilesControl();
            SettingsControlObject   = new SettingsControl();
            PlayerControlObject     = new PlayerControl();
            UserRatingControlObject = new UserRatingControl();

            SV_MainDisplay.Content = FilesControlObject;
            MakeButtonPressedOnLeft(Button_FileControl);
            await WarmupMediaInfoEngine();
            await SearchForVLCDLL();
            await LoadUserSettings();

            startupWindow.Close();

            if (WindowState == WindowState.Minimized)
            {
                WindowState = WindowState.Normal;
            }

            Activate();
        }
Beispiel #7
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form w = new StartupWindow();

            w.Show();
            Application.Run();
        }
Beispiel #8
0
        private void App_OnStartup(object sender, StartupEventArgs e)
        {
            StaticMessageBoxSpawner.Spawner = new WpfMessageBoxSpawner();
            StaticUiUpdateNotifier.Notifier = new WpfUiUpdateNotifier();
            var clipboard = new WpfClipboard();

            var startWindow = new StartupWindow {
                ApplicationName = "File uploader"
            };

            startWindow.Show();
            var apiConfiguration = new ApiConfiguration(
                Settings.Default.ApiServerAddress,
                Settings.Default.ApiServerPort);
            var dataApiClient = new DataApiClient(apiConfiguration);

            if (!dataApiClient.IsAvailable())
            {
                MessageBox.Show($"Cannot contact DataAPI @ '{apiConfiguration.ServerAddress}:{apiConfiguration.ServerPort}'. Shutting down...");
                Current.Shutdown(-1);
                return;
            }
            try
            {
                dataApiClient.Login();
            }
            catch
            {
                // Ignore. If Active Directory is not available, in some other way later.
            }

            var imageDatabase                 = new GenericDatabase <Image>(dataApiClient);
            var shortIdDatabase               = new GenericDatabase <ShortId>(dataApiClient);
            var dataSetDatabase               = new GenericDatabase <DataSet>(dataApiClient);
            var tagDatabase                   = new GenericDatabase <DataTag>(dataApiClient);
            var projectDatabase               = new GenericDatabase <DataProject>(dataApiClient);
            var protocolDatabase              = new GenericDatabase <DataCollectionProtocol>(dataApiClient);
            var protocolParameterDatabase     = new GenericDatabase <DataCollectionProtocolParameter>(dataApiClient);
            var dataBlobDatabase              = new GenericDatabase <DataBlob>(dataApiClient);
            var dataProjectUploadInfoDatabase = new GenericDatabase <DataProjectUploadInfo>(dataApiClient);

            var fileHandlers = new IFileHandler[]
            {
                new ImageFileHandler(imageDatabase)
            };
            var additionalInformationViewSpawner = new WpfAdditionalInformationViewSpawner();
            var fileManager = new UploadedFileProcessor(
                fileHandlers,
                dataApiClient,
                dataBlobDatabase,
                dataProjectUploadInfoDatabase,
                clipboard,
                additionalInformationViewSpawner);

            var mainWindow    = new MainWindow();
            var mainViewModel = new MainViewModel(
                mainWindow,
                dataApiClient,
                fileManager,
                dataSetDatabase,
                tagDatabase,
                projectDatabase,
                protocolDatabase,
                protocolParameterDatabase);

            mainWindow.ViewModel = mainViewModel;
            startWindow.Close();
            mainWindow.ShowDialog();
        }