/// <summary> /// Initializes a new instance of the <see cref="Lipsum"/> class. /// </summary> /// <param name="lipsumFlavor"> /// The flavor for the generated text /// </param> /// <param name="minWords"> /// The min words of the generated text. /// </param> /// <param name="maxWords"> /// The max words of the generated text. /// </param> /// <param name="minSentences"> /// The min sentences of the generated text /// </param> /// <param name="maxSentences"> /// The max sentences of the generated text /// </param> /// <param name="paragraphs"> /// The count of generated paragraphs. /// </param> /// <param name="randomSeed"> /// The seed for randomizer to get the same result with the same seed. /// </param> public Lipsum(LipsumFlavor lipsumFlavor, int minWords = 10, int maxWords = 50, int minSentences = 3, int maxSentences = 8, int paragraphs = 3, int?randomSeed = null) { this.flavor = lipsumFlavor; this.paragraphs = paragraphs; this.minSentences = minSentences; this.maxSentences = maxSentences < minSentences ? minSentences : maxSentences; this.minWords = minWords; this.maxWords = maxWords < minWords ? minWords : maxWords; this.map = new Dictionary <LipsumFlavor, string[]>() { { LipsumFlavor.LoremIpsum, LoremIpsum }, { LipsumFlavor.ChildHarold, ChildeHarold }, { LipsumFlavor.InDerFremde, InderFremde }, { LipsumFlavor.LeMasque, LeMasque } }; this.seed = randomSeed; this.random = new System.Random(); }
/// <summary> /// Initializes a new instance of the <see cref="Lipsum"/> class. /// </summary> /// <param name="flavor"> /// The flavor for the generated text /// </param> /// <param name="paragraphs"> /// The count of generated paragraphs. /// </param> /// <param name="minSentences"> /// The min sentences of the generated text /// </param> /// <param name="maxSentences"> /// The max sentences of the generated text /// </param> /// <param name="minWords"> /// The min words of the generated text. /// </param> /// <param name="maxWords"> /// The max words of the generated text. /// </param> /// <param name="seed"> /// The seed for the random to get the same result with the same seed. /// </param> public Lipsum(LipsumFlavor flavor, int paragraphs = 3, int minSentences = 3, int maxSentences = 8, int minWords = 10, int maxWords = 50, int?seed = null) { this.flavor = flavor; this.paragraphs = paragraphs; this.minSentences = minSentences; this.maxSentences = maxSentences < minSentences ? minSentences : maxSentences; this.minWords = minWords; this.maxWords = maxWords < minWords ? minWords : maxWords; this.map = new Dictionary <LipsumFlavor, string[]>() { { LipsumFlavor.LoremIpsum, LoremIpsum }, { LipsumFlavor.ChildHarold, ChildeHarold }, { LipsumFlavor.InDerFremde, InderFremde }, { LipsumFlavor.LeMasque, LeMasque } }; this.seed = seed.HasValue ? seed.Value : Environment.TickCount; }
/// <summary> /// Initializes a new instance of the <see cref="Lipsum"/> class. /// </summary> /// <param name="lipsumFlavor"> /// The flavor for the generated text /// </param> /// <param name="minWords"> /// The min words of the generated text. /// </param> /// <param name="maxWords"> /// The max words of the generated text. /// </param> /// <param name="minSentences"> /// The min sentences of the generated text /// </param> /// <param name="maxSentences"> /// The max sentences of the generated text /// </param> /// <param name="paragraphs"> /// The count of generated paragraphs. /// </param> public Lipsum(LipsumFlavor lipsumFlavor, int minWords, int maxWords, int minSentences, int maxSentences, int paragraphs) : this(lipsumFlavor, minWords, maxWords, minSentences, maxSentences, paragraphs, null) { }
/// <summary> /// Initializes a new instance of the <see cref="Lipsum"/> class. /// </summary> /// <param name="lipsumFlavor"> /// The flavor for the generated text /// </param> /// <param name="minWords"> /// The min words of the generated text. /// </param> /// <param name="maxWords"> /// The max words of the generated text. /// </param> /// <param name="minSentences"> /// The min sentences of the generated text /// </param> /// <param name="maxSentences"> /// The max sentences of the generated text /// </param> public Lipsum(LipsumFlavor lipsumFlavor, int minWords, int maxWords, int minSentences, int maxSentences) : this(lipsumFlavor, minWords, maxWords, minSentences, maxSentences, 3) { }
/// <summary> /// Initializes a new instance of the <see cref="Lipsum"/> class. /// </summary> /// <param name="lipsumFlavor"> /// The flavor for the generated text /// </param> /// <param name="minWords"> /// The min words of the generated text. /// </param> public Lipsum(LipsumFlavor lipsumFlavor, int minWords) : this(lipsumFlavor, minWords, 50) { }
/// <summary> /// Initializes a new instance of the <see cref="Lipsum"/> class. /// </summary> /// <param name="lipsumFlavor"> /// The flavor for the generated text /// </param> public Lipsum(LipsumFlavor lipsumFlavor) : this(lipsumFlavor, 10) { }