示例#1
0
        internal static void Main()
        {
            //***************************************
            System.Windows.Forms.Application.EnableVisualStyles();

            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
            //***************************************

            //***************************************
            Infrastructure.BaseForm startupForm = new StartupForm();

            System.Windows.Forms.Application.Run(mainForm: startupForm);
            //***************************************

            //***************************************
            if ((startupForm is null) == false)
            {
                if (startupForm.IsDisposed is false)
                {
                    startupForm = null;
                    startupForm.Dispose();
                }
            }
            //***************************************
        }
示例#2
0
 private void InitializeComponents()
 {
     Service          = FSCore.Service;
     StartupForm      = new StartupForm();
     ProgressForm     = new ProgressForm();
     BackgroundWorker = new BackgroundWorker();
 }
示例#3
0
        private void GoBackToStartupFormButton_Click(object sender, EventArgs e)
        {
            void OpenStartupForm()
            {
                this.Hide();

                var startupForm = new StartupForm();

                startupForm.Closed += (s, args) => this.Close();

                startupForm.Show();
            }

            bool anyChangesMade = CheckIfAnyChangesMade();

            if (anyChangesMade)
            {
                CommonFormService.ShowConfirmAction(
                    "Grįžti atgal",
                    "Ar tikrai norite grįžti į pradžios formą ? (neišaugoti pakeitimai bus atšaukti)",
                    OpenStartupForm);
            }
            else
            {
                OpenStartupForm();
            }
        }
示例#4
0
 /// <summary>
 /// Construct the OptimisationForm
 /// </summary>
 public OptimisationForm(StartupForm startupForm)
 {
     InitializeComponent();
     Presenter     = new OptimisationPresenter(this, startupForm);
     SettingsForm  = new OptimisationSettingsForm();
     RunForm       = new OptimisationRunForm();
     CompletedForm = new OptimisationCompletedForm();
 }
 public OptimisationPresenter(IOptimisationForm view, StartupForm startForm)
 {
     _view = view;
     _view.RunOptimisation     += delegate(object sender, EventArgs e) { RunOptimisation(); };
     _view.CancelOptimisation  += delegate(object sender, EventArgs e) { CancelOptimisation(); };
     _view.VisualiseTrajectory += delegate(object sender, EventArgs e) { VisualiseTrajectory(); };
     _view.SaveTrajectory      += delegate(object sender, EventArgs e) { SaveTrajectory(); };
     _startForm = startForm;
 }
        private void StartDifferentTestButton_Click(object sender, EventArgs e)
        {
            this.Hide();

            var startupForm = new StartupForm();

            startupForm.Closed += (s, args) => this.Close();

            startupForm.Show();
        }
示例#7
0
        private void GetBackToStartupForm()
        {
            this.Hide();

            var startupForm = new StartupForm();

            startupForm.Closed += (s, args) => this.Close();

            startupForm.Show();
        }
示例#8
0
        public KFlearningApplicationContext(ITelemetryService telemetryService, StartupForm form, ILogger logger)
        {
            _mainForm = form;
            _logger   = logger;

            _logger.Info("Sending telemetry");
            Task.Run(() => telemetryService.Load());

            _mainForm.HandleDestroyed += OnFormDestroy;
            _mainForm.Show();
        }
示例#9
0
        public KFmaintenanceApplicationContext(ITelemetryService telemetryService, StartupForm form)
        {
            _telemetry = telemetryService;
            _mainForm  = form;

            Task.Run(() => _telemetry.Load());

            _mainForm.HandleDestroyed += OnFormDestroy;
            _mainForm.Opacity          = 0;
            _mainForm.Show();
            _mainForm.Hide();
            _mainForm.Opacity = 1;
        }
示例#10
0
        public OpenDb(StartupForm startupForm)
        {
            InitializeComponent();

            _startupForm = startupForm;
        }
示例#11
0
 public ConnectDialogMenuItem(ControlEventQueue dispatcher, PresenterModel model)
 {
     this.Text      = "Launch Connection Dialog...";
     this.m_Startup = new StartupForm(model, dispatcher);
     this.m_Model   = model;
 }
