Ejemplo n.º 1
0
        public virtual SSAFieldsLine CreateFieldsLine(string name, string[] fields)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (fields == null)
            {
                throw new ArgumentNullException(nameof(fields));
            }

            switch (name)
            {
            case "Format":
                SSAFormatLine formatLine = new SSAFormatLine(fields);
                if (this.FormatLine == null)
                {
                    this.FormatLine = formatLine;
                }
                else
                {
                    throw new InvalidOperationException();
                }
                return(formatLine);

            default:
                return(new SSAFieldsLine(name, fields));
            }
        }
Ejemplo n.º 2
0
        public SSAFieldsLine(string name, string text, SSAFormatLine formatLine) : this(name, text)
        {
            if (formatLine == null)
            {
                throw new ArgumentNullException(nameof(formatLine));
            }

#if true
            int fieldCount = formatLine.fields.Length;
#else
            int fieldCount = formatLine.Fields.Count(_field => !_field.DefaultValue.HasValue);
#endif
            this.fields = this.fields.Take(fieldCount - 1).Concat(new[] { string.Join(",", this.fields.Skip(fieldCount - 1)) }).ToArray();
        }
Ejemplo n.º 3
0
        protected internal override ISSALine CreateNamedLine(string name, string text)
        {
            switch (name)
            {
            case "Format":
                SSAFormatLine formatLine = new SSAFormatLine(text);
                if (this.FormatLine == null && this.lines.Count == 0)
                {
                    this.FormatLine = formatLine;
                }
                else
                {
                    throw new InvalidOperationException();
                }
                return(formatLine);

            default:
                return(base.CreateNamedLine(name, text));
            }
        }
Ejemplo n.º 4
0
 public SSAStyleLine(string text, SSAFormatLine formatLine) : base("Style", text, formatLine)
 {
 }
Ejemplo n.º 5
0
 public SSADialogLine(string text, SSAFormatLine formatLine) : base("Dialogue", text, formatLine)
 {
 }