/// <summary> /// コンストラクタ。 /// </summary> /// <param name="name"> /// プリセット名。 null を指定すると既定値になる。 /// </param> /// <param name="value"> /// プリセットデータ。 null を指定すると既定値になる。 /// </param> public Preset(string name, CaptionInfo value) { if (name != null && !IsValidName(name)) { throw new ArgumentException("不正なプリセット名です。", "name"); } this.Name = name ?? DefaultName; this.Value = value ?? new CaptionInfo(); }
/// <summary> /// 自身のクローンを作成する。 /// </summary> /// <returns>自身のクローン。</returns> public CaptionInfo Clone() { var dest = new CaptionInfo(); dest.X = this.X; dest.Y = this.Y; dest.Z = this.Z; dest.Angle = this.Angle; dest.HorizontalAlignment = this.HorizontalAlignment; dest.LineSpace = this.LineSpace; dest.LetterSpace = this.LetterSpace; dest.FontName = this.FontName; dest.FontSize = this.FontSize; dest.FontBold = this.FontBold; dest.FontItalic = this.FontItalic; dest.FontUnderline = this.FontUnderline; dest.FontStrike = this.FontStrike; dest.TextColor = this.TextColor; dest.Alpha = this.Alpha; dest.EdgeEnabled = this.EdgeEnabled; dest.EdgeColor = this.EdgeColor; dest.EdgeWidth = this.EdgeWidth; dest.ShadowEnabled = this.ShadowEnabled; dest.ShadowDistance = this.ShadowDistance; return dest; }