Beispiel #1
0
 private void DocumentDocumentChanged(object sender, ICSharpCode.TextEditor.Document.DocumentEventArgs args)
 {
     if (!_settingText)
     {
         DoDocumentChanged(sender, args);
     }
 }
		void DocumentChanged(object sender, DocumentEventArgs e)
		{
			int oldCount = foldMarker.Count;
			document.UpdateSegmentListOnDocumentChange(foldMarker, e);
			if (oldCount != foldMarker.Count) {
				document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea));
			}
		}
 private void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     btSave.Enabled = true;
     lbSourceCode_UnsavedChanges.Visible = true;
     btSaveFile.Enabled = true;
     lbSource_CodeFileSaved.Visible = false;
     if (null != eDocumentDataChanged)
         foreach (Delegate dDelegate in eDocumentDataChanged.GetInvocationList())
             dDelegate.DynamicInvoke(new Object[] { tecSourceCode.Text });
 }
 void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     validated = false;
     validationTimer.Stop();
     validationTimer.Start();
     if (e.Text != null)
     {
         if (-1 != e.Text.IndexOfAny("<>".ToCharArray()))
             Document.FoldingManager.UpdateFoldings(string.Empty, null);
     }
 }
Beispiel #5
0
		void DocumentChanged(object sender, DocumentEventArgs e)
		{
			if (e.Text == null) {
				Remove(e.Offset, e.Length);
			} else {
				if (e.Length < 0) {
					Insert(e.Offset, e.Text);
				} else {
					Replace(e.Offset, e.Length, e.Text);
				}
			}
		}
Beispiel #6
0
 // RZ: 5.6.2012
 /// <summary>
 /// Enables/disables the "Validate" menu item depending on whether or
 /// not the text editor is empty.
 /// </summary>
 private void topTabs_TemplateEditor_TextChanged(object sender, EventArgs e)
 {
     if (!(e is ICSharpCode.TextEditor.Document.DocumentEventArgs))
     {
         return;
     }
     ICSharpCode.TextEditor.Document.DocumentEventArgs anEvent = (ICSharpCode.TextEditor.Document.DocumentEventArgs)e;
     if (anEvent.Document.TextLength == 0)
     {
         mnuTools_Validate.Enabled = false;
     }
     else
     {
         mnuTools_Validate.Enabled = true;
     }
     template.TemplateText = anEvent.Document.TextContent;
     doc.Data = template.Output;
     return;
 }
 private void OnDocumentChangedDoUpdateContextMenu(object sender, DocumentEventArgs e)
 {
     bool isVisible = (Document.TotalNumberOfLines > ActiveTextAreaControl.TextArea.TextView.VisibleLineCount);
     ActiveTextAreaControl.VScrollBar.Visible = isVisible;
 }
Beispiel #8
0
		public void AdjustScrollBars(object sender, DocumentEventArgs e)
		{
			vScrollBar.Minimum = 0;
			// number of visible lines in document (folding!)
			vScrollBar.Maximum = textArea.MaxVScrollValue;
			int max = 0;
			foreach (LineSegment lineSegment in this.Document.LineSegmentCollection) {
				int lineNumber = Document.GetLineNumberForOffset(lineSegment.Offset);
				if(Document.FoldingManager.IsLineVisible(lineNumber)) {
					max = Math.Max(max, textArea.TextView.GetVisualColumnFast(lineSegment, lineSegment.Length));
				}
			}
			hScrollBar.Minimum = 0;
			hScrollBar.Maximum = (Math.Max(0, max + textArea.TextView.VisibleColumnCount - 1));
			
			vScrollBar.LargeChange = Math.Max(0, textArea.TextView.DrawingPosition.Height);
			vScrollBar.SmallChange = Math.Max(0, textArea.TextView.FontHeight);
			
			hScrollBar.LargeChange = Math.Max(0, textArea.TextView.VisibleColumnCount - 1);
			hScrollBar.SmallChange = Math.Max(0, (int)textArea.TextView.SpaceWidth);
		}
