public static ViewportCommand Get(ViewportCommands.Id id) { if (Enum.IsDefined(typeof(ViewportCommands.Id), id)) { if (Commands.TryGetValue(id, out var value)) { return(value); } return(new ViewportCommand(id)); } return(null); }
private ViewportCommand(ViewportCommands.Id id) { this.Id = id; Commands[id] = this; }