Ejemplo n.º 1
0
        } // ProxyConfiguration

        public string GetProxiedLocationUrl(string protocol, string address, ushort port)
        {
            if (!IsEnabled)
            {
                return(string.Format("{0}://@{1}:{2}", protocol, address, port));
            } // if

            var paramKeys = new string[]
            {
                "protocol",
                "protocolU",
                "multicastAddress",
                "multicastPort"
            };
            var paramValues = new string[]
            {
                protocol,
                protocol.ToUpperInvariant(),
                address,
                port.ToString()
            };
            var parameters = ArgumentsManager.CreateParameters(paramKeys, paramValues, false);

            return(ArgumentsManager.ExpandArgument(ProxyConfiguration, parameters, ParameterOpenBrace, ParameterCloseBrace, StringComparison.CurrentCultureIgnoreCase));
        } // GetProxiedLocationUrl
Ejemplo n.º 2
0
        } // LaunchRecorderProgram

        private IDictionary <string, string> CreateParameters(string filename, RecordTask task)
        {
            var paramKeys = new string[]
            {
                "OutputFile",
                "Channel.Url",
                "Channel.Name",
                "Channel.Description",
                "Description.Name",
                "Description.Description",
                "Duration.TotalSeconds",
            };
            var paramValues = new string[]
            {
                filename,
                task.Channel.ChannelUrl,
                task.Channel.Name,
                task.Channel.Description,
                task.Description.Name,
                task.Description.Description,
                ((int)TotalTime.TotalSeconds).ToString(CultureInfo.InvariantCulture),
            };

            return(ArgumentsManager.CreateParameters(paramKeys, paramValues, false));
        } // CreateParameters
Ejemplo n.º 3
0
        } // ShowTvChannel

        public static void Launch(TvPlayer player, UiBroadcastService service, bool throughShortcut)
        {
            if (!File.Exists(player.Path))
            {
                var ex = new FileNotFoundException();
                throw new FileNotFoundException(ex.Message + "\r\n" + player.Path);
            } // if

            if (LaunchParamKeys == null)
            {
                LaunchParamKeys = new string[]
                {
                    "Channel.Url",
                    "Channel.Name",
                    "Channel.Description",
                    "Channel.Icon.Path",
                };
            } // if

            var paramValues = new string[]
            {
                service.LocationUrl,
                service.DisplayName,
                service.DisplayDescription,
                service.Logo.GetLogoIconPath(),
            };

            var parameters      = ArgumentsManager.CreateParameters(LaunchParamKeys, paramValues, false);
            var arguments       = ArgumentsManager.ExpandArguments(player.Arguments, parameters, TvPlayer.ParameterOpenBrace, TvPlayer.ParameterCloseBrace, StringComparison.CurrentCultureIgnoreCase);
            var launchArguments = ArgumentsManager.JoinArguments(arguments);

            if (throughShortcut)
            {
                LaunchShortcut(player, service, launchArguments);
            }
            else
            {
                LaunchProcess(player, launchArguments);
            } // if-else
        }     // Launch