Exemple #1
0
        /// <summary>
        /// Load the contents of a file from the windows file system into memory and display it.
        /// </summary>
        /// <param name="filename"></param>
        public override void LoadFile(string filename)
        {
            // Look-up plugin model
            string          plugin = this.dm_DocumentDataModel.PluginModelName;
            PluginModelBase m      = PluginManager.GetPluginModel(plugin);

            // Look-up shape converter
            UmlTypeToStringConverterBase conv = null;

            conv = m.ShapeConverter;

            // Convert Xml document into a list of shapes and page definition
            List <ShapeViewModelBase> coll;
            PageViewModelBase         page = conv.LoadDocument(filename, _CanvasViewModel, out coll);

            // Apply new page and shape definitions to data model
            _DataModel.LoadFileFromCollection(page, coll);

            this.prop_DocumentFilePath = filename;
            this.vm_CanvasViewModel.SelectedItem.Clear();
        }