Beispiel #9
0
 void DocumentChanged(object sender, DocumentEventArgs e)
 {
     // reset markers table
     markersTable.Clear();
     document.UpdateSegmentListOnDocumentChange(textMarker, e);
 }
		protected void OnDocumentChanged(DocumentEventArgs e)
		{
			if (DocumentChanged != null) {
				DocumentChanged(this, e);
			}
		}
		void DocumentAboutToBeChanged(object sender, DocumentEventArgs e)
		{
			// => startOffset test required so that this startOffset/endOffset are not incremented again
			//    for BeforeStartKey characters
			if (e.Offset >= startOffset && e.Offset <= endOffset) {
				if (e.Length > 0) { // length of removed region
					endOffset -= e.Length;
				}
				if (!string.IsNullOrEmpty(e.Text)) {
					endOffset += e.Text.Length;
				}
			}
		}
 void DocumentChanged(object sender, DocumentEventArgs e)
 {
 }
 void DocumentChanged(object sender, DocumentEventArgs e)
 {
     //if (e.Text == null)
     //{
     //    Remove(e.Offset, e.Length);
     //}
     //else
     //{
     //    if (e.Length < 0)
     //    {
     //        Insert(e.Offset, e.Text);
     //    }
     //    else
     //    {
     //        Replace(e.Offset, e.Length, e.Text);
     //    }
     //}
 }
Beispiel #14
0
 /// <summary>
 /// Sets the dirty flag since the document has changed.
 /// </summary>
 void DocumentChanged(object sender, DocumentEventArgs e)
 {
     if (PrimaryFile != null) {
         PrimaryFile.MakeDirty();
     }
 }
        private void WindowDocumentChanged(object sender, DocumentEventArgs e)
        {
            /*
             * The following is commented because the script is only parsed when the
             * the document is saved.  Could change this, but will have to suppress
             * the errors.
             */
            //// Can't parse a file that doesn't exist on the harddrive
            //if (this.ActiveDocument.SourceFile.FileType == FileType.Existing &&
            //    !_loader.IsBusy)
            //{
            //    // Parse the file in the background
            //    _loader.RunWorkerAsync();
            //}

            UpdateTitle();
        }
Beispiel #16
0
 //mark dirty
 private void OnDocumentChanged(object sender, DocumentEventArgs e)
 {
     IsDirty = true;
 }
		void TextAreaChangedEvent(object sender, DocumentEventArgs e)
		{
			IsDirty = true;
			NavigationService.ContentChanging(this.textAreaControl, e);
		}
 private void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     textChanged = true;
 }
Beispiel #19
0
 private void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     if (ActiveEditor != null)
         SetModifiedFlag(ActiveEditor, true);            
 }
 void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     if (Changed != null)
         Changed(this, e);
 }
Beispiel #21
0
 private void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     m_sText = m_oEditor.Text;
     OnDocumentChanged(e);
 }
Beispiel #22
0
 void SharpText_DocumentChanged(object sender, DocumentEventArgs e)
 {
     ToRefresh = 5;
     if (!FoldingRefresher.Enabled)
         FoldingRefresher.Enabled = true;
 }
 private void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     this.txtContent.Document.FoldingManager.FoldingStrategy = new RegionFoldingStrategy();
     this.txtContent.Document.FoldingManager.UpdateFoldings(null, null);
 }
Beispiel #24
0
		void DocumentChanged(object sender, DocumentEventArgs e)
		{
			// reset markers table
			markersTable.Clear();
			document.UpdateSegmentListOnDocumentChange(textMarker, e);
		}
Beispiel #25
0
        private void Document_DocumentChanged(object sender, DocumentEventArgs e)
        {
            //base.Document.FoldingManager.UpdateFoldings(string.Empty, null);
            bool isVisible = (base.Document.TotalNumberOfLines > this.ActiveTextAreaControl.TextArea.TextView.VisibleLineCount);
            base.ActiveTextAreaControl.VScrollBar.Visible = isVisible;

            if (this.Presenter == null) return;
            if (this.Text == Environment.NewLine && string.IsNullOrEmpty(this.presenter.Text)) return;

            this.Presenter.Text = this.Text;
        }
		void TextAreaChangedEvent(object sender, DocumentEventArgs e)
		{
			this.PrimaryFile.MakeDirty();
			NavigationService.ContentChanging(this.textEditorControl, e);
		}
Beispiel #27
0
 void TextEditorDocumentChanged(object sender, ICSharpCode.TextEditor.Document.DocumentEventArgs e)
 {
     _SetTextInternal = true;
     Text             = e.Document.TextContent;
     _SetTextInternal = false;
 }
		private void Document_DocumentChanged(object sender, DocumentEventArgs e) {
			if (!IsDirty) 
				IsDirty = true;
		}
