Пример #1
0
        public static DslModeling::ElementLink Connect(DslModeling::ModelElement source, DslModeling::ModelElement target)
        {
            if (source == null)
            {
                throw new global::System.ArgumentNullException("source");
            }
            if (target == null)
            {
                throw new global::System.ArgumentNullException("target");
            }

            if (CanAcceptSourceAndTarget(source, target))
            {
                if (source is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)
                {
                    if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
                    {
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service         sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)source;
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)target;

                        return(ConnectServiceToServiceContract(sourceAccepted, targetAccepted));
                    }
                    else if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)
                    {
                        return(null);
                    }
                }
                if (source is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
                {
                    if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
                    {
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)source;
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation       targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)target;

                        return(ConnectServiceContractToOperation(sourceAccepted, targetAccepted));
                    }
                    else if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)
                    {
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)source;
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service         targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)target;

                        return(ConnectServiceContractToService(sourceAccepted, targetAccepted));
                    }
                    else if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
                    {
                        return(null);
                    }
                }
                if (source is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
                {
                    if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)
                    {
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation   sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)source;
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)target;
                        DslModeling::ElementLink result = new global::Microsoft.Practices.ServiceFactory.ServiceContracts.OperationReferencesResponse(sourceAccepted, targetAccepted);
                        if (DslModeling::DomainClassInfo.HasNameProperty(result))
                        {
                            DslModeling::DomainClassInfo.SetUniqueName(result);
                        }
                        return(result);
                    }
                    else if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
                    {
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation       sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)source;
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)target;

                        return(ConnectOperationToServiceContract(sourceAccepted, targetAccepted));
                    }
                    else if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
                    {
                        return(null);
                    }
                }
                if (source is global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)
                {
                    if (target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
                    {
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)source;
                        global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation   targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)target;
                        DslModeling::ElementLink result = new global::Microsoft.Practices.ServiceFactory.ServiceContracts.RequestReferencedByOperation(sourceAccepted, targetAccepted);
                        if (DslModeling::DomainClassInfo.HasNameProperty(result))
                        {
                            DslModeling::DomainClassInfo.SetUniqueName(result);
                        }
                        return(result);
                    }
                }
            }
            global::System.Diagnostics.Debug.Fail("Having agreed that the connection can be accepted we should never fail to make one.");
            throw new global::System.InvalidOperationException();
        }
Пример #2
0
		public static DslModeling::ElementLink Connect(DslModeling::ModelElement source, DslModeling::ModelElement target)
		{
			if(source == null)
			{
				throw new global::System.ArgumentNullException("source");
			}
			if(target == null)
			{
				throw new global::System.ArgumentNullException("target");
			}

			if(CanAcceptSourceAndTarget(source, target))
			{
				if(source is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)
				{
					if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
					{
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)source;
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)target;

						return ConnectServiceToServiceContract(sourceAccepted, targetAccepted);
					}
					else if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)
					{
						return null;
					}
				}
				if(source is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
				{
					if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
					{
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)source;
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)target;

						return ConnectServiceContractToOperation(sourceAccepted, targetAccepted);
					}
					else if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)
					{
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)source;
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Service)target;

						return ConnectServiceContractToService(sourceAccepted, targetAccepted);
					}
					else if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
					{
						return null;
					}
				}
				if(source is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
				{
					if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)
					{
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)source;
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)target;
						DslModeling::ElementLink result = new global::Microsoft.Practices.ServiceFactory.ServiceContracts.OperationReferencesResponse(sourceAccepted, targetAccepted);
						if(DslModeling::DomainClassInfo.HasNameProperty(result))
						{
							DslModeling::DomainClassInfo.SetUniqueName(result);
						}
						return result;
					}
					else if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)
					{
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)source;
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.ServiceContract)target;

						return ConnectOperationToServiceContract(sourceAccepted, targetAccepted);
					}
					else if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
					{
						return null;
					}
				}
				if(source is global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)
				{
					if(target is global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)
					{
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase sourceAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.MessageBase)source;
						global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation targetAccepted = (global::Microsoft.Practices.ServiceFactory.ServiceContracts.Operation)target;
						DslModeling::ElementLink result = new global::Microsoft.Practices.ServiceFactory.ServiceContracts.RequestReferencedByOperation(sourceAccepted, targetAccepted);
						if(DslModeling::DomainClassInfo.HasNameProperty(result))
						{
							DslModeling::DomainClassInfo.SetUniqueName(result);
						}
						return result;
					}
				}

			}
			global::System.Diagnostics.Debug.Fail("Having agreed that the connection can be accepted we should never fail to make one.");
			throw new global::System.InvalidOperationException();
		}