//--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="ModelDocument"/> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <param name="documentType">The type of the document.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> or <paramref name="documentType"/> is <see langword="null"/>.
        /// </exception>
        internal ModelDocument(IEditorService editor, DocumentType documentType)
            : base(editor, documentType)
        {
            _modelsExtension        = editor.Extensions.OfType <ModelsExtension>().FirstOrDefault().ThrowIfMissing();
            _useDigitalRuneGraphics = _modelsExtension.UseDigitalRuneGraphics;

            var services = Editor.Services;

            _documentService   = services.GetInstance <IDocumentService>().ThrowIfMissing();
            _statusService     = services.GetInstance <IStatusService>().ThrowIfMissing();
            _outputService     = services.GetInstance <IOutputService>().ThrowIfMissing();
            _animationService  = services.GetInstance <IAnimationService>().ThrowIfMissing();
            _monoGameService   = services.GetInstance <IMonoGameService>().ThrowIfMissing();
            _outlineService    = services.GetInstance <IOutlineService>().WarnIfMissing();
            _propertiesService = services.GetInstance <IPropertiesService>().WarnIfMissing();
            _errorService      = services.GetInstance <IErrorService>().WarnIfMissing();

            Editor.ActiveDockTabItemChanged += OnEditorDockTabItemChanged;

            UpdateProperties();
            UpdateOutline();
        }
Exemple #2
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="ModelDocument"/> class.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <param name="documentType">The type of the document.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="editor"/> or <paramref name="documentType"/> is <see langword="null"/>.
        /// </exception>
        internal ModelDocument(IEditorService editor, DocumentType documentType)
          : base(editor, documentType)
        {
            _modelsExtension = editor.Extensions.OfType<ModelsExtension>().FirstOrDefault().ThrowIfMissing();
            _useDigitalRuneGraphics = _modelsExtension.UseDigitalRuneGraphics;

            var services = Editor.Services;
            _documentService = services.GetInstance<IDocumentService>().ThrowIfMissing();
            _statusService = services.GetInstance<IStatusService>().ThrowIfMissing();
            _outputService = services.GetInstance<IOutputService>().ThrowIfMissing();
            _animationService = services.GetInstance<IAnimationService>().ThrowIfMissing();
            _monoGameService = services.GetInstance<IMonoGameService>().ThrowIfMissing();
            _outlineService = services.GetInstance<IOutlineService>().WarnIfMissing();
            _propertiesService = services.GetInstance<IPropertiesService>().WarnIfMissing();
            _errorService = services.GetInstance<IErrorService>().WarnIfMissing();

            Editor.ActiveDockTabItemChanged += OnEditorDockTabItemChanged;

            UpdateProperties();
            UpdateOutline();
        }