Пример #1
0
 public void AddDependency(ServiceDependency dependency, bool isUnion)
 {
     if (dependencies == null)
     {
         dependencies = new List <ServiceDependency>();
     }
     dependencies.Add(dependency);
     target.Status = DependencyStatusToServiceStatus(dependency.Status, isUnion);
 }
Пример #2
0
 private ServiceDependency SetName(ServiceDependency serviceDependency, ParameterInfo parameter, string name)
 {
     if (name != null)
     {
         serviceDependency.Name = name;
     }
     else
     {
         Type type = null;
         if (serviceDependency.ContainerService != null)
         {
             type = serviceDependency.ContainerService.Type;
         }
         else if (serviceDependency.Value != null)
         {
             type = serviceDependency.Value.GetType();
         }
         serviceDependency.Name = type == null || type.IsSimpleType() || type.UnwrapEnumerable() != type ||
                                  valueFormatters.ContainsKey(type)
                                 ? parameter.Name
                                 : type.FormatName();
     }
     return(serviceDependency);
 }
Пример #3
0
 public void AddDependency(ServiceDependency dependency, bool isUnion)
 {
     if (dependencies == null)
         dependencies = new List<ServiceDependency>();
     dependencies.Add(dependency);
     target.Status = DependencyStatusToServiceStatus(dependency.Status, isUnion);
 }
 private ServiceDependency SetName(ServiceDependency serviceDependency, ParameterInfo parameter, string name)
 {
     if (name != null)
         serviceDependency.Name = name;
     else
     {
         Type type = null;
         if (serviceDependency.ContainerService != null)
             type = serviceDependency.ContainerService.Type;
         else if (serviceDependency.Value != null)
             type = serviceDependency.Value.GetType();
         serviceDependency.Name = type == null || type.IsSimpleType() || type.UnwrapEnumerable() != type ||
                                  valueFormatters.ContainsKey(type)
             ? parameter.Name
             : type.FormatName();
     }
     return serviceDependency;
 }