//GetSelectionIndexを呼び出すと呼び出される関数
void _textStore_GetSelectionIndex(out int o_startIndex, out int o_endIndex)
{
//キャレット位置を取得しo_startIndexに代入
//キャレット位置+選択長をo_endIndexに代入
//キャレット位置と選択長は文字数
}
//ITextStoreACP2:GetSelectionの実装
public void GetSelection(int i_index,int i_selectionBufferLength,TS_SELECTION_ACP[] o_selections,out int o_fetchedLength
)
{
#if TSF_DEBUG_OUTPUT
using(var dbgout = new DebugOut("{0}()", DebugOut.GetCaller()) )
#endif
{
if (GetSelectionIndex == null)
throw new NotImplementedException();
o_fetchedLength = 0;
if (IsLocked(LockFlags.TS_LF_READ) == false)
{
throw new COMException("読取用ロックがされていません。",TsResult.TS_E_NOLOCK);
}
if (i_index != -1 && i_index > 0)
{
throw new COMException("選択は1つだけしかサポートしていません。",UnmanagedAPI.WinError.HRESULT.E_INVALIDARG);
}
if (i_selectionBufferLength > 0)
{
int start = 0, end = 0;
GetSelectionIndex(out start, out end);
if (start <= end)
{
o_selections[0].start = start;
o_selections[0].end = end;
o_selections[0].style.ase = TsActiveSelEnd.TS_AE_END;
o_selections[0].style.interimChar = false;
}
else
{
o_selections[0].start = end;
o_selections[0].end = start;
o_selections[0].style.ase = TsActiveSelEnd.TS_AE_START;
o_selections[0].style.interimChar = false;
}
o_fetchedLength = 1;
}
}
}
Ly9HZXRTZWxlY3Rpb25JbmRleOOCkuWRvOOBs+WHuuOBmeOBqOWRvOOBs+WHuuOBleOCjOOCi+mWouaVsAp2b2lkIF90ZXh0U3RvcmVfR2V0U2VsZWN0aW9uSW5kZXgob3V0IGludCBvX3N0YXJ0SW5kZXgsIG91dCBpbnQgb19lbmRJbmRleCkKewogICAgLy/jgq3jg6Pjg6zjg4Pjg4jkvY3nva7jgpLlj5blvpfjgZdvX3N0YXJ0SW5kZXjjgavku6PlhaUKICAgIC8v44Kt44Oj44Os44OD44OI5L2N572uK+mBuOaKnumVt+OCkm9fZW5kSW5kZXjjgavku6PlhaUKICAgIC8v44Kt44Oj44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1ZmZlckxlbmd0aCA+IDApCiAgICAgICAgewogICAgICAgICAgICBpbnQgc3RhcnQgPSAwLCBlbmQgPSAwOwogICAgICAgICAgICBHZXRTZWxlY3Rpb25JbmRleChvdXQgc3RhcnQsIG91dCBlbmQpOwogICAgICAgICAgICBpZiAoc3RhcnQgPD0gZW5kKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBvX3NlbGVjdGlvbnNbMF0uc3RhcnQgPSBzdGFydDsKICAgICAgICAgICAgICAgIG9fc2VsZWN0aW9uc1swXS5lbmQgPSBlbmQ7CiAgICAgICAgICAgICAgICBvX3NlbGVjdGlvbnNbMF0uc3R5bGUuYXNlID0gVHNBY3RpdmVTZWxFbmQuVFNfQUVfRU5EOwogICAgICAgICAgICAgICAgb19zZWxlY3Rpb25zWzBdLnN0eWxlLmludGVyaW1DaGFyID0gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBvX3NlbGVjdGlvbnNbMF0uc3RhcnQgPSBlbmQ7CiAgICAgICAgICAgICAgICBvX3NlbGVjdGlvbnNbMF0uZW5kID0gc3RhcnQ7CiAgICAgICAgICAgICAgICBvX3NlbGVjdGlvbnNbMF0uc3R5bGUuYXNlID0gVHNBY3RpdmVTZWxFbmQuVFNfQUVfU1RBUlQ7CiAgICAgICAgICAgICAgICBvX3NlbGVjdGlvbnNbMF0uc3R5bGUuaW50ZXJpbUNoYXIgPSBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBvX2ZldGNoZWRMZW5ndGggPSAxOwogICAgICAgIH0KICAgIH0KfQ==
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