Example #1
0
 public void TearDown()
 {
     _view = null;
     _model = null;
     _controller = null;
     _currentDirNodes = null;
     Directory.Delete(TestPath, true);
 }
Example #2
0
 public void SetUp()
 {
     _view = new MainWindow();
     _model = new BaconModel();
     _controller = new MainViewController(_model, _view);
     _currentDirNodes = new TreeView().Nodes;
     Directory.CreateDirectory(TestPath);
     //_model.ChangeDirectory(TestPath);
     var tp = new FileInfo(TestPath + TestFile);
     string test = "Push me" + Environment.NewLine + "And then just touch me" + Environment.NewLine +
                   "Till I can get my satisfaction" + Environment.NewLine +
                   "Satisfaction, satisfaction, satisfaction, satifaction";
     File.WriteAllText(tp.FullName, test);
 }
        /// <summary>
        /// Constructor that accepts a model.
        /// </summary>
        /// <param name="model"></param>
        /// <param name="contentType"></param>
        public MediaSelectionDialog(BaconModel model, ContentType contentType)
        {
            InitializeComponent();

            _model = model;
            _contentType = contentType;

            InitBasedOnContentType();

            BuildOpenImageDialog();
            BuildBrowseButton();
            BuildImageUrlTextbox();
            BuildOptions();
            BuildOkButton();
            BuildCancelButton();
        }
Example #4
0
        /// <summary>
        /// Constructor for the main form.
        /// </summary>
        public MainWindow()
        {
            font = new Font(Font.FontFamily, 20);
            // Initialise form controls.
            InitializeComponent();
            //txtX.Minimum = 0;
            //txtY.Minimum = 0;

            //sets tooltips for buttons
            var tooltip = new ToolTip();
            tooltip.SetToolTip(btnAddFile, "Creates a new blank html for the editor");
            tooltip.SetToolTip(btnPreview, "Displays the QR code linked to the currently selected file");
            tooltip.SetToolTip(btnRemoveFile, "Deletes the selected file from the editor");
            tooltip.SetToolTip(btnPrintPreview, "Displays the print preview of the QR codes");

            mapBox.ZoomChanged += MapZoomChanged;
            mapBox.MapCoordinateChanged += MapCoordinateChanged;

            // Event binding.
            tsbImage.Click += btnImage_Click;
            tsbAudio.Click += btnAudio_Click;
            tsbBold.Click += btnBold_Click;
            tsbItalics.Click += btnItalics_Click;
            btnPreview.Click += btnPreview_Click;

            printToolStripMenuItem.Click += btnPrintPreview_Click;
            exitToolStripMenuItem.Click += exitToolStripMenuItem_Click;
            listViewContents.SelectedIndexChanged += listViewContents_SelectedIndexChanged;

            Load += MainWindow_Load;

            // Initialise HTMLEditor.
            HTMLEditor.Navigate("about:blank");
            Debug.Assert(HTMLEditor.Document != null, "HTMLEditor.Document != null");
            HtmlDocument htmlDocument = HTMLEditor.Document.OpenNew(false);
            Debug.Assert(htmlDocument != null, "htmlDocument != null");
            htmlDocument.Write("<html><body></body></html>");
            var doc = HTMLEditor.Document.DomDocument as IHTMLDocument2;
            Debug.Assert(doc != null, "doc != null");
            doc.designMode = "on";
            HTMLEditor.Navigating += HTMLEditor_Navigating;

            // Initialise MVP objects.
            _model = new BaconModel();
            _controller = new MainViewController(_model, this);
        }
 public MainViewController(BaconModel model, IMainView view)
 {
     _model = model;
     _view = view;
     _view.EnableRequiredControls();
 }
 public PreviewController(BaconModel model, IPreviewView view)
 {
     _model = model;
     _view = view;
 }