Example #1
0
        void Page_Loaded(object sender, RoutedEventArgs e)
        {
            Storyboard fadeInStoryBoard = (Storyboard)FindName("FadeInStoryBoard");
            fadeInStoryBoard.Begin();

            _notificationPresenter = new NotificationPresenter(NotificationControl);
            _notificationPresenter.ShowNotification("Loaded Okay!");

            _loadingPresenter = new LoadingPresenter(LoadingControl);

            _optionsPresenter  = new OptionsPresenter(OptionsControl);
            _optionsPresenter.ClearBookWeb += new EventHandler(_optionsPresenter_ClearBookWeb);
            _optionsPresenter.Help += new EventHandler(_optionsPresenter_Help);
            _optionsPresenter.TextBookSearch += new EventHandler(_optionsPresenter_TextBookSearch);

            _bookDetailPresenter = new BookDetailPresenter(DetailControl);
            _bookDetailPresenter.Hidden += new Tarantula.MVP.Events.BookEventHandler(_bookDetailPresenter_Hidden);

            _helpPresenter = new HelpPresenter(new HelpControl());

            _textSearchPresenter = new TextSearchPresenter(new TextSearchControl());
            _textSearchPresenter.StartSearch += new Tarantula.MVP.Events.TextSearchEventHandler(_textSearchPresenter_StartSearch);

            _bookWebPresenter= new BookWebPresenter(bookWebControl);
            _bookWebPresenter.OnLoadingBooks += new EventHandler(_bookWebPresenter_OnLoadingBooks);
            _bookWebPresenter.OnFinishedLoadingBooks += new EventHandler(_bookWebPresenter_OnFinishedLoadingBooks);
            _bookWebPresenter.OnLoadingBooksError += new Tarantula.MVP.Events.BookWebNotificationHandler(_bookWebPresenter_OnLoadingBooksError);
            _bookWebPresenter.ShowBookDetails += new Tarantula.MVP.Events.BookEventHandler(_bookWebPresenter_ShowBookDetails);
            _bookWebPresenter.SearchResultsSummary += new Tarantula.MVP.Events.BookWebNotificationHandler(_bookWebPresenter_SearchResultsSummary);
        }
    private void SetNPCHead()
    {
        OptionsPresenter optionsPresenter = GetComponent <OptionsPresenter>();
        Image            image            = optionsPresenter.DialogUI.transform.Find("NPCHeadImage").GetComponent <Image>();

        image.sprite = CharacterHeadSprite;
    }
