Exemplo n.º 1
0
        /// <summary>
        /// Load the model from the underlying text buffer.
        /// </summary>
        private void LoadModelFromXmlModel()
        {
            try
            {
                //var document = GetParseTree();
                var document = textBufferSerializer.Parse();
                LoadModelFromXmlModel(document);
            }
            catch (Exception e)
            {
                //Display error message
                ErrorHandler.ThrowOnFailure(VsShellUtilities.ShowMessageBox(serviceProvider,
                                                                            string.Format("Invalid document format: {0}", e.Message),
                                                                            Resources.ProductName,
                                                                            OLEMSGICON.OLEMSGICON_CRITICAL,
                                                                            OLEMSGBUTTON.OLEMSGBUTTON_OK,
                                                                            OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST));
            }

            BufferDirty = false;

            // Update designer view
            ViewModelChanged.Fire(this);
        }