/// <summary> /// Get an array of SelLevInfo structs from the given selection. /// </summary> /// <param name="vwsel"></param> /// <param name="cvsli"></param> /// <param name="ihvoRoot"></param> /// <param name="tagTextProp"></param> /// <param name="cpropPrevious"></param> /// <param name="ichAnchor"></param> /// <param name="ichEnd"></param> /// <param name="ws"></param> /// <param name="fAssocPrev"></param> /// <param name="ihvoEnd"></param> /// <param name="ttp"></param> /// <returns></returns> public static SelLevInfo[] AllTextSelInfo(IVwSelection vwsel, int cvsli, out int ihvoRoot, out int tagTextProp, out int cpropPrevious, out int ichAnchor, out int ichEnd, out int ws, out bool fAssocPrev, out int ihvoEnd, out ITsTextProps ttp) { Debug.Assert(vwsel != null); using (ArrayPtr rgvsliPtr = MarshalEx.ArrayToNative <SelLevInfo>(cvsli)) { vwsel.AllTextSelInfo(out ihvoRoot, cvsli, rgvsliPtr, out tagTextProp, out cpropPrevious, out ichAnchor, out ichEnd, out ws, out fAssocPrev, out ihvoEnd, out ttp); return(MarshalEx.NativeToArray <SelLevInfo>(rgvsliPtr, cvsli)); } }
/// <summary> /// Get an array of SelLevInfo structs from the given selection. /// </summary> /// <param name="vwsel"></param> /// <param name="cvsli"></param> /// <param name="ihvoRoot"></param> /// <param name="tagTextProp"></param> /// <param name="cpropPrevious"></param> /// <param name="ichAnchor"></param> /// <param name="ichEnd"></param> /// <param name="ws"></param> /// <param name="fAssocPrev"></param> /// <param name="ihvoEnd"></param> /// <param name="ttp"></param> /// <returns></returns> public static SelLevInfo[] AllTextSelInfo(IVwSelection vwsel, int cvsli, out int ihvoRoot, out int tagTextProp, out int cpropPrevious, out int ichAnchor, out int ichEnd, out int ws, out bool fAssocPrev, out int ihvoEnd, out ITsTextProps ttp) { Debug.Assert(vwsel != null); using (ArrayPtr rgvsliPtr = MarshalEx.ArrayToNative<SelLevInfo>(cvsli)) { vwsel.AllTextSelInfo(out ihvoRoot, cvsli, rgvsliPtr, out tagTextProp, out cpropPrevious, out ichAnchor, out ichEnd, out ws, out fAssocPrev, out ihvoEnd, out ttp); return MarshalEx.NativeToArray<SelLevInfo>(rgvsliPtr, cvsli); } }
private ITsTextProps spyOnSelection(IVwSelection sel) { // See what got selected int ihvoRoot = 0; // first rootbox int cvsli = sel.CLevels(true); // selection levels-1 involved cvsli--; int tag; int cpropPrevious; int ichAnchor; int ichEnd; int ws; bool fAssocPrev; int ihvoEnd1; ITsTextProps ttp; ArrayPtr rgvsliTemp = MarshalEx.ArrayToNative(cvsli, typeof(SelLevInfo)); sel.AllTextSelInfo(out ihvoRoot, cvsli, rgvsliTemp, out tag, out cpropPrevious, out ichAnchor, out ichEnd, out ws, out fAssocPrev, out ihvoEnd1, out ttp); SelLevInfo[] rgvsli = (SelLevInfo[])MarshalEx.NativeToArray(rgvsliTemp, cvsli, typeof(SelLevInfo)); // use the debugger to look at the vars. Can't get into ttp here. return(ttp); }
private ITsTextProps spyOnSelection(IVwSelection sel) { // See what got selected int ihvoRoot = 0; // first rootbox int cvsli = sel.CLevels(true); // selection levels-1 involved cvsli--; int tag; int cpropPrevious; int ichAnchor; int ichEnd; int ws; bool fAssocPrev; int ihvoEnd1; ITsTextProps ttp; ArrayPtr rgvsliTemp = MarshalEx.ArrayToNative(cvsli, typeof(SelLevInfo)); sel.AllTextSelInfo(out ihvoRoot, cvsli, rgvsliTemp, out tag, out cpropPrevious, out ichAnchor, out ichEnd, out ws, out fAssocPrev, out ihvoEnd1, out ttp); SelLevInfo[] rgvsli = (SelLevInfo[])MarshalEx.NativeToArray(rgvsliTemp, cvsli, typeof(SelLevInfo)); // use the debugger to look at the vars. Can't get into ttp here. return ttp; }