internal DataSetItemConfirmation
     (DataSetConfigurationWrapper wrapper, Func <DataSetConfigurationWrapper, IEnumerable <AssociationCouplerViewModel> > enumerator, bool associationRoleEditable, IEnumerable <DomainModelWrapper> domainsEnumerable)
 {
     DataSetConfigurationWrapper = wrapper;
     m_GetMessageHandlers        = enumerator;
     Domains = domainsEnumerable;
     DomainsSelectedIndex                    = 0;
     AssociationCouplersEnumerator           = m_GetMessageHandlers(DataSetConfigurationWrapper);
     AssociationRoleSelectorControlViewModel = new AssociationRoleSelectorControlViewModel(x => AssociationRole = x, AssociationRole, associationRoleEditable);
 }
        private void AddDataSetCommandHandler()
        {
            DataSetConfigurationWrapper _dsc          = DataSetConfigurationWrapper.CreateDefault();
            DataSetItemConfirmation     _confirmation = new DataSetItemConfirmation(_dsc, m_AssociationServices.GetAssociationCouplerViewModelEnumerator, true, m_DomainsService.GetAvailableDomains())
            {
                Title = "New DataSet"
            };
            bool _confirmed = false;

            b_AddRequest.Raise(_confirmation, x => { _confirmed = x.Confirmed; });
            if (_confirmed)
            {
                m_DataSetModelServices.AddDataSet(_confirmation.DataSetConfigurationWrapper);
                _confirmation.ApplyChanges();
            }
        }
Exemplo n.º 3
0
 internal void ApplyChanges(DataSetConfigurationWrapper dataSetConfigurationWrapper)
 {
     m_Coupler.AssociationWrapper.DataSetWriterId = dataSetConfigurationWrapper.DefaultDataSetWriterId;
     m_Coupler.AssociationWrapper.PublisherId     = dataSetConfigurationWrapper.Id;
     ApplyChanges();
 }
 public void Remove(DataSetConfigurationWrapper item)
 {
     m_Configuration.Remove(item);
 }
 public void AddDataSet(DataSetConfigurationWrapper item)
 {
     m_Configuration.Add(item);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the array of all candidates <see cref="AssociationCouplerViewModel" /> that can be associated with <paramref name="dscWrapper" />
 /// </summary>
 /// <param name="dscWrapper">The wrapper <see cref="DataSetConfigurationWrapper" />.</param>
 /// <returns>All available <see cref="AssociationCouplerViewModel" />.</returns>
 public AssociationCouplerViewModel[] GetAssociationCouplerViewModelEnumerator(DataSetConfigurationWrapper dscWrapper)
 {
     return(m_MessageHandlerModelServices.GetMessageHandlers(dscWrapper.AssociationRole).
            Select <IMessageHandlerConfigurationWrapper, AssociationCouplerViewModel>
                (mhcWrapper => new AssociationCouplerViewModel(new AssociationCoupler(mhcWrapper.Check(dscWrapper),
                                                                                      (associated, association) => mhcWrapper.Associate(associated, association),
                                                                                      mhcWrapper.ToString(),
                                                                                      DefaultAssociation(mhcWrapper.TransportRole, dscWrapper)))).
            ToArray <AssociationCouplerViewModel>());
 }
Exemplo n.º 7
0
        private IAssociationConfigurationWrapper DefaultAssociation(AssociationRole transportRole, DataSetConfigurationWrapper dsc)
        {
            IAssociationConfigurationWrapper _ret = null;

            switch (transportRole)
            {
            case AssociationRole.Consumer:
                _ret = ConsumerAssociationConfigurationWrapper.GetDefault(dsc);
                break;

            case AssociationRole.Producer:
                _ret = ProducerAssociationConfigurationWrapper.GetDefault(dsc);
                break;
            }
            return(_ret);
        }