public IViewContent CreateContentForFile(OpenedFile file)
		{
			ChooseEncodingDialog dlg = new ChooseEncodingDialog();
			dlg.Owner = SD.Workbench.MainWindow;
			using (Stream stream = file.OpenRead()) {
				using (StreamReader reader = FileReader.OpenStream(stream, SD.FileService.DefaultFileEncoding)) {
					reader.Peek(); // force reader to auto-detect encoding
					dlg.Encoding = reader.CurrentEncoding;
				}
			}
			if (dlg.ShowDialog() == true) {
				return new AvalonEditViewContent(file, dlg.Encoding);
			} else {
				return null;
			}
		}
        public IViewContent CreateContentForFile(OpenedFile file)
        {
            ChooseEncodingDialog dlg = new ChooseEncodingDialog();

            dlg.Owner = WorkbenchSingleton.MainWindow;
            using (Stream stream = file.OpenRead()) {
                using (StreamReader reader = FileReader.OpenStream(stream, FileService.DefaultFileEncoding.GetEncoding())) {
                    reader.Peek();                     // force reader to auto-detect encoding
                    dlg.Encoding = reader.CurrentEncoding;
                }
            }
            if (dlg.ShowDialog() == true)
            {
                return(new AvalonEditViewContent(file, dlg.Encoding));
            }
            else
            {
                return(null);
            }
        }