public TaskCommand(string s) { DisplayName = s; if (s.Contains(":")) { var parts = s.Split(new[] { ':' }, 2); CommandName = parts[0]; CommandValue = parts[1]; DisplayName = CommandName; } else { CommandName = s; } if (CommandName.Contains("=")) { var parts = CommandName.Split(new[] { '=' }, 2); DisplayName = parts[0]; CommandName = parts[1]; } }