public bool Equals(PSDocumentOption other) { return(other != null && Document == other.Document && Execution == other.Execution && Markdown == other.Markdown && Output == other.Output); }
public PSDocumentOption(PSDocumentOption option) { // Set from existing option instance Document = new DocumentOption(option?.Document); Execution = new ExecutionOption(option?.Execution); Markdown = new MarkdownOption(option?.Markdown); Output = new OutputOption(option?.Output); }
public PSDocumentOption(PSDocumentOption option) { // Set from existing option instance Markdown = new MarkdownOption { WrapSeparator = option.Markdown.WrapSeparator }; }
/// <summary> /// Load a YAML formatted PSDocumentOption object from disk. /// </summary> /// <param name="option"></param> /// <param name="path">A file or directory to read options from.</param> /// <returns>An options object.</returns> /// <remarks> /// This method is called from PowerShell. /// </remarks> public static PSDocumentOption FromFileOrEmpty(PSDocumentOption option, string path) { if (option == null) { return(FromFileOrEmpty(path)); } return(!string.IsNullOrEmpty(path) ? Combine(option, FromFileOrEmpty(path)) : option); }
private PSDocumentOption(string sourcePath, PSDocumentOption option) { SourcePath = sourcePath; // Set from existing option instance Document = new DocumentOption(option?.Document); Execution = new ExecutionOption(option?.Execution); Markdown = new MarkdownOption(option?.Markdown); Output = new OutputOption(option?.Output); }
private static PSDocumentOption Combine(PSDocumentOption o1, PSDocumentOption o2) { var result = new PSDocumentOption(o1?.SourcePath ?? o2?.SourcePath, o1); result.Document = DocumentOption.Combine(result.Document, o2?.Document); result.Execution = ExecutionOption.Combine(result.Execution, o2?.Execution); result.Markdown = MarkdownOption.Combine(result.Markdown, o2?.Markdown); result.Output = OutputOption.Combine(result.Output, o2?.Output); return(result); }
public PSDocumentOption(PSDocumentOption option) { // Set from existing option instance Markdown = new MarkdownOption { WrapSeparator = option.Markdown.WrapSeparator, Encoding = option.Markdown.Encoding, SkipEmptySections = option.Markdown.SkipEmptySections, ColumnPadding = option.Markdown.ColumnPadding, UseEdgePipes = option.Markdown.UseEdgePipes }; Execution = new ExecutionOption { LanguageMode = option.Execution.LanguageMode }; }
private static PSDocumentOption FromEnvironment(PSDocumentOption option) { if (option == null) { option = new PSDocumentOption(); } // Start loading matching values var env = EnvironmentHelper.Default; //option.Document.Load(env); // Currently set from cmdlet option.Execution.Load(env); option.Input.Load(env); option.Markdown.Load(env); option.Output.Load(env); option.Configuration.Load(env); return(option); }
public static PSDocumentOption FromHashtable(Hashtable hashtable) { var option = new PSDocumentOption(); if (hashtable == null) { return(option); } // Start loading matching values var index = BuildIndex(hashtable); //option.Document.Load(index); // Currently set from cmdlet option.Execution.Load(index); option.Input.Load(index); option.Markdown.Load(index); option.Output.Load(index); option.Configuration.Load(index); return(option); }