Exemplo n.º 1
0
 public static IEnumerable <EndPoint> Publishers(this EndPointConfig config)
 {
     if (config.EndPoints == null)
     {
         return(new List <EndPoint>().AsEnumerable());
     }
     else
     {
         return(from g in config.EndPoints where g.EndPointType == EndPointTypeOptions.Publisher select g);
     }
 }
Exemplo n.º 2
0
        public static void RemoveEndPoint(this EndPointConfig config, string name)
        {
            if (config.EndPoints != null)
            {
                EndPoint match = config.EndPoints.FirstOrDefault(g => g.Name.Equals(name, StringComparison.OrdinalIgnoreCase));

                if (match != null)
                {
                    config.EndPoints.Remove(match);
                }
            }
        }
Exemplo n.º 3
0
        public static void AddEndPoint(this EndPointConfig config, EndPoint toAdd)
        {
            if (config.EndPoints == null)
            {
                config.EndPoints = new List <EndPoint>();
            }

            if (config.EndPoints.Exists(g => g.Name.Equals(toAdd.Name, StringComparison.OrdinalIgnoreCase)))
            {
                throw new InvalidOperationException(string.Format("EndPoint: {0} already exists", toAdd.Name));
            }
            config.EndPoints.Add(toAdd);
        }