[svn] r7783: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs

kliss svnadmin at nemerle.org
Tue Sep 4 18:35:00 CEST 2007


Log:
Missing files from previous commit

Author: kliss
Date: Tue Sep  4 18:34:53 2007
New Revision: 7783

Modified:
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleSource.cs	Tue Sep  4 18:34:53 2007
@@ -252,5 +252,30 @@
 		}
 
 		#endregion
+
+        internal static int HiddenRegionCookie = 25;
+
+        internal void CollapseAllRegions()
+        {
+            IVsHiddenTextSession session = GetHiddenTextSession();
+            IVsEnumHiddenRegions ppenum;
+            TextSpan[] aspan = new TextSpan[1];
+            aspan[0] = GetDocumentSpan();
+            NativeMethods.ThrowOnFailure(session.EnumHiddenRegions((uint)FIND_HIDDEN_REGION_FLAGS.FHR_BY_CLIENT_DATA, (uint)NemerleSource.HiddenRegionCookie, aspan, out ppenum));
+            IVsHiddenRegion[] aregion = new IVsHiddenRegion[1];
+            using (new CompoundAction(this, "ToggleAllRegions"))
+            {
+                uint fetched;
+                while (ppenum.Next(1, aregion, out fetched) == NativeMethods.S_OK && fetched == 1)
+                {
+                    uint dwState;
+                    aregion[0].GetState(out dwState);
+                    //dwState &= ~(uint)HIDDEN_REGION_STATE.hrsExpanded;
+                    dwState = (uint) HIDDEN_REGION_STATE.hrsDefault;
+                    NativeMethods.ThrowOnFailure(aregion[0].SetState(dwState,
+                        (uint)CHANGE_HIDDEN_REGION_FLAGS.chrDefault));
+                }
+            }
+        }
 	}
 }



More information about the svn mailing list