public void TestDrawingPresentationModel()
        {
            var drawingPresentationModel = new DrawingPresentationModel();
            var target = new PrivateObject(drawingPresentationModel);

            Assert.IsNotNull(target.GetFieldOrProperty(MEMBER_VARIABLE_NAME_BUTTON_ENABLED_STATES_MANAGER));
        }
 public void Initialize()
 {
     _drawingPresentationModel = new DrawingPresentationModel();
     _target = new PrivateObject(_drawingPresentationModel);
     _buttonEnabledStatesManager = new ButtonEnabledStatesManagerMock();
     _target.SetFieldOrProperty(MEMBER_VARIABLE_NAME_BUTTON_ENABLED_STATES_MANAGER, _buttonEnabledStatesManager);
 }
Ejemplo n.º 3
0
 /// <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()
 {
     this.InitializeComponent();
     this.Suspending          += OnSuspending;
     _drawingPresentationModel = new DrawingPresentationModel();
     _model = new Model();
     _drawingPageNavigationEventArgumentsParameter = new DrawingPageNavigationEventArgumentsParameter(_drawingPresentationModel, _model);
 }
 /// <summary>
 /// Initializes this instance.
 /// </summary>
 private void Initialize(DrawingPresentationModel drawingPresentationModelData, Model modelData)
 {
     _drawingPresentationModel = drawingPresentationModelData;
     _model           = modelData;
     _graphicsAdapter = new DrawingPageGraphicsAdapter(_canvas);
     // Observers
     SubscribeEvents();
     // UI
     SubscribeViewEvents();
     // Initial UI States
     _drawingPresentationModel.Initialize();
     UpdateUndoRedoButtonEnabledStates();
     _canvas.Loaded += (sender, eventArguments) => _model.Initialize(_canvas.ActualWidth, _canvas.ActualHeight, ShapeDrawerType.None); // The actual width and height of the canvas can only be determined after it is completely loaded.
 }
 public DrawingForm(DrawingPresentationModel drawingPresentationModelData, Model modelData)
 {
     InitializeComponent();
     _drawingPresentationModel = drawingPresentationModelData;
     _model         = modelData;
     this.Disposed += RemoveEvents;
     // Observers
     SubscribeEvents();
     // UI
     SubscribeViewEvents();
     // Initial UI States
     _drawingPresentationModel.Initialize();
     UpdateUndoRedoButtonEnabledStates();
     _model.Initialize(_canvas.Size.Width, _canvas.Size.Height, ShapeDrawerType.None);
 }
Ejemplo n.º 6
0
 public DrawingPageNavigationEventArgumentsParameter(DrawingPresentationModel drawingPresentationModelData, Model modelData)
 {
     DrawingPresentationModel = drawingPresentationModelData;
     Model = modelData;
 }