Example #1
0
 public Class(CompilationUnit cu, ClassType t, Modifier m, IRegion region)
 {
     this.cu = cu;
     classType = t;
     this.region = region;
     modifiers = (ModifierEnum)m;
 }
Example #2
0
 void RetrieveRegions(CompilationUnit cu, SpecialTracker tracker)
 {
     for (int i = 0; i < tracker.CurrentSpecials.Count; ++i) {
         PreProcessingDirective directive = tracker.CurrentSpecials[i] as PreProcessingDirective;
         if (directive != null) {
             if (directive.Cmd == "#region") {
                 int deep = 1;
                 for (int j = i + 1; j < tracker.CurrentSpecials.Count; ++j) {
                     PreProcessingDirective nextDirective = tracker.CurrentSpecials[j] as PreProcessingDirective;
                     if (nextDirective != null) {
                         switch (nextDirective.Cmd) {
                             case "#region":
                                 ++deep;
                                 break;
                             case "#endregion":
                                 --deep;
                                 if (deep == 0) {
                                     cu.FoldingRegions.Add(new FoldingRegion(directive.Arg.Trim(), new DefaultRegion(directive.Start, new Point(nextDirective.End.X - 2, nextDirective.End.Y))));
                                     goto end;
                                 }
                                 break;
                         }
                     }
                 }
                 end: ;
             }
         }
     }
 }