Example #3
0
        public DialogResult ShowView()
        {
            _ViewModel = new ViewModel(this);
            _Presenter = new OptionsPresenter();
            _Presenter.Initialise(this);

            return(DialogResult.OK);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="OptionsForm" /> class.
        /// </summary>
        /// <param name="settingsService">The settings service.</param>
        public OptionsForm(ISettingsService settingsService)
        {
            this.InitializeComponent();

            this.presenter = new OptionsPresenter(this, settingsService);

            this.presenter.LoadSettings();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="OptionsForm" /> class.
        /// </summary>
        /// <param name="displayLogo">if set to <c>true</c> [display logo].</param>
        public OptionsForm(bool displayLogo)
        {
            this.InitializeComponent();

            this.presenter = new OptionsPresenter(this, displayLogo);

            this.presenter.LoadSettings();
        }
Example #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OptionsForm"/> class.
        /// </summary>
        public OptionsForm()
        {
            this.InitializeComponent();

            this.presenter = new OptionsPresenter(this);

            this.presenter.LoadSettings();
        }
Example #7
0
 public frmOptions()
 {
     InitializeComponent();
     this.presenter = new OptionsPresenter(this);
     this.cursorHighlightOptions = new CursorHighlightOptions();
     this.chdHighlight.Control   = this.cursorHighlightOptions;
     this.watermarkOptions       = new WatermarkOptions();
     this.chdWatermark.Control   = this.watermarkOptions;
 }
Example #8
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!DesignMode)
            {
                PluginLocalise.Form(this);
                fileNameDatabase.BrowserTitle = PluginStrings.SelectDatabaseFile;

                _Presenter = new OptionsPresenter();
                _Presenter.Initialise(this);

                AddControlBinder(new CheckBoxBoolBinder <OptionsView>(this, checkBoxEnabled, r => r.PluginEnabled, (r, v) => r.PluginEnabled = v));
                AddControlBinder(new CheckBoxBoolBinder <OptionsView>(this, checkBoxOnlyUpdateDatabasesCreatedByPlugin, r => !r.AllowUpdateOfOtherDatabases, (r, v) => r.AllowUpdateOfOtherDatabases = !v)
                {
                    ModelPropertyName = nameof(OptionsView.AllowUpdateOfOtherDatabases)
                });
                AddControlBinder(new CheckBoxBoolBinder <OptionsView>(this, checkBoxWriteOnlineLookupsToDatabase, r => r.SaveDownloadedAircraftDetails, (r, v) => r.SaveDownloadedAircraftDetails = v)
                {
                    UpdateMode = DataSourceUpdateMode.OnPropertyChanged,
                });
                AddControlBinder(new CheckBoxBoolBinder <OptionsView>(this, checkBoxRefreshOutOfDateAircraft, r => r.RefreshOutOfDateAircraft, (r, v) => r.RefreshOutOfDateAircraft = v)
                {
                    UpdateMode = DataSourceUpdateMode.OnPropertyChanged,
                });

                AddControlBinder(new FileNameStringBinder <OptionsView>(this, fileNameDatabase, r => r.DatabaseFileName, (r, v) => r.DatabaseFileName = v));

                AddControlBinder(new ComboBoxBinder <OptionsView, CombinedFeed, int>(this, comboBoxReceiverId, CombinedFeeds, r => r.ReceiverId, (r, v) => r.ReceiverId = v)
                {
                    GetListItemDescription = r => r.Name,
                    GetListItemValue       = r => r.UniqueId,
                });

                AddControlBinder(new LabelStringBinder <OptionsView>(this, labelWriteOnlineLookupsNotice, r => r.OnlineLookupWriteActionNotice, (r, v) => r.OnlineLookupWriteActionNotice = v));

                InitialiseControlBinders();
                EnableDisableControls();
            }
        }
Example #9
0
        public void Initalize_Sets_URL_On_View()
        {
            MockRepository      repo                   = new MockRepository();
            IOptionsView        mockOptionsView        = repo.StrictMock <IOptionsView>();
            ISettingsOriginator mockSettingsOriginator = repo.StrictMock <ISettingsOriginator>();
            ISettingsMemento    mockSettingsMemento    = repo.StrictMock <ISettingsMemento>();
            ISetting            urlSetting             = repo.StrictMock <ISetting>();
            ISetting            userNameSetting        = repo.StrictMock <ISetting>();
            ISetting            passwordSetting        = repo.StrictMock <ISetting>();
            string url      = "http://www.google.com";
            string userName = "******";
            string password = "******";

            urlSetting.Expect(set => set.Value).Return(url);
            userNameSetting.Expect(set => set.Value).Return(userName);
            passwordSetting.Expect(set => set.Value).Return(password);

            mockSettingsOriginator.Expect(org => org.Get("TrackerURL")).Return(urlSetting);
            mockSettingsOriginator.Expect(org => org.Get("UserName")).Return(userNameSetting);
            mockSettingsOriginator.Expect(org => org.Get("Password")).Return(passwordSetting);
            mockSettingsOriginator.Expect(org => org.GetMemento()).Return(mockSettingsMemento);


            mockOptionsView.Expect(view => view.URL).SetPropertyWithArgument(url);
            mockOptionsView.Expect(view => view.UserName).SetPropertyWithArgument(userName);
            mockOptionsView.Expect(view => view.Password).SetPropertyWithArgument(password);

            repo.ReplayAll();

            IOptionsPresenter pres = new OptionsPresenter(mockOptionsView, mockSettingsOriginator);

            pres.Initalize();

            mockOptionsView.VerifyAllExpectations();
            mockSettingsOriginator.VerifyAllExpectations();
            urlSetting.VerifyAllExpectations();
        }
Example #10
0
 public frmOptions()
 {
     InitializeComponent();
     this.presenter    = new OptionsPresenter(this);
     this.windowFinder = new WindowFinder();
 }