Exemplo n.º 1
0
        public string GetServiceDescription(C_NSF.ServiceConfig service)
        {
            var f = this.GetFacade(service.HostUri);

            return(this.Is_C_NSF(f)
                ? (f as C_NSF.Remoting.RemoteFacade).GetServiceDescription(service)
                : (f as T_NSF.Remoting.RemoteFacade).GetServiceDescription(this.Parse(service)));
        }
 /// <summary>
 /// 向表中增加服务配置,重复则忽略
 /// </summary>
 /// <param name="config"></param>
 /// <returns></returns>
 public bool AddServiceConfig(ServiceConfig config)
 {
     var temp = this.Configs.ToList();
     if (temp.Exists(o => o.Equals(config))) return false;
     temp.Add(config);
     this.Configs = temp.ToArray();
     return true;
 }
Exemplo n.º 3
0
 private T_NSF.ServiceConfig Parse(C_NSF.ServiceConfig c)
 {
     return(new T_NSF.ServiceConfig()
     {
         AssemblyName = c.AssemblyName,
         HostUri = c.HostUri,
         LoadBalancingAlgorithm = c.LoadBalancingAlgorithm,
         Name = c.Name
     });
 }
 private string BuildDescription(ServiceConfig service)
 {
     var type = service.Type;
     //排除object继承的方法
     var list = from m in type.GetMethods()
                where !new string[] { "GetHashCode", "GetType", "Equals", "ToString" }.Contains(m.Name)
                select string.Format("<div><h3>【方法】{0}</h3><br/>【参数】<br/>{1}<br/>【返回】{2}</div>"
                , m.Name
                , this.BuildParameters(m)
                , m.ReturnType.FullName);
     return "<h2>"
         + service.Name
         + "服务定义</h2>"
         + string.Join("<br/>", list.ToArray());
 }
Exemplo n.º 5
0
        private string BuildDescription(ServiceConfig service)
        {
            var type = service.Type;
            //排除object继承的方法
            var list = from m in type.GetMethods()
                       where !new string[] { "GetHashCode", "GetType", "Equals", "ToString" }.Contains(m.Name)
            select string.Format("<div><h3>【方法】{0}</h3><br/>【参数】<br/>{1}<br/>【返回】{2}</div>"
                                 , m.Name
                                 , this.BuildParameters(m)
                                 , m.ReturnType.FullName);

            return("<h2>"
                   + service.Name
                   + "服务定义</h2>"
                   + string.Join("<br/>", list.ToArray()));
        }
 public virtual string Render(ServiceConfig service)
 {
     return this.BuildDescription(service);
 }
Exemplo n.º 7
0
 public virtual string Render(ServiceConfig service)
 {
     return(this.BuildDescription(service));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 获取指定服务的描述
 /// </summary>
 /// <param name="service"></param>
 /// <returns></returns>
 public string GetServiceDescription(ServiceConfig service)
 {
     return(this.IsLocal(service.HostUri)
         ? this.Resolve <IServiceDescriptionRender>().Render(service)
         : this._remoteHandle.GetServiceDescription(service));
 }