public ZilSegment([NotNull] ZilObject obj) { if (obj is ZilForm objForm) { form = objForm; } else { throw new ArgumentException("Segment must be based on a FORM"); } }
public static ZilSegment FromList([NotNull] Context ctx, [NotNull] ZilListBase list) { if (!(list is ZilForm form)) { form = new ZilForm(list) { SourceLine = SourceLines.Chtyped }; } return(new ZilSegment(form)); }