Esempio n. 1
0
 public FoldSegment(Document doc, string description, int offset, int length, FoldingType foldingType) : base(offset, length)
 {
     this.doc         = doc;
     this.isFolded    = false;
     this.Description = description;
     this.FoldingType = foldingType;
 }
Esempio n. 2
0
		public FoldSegment (Document doc, string description, int offset, int length, FoldingType foldingType) : base (offset, length)
		{
			this.doc = doc;
			this.IsFolded    = false;
			this.Description = description;
			this.FoldingType = foldingType;
		}
Esempio n. 3
0
 public FoldSegment(FoldSegment foldSegment) : base(foldSegment.Offset, foldSegment.Length)
 {
     this.doc         = foldSegment.doc;
     this.isFolded    = foldSegment.IsFolded;
     this.Description = foldSegment.Description;
     this.FoldingType = foldSegment.FoldingType;
 }
		public static IFoldSegment CreateFoldSegment (TextEditor editor, ISegment segment, bool isCollapsed = false, string collapsedText = "...", FoldingType foldingType = FoldingType.Unknown)
		{
			if (editor == null)
				throw new ArgumentNullException ("editor");
			if (segment == null)
				throw new ArgumentNullException ("segment");
			return CreateFoldSegment (editor, segment.Offset, segment.Length, isCollapsed, collapsedText, foldingType);
		}
		public static IFoldSegment CreateFoldSegment (TextEditor editor, ISegment segment, FoldingType foldingType = FoldingType.Unknown)
		{
			if (editor == null)
				throw new ArgumentNullException ("editor");
			if (segment == null)
				throw new ArgumentNullException ("segment");
			return CreateFoldSegment (editor, segment.Offset, segment.Length, false, "...", foldingType);
		}
		public static IFoldSegment CreateFoldSegment (TextEditor editor, int offset, int length, bool isCollapsed = false, string collapsedText = "...", FoldingType foldingType = FoldingType.Unknown)
		{
			if (editor == null)
				throw new ArgumentNullException ("editor");
			var result =  editor.CreateFoldSegment (offset, length, isCollapsed);
			result.CollapsedText = collapsedText;
			result.FoldingType = foldingType;
			return result;
		}
        public static dynamic GetTSObject(FoldingType dynEnum)
        {
            var tsType = TSActivator.CreateInstance("Tekla.Structures.Forming.FoldingType").GetType();

            switch (dynEnum)
            {
            case FoldingType.NOT_SPECIFIED:
                return(System.Enum.Parse(tsType, "NOT_SPECIFIED"));

            case FoldingType.FOLDED:
                return(System.Enum.Parse(tsType, "FOLDED"));

            case FoldingType.UNFOLDED:
                return(System.Enum.Parse(tsType, "UNFOLDED"));

            default:
                throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented");
            }
        }
		FoldSegment AddMarker (List<FoldSegment> foldSegments, string text, DomRegion region, FoldingType type)
		{
			Document document = textEditorData.Document;
			if (document == null || region.BeginLine <= 0 || region.EndLine <= 0 || region.BeginLine > document.LineCount || region.EndLine > document.LineCount)
				return null;
			
			int startOffset = document.LocationToOffset (region.BeginLine, region.BeginColumn);
			int endOffset   = document.LocationToOffset (region.EndLine, region.EndColumn );
			
			FoldSegment result = new FoldSegment (document, text, startOffset, endOffset - startOffset, type);
			
			foldSegments.Add (result);
			return result;
		}
		public FoldSegment (FoldSegment foldSegment) : base (foldSegment.Offset, foldSegment.Length)
		{
			this.doc = foldSegment.doc;
			this.isFolded = foldSegment.IsFolded;
			this.Description = foldSegment.Description;
			this.FoldingType = foldSegment.FoldingType;
		}
Esempio n. 10
0
 public FoldSegment(string description, int offset, int length, FoldingType foldingType) : base(offset, length)
 {
     this.isFolded      = false;
     this.CollapsedText = description;
     this.FoldingType   = foldingType;
 }
Esempio n. 11
0
 public FoldSegment(FoldSegment foldSegment) : base(foldSegment.Offset, foldSegment.Length)
 {
     this.isFolded      = foldSegment.IsCollapsed;
     this.CollapsedText = foldSegment.CollapsedText;
     this.FoldingType   = foldSegment.FoldingType;
 }
Esempio n. 12
0
 public FoldSegment(string description, int offset, int length, FoldingType foldingType) : base(offset, length)
 {
     this.IsFolded    = false;
     this.Description = description;
     this.FoldingType = foldingType;
 }
Esempio n. 13
0
		FoldSegment AddMarker (List<FoldSegment> foldSegments, string text, DomRegion region, FoldingType type)
		{
			Document document = textEditorData.Document;
			if (document == null || region.Start.Line <= 0 || region.End.Line <= 0 || region.Start.Line > document.LineCount || region.End.Line > document.LineCount)
				return null;
			int startOffset = document.LocationToOffset (region.Start.Line, region.Start.Column);
			// end doesn't include the char at that position.
			int endOffset   = document.LocationToOffset (region.End.Line, region.End.Column) - 1;
			FoldSegment result = new FoldSegment (document, text, startOffset, endOffset - startOffset, type);
			
			foldSegments.Add (result);
			return result;
		}
		public static IFoldSegment CreateFoldSegment (TextEditor editor, int offset, int length, FoldingType foldingType = FoldingType.Unknown)
		{
			if (editor == null)
				throw new ArgumentNullException ("editor");
			return CreateFoldSegment (editor, offset, length, false, "...", foldingType);
		}
Esempio n. 15
0
        public static IFoldSegment CreateFoldSegment(TextEditor editor, int offset, int length, bool isCollapsed = false, string collapsedText = "...", FoldingType foldingType = FoldingType.Unknown)
        {
            if (editor == null)
            {
                throw new ArgumentNullException("editor");
            }
            var result = editor.CreateFoldSegment(offset, length, isCollapsed);

            result.CollapsedText = collapsedText;
            result.FoldingType   = foldingType;
            return(result);
        }
Esempio n. 16
0
 public static IFoldSegment CreateFoldSegment(TextEditor editor, ISegment segment, bool isCollapsed = false, string collapsedText = "...", FoldingType foldingType = FoldingType.Unknown)
 {
     if (editor == null)
     {
         throw new ArgumentNullException("editor");
     }
     if (segment == null)
     {
         throw new ArgumentNullException("segment");
     }
     return(CreateFoldSegment(editor, segment.Offset, segment.Length, isCollapsed, collapsedText, foldingType));
 }
Esempio n. 17
0
 public static IFoldSegment CreateFoldSegment(TextEditor editor, ISegment segment, FoldingType foldingType = FoldingType.Unknown)
 {
     if (editor == null)
     {
         throw new ArgumentNullException("editor");
     }
     if (segment == null)
     {
         throw new ArgumentNullException("segment");
     }
     return(CreateFoldSegment(editor, segment.Offset, segment.Length, false, "...", foldingType));
 }
Esempio n. 18
0
 public static IFoldSegment CreateFoldSegment(TextEditor editor, int offset, int length, FoldingType foldingType = FoldingType.Unknown)
 {
     if (editor == null)
     {
         throw new ArgumentNullException("editor");
     }
     return(CreateFoldSegment(editor, offset, length, false, "...", foldingType));
 }