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


C# IScope.GetConnections方法代码示例

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


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

示例1: InvokeClients

 /// <summary>
 /// Invoke clients with parameters and callback.
 /// </summary>
 /// <param name="method">Method name.</param>
 /// <param name="arguments">Invocation parameters passed to the method.</param>
 /// <param name="callback">Callback used to handle return values.</param>
 /// <param name="ignoreSelf">Current client shoud be ignored.</param>
 /// <param name="targetScope">Invoke clients subscribed to the specified Scope.</param>
 protected void InvokeClients(string method, object[] arguments, IPendingServiceCallback callback, bool ignoreSelf, IScope targetScope)
 {
     try
     {
         if (log.IsDebugEnabled)
             log.Debug(string.Format("Invoke clients: {0}", method));
         IServiceCapableConnection connection = FluorineFx.Context.FluorineContext.Current.Connection as IServiceCapableConnection;
         IEnumerator collections = targetScope.GetConnections();
         while (collections.MoveNext())
         {
             IConnection connectionTmp = collections.Current as IConnection;
             if (!connectionTmp.Scope.Name.Equals(targetScope.Name))
                 continue;
             if ((connectionTmp is IServiceCapableConnection) && (!ignoreSelf || connectionTmp != connection))
                 (connectionTmp as IServiceCapableConnection).Invoke(method, arguments, callback);
         }
     }
     catch (Exception ex)
     {
         if (log.IsErrorEnabled)
             log.Error("InvokeClients failed", ex);
         throw;
     }
     finally
     {
         if (log.IsDebugEnabled)
             log.Debug(string.Format("Finished invoking clients ({0})", method));
     }
 }
开发者ID:Nicholi,项目名称:fluorinefx-mod,代码行数:37,代码来源:ApplicationAdapter.cs


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