Пример #1
0
SmartPointer<IHandlerActivation> HandlerService::ActivateHandler(
    const SmartPointer<IHandlerActivation>& childActivation)
{
  const QString commandId = childActivation->GetCommandId();
  const IHandler::Pointer handler = childActivation->GetHandler();
  const Expression::Pointer expression = childActivation->GetExpression();
  const int depth = childActivation->GetDepth() + 1;
  const IHandlerActivation::Pointer localActivation(
        new HandlerActivation(commandId, handler, expression, depth, this));
  handlerAuthority->ActivateHandler(localActivation);
  return localActivation;
}
Пример #2
0
SmartPointer<IHandlerActivation> SlaveHandlerService::ActivateHandler(const SmartPointer<IHandlerActivation>& childActivation)
{
  const QString commandId = childActivation->GetCommandId();
  const IHandler::Pointer handler = childActivation->GetHandler();
  const Expression::Pointer childExpression = childActivation->GetExpression();
  Expression::Pointer expression = defaultExpression;
  if (childExpression.IsNotNull() && defaultExpression.IsNotNull())
  {
    const AndExpression::Pointer andExpression(new AndExpression());
    andExpression->Add(childExpression);
    andExpression->Add(defaultExpression);
    expression = andExpression;
  }
  else if (childExpression.IsNotNull())
  {
    expression = childExpression;
  }
  const int depth = childActivation->GetDepth() + 1;
  const IHandlerActivation::Pointer localActivation(
        new HandlerActivation(commandId, handler, expression, depth, this));

  return DoActivation(localActivation);
}