Esempio n. 1
0
 // always use primary text editor for loading/saving
 // (the file encoding is stored only there)
 public void Load(Stream stream)
 {
     if (UseFixedEncoding)
     {
         using (StreamReader reader = new StreamReader(stream, primaryTextEditor.Encoding, detectEncodingFromByteOrderMarks: false)) {
             ReloadDocument(primaryTextEditor.Document, reader.ReadToEnd());
         }
     }
     else
     {
         // do encoding auto-detection
         using (StreamReader reader = FileReader.OpenStream(stream, this.Encoding ?? SD.FileService.DefaultFileEncoding)) {
             ReloadDocument(primaryTextEditor.Document, reader.ReadToEnd());
             this.Encoding = reader.CurrentEncoding;
         }
     }
     // raise event which allows removing existing NewLineConsistencyCheck overlays
     if (LoadedFileContent != null)
     {
         LoadedFileContent(this, EventArgs.Empty);
     }
     NewLineConsistencyCheck.StartConsistencyCheck(this);
 }
		public static void StartConsistencyCheck(CodeEditor editor)
		{
			NewLineConsistencyCheck c = new NewLineConsistencyCheck(editor);
			ThreadPool.QueueUserWorkItem(c.CheckNewLinesForConsistency);
		}
Esempio n. 3
0
        public static void StartConsistencyCheck(CodeEditor editor)
        {
            NewLineConsistencyCheck c = new NewLineConsistencyCheck(editor);

            ThreadPool.QueueUserWorkItem(c.CheckNewLinesForConsistency);
        }