public FormsDesignerContent(FormsDesignerExtension parent, OpenedFile sourceFile)
            : base(parent)
        {
            _language = (NetLanguageDescriptor)LanguageDescriptor.GetLanguageByPath(sourceFile.FilePath);
            if (!(_language is NetLanguageDescriptor))
            {
                throw new ArgumentException("File must be a .NET source file.");
            }

            _extensionHost = parent.ExtensionHost;
            _extensionHost.ControlManager.AppearanceChanged += ControlManager_AppearanceChanged;

            _propertyContainer = new PropertyContainer();

            _serviceContainer = new ServiceContainer();
            _surfaceManager   = parent.DesignerSurfaceManager;

            _codeReader = new DesignerCodeReader(_extensionHost, _language);
            _codeWriter = new DesignerCodeWriter(_language);

            this.Text           = sourceFile.FilePath.FileName + sourceFile.FilePath.Extension + " [Design]";
            this.AssociatedFile = sourceFile;
            this.AssociatedFile.FilePathChanged += AssociatedFile_FilePathChanged;

            _errorControl = new ErrorControl()
            {
                Dock = DockStyle.Fill,
            };
            _errorControl.ReloadRequested += _errorControl_ReloadRequested;

            SetupDesigner();
        }
        public FormsDesignerContent(FormsDesignerExtension parent, OpenedFile sourceFile)
            : base(parent)
        {
            _language = (NetLanguageDescriptor)LanguageDescriptor.GetLanguageByPath(sourceFile.FilePath);
            if (!(_language is NetLanguageDescriptor))
                throw new ArgumentException("File must be a .NET source file.");
            
            _extensionHost = parent.ExtensionHost;
            _extensionHost.ControlManager.AppearanceChanged += ControlManager_AppearanceChanged;

            _propertyContainer = new PropertyContainer();

            _serviceContainer = new ServiceContainer();
            _surfaceManager = parent.DesignerSurfaceManager;

            _codeReader = new DesignerCodeReader(_extensionHost, _language);
            _codeWriter = new DesignerCodeWriter(_language);

            this.Text = sourceFile.FilePath.FileName + sourceFile.FilePath.Extension + " [Design]";
            this.AssociatedFile = sourceFile;
            this.AssociatedFile.FilePathChanged += AssociatedFile_FilePathChanged;
            
            _errorControl = new ErrorControl()
            {
                Dock = DockStyle.Fill,
            };
            _errorControl.ReloadRequested += _errorControl_ReloadRequested;

            SetupDesigner();
        }