public IBaseAdaptedOutput CreateAdaptedOutput(IIdentifiable adaptedOutputId, IBaseOutput adaptee, IBaseInput target)
        {
            // TODO: Some usefull criteria here
            if (true)
            {
                // If a MultiInputAdaptor already exists for the target, get that one, otherwise create a new.
                MultiInputAdaptor multiInputAdaptor;
                if (!ExistingMultiInputAdaptors.TryGetValue(target, out multiInputAdaptor))
                {
                    multiInputAdaptor = new MultiInputAdaptor("SomeId")
                    {
                        SpatialDefinition = ((ITimeSpaceInput)target).SpatialDefinition
                    };
                    multiInputAdaptor.AddConsumer(target);
                    ExistingMultiInputAdaptors.Add(target, multiInputAdaptor);
                }

                if (adaptedOutputId == _identityAdaptor)
                {
                    // Identity adaptor
                    IBaseAdaptedOutput adaptedOutput = multiInputAdaptor.CreateChildAdaptor(adaptee);
                    return(adaptedOutput);
                }
                else
                {
                    // ElementMapping adaptor
                    IBaseAdaptedOutput adaptedOutput = _spatialAdaptorFactory.CreateAdaptedOutput(adaptedOutputId, adaptee, target);
                    if (adaptedOutput != null)
                    {
                        multiInputAdaptor.Adaptees.Add((ITimeSpaceOutputAdder)adaptedOutput);
                        return(adaptedOutput);
                    }
                }
            }

            return(null);
        }
 public ChildIdentityAdaptor(MultiInputAdaptor parent, ITimeSpaceOutput adaptee)
 {
   _parent = parent;
   _adaptee = adaptee;
 }
    public IBaseAdaptedOutput CreateAdaptedOutput(IIdentifiable adaptedOutputId, IBaseOutput adaptee, IBaseInput target)
    {
      // TODO: Some usefull criteria here
      if (true)
      {
        // If a MultiInputAdaptor already exists for the target, get that one, otherwise create a new.
        MultiInputAdaptor multiInputAdaptor;
        if (!ExistingMultiInputAdaptors.TryGetValue(target, out multiInputAdaptor))
        {
          multiInputAdaptor = new MultiInputAdaptor("SomeId")
                                  {
                                    SpatialDefinition = ((ITimeSpaceInput)target).SpatialDefinition
                                  };
          multiInputAdaptor.AddConsumer(target);
          ExistingMultiInputAdaptors.Add(target, multiInputAdaptor);
        }

        if (adaptedOutputId == _identityAdaptor)
        {
          // Identity adaptor
          IBaseAdaptedOutput adaptedOutput = multiInputAdaptor.CreateChildAdaptor(adaptee);
          return (adaptedOutput);
        }
        else
        {
          // ElementMapping adaptor
          IBaseAdaptedOutput adaptedOutput = _spatialAdaptorFactory.CreateAdaptedOutput(adaptedOutputId, adaptee, target);
          if (adaptedOutput != null)
          {
            multiInputAdaptor.Adaptees.Add((ITimeSpaceOutputAdder) adaptedOutput);
            return (adaptedOutput);
          }
        }
      }

      return (null);

    }
 public ChildIdentityAdaptor(MultiInputAdaptor parent, ITimeSpaceOutput adaptee)
 {
     _parent  = parent;
     _adaptee = adaptee;
 }