private String SelectTodoListItemName(TodoListItem todoListItem) { //Object[] objects = new Object[] //{ // todoListItem, // TodoListItem // "Hello world", // String // 2 // int -> Int32 //}; //foreach (var obj in objects) //{ // if (obj is TodoListItem) // { // TodoListItem todoListItem2 = obj as TodoListItem; // return todoListItem2.Name; // } // if (obj.GetType() == typeof(TodoListItem)) // { // return ((TodoListItem) obj).Name; // } // if (obj.GetType() == typeof(String)) // { // return (String) obj; // } //} return(todoListItem.Name); }
private String SelectTodoListItemName(TodoListItem todoListItem) { //Object[] objects = new Object[] //{ // todoListItem, // TodoListItem // "Hello world", // String // 2 // int -> Int32 //}; //foreach (var obj in objects) //{ // if (obj is TodoListItem) // { // TodoListItem todoListItem2 = obj as TodoListItem; // return todoListItem2.Name; // } // if (obj.GetType() == typeof(TodoListItem)) // { // return ((TodoListItem) obj).Name; // } // if (obj.GetType() == typeof(String)) // { // return (String) obj; // } //} return todoListItem.Name; }