fork download
  1. //GetSelectionIndexを呼び出すと呼び出される関数
  2. void _textStore_GetSelectionIndex(out int o_startIndex, out int o_endIndex)
  3. {
  4. //キャレット位置を取得しo_startIndexに代入
  5. //キャレット位置+選択長をo_endIndexに代入
  6. //キャレット位置と選択長は文字数
  7. }
  8.  
  9. //ITextStoreACP2:GetSelectionの実装
  10. public void GetSelection(int i_index,int i_selectionBufferLength,TS_SELECTION_ACP[] o_selections,out int o_fetchedLength
  11. )
  12. {
  13. #if TSF_DEBUG_OUTPUT
  14. using(var dbgout = new DebugOut("{0}()", DebugOut.GetCaller()) )
  15. #endif
  16. {
  17. if (GetSelectionIndex == null)
  18. throw new NotImplementedException();
  19. o_fetchedLength = 0;
  20. if (IsLocked(LockFlags.TS_LF_READ) == false)
  21. {
  22.   throw new COMException("読取用ロックがされていません。",TsResult.TS_E_NOLOCK);
  23. }
  24. if (i_index != -1 && i_index > 0)
  25. {
  26. throw new COMException("選択は1つだけしかサポートしていません。",UnmanagedAPI.WinError.HRESULT.E_INVALIDARG);
  27. }
  28. if (i_selectionBufferLength > 0)
  29. {
  30. int start = 0, end = 0;
  31. GetSelectionIndex(out start, out end);
  32. if (start <= end)
  33. {
  34. o_selections[0].start = start;
  35. o_selections[0].end = end;
  36. o_selections[0].style.ase = TsActiveSelEnd.TS_AE_END;
  37. o_selections[0].style.interimChar = false;
  38. }
  39. else
  40. {
  41. o_selections[0].start = end;
  42. o_selections[0].end = start;
  43. o_selections[0].style.ase = TsActiveSelEnd.TS_AE_START;
  44. o_selections[0].style.interimChar = false;
  45. }
  46. o_fetchedLength = 1;
  47. }
  48. }
  49. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(2,0): error CS1525: Unexpected symbol `void'
prog.cs(10,8): error CS1525: Unexpected symbol `void'
prog.cs(10,83): warning CS0658: `]' is invalid attribute target. All attributes in this attribute section will be ignored
prog.cs(22,9): error CS1056: Unexpected character ` '
prog.cs(22,10): error CS1056: Unexpected character ` '
prog.cs(49,1): error CS8025: Parsing error
Compilation failed: 5 error(s), 1 warnings
stdout
Standard output is empty