protected override void ProcessRecord() { var result = AudioMetadataEncoderManager.GetEncoderInfo(); ProcessLogMessages(); WriteObject(result, true); }
protected override void BeginProcessing() { if (Format != null) { _expectedExtension = AudioMetadataEncoderManager.GetEncoderInfo() .FirstOrDefault(info => info.Format.Equals(Format, StringComparison.OrdinalIgnoreCase))?.Extension; } }
public IEnumerable <CompletionResult> CompleteArgument( string commandName, string parameterName, string wordToComplete, CommandAst commandAst, IDictionary fakeBoundParameters) { var pattern = new WildcardPattern($"{wordToComplete}*", WildcardOptions.IgnoreCase); return(AudioMetadataEncoderManager.GetEncoderInfo() .Where(info => pattern.IsMatch(info.Format)) .Select(info => new CompletionResult( info.Format, info.Format, CompletionResultType.ParameterValue, info.Description))); }
public object GetDynamicParameters() { if (Format != null) { return(_parameters = SettingAdapter.SettingInfoToParameters( AudioMetadataEncoderManager.GetSettingInfoByFormat(Format))); } // AudioFile parameter may not be bound yet if (AudioFile == null) { return(null); } return(_parameters = SettingAdapter.SettingInfoToParameters( AudioMetadataEncoderManager.GetSettingInfoByExtension(Path.GetExtension(AudioFile.Path)))); }