Exemplo n.º 1
0
        /// <summary>
        /// Load a files contents into the viewmodel for viewing and editing.
        /// </summary>
        /// <param name="dm"></param>
        /// <param name="closeOnErrorWithoutMessage"></param>
        /// <returns></returns>
        public static EdiViewModel LoadFile(IDocumentModel dm,
                                            ISettingsManager settings,
                                            bool closeOnErrorWithoutMessage = false)
        {
            EdiViewModel vm = new EdiViewModel();

            vm.InitInstance(settings.SettingData);
            vm.FilePath = dm.FileNamePath;
            vm.CloseOnErrorWithoutMessage = closeOnErrorWithoutMessage;

            vm.LoadFileAsync(vm.FilePath);
            ////vm.OpenFile(filePath);   // Non-async file open version

            return(vm);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Load an Edi text editor file based on an <seealso cref="IDocumentModel"/>
 /// representation and a <seealso cref="ISettingsManager"/> instance.
 /// </summary>
 /// <param name="dm"></param>
 /// <param name="o">Should point to a <seealso cref="ISettingsManager"/> instance.</param>
 /// <returns></returns>
 public static EdiViewModel LoadFile(IDocumentModel dm,
                                     object o)
 {
     return(EdiViewModel.LoadFile(dm, o as ISettingsManager));
 }