示例#1
0
        /// <summary>
        /// Returns all query parameters.
        /// </summary>
        private IEnumerator <KeyValuePair <string, string> > GetQueries()
        {
            if (!string.IsNullOrEmpty(this.Cursor))
            {
                var cursor = JsonConvert.DeserializeObject <JObject>(this.Cursor);
                foreach (var pair in cursor)
                {
                    yield return(new KeyValuePair <string, string>(pair.Key, pair.Value.ToString()));
                }
            }
            yield return(new KeyValuePair <string, string>("mode", ((int)GameMode).ToString()));

            yield return(new KeyValuePair <string, string>("category", ((int)Category).ToString()));

            yield return(new KeyValuePair <string, string>("genre", ((int)Genre).ToString()));

            yield return(new KeyValuePair <string, string>("language", ((int)Language).ToString()));

            yield return(new KeyValuePair <string, string>("sort", ((int)Sort).ToString()));

            yield return(new KeyValuePair <string, string>("query", Query));

            yield return(new KeyValuePair <string, string>("hasVideo", HasVideo.ToString().ToLower()));

            yield return(new KeyValuePair <string, string>("hasStoryboard", HasStoryboard.ToString().ToLower()));

            yield return(new KeyValuePair <string, string>("isDescending", IsDescending.ToString().ToLower()));
        }
示例#2
0
        public void Log(LogOptions lop = LogOptions.ContextData)
        {
            object sync = Sync;

            lock (sync)
            {
                switch (lop)
                {
                case LogOptions.Bitrate:
                    WriteLine("Bitrate:" + Bitrate, ConsoleColor.White);
                    break;

                case LogOptions.CompiledSize:
                    WriteLine("CompiledSize:" + CompiledSize, ConsoleColor.White);
                    break;

                case LogOptions.CompiledTime:
                    WriteLine("CompiledTime:" + CompiledTime, ConsoleColor.White);
                    break;

                case LogOptions.Configuration:
                    WriteLine("Configuration:" + Configuration, ConsoleColor.White);
                    break;

                case LogOptions.ContextData:
                    WriteLine("ContextData:\r\n", ConsoleColor.White);
                    foreach (string str in ContextData)
                    {
                        WriteLine("  " + str + "\r\n", ConsoleColor.White);
                    }
                    break;

                case LogOptions.Data:
                    WriteLine("Data:" + Data, ConsoleColor.White);
                    break;

                case LogOptions.Duration:
                    WriteLine("Duration:" + Duration, ConsoleColor.White);
                    break;

                case LogOptions.ffplayPath:
                    WriteLine("ffplayPath:" + ffplayPath, ConsoleColor.White);
                    break;

                case LogOptions.ffprobePath:
                    WriteLine("ffprobePath:" + ffprobePath, ConsoleColor.White);
                    break;

                case LogOptions.ForecastTime:
                    WriteLine("ForecastTime:" + ForecastTime, ConsoleColor.White);
                    break;

                case LogOptions.FPS:
                    WriteLine("FPS:" + FPS, ConsoleColor.White);
                    break;

                case LogOptions.Frame:
                    WriteLine("Frame:" + Frame, ConsoleColor.White);
                    break;

                case LogOptions.ffmpegPath:
                    WriteLine("ffmpegPath:" + ffmpegPath, ConsoleColor.White);
                    break;

                case LogOptions.HasAudio:
                    WriteLine("HasAudio:" + HasAudio.ToString(), ConsoleColor.White);
                    break;

                case LogOptions.HasVideo:
                    WriteLine("HasVideo:" + HasVideo.ToString(), ConsoleColor.White);
                    break;

                case LogOptions.PrimaryBitrate:
                    WriteLine("PrimaryBitrate:" + PrimaryBitrate, ConsoleColor.White);
                    break;

                case LogOptions.PrimaryFileSize:
                    WriteLine("PrimaryFileSize:" + PrimaryFileSize, ConsoleColor.White);
                    break;

                case LogOptions.PrimaryFPS:
                    WriteLine("PrimaryFPS:" + PrimaryFPS, ConsoleColor.White);
                    break;

                case LogOptions.PrimarySize:
                    WriteLine(string.Concat(new object[]
                    {
                        "PrimarySize:",
                        PrimarySize.Width,
                        "x",
                        PrimarySize.Height
                    }), ConsoleColor.White);
                    break;

                case LogOptions.Quality:
                    WriteLine("Quality:" + Quality, ConsoleColor.White);
                    break;

                case LogOptions.Speed:
                    WriteLine("Speed:" + Speed, ConsoleColor.White);
                    break;

                case LogOptions.StartTime:
                    WriteLine("StartTime:" + StartTime, ConsoleColor.White);
                    break;

                case LogOptions.StreamEncoder:
                    WriteLine("StreamEncoder:", ConsoleColor.White);
                    foreach (string str2 in StreamEncoder)
                    {
                        WriteLine("   " + str2 + "\r\n", ConsoleColor.White);
                    }
                    break;

                case LogOptions.StreamInfo:
                    WriteLine("StreamInfo:", ConsoleColor.White);
                    foreach (string str3 in StreamInfo)
                    {
                        WriteLine("   " + str3 + "\r\n", ConsoleColor.White);
                    }
                    break;

                case LogOptions.StreamMapping:
                    WriteLine("StreamMapping:", ConsoleColor.White);
                    foreach (string str4 in StreamMapping)
                    {
                        WriteLine("   " + str4 + "\r\n", ConsoleColor.White);
                    }
                    break;

                case LogOptions.TargetSize:
                    WriteLine(string.Concat(new object[]
                    {
                        "TargetSize:",
                        TargetSize.Width,
                        "x",
                        TargetSize.Height
                    }), ConsoleColor.White);
                    break;
                }
            }
        }