示例#12
0
        /// <summary>
        /// This constructor is for the case where the app is started normally (not as a CXP capability).
        /// </summary>
        /// <param name="loader"></param>
        /// <param name="model"></param>
        public ViewerForm(DeckMarshalService loader, PresenterModel model)
        {
            Trace.WriteLine("Start ViewerForm Ctor");
            this.SuspendLayout();
            this.m_EventQueue = new ControlEventQueue(this);

            this.m_Model   = model;
            this.m_Marshal = loader;

            UpdateTitle();

            FontSetting();

            this.Font = ViewerStateModel.FormFont;
            this.Name = "ViewerForm";

            //Retrieve the icon
            System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly();
            Trace.WriteLine("Get Icon");

            this.Icon = new Icon(thisExe.GetManifestResourceStream("UW.ClassroomPresenter.Presenter.ico"));

            this.StartPosition = FormStartPosition.Manual;
            this.loadRegSettings();
            this.MinimumSize = new Size(440, 330);

            Menus.FileMenu.CloseFormDelegate cfd = new UW.ClassroomPresenter.Viewer.Menus.FileMenu.CloseFormDelegate(this.Close);
            this.Menu = new Menus.ViewerMainMenu(this.m_EventQueue, this.m_Model, loader, cfd);

            Trace.WriteLine("Create tool bars");

            this.m_MainToolBars = new MainToolBars(this.m_Model, this.m_EventQueue);
            //this.m_ClassroomBrowser = new AutoDisplayClassroomsBrowser(this.m_Model);
            Trace.WriteLine("Make StartupForm");

            this.m_StartupForm = new StartupForm(this.m_Model, this.m_EventQueue);
            Trace.WriteLine("Make ViewerPresentationLayout");

            this.m_PresentationLayout = new ViewerPresentationLayout(this.m_Model);

            //this.m_ClassroomBrowser.Dock = DockStyle.Fill;
            this.m_PresentationLayout.Dock = DockStyle.Fill;

            this.Controls.Add(this.m_PresentationLayout);

            // Hack: toggle the second monitor to make it scale correctly when using Surface Pro 3.
            // Bounds need to be set after the ViewerPresentationLayout control is added,
            // Otherwise DPI scaling appears to be done incorrectly.  This issue so far
            // appears to be unique to the Surface Pro 3.
            using (Synchronizer.Lock(model.ViewerState.SyncRoot)) {
                if (model.ViewerState.SecondMonitorEnabled)
                {
                    model.ViewerState.SecondMonitorEnabled = false;
                    model.ViewerState.SecondMonitorEnabled = true;
                }
            }

            //this.Controls.Add(this.m_ClassroomBrowser);
            this.m_StartupForm.Visible = false;

            this.Controls.Add(this.m_MainToolBars.m_MainToolBar);
            this.Controls.Add(this.m_MainToolBars.m_MainClassmateToolBar);
            this.Controls.Add(this.m_MainToolBars.m_ExtraClassmateToolBar);

            this.ResumeLayout(false);

            Trace.WriteLine("Make KeyEventHandler");

            this.KeyDown   += new KeyEventHandler(this.OnKeyDown);
            this.KeyPreview = true;

            ///add listeners for HumanName, Role, Stylus properties
            role_listener_       = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.ParticipantRoleChanged));
            stylus_listener_     = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.StylusChanged));
            instructor_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.InstructorChanged));


            this.m_Model.Participant.Changed["Role"].Add(role_listener_.Dispatcher);
            this.m_Model.Changed["Stylus"].Add(stylus_listener_.Dispatcher);
            this.m_Model.Network.Changed["Association"].Add(instructor_listener_.Dispatcher);

            //Add listener for the version exchange warning pop-up
            this.m_VersionExchangePopUpListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.PopUpWarningHandler));
            this.m_Model.VersionExchange.Changed["PopUpWarningMessage"].Add(m_VersionExchangePopUpListener.Dispatcher);

            Trace.WriteLine("Make EventDispatcher");

            //Add listener for NetworkStatus
            m_NetworkStatusListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.NetworkStatusChanged));
            this.m_Model.Network.Changed["NetworkStatus"].Add(m_NetworkStatusListener.Dispatcher);

            Trace.WriteLine("Make FullScreenAdapter");

            this.m_FullScreenAdapter = new FullScreenAdapter(this.m_Model, this.m_PresentationLayout);

            instructor_listener_.Dispatcher(this, null);
            role_listener_.Dispatcher(this, null);
            stylus_listener_.Dispatcher(this, null);

            this.Activated   += this.ShowStartup;
            this.FormClosing += this.SaveClose;

            //Store local DPI settings which are used to make sure ink is scaled correctly.
            using (Graphics g = this.CreateGraphics()) {
                ViewerStateModel.SetLocalDpi(g.DpiX, g.DpiY);
            }
            Trace.WriteLine("ViewerForm Ctor done.");
        }
示例#13
0
 /// <summary>
 /// Construct the VisualisationForm
 /// </summary>
 public VisualisationForm(StartupForm startupForm)
 {
     InitializeComponent();
     StartupForm = startupForm;
 }
