Exemplo n.º 1
0
        public LayoutView(
            IAppContext context,
            PrintingPlugin plugin,
            IBroadcasterService broadcaster,
            IStyleService styleService,
            ElementsPresenter elements,
            PdfExportService pdfService
            )
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (plugin == null)
            {
                throw new ArgumentNullException("plugin");
            }
            if (broadcaster == null)
            {
                throw new ArgumentNullException("broadcaster");
            }
            if (styleService == null)
            {
                throw new ArgumentNullException("styleService");
            }
            if (elements == null)
            {
                throw new ArgumentNullException("elements");
            }
            if (pdfService == null)
            {
                throw new ArgumentNullException("pdfService");
            }

            _context      = context;
            _plugin       = plugin;
            _broadcaster  = broadcaster;
            _styleService = styleService;
            _elements     = elements;
            _pdfService   = pdfService;

            InitializeComponent();

            // there is no way to get it other than in context of some Control
            ScreenHelper.ScreenDpi = layoutControl1.GetScreenDpi();

            InitControls();

            AttachEventHandlers();

            InitDockPanels();

            InitMenus();

            RestorePreviousState();

            statusStripEx1.ContextMenuStrip = null;

            FormClosing += LayoutViewFormClosing;
        }
Exemplo n.º 2
0
        public LayoutMenuListener(IAppContext context, ILayoutView view, PdfExportService pdfService)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }
            if (pdfService == null)
            {
                throw new ArgumentNullException("pdfService");
            }

            _context       = context;
            _view          = view;
            _pdfService    = pdfService;
            _map           = context.Map;
            _layoutControl = view.LayoutControl;
        }