Search Results

Search found 2 results on 1 pages for 'jacksonakj'.

Page 1/1 | 1 

  • "Illegal characters in path." Visual Studio WinForm Design View

    - by jacksonakj
    I am putting together a lightweight MVP pattern for a WinForms project. Everything compiles and runs fine. However when I attempt to open the WinForm in design mode in Visual Studio I get a "Illegal characters in path" error. My WinForm is using generics and inheriting from a base Form class. Is there a problem with using generics in a WinForm? Here is the WinForm and base Form class. public partial class TapsForm : MvpForm<TapsPresenter, TapsFormModel>, ITapsView { public TapsForm() { InitializeComponent(); } public TapsForm(TapsPresenter presenter) :base(presenter) { InitializeComponent(); UpdateModel(); } public IList<Taps> Taps { set { gridTaps.DataSource = value; } } private void UpdateModel() { Model.RideId = Int32.Parse(cboRide.Text); Model.Latitude = Double.Parse(txtLatitude.Text); Model.Longitude = Double.Parse(txtLongitude.Text); } } Base form MvpForm: public class MvpForm<TPresenter, TModel> : Form, IView where TPresenter : class, IPresenter where TModel : class, new() { private readonly TPresenter presenter; private TModel model; public MvpForm() { } public MvpForm(TPresenter presenter) { this.presenter = presenter; this.presenter.RegisterView(this); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (presenter != null) presenter.IntializeView(); } public TModel Model { get { if (model == null) throw new InvalidOperationException("The Model property is currently null, however it should have been automatically initialized by the presenter. This most likely indicates that no presenter was bound to the control. Check your presenter bindings."); return model; } set { model = value;} } }

    Read the article

  • Unit test for Web Forms MVP presenter has a null Model

    - by jacksonakj
    I am using Web Forms MVP to write an DotNetNuke user control. When the 'SubmitContactUs' event is raised in my unit test the presenter attempts to set the 'Message' property on the Modal. However the View.Modal is null in the presenter. Shouldn't the Web Forms MVP framework automatically build a new View.Model object in the presenter? It could be that the 'Arrange' portion of my test is missing something that the presenter needs. Any help would be appreciated. Here is my test: using System; using AthleticHost.ContactUs.Core.Presenters; using AthleticHost.ContactUs.Core.Views; using Xunit; using Moq; namespace AthleticHost.ContactUs.Tests { public class ContactUsPresenterTests { [Fact] public void ContactUsPresenter_Sets_Message_OnSubmit() { // Arrange var view = new Mock<IContactUsView>(); var presenter = new ContactUsPresenter(view.Object); // Act view.Raise(v => v.Load += null, new EventArgs()); view.Raise(v => v.SubmitContactUs += null, new SubmitContactUsEventArgs("Chester", "Tester", "[email protected]", "http://www.test.com", "This is a test of the emergancy broadcast system...")); presenter.ReleaseView(); // Assert Assert.Contains("Chester Tester", view.Object.Model.Message); } } }

    Read the article

1