Beispiel #29
0
 void Document_DocumentChanged(object sender, DocumentEventArgs e)
 {
     Document.FoldingManager.UpdateFoldings(null, null);
 }
Beispiel #30
0
 void Query_DocumentChanged(object sender, DocumentEventArgs e)
 {
     ToRefresh = 10;
     if (!FoldingRefresher.Enabled)
         FoldingRefresher.Enabled = true;
 }
Beispiel #31
0
        void Document_DocumentChanged(object sender, DocumentEventArgs e)
        {
            int startOffset = e.Offset;
            int endOffset = e.Offset + e.Length;

            if (startOffset < 0 || startOffset >= Document.TextLength)
                startOffset = 0;
            if (endOffset < 0 || endOffset >= Document.TextLength)
                endOffset = 0;

            var segment = Document.GetLineSegmentForOffset(startOffset);

            int startLine = segment.LineNumber;
            int startIndex = segment.Offset - startOffset;

            segment = Document.GetLineSegmentForOffset(endOffset);

            int endLine = segment.LineNumber;
            int endIndex = segment.Offset - endOffset;

            _connectionPoint.ForAll(p => p.OnChanged(startLine, startIndex, endLine, endIndex));
        }
Beispiel #32
0
		void AdjustScrollBarsOnDocumentChange(object sender, DocumentEventArgs e)
		{
			if (motherTextEditorControl.IsInUpdate == false) {
				AdjustScrollBarsClearCache();
				AdjustScrollBars();
			} else {
				adjustScrollBarsOnNextUpdate = true;
			}
		}
		public void UpdateSegmentListOnDocumentChange(ArrayList list, DocumentEventArgs e)
		{
			for (int i = 0; i < list.Count; ++i) {
				ISegment fm = (ISegment)list[i];
			
				if (e.Offset <= fm.Offset && fm.Offset <= e.Offset + e.Length ||
				    e.Offset <= fm.Offset + fm.Length && fm.Offset + fm.Length <= e.Offset + e.Length) {
					list.RemoveAt(i);
					--i;
					continue;
				}
				
				if (fm.Offset  <= e.Offset && e.Offset <= fm.Offset + fm.Length) {
					if (e.Text != null) {
						fm.Length += e.Text.Length;
					}
					if (e.Length > 0) {
						fm.Length -= e.Length;
					}
					continue;
				}
				
				if (fm.Offset >= e.Offset) {
					if (e.Text != null) {
						fm.Offset += e.Text.Length;
					}
					if (e.Length > 0) {
						fm.Offset -= e.Length;
					}
				}
			}
		}
Beispiel #34
0
 private void PluginEditorTE_Change(object sender, DocumentEventArgs e)
 {
     ResetSearchValues();
 }
        public void UpdateSegmentListOnDocumentChange <T>(List <T> list, DocumentEventArgs e) where T : ISegment
        {
            int removedCharacters  = e.Length > 0 ? e.Length : 0;
            int insertedCharacters = e.Text != null ? e.Text.Length : 0;

            for (int i = 0; i < list.Count; ++i)
            {
                ISegment s            = list[i];
                int      segmentStart = s.Offset;
                int      segmentEnd   = s.Offset + s.Length;

                if (e.Offset <= segmentStart)
                {
                    segmentStart -= removedCharacters;
                    if (segmentStart < e.Offset)
                    {
                        segmentStart = e.Offset;
                    }
                }
                if (e.Offset < segmentEnd)
                {
                    segmentEnd -= removedCharacters;
                    if (segmentEnd < e.Offset)
                    {
                        segmentEnd = e.Offset;
                    }
                }

                if (segmentStart <= segmentEnd)     //DC
                {
                    return;
                }
                //Debug.Assert(segmentStart <= segmentEnd);//DC

                if (segmentStart == segmentEnd)
                {
                    list.RemoveAt(i);
                    --i;
                    continue;
                }

                if (e.Offset <= segmentStart)
                {
                    segmentStart += insertedCharacters;
                }
                if (e.Offset < segmentEnd)
                {
                    segmentEnd += insertedCharacters;
                }

                if (segmentStart < segmentEnd)      //DC
                {
                    return;
                }

                //Debug.Assert(segmentStart < segmentEnd);  //DC

                s.Offset = segmentStart;
                s.Length = segmentEnd - segmentStart;
            }
        }