Esempio n. 1
0
        public string MulicastSessionList(string environment)
        {
            if (environment == "winpe")
            {
                var multicastList = new List <Services.Client.WinPEMulticastList>();
                foreach (var multicast in BLL.ActiveMulticastSession.GetOnDemandList())
                {
                    var multicastSession = new Services.Client.WinPEMulticastList();
                    multicastSession.Port = multicast.Port.ToString();
                    multicastSession.Name = multicast.Name;
                    multicastList.Add(multicastSession);
                }
                return(JsonConvert.SerializeObject(multicastList));
            }
            else
            {
                var multicastList = new Services.Client.MulticastList()
                {
                    Multicasts = new List <string>()
                };

                foreach (var multicast in BLL.ActiveMulticastSession.GetOnDemandList())
                {
                    multicastList.Multicasts.Add(multicast.Port + " " + multicast.Name);
                }

                return(JsonConvert.SerializeObject(multicastList));
            }
        }
Esempio n. 2
0
        public string MulicastSessionList()
        {
            var multicastList = new Services.Client.MulticastList() { Multicasts = new List<string>() };

            foreach (var multicast in BLL.ActiveMulticastSession.GetOnDemandList())
            {
                multicastList.Multicasts.Add(multicast.Port + " " + multicast.Name);
            }

            return JsonConvert.SerializeObject(multicastList);
        }
Esempio n. 3
0
        public string MulicastSessionList(string environment)
        {
            if (environment == "winpe")
            {
                var multicastList = new List<Services.Client.WinPEMulticastList>();
                foreach (var multicast in BLL.ActiveMulticastSession.GetOnDemandList())
                {
                    var multicastSession = new Services.Client.WinPEMulticastList();
                    multicastSession.Port = multicast.Port.ToString();
                    multicastSession.Name = multicast.Name;
                    multicastList.Add(multicastSession);
                }
                return JsonConvert.SerializeObject(multicastList);
            }
            else
            {
                var multicastList = new Services.Client.MulticastList() {Multicasts = new List<string>()};

                foreach (var multicast in BLL.ActiveMulticastSession.GetOnDemandList())
                {
                    multicastList.Multicasts.Add(multicast.Port + " " + multicast.Name);
                }

                return JsonConvert.SerializeObject(multicastList);
            }
        }