コード例 #1
0
        void HandleTextEditorDataDocumentFolded(object sender, FoldSegmentEventArgs e)
        {
            int start = OffsetToLineNumber(e.FoldSegment.StartLine.Offset);
            int end   = OffsetToLineNumber(e.FoldSegment.EndLine.Offset);

            if (e.FoldSegment.IsFolded)
            {
                if (e.FoldSegment.Marker != null)
                {
                    heightTree.Unfold(e.FoldSegment.Marker, start, end - start);
                }
                e.FoldSegment.Marker = heightTree.Fold(start, end - start);
            }
            else
            {
                heightTree.Unfold(e.FoldSegment.Marker, start, end - start);
                e.FoldSegment.Marker = null;
            }
        }
コード例 #2
0
			void HandleFolded (object sender, FoldSegmentEventArgs e)
			{
				RequestRedraw ();
			}
コード例 #3
0
		void HandleTextEditorDataDocumentFolded (object sender, FoldSegmentEventArgs e)
		{
			int start = OffsetToLineNumber (e.FoldSegment.StartLine.Offset);
			int end = OffsetToLineNumber (e.FoldSegment.EndLine.Offset);
			
			if (e.FoldSegment.IsFolded) {
				if (e.FoldSegment.Marker != null)
					heightTree.Unfold (e.FoldSegment.Marker, start, end - start);
				e.FoldSegment.Marker = heightTree.Fold (start, end - start);
			} else {
				heightTree.Unfold (e.FoldSegment.Marker, start, end - start);
				e.FoldSegment.Marker = null;
			}
		}
コード例 #4
0
		internal void InformFoldChanged (FoldSegmentEventArgs args)
		{
			if (args.FoldSegment.IsFolded) {
				foldedSegments.Add (args.FoldSegment);
			} else {
				foldedSegments.Remove (args.FoldSegment);
			}
			var handler = Folded;
			if (handler != null)
				handler (this, args);
		}
コード例 #5
0
		internal void InformFoldChanged (FoldSegmentEventArgs args)
		{
			lock (foldSegmentTaskLock) {
				if (foldSegmentTask != null) {
					foldSegmentTask.ContinueWith (delegate {
						Gtk.Application.Invoke (delegate {
							InternalInformFoldChanged (args);	
						});
					});
				} else {
					InternalInformFoldChanged (args);
				}
			}
		}