public virtual bool Init(YamLikeCommand cmd) { if (cmd.SubCommand == null || cmd.SubCommand.Count == 0) { return(false); } List <IDrawCommand> tmp = new List <IDrawCommand>(); foreach (var c in cmd.SubCommand) { IDrawCommand drawingCmd = CommandDrawingFactoryEx.create(c); if (drawingCmd == null) { continue; } tmp.Add(drawingCmd); } if (tmp.Count == 0) { return(false); } this.Commands.AddRange(tmp); return(true); }