public override void ElementAdded(ElementAddedEventArgs e)
        {
            PrimitiveDataTypeCollection dataContractPrimitiveCollection = e.ModelElement as PrimitiveDataTypeCollection;

            if (dataContractPrimitiveCollection == null)
            {
                return;
            }

            DataContractModel root = dataContractPrimitiveCollection.DataContractModel;

            if (root != null &&
                root.ImplementationTechnology != null)
            {
                ExtensionProviderHelper.AttachObjectExtender(dataContractPrimitiveCollection, root.ImplementationTechnology);
            }

            if (string.IsNullOrEmpty(dataContractPrimitiveCollection.ItemType))
            {
                dataContractPrimitiveCollection.ItemType = typeof(string).FullName;
            }

            if (String.IsNullOrEmpty(dataContractPrimitiveCollection.Namespace))
            {
                dataContractPrimitiveCollection.Namespace = ArtifactLinkHelper.DefaultNamespace(e.ModelElement);
            }

            UpdateDataContractCollectionType(dataContractPrimitiveCollection, CollectionTypes.Values[CollectionTypes.ListKey]);
        }
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            ServiceDescription service          = e.ModelElement as ServiceDescription;
            IExtensibleObject  extensibleObject = service as IExtensibleObject;

            if (extensibleObject.ExtensionProvider != null)
            {
                ExtensionProviderHelper.AttachObjectExtender(service, extensibleObject.ExtensionProvider);
            }
        }
Example #3
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            Endpoint          endpoint         = e.ModelElement as Endpoint;
            IExtensibleObject extensibleObject = endpoint as IExtensibleObject;

            if (extensibleObject.ExtensionProvider != null)
            {
                ExtensionProviderHelper.AttachObjectExtender(endpoint, extensibleObject.ExtensionProvider);
            }
        }
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            DataContractCollection dataContractCollection = e.ModelElement as DataContractCollection;
            DataContractModel      root = dataContractCollection.DataContractModel;

            if (root != null &&
                root.ImplementationTechnology != null)
            {
                ExtensionProviderHelper.AttachObjectExtender(dataContractCollection, root.ImplementationTechnology);
            }
        }
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            Message messageContract   = e.ModelElement as Message;
            ServiceContractModel root = messageContract.ServiceContractModel;

            if (root != null &&
                root.ImplementationTechnology != null)
            {
                ExtensionProviderHelper.AttachObjectExtender(messageContract, root.ImplementationTechnology);
            }
        }
Example #6
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            FaultContract     faultContract = e.ModelElement as FaultContract;
            DataContractModel root          = faultContract.DataContractModel;

            if (root != null &&
                root.ImplementationTechnology != null)
            {
                ExtensionProviderHelper.AttachObjectExtender(faultContract, root.ImplementationTechnology);
            }
        }
Example #7
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            PrimitiveMessagePart messagePart = e.ModelElement as PrimitiveMessagePart;

            if (messagePart.Message != null)
            {
                ServiceContractModel root = messagePart.Message.ServiceContractModel;
                if (root != null && root.ImplementationTechnology != null)
                {
                    ExtensionProviderHelper.AttachObjectExtender(messagePart, root.ImplementationTechnology);
                }
            }
        }
Example #8
0
 public override void ElementPropertyChanged(ElementPropertyChangedEventArgs e)
 {
     if (e.NewValue is IExtensionProvider)
     {
         // update all extenders
         foreach (ModelElement element in e.ModelElement.Store.ElementDirectory.AllElements)
         {
             if (typeof(IExtensibleObject).IsAssignableFrom(element.GetType()))
             {
                 ExtensionProviderHelper.AttachObjectExtender((IExtensibleObject)element, (IExtensionProvider)e.NewValue);
             }
         }
     }
 }
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            XsdElementFault fault = e.ModelElement as XsdElementFault;

            if (fault.Operation != null)
            {
                ServiceContractModel root = fault.Operation.ServiceContractModel;
                if (root != null &&
                    root.ImplementationTechnology != null)
                {
                    ExtensionProviderHelper.AttachObjectExtender(fault, root.ImplementationTechnology);
                }
            }
        }
Example #10
0
 public override void ElementPropertyChanged(ElementPropertyChangedEventArgs e)
 {
     if (e.NewValue is IExtensionProvider)
     {
         HostApplication hostApp = e.ModelElement as HostApplication;
         foreach (ServiceDescription sd in hostApp.ServiceDescriptions)
         {
             ExtensionProviderHelper.AttachObjectExtender((IExtensibleObject)sd, (IExtensionProvider)e.NewValue);
             foreach (Endpoint endpoint in sd.Endpoints)
             {
                 ExtensionProviderHelper.AttachObjectExtender((IExtensibleObject)endpoint, (IExtensionProvider)e.NewValue);
             }
         }
     }
 }
Example #11
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            Operation            operation = e.ModelElement as Operation;
            ServiceContractModel root      = operation.ServiceContractModel;

            if (root != null && root.ImplementationTechnology != null)
            {
                ExtensionProviderHelper.AttachObjectExtender(operation, root.ImplementationTechnology);
            }

            if (String.IsNullOrEmpty(operation.Action))
            {
                operation.Action = Operation.BuildDefaultAction(operation);
            }
        }
Example #12
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            Service service           = e.ModelElement as Service;
            ServiceContractModel root = service.ServiceContractModel;

            if (root != null)
            {
                if (root.ImplementationTechnology != null)
                {
                    ExtensionProviderHelper.AttachObjectExtender(service, root.ImplementationTechnology);
                }

                if (String.IsNullOrEmpty(service.Namespace))
                {
                    service.Namespace = root.Namespace;
                }
            }
        }
Example #13
0
        public override void ElementAdded(ElementAddedEventArgs e)
        {
            DataMember        dataElement = e.ModelElement as DataMember;
            DataContractModel root        = null;

            if (dataElement.DataContract != null)
            {
                root = dataElement.DataContract.DataContractModel;
            }
            else if (dataElement.FaultContract != null)
            {
                root = dataElement.FaultContract.DataContractModel;
            }

            if (root != null &&
                root.ImplementationTechnology != null)
            {
                ExtensionProviderHelper.AttachObjectExtender(dataElement, root.ImplementationTechnology);
            }
        }