/// <summary> /// display program message to user /// </summary> /// <param name="message">current message</param> /// <param name="showType">current message type</param> /// <param name="line">if true console.writeLine used</param> public static void ShowApplicationMessageToUser(string message, ShowType showType = ShowType.INFO, bool line = true) { SetConsoleColor(showType); if (line) { Console.WriteLine($"[{showType.ToString()}] : {message}"); } else { Console.Write($"[{showType.ToString()}] : {message}"); } Console.ResetColor(); }
public static string ToDescriptionString(this ShowType val) { DescriptionAttribute[] attributes = (DescriptionAttribute[])val .GetType() .GetField(val.ToString()) .GetCustomAttributes(typeof(DescriptionAttribute), false); return(attributes.Length > 0 ? attributes[0].Description : string.Empty); }
public string ToLongString() { string[] lines = { $"{Title} ({ReleaseDate.ToShortDateString()}), {Genre}-{ShowType.ToString()}", Description, Actors, $"IMDB: {ImdbRating} ({ImdbId})", (!Available ? " Unavailable" : "") }; return(String.Join(Environment.NewLine, lines)); }
public static void Show(ShowType show, string msg, ServerType svr = ServerType.ALL) { ColorToken ct = "".Cyan(); switch (show) { case ShowType.Debug: ct = show.ToString().DarkCyan(); break; case ShowType.Error: ct = show.ToString().Red(); break; case ShowType.Exception: ct = show.ToString().Magenta(); break; case ShowType.Info: ct = show.ToString().Gray(); break; case ShowType.Status: ct = show.ToString().Green(); break; case ShowType.Warn: ct = show.ToString().Yellow(); break; } switch (svr) { case ServerType.ALL: ColorConsole.WriteLine("[", ct, "]: ", msg); break; case ServerType.CHAR: ColorConsole.WriteLine("[", "Char-Server".Magenta(), "|", ct, "]: ", msg); break; case ServerType.LOGIN: ColorConsole.WriteLine("[", "Login-Server".Blue(), "|", ct, "]: ", msg); break; case ServerType.MAP: ColorConsole.WriteLine("[", "Map-Server".Yellow(), "|", ct, "]: ", msg); break; } }
public override string ToString() { return($"{Title} ({ReleaseDate.Year},{ShowType.ToString()[0]}){(!Available ? " Unavailable" : "")}"); }
public override string Render() { if (Visiable) { AddAttributes(); var texts = new List <string>(); if (TextID.IsNullOrEmpty()) { TextID = "{0}_Text".FormatTo(Id); } if (!Value.IsNullOrEmpty() && !SelectType.IsNullOrEmpty()) { var page = PageBuilder.BuildPage(SelectType); if (page != null && page.Controls.Count > 0) { IFieldConverter listDs = null; page.Controls.ForEach((o) => { if (o is IListDataSourceControl) { listDs = (o as IListDataSourceControl).DataSource as IFieldConverter; return; } else if (o is ICascadeDataSourceControl) { listDs = (o as ICascadeDataSourceControl).DataSource as IFieldConverter; return; } }); if (listDs != null) { if (IsMulitle) { foreach (var v in Value.Split(',')) { texts.Add(listDs.Converter(Id, v, null).ToString()); } } else { texts.Add(listDs.Converter(Id, Value, null).ToString()); } } } } string text = string.Empty; if (texts.Count > 0) { text = string.Join(",", texts.ToArray()); } var textBox = new TextBox() { Id = TextID, Name = TextID, Value = text }; if (!Attributes.IsNullOrEmpty()) { foreach (var attr in Attributes) { textBox.Attributes[attr.Key] = attr.Value; } } textBox.Attributes["data-selector"] = SelectType; textBox.Attributes["data-showtype"] = ShowType.ToString(); textBox.Attributes["data-multiple"] = IsMulitle.ToString().ToLower(); textBox.Attributes["data-target"] = Id; textBox.Attributes["data-dialogheight"] = DialogHeight.ToString(); textBox.Attributes["data-dialogwidth"] = DialogWidth.ToString(); var hidden = new HiddenField() { Id = Id, Name = Id, Value = Value, Validator = Validator }; string result = hidden.Render() + textBox.Render(); return(ContainerTemplate.FormatTo(Id, Label, result, Description)); } return(string.Empty); }
public override string ToString() { string allOpts = ""; allOpts += "Task -> " + taskName + "\r\n"; allOpts += "Profile -> " + profile + "\r\n"; allOpts += "Source File -> " + sourceVideo + "\r\n"; allOpts += "Relative Source Path -> " + relativeSourcePath + "\r\n"; allOpts += "Destination Path -> " + destinationPath + "\r\n"; allOpts += "Working Path -> " + workingPath + "\r\n"; allOpts += "Fallback Destination -> " + fallbackToSourcePath.ToString() + "\r\n"; allOpts += "Skip ReProcessing -> " + skipReprocessing.ToString() + "\r\n"; allOpts += "Check Reprocessing History -> " + checkReprocessingHistory.ToString() + "\r\n"; allOpts += "Auto Increment Filename -> " + autoIncrementFilename.ToString() + "\r\n"; allOpts += "Add to iTunes Library -> " + addToiTunes.ToString() + "\r\n"; allOpts += "Add to WMP Library -> " + addToWMP.ToString() + "\r\n"; allOpts += "Max Width -> " + maxWidth.ToString() + "\r\n"; allOpts += "Quality Multipltier -> " + qualityMultiplier.ToString(CultureInfo.InvariantCulture) + "\r\n"; allOpts += "FPS -> " + FPS + "\r\n"; allOpts += "Auto DeInterlacing -> " + autoDeInterlace.ToString() + "\r\n"; allOpts += "Prefer Hardware Encoding -> " + preferHardwareEncoding.ToString() + "\r\n"; allOpts += "Volume Multipltier -> " + volumeMultiplier.ToString(CultureInfo.InvariantCulture) + "\r\n"; allOpts += "DRC -> " + drc.ToString() + "\r\n"; allOpts += "Force Stereo -> " + stereoAudio.ToString() + "\r\n"; allOpts += "Encoder Select Best Audio Track -> " + encoderSelectBestAudioTrack.ToString() + "\r\n"; allOpts += "Profile Audio Language -> " + audioLanguage.ToUpper() + "\r\n"; allOpts += "Audio Offset -> " + audioOffset.ToString(CultureInfo.InvariantCulture) + "\r\n"; allOpts += "Start Trim -> " + startTrim.ToString() + "\r\n"; allOpts += "End Trim -> " + endTrim.ToString() + "\r\n"; allOpts += "Closed Captions -> " + extractCC + "\r\n"; allOpts += "Closed Captions Offset -> " + ccOffset.ToString(CultureInfo.InvariantCulture) + "\r\n"; allOpts += "Embed Subtitles and Chapters -> " + embedSubtitlesChapters.ToString() + "\r\n"; allOpts += "Commercial Removal -> " + commercialRemoval.ToString() + "\r\n"; allOpts += "Custom Comskip INI Path -> " + comskipIni + "\r\n"; allOpts += "Download Series Details -> " + downloadSeriesDetails.ToString() + "\r\n"; allOpts += "Download Banner -> " + downloadBanner.ToString() + "\r\n"; allOpts += "Overwrite Title from Internet -> " + overwriteTitleIMDB.ToString() + "\r\n"; if (metadataCorrections != null) { for (int i = 0; i < metadataCorrections.Length; i++) { allOpts += "Metadata Correction => Option " + i.ToString() + "\r\n"; allOpts += metadataCorrections[i].ToString(); } } allOpts += "Prioritize matching by Original Broadcast Date -> " + prioritizeOriginalBroadcastDateMatch.ToString() + "\r\n"; allOpts += "Force Show Type -> " + forceShowType.ToString() + "\r\n"; allOpts += "Write Metadata -> " + writeMetadata.ToString() + "\r\n"; allOpts += "Rename by Series -> " + renameBySeries.ToString() + "\r\n"; allOpts += "Alt Rename by Series -> " + altRenameBySeries.ToString() + "\r\n"; allOpts += "Custom Rename by Series -> " + customRenameBySeries + "\r\n"; allOpts += "Rename Only -> " + renameOnly.ToString() + "\r\n"; allOpts += "File Selection Pattern -> " + fileSelection + "\r\n"; allOpts += "Show Selection Pattern -> " + metaShowSelection + "\r\n"; allOpts += "Channel Selection Pattern -> " + metaNetworkSelection + "\r\n"; allOpts += "Show Type Selection -> " + metaShowTypeSelection.ToString() + "\r\n"; allOpts += "DRM Type Selection -> " + metaDRMSelection.ToString() + "\r\n"; allOpts += "Monitor Tasks Selection -> " + (monitorTaskNames == null ? "" : String.Join(",", monitorTaskNames)) + "\r\n"; allOpts += "Insert at Top of Queue -> " + insertQueueTop.ToString() + "\r\n"; allOpts += "Extract XML -> " + extractXML.ToString() + "\r\n"; allOpts += "Disable Cropping -> " + disableCropping.ToString() + "\r\n"; allOpts += "Task Commercial Skip Cut -> " + commercialSkipCut.ToString() + "\r\n"; allOpts += "Skip Copying Original File for Backup -> " + skipCopyBackup.ToString() + "\r\n"; allOpts += "Skip Remuxing Original File to TS -> " + skipRemuxing.ToString() + "\r\n"; allOpts += "Ignore Copy Protection -> " + ignoreCopyProtection.ToString() + "\r\n"; allOpts += "TiVO MAK Key -> " + tivoMAKKey + "\r\n"; allOpts += "Domain Name -> " + domainName + "\r\n"; allOpts += "User Name -> " + userName + "\r\n"; allOpts += "Password -> " + new String('*', password.Length) + "\r\n"; // mask the password, preserve the length allOpts += "Task Enabled -> " + enabled.ToString() + "\r\n"; return(allOpts); }