当前位置: 首页>>代码示例>>C#>>正文


C# IConnector.AttachEndPoint方法代码示例

本文整理汇总了C#中IConnector.AttachEndPoint方法的典型用法代码示例。如果您正苦于以下问题:C# IConnector.AttachEndPoint方法的具体用法?C# IConnector.AttachEndPoint怎么用?C# IConnector.AttachEndPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IConnector的用法示例。


在下文中一共展示了IConnector.AttachEndPoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessAttachEndPoint

        public static void ProcessAttachEndPoint(IBlockWeb containerWeb, IConnector connector, XmlElement endpointElement, string blockId)
        {
            string endpointKey = null;

            if (endpointElement.Name == "valueEndPoint")
            {
                if (!TemplateProcessor.ProcessTemplateFile(endpointElement, containerWeb, blockId, connector))
                {
                    object value = ObjectReader.ReadObject(endpointElement);
                    endpointKey = connector.AttachEndPoint(value);
                }
            }
            else if (endpointElement.Name == "serviceEndPoint")
            {
                if (!TemplateProcessor.ProcessTemplateFile(endpointElement, containerWeb, blockId, connector))
                {
                    string endpointBlockId = endpointElement.GetAttribute("blockId");
                    string endpointService = endpointElement.GetAttribute("service");

                    if (!endpointElement.HasAttribute("blockId")) endpointBlockId = blockId;

                    endpointKey = connector.AttachEndPoint(endpointBlockId, endpointService);
                }
            }
            else if (endpointElement.Name == "connectorEndPoint")
            {
                if (!TemplateProcessor.ProcessTemplateFile(endpointElement, containerWeb, blockId, connector))
                {
                    string endpointBlockId = endpointElement.GetAttribute("blockId");
                    string endPointConnectorKey = endpointElement.GetAttribute("connectorKey");

                    if (!endpointElement.HasAttribute("blockId")) endpointBlockId = blockId;

                    endpointKey = connector.AttachConnectorEndPoint(endpointBlockId, endPointConnectorKey);
                }
            }
            else
            {
                throw new InvalidOperationException();
            }

            //now process fixed args
            XmlElement fixedArgsElement = endpointElement.SelectSingleNode("fixedArgs") as XmlElement;

            if (fixedArgsElement != null && endpointKey != null)
            {
                List<Connector.EndPoint> fixedArgs = EndPointExtractor.ExtractArguments(fixedArgsElement, containerWeb);

                foreach (Connector.EndPoint endPoint in fixedArgs)
                {
                    connector.AddFixedArg(endpointKey, endPoint);
                }
            }
        }
开发者ID:mm-binary,项目名称:DARF,代码行数:54,代码来源:EndPointExtractor.cs

示例2: Attach

        public void Attach(IConnector connector, IBlockWeb context)
        {
            string epKey = null;

            if (value != null)
            {
                epKey = connector.AttachEndPoint(value);
            }
            else if (serviceName != null)
            {
                epKey = connector.AttachEndPoint(blockId, serviceName);
            }
            else
            {
                epKey = connector.AttachConnectorEndPoint(blockId, connectorKey);
            }

            foreach (EndPointDescriptor ep in FixedArgs)
            {
                connector.AddFixedArg(epKey, ep.GetEndPoint(context));
            }
        }
开发者ID:mm-binary,项目名称:DARF,代码行数:22,代码来源:AttachEndPointNode.cs

示例3: AttachToConnector

 public void AttachToConnector(IConnector connector)
 {
     if (address != null)
     {
         if (addressIsConnector == false)
         {
             connector.AttachEndPoint(address.GetBlockId(), address.GetServiceName());
         }
         else
         {
             connector.AttachConnectorEndPoint(address.GetBlockId(), address.GetConnectorKey());
         }
     }
     else if (epObject != null)
     {
         connector.AttachEndPoint(epObject.Value);
     }
     else
     {
         connector.AttachEndPoint(epIdentifier.Value);
     }
 }
开发者ID:mm-binary,项目名称:DARF,代码行数:22,代码来源:AttachEndPointCmd.cs


注:本文中的IConnector.AttachEndPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。