示例#14
0
文件: Viewer.cs 项目: xaccc/CP3
        /// <summary>
        /// This constructor is for the case where the app is started normally (not as a CXP capability).
        /// </summary>
        /// <param name="loader"></param>
        /// <param name="model"></param>
        public ViewerForm(DeckMarshalService loader, PresenterModel model)
        {
            Trace.WriteLine("Start ViewerForm Ctor");
            this.SuspendLayout();
            this.m_EventQueue = new ControlEventQueue(this);

            this.m_Model   = model;
            this.m_Marshal = loader;

            UpdateTitle();

            FontSetting();

            this.Font = ViewerStateModel.FormFont;
            this.Name = "ViewerForm";

            //Retrieve the icon
            System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly();
            Trace.WriteLine("Get Icon");

            this.Icon = new Icon(thisExe.GetManifestResourceStream("UW.ClassroomPresenter.Presenter.ico"));

            // The form should fill 5/6 of the screen by default.
            // FIXME: Load/Store previous window size from/in the registry.
            this.Size = new Size(SystemInformation.WorkingArea.Size.Width * 5 / 6,
                                 SystemInformation.WorkingArea.Size.Height * 5 / 6);
            // the form should be no smaller than 1/2 it's original size
            this.MinimumSize = new Size(this.Size.Width / 2, this.Size.Height / 2);

            Menus.FileMenu.CloseFormDelegate cfd = new UW.ClassroomPresenter.Viewer.Menus.FileMenu.CloseFormDelegate(this.Close);
            this.Menu = new Menus.ViewerMainMenu(this.m_EventQueue, this.m_Model, loader, cfd);

            Trace.WriteLine("Create tool bars");

            this.m_MainToolBars = new MainToolBars(this.m_Model, this.m_EventQueue);
            //this.m_ClassroomBrowser = new AutoDisplayClassroomsBrowser(this.m_Model);
            Trace.WriteLine("Make StartupForm");

            this.m_StartupForm = new StartupForm(this.m_Model, this.m_EventQueue);
            Trace.WriteLine("Make ViewerPresentationLayout");

            this.m_PresentationLayout = new ViewerPresentationLayout(this.m_Model);

            //this.m_ClassroomBrowser.Dock = DockStyle.Fill;
            this.m_PresentationLayout.Dock = DockStyle.Fill;

            this.Controls.Add(this.m_PresentationLayout);
            //this.Controls.Add(this.m_ClassroomBrowser);
            this.m_StartupForm.Visible = false;

            this.Controls.Add(this.m_MainToolBars.m_MainToolBar);
            this.Controls.Add(this.m_MainToolBars.m_MainClassmateToolBar);
            this.Controls.Add(this.m_MainToolBars.m_ExtraClassmateToolBar);

            this.ResumeLayout(false);

            Trace.WriteLine("Make KeyEventHandler");

            this.KeyDown   += new KeyEventHandler(this.OnKeyDown);
            this.KeyPreview = true;

            ///add listeners for HumanName, Role, Stylus properties
            role_listener_       = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.ParticipantRoleChanged));
            stylus_listener_     = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.StylusChanged));
            instructor_listener_ = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.InstructorChanged));


            this.m_Model.Participant.Changed["Role"].Add(role_listener_.Dispatcher);
            this.m_Model.Changed["Stylus"].Add(stylus_listener_.Dispatcher);
            this.m_Model.Network.Changed["Association"].Add(instructor_listener_.Dispatcher);

            //Add listener for the version exchange warning pop-up
            this.m_VersionExchangePopUpListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.PopUpWarningHandler));
            this.m_Model.VersionExchange.Changed["PopUpWarningMessage"].Add(m_VersionExchangePopUpListener.Dispatcher);

            Trace.WriteLine("Make EventDispatcher");

            //Add listener for NetworkStatus
            m_NetworkStatusListener = new EventQueue.PropertyEventDispatcher(this.m_EventQueue, new PropertyEventHandler(this.NetworkStatusChanged));
            this.m_Model.Network.Changed["NetworkStatus"].Add(m_NetworkStatusListener.Dispatcher);

            Trace.WriteLine("Make FullScreenAdapter");

            this.m_FullScreenAdapter = new FullScreenAdapter(this.m_Model, this.m_PresentationLayout);

            instructor_listener_.Dispatcher(this, null);
            role_listener_.Dispatcher(this, null);
            stylus_listener_.Dispatcher(this, null);

            this.Activated   += this.ShowStartup;
            this.FormClosing += this.SaveClose;

            //Store local DPI settings which are used to make sure ink is scaled correctly.
            using (Graphics g = this.CreateGraphics()) {
                ViewerStateModel.SetLocalDpi(g.DpiX, g.DpiY);
            }
            Trace.WriteLine("ViewerForm Ctor done.");
        }
示例#15
0
 private void CloseStartupForm(object sender, ISortParams e)
 {
     StartupForm.Hide();
 }