Beispiel #1
0
void PlanEntryModel::SetEntryType(TimeEntry::EntryType type)
{
	StringBuffer sb;
	sb.appendInt(static_cast<int>(type));
	BSTR bstr = SysAllocString(sb);
	SetAttribute(TYPE, bstr);
	SysFreeString(bstr);
}
Beispiel #2
0
/// State is internal maintenance flag.
void CTaskModel::SetState(TASK_STATE state)
{
	StringBuffer sb;
	sb.appendInt(static_cast<int>(state));
	SetAttribute(STATE, sb);
	SetModifiedDate(ModelUtils::CurrentUTC());
	TaskEvent te(TaskEvent::PercentComplete, m_id);
	notifyTaskListeners(&te);
}
TCHAR* Token::toString() const{
	StringBuffer sb;
    sb.append(_T("("));
    sb.append( _termText );
    sb.append(_T(","));
    sb.appendInt( _startOffset );
    sb.append(_T(","));
    sb.appendInt( _endOffset );
    
    if ((!_tcscmp( _type, _T("word"))) == 0 ){
      sb.append(_T(",type="));
      sb.append(_type);
    }
    if (positionIncrement != 1){
      sb.append(_T(",posIncr="));
      sb.appendInt(positionIncrement);
    }
    sb.append(_T(")"));

    return sb.toString();
}
Beispiel #4
0
///
/// Arbitrary integer set by user.
///
void CTaskModel::SetPriority(int pri)
{
	StringBuffer sb;
	sb.appendInt(pri);
	SetAttribute(PRIORITY, sb);
	SetModifiedDate(ModelUtils::CurrentUTC());
	
	#ifdef _DEBUG
	
	TCHAR out[1024];
	_stprintf_s(out, _T("Set Task: %0.16I64x -Priority: %d\r\n"), m_id, pri);
	OutputDebugString(out);

	#endif
	
	TaskEvent te(TaskEvent::Priority, m_id);
	notifyTaskListeners(&te);
}