C# Class Todoist.NET.User

The user.
ファイルを表示 Open project: jbfp/Todoist.NET

Public Methods

Method Description
AddItemToProject ( int projectId, string content, int priority, int indent, int itemOrder ) : void

Adds an item to a project.

AddNoteToItem ( int itemId, string content ) : void

Adds a note to an item.

CompleteItems ( int itemIds, bool sendToHistory ) : void

Complete items and move them to history.

CreateLabel ( string labelName, LabelColor color ) : void

Create a new label.

CreateProject ( string projectName, int indent, int order, Color color ) : void

Create a new project. Call GetProjects() on the project collection to refresh it.

DeleteItems ( int itemIds ) : void

Delete existing items.

DeleteLabel ( string name ) : void

Delete a specified label.

DeleteNote ( int itemId, int noteId ) : void

Delete an existing note.

DeleteProject ( int projectId ) : void

Delete an existing project. Call GetProjects() on the project collection to refresh it.

GetAllCompletedItems ( int projectId, string label, string interval ) : ReadOnlyCollection

Gets all completed items (only available to premium users).

GetCompletedItemsByProjectId ( int projectId ) : ReadOnlyCollection

Gets all completed items of a project.

GetItemsById ( int itemIds ) : ReadOnlyCollection

Gets a ReadOnlyCollection{Item} by id.

GetLabels ( ) : ReadOnlyCollection

Gets a ReadOnlyCollection{T} of labels the user has created.

GetNotesByItemId ( int itemId ) : ReadOnlyCollection

Gets all notes of an item.

GetProject ( int projectId ) : Project

Gets data about a project. It does not have to be a project in the collection, but it must still be a project the user owns. This will not add the project to the collection.

GetUncompletedItemsByProjectId ( int projectId ) : ReadOnlyCollection

Returns a project's uncompleted items (tasks).

LogOff ( ) : void

Resets all properties, because there is no real logging out from Todoist.com

LogOn ( string logOnEmail, string password ) : LogOnResult

LogOn user into Todoist to get a token. Required to do any communication.

MoveItems ( int itemIds, int fromProjectId, int toProjectId ) : void

Move items from one project to another.

Register ( string email, string fullName, string password, string timeZone ) : void

Registers a new user account with Todoist. The connection is secured with https.

UncompleteItems ( int itemIds ) : void

"Un-complete" items and move them to the active projects.

UpdateItem ( int itemId, string content, int priority, int indent, bool isCollapsed ) : void

Update an existing item.

UpdateItemOrdering ( int projectId, int itemIds ) : void

Update the order of a project's tasks.

UpdateLabelColor ( string name, LabelColor color ) : void

Update the color of a specified label.

UpdateLabelName ( string oldName, string newName ) : void

Update the name of a specified label.

UpdateProject ( int projectId, string name, TodoistColor color, int indent, int itemOrder, bool isCollapsed, bool isGroup ) : void

Update an existing project.

UpdateProjectOrdering ( int order ) : void

Updates how the projects are ordered.

UpdateRecurringDate ( int itemIds ) : void

Update recurring dates and set them to next date regarding an item's date_string.

UpdateUser ( string newEmail, string newFullName, string newPassword, string newTimeZone, DateFormat newDateFormat, TimeFormat newTimeFormat, StartPage newStartPage ) : void

Update user

User ( ) : System

Initializes a new instance of the User class.

Private Methods

Method Description
AnalyseJson ( ) : void

The analyse json.

AnalyseProjectJson ( string jsonData ) : Project

The analyse project json.

CheckLoginStatus ( ) : void

Checks user's login status.

Method Details

AddItemToProject() public method

Adds an item to a project.
public AddItemToProject ( int projectId, string content, int priority, int indent, int itemOrder ) : void
projectId int /// The id of the project the item is to be added to. ///
content string /// The text of the task. ///
priority int /// 4 is urgent, 1 is default, natural. ///
indent int /// 1 is top-level, 4 is lowest level. ///
itemOrder int /// Item index on the list. ///
return void

AddNoteToItem() public method

Adds a note to an item.
public AddNoteToItem ( int itemId, string content ) : void
itemId int /// The item id of where the note is to be added. ///
content string /// The text of the new note. ///
return void

CompleteItems() public method

Complete items and move them to history.
public CompleteItems ( int itemIds, bool sendToHistory ) : void
itemIds int /// The item ids, which are to be completed. ///
sendToHistory bool /// Value if the task is to be sent to 'history'. ///
return void

CreateLabel() public method

Create a new label.
public CreateLabel ( string labelName, LabelColor color ) : void
labelName string /// The name of the new label. ///
color LabelColor /// The color. ///
return void

CreateProject() public method

Create a new project. Call GetProjects() on the project collection to refresh it.
public CreateProject ( string projectName, int indent, int order, Color color ) : void
projectName string /// Name of the new project. ///
indent int /// Indent level of the new project. ///
order int /// Weight in project list. ///
color Color /// of the new project. ///
return void

DeleteItems() public method

Delete existing items.
public DeleteItems ( int itemIds ) : void
itemIds int /// The item ids, which are to be deleted. ///
return void

DeleteLabel() public method

Delete a specified label.
/// If the name is null or whitespace, a is thrown. ///
public DeleteLabel ( string name ) : void
name string /// The name of the label. ///
return void

DeleteNote() public method

Delete an existing note.
public DeleteNote ( int itemId, int noteId ) : void
itemId int /// The item id, from where the note is to be deleted. ///
noteId int /// The note id, which is to be deleted. ///
return void

DeleteProject() public method

Delete an existing project. Call GetProjects() on the project collection to refresh it.
public DeleteProject ( int projectId ) : void
projectId int /// The id of the project to delete ///
return void

GetAllCompletedItems() public method

Gets all completed items (only available to premium users).
public GetAllCompletedItems ( int projectId, string label, string interval ) : ReadOnlyCollection
projectId int /// Filter the tasks by project_id. ///
label string /// Filter the tasks by label (could be home). ///
interval string /// Restrict time range, default is past 2 weeks. ///
return ReadOnlyCollection

GetCompletedItemsByProjectId() public method

Gets all completed items of a project.
public GetCompletedItemsByProjectId ( int projectId ) : ReadOnlyCollection
projectId int /// The id of the project where the completed items are from ///
return ReadOnlyCollection

GetItemsById() public method

Gets a ReadOnlyCollection{Item} by id.
public GetItemsById ( int itemIds ) : ReadOnlyCollection
itemIds int /// int array of specific item ids. ///
return ReadOnlyCollection

GetLabels() public method

Gets a ReadOnlyCollection{T} of labels the user has created.
public GetLabels ( ) : ReadOnlyCollection
return ReadOnlyCollection

GetNotesByItemId() public method

Gets all notes of an item.
public GetNotesByItemId ( int itemId ) : ReadOnlyCollection
itemId int /// The item id from where the notes are to be found. ///
return ReadOnlyCollection

GetProject() public method

Gets data about a project. It does not have to be a project in the collection, but it must still be a project the user owns. This will not add the project to the collection.
public GetProject ( int projectId ) : Project
projectId int /// The id of the project specified ///
return Project

GetUncompletedItemsByProjectId() public method

Returns a project's uncompleted items (tasks).
public GetUncompletedItemsByProjectId ( int projectId ) : ReadOnlyCollection
projectId int /// The id of the project where the uncompleted items are from ///
return ReadOnlyCollection

LogOff() public method

Resets all properties, because there is no real logging out from Todoist.com
public LogOff ( ) : void
return void

LogOn() public method

LogOn user into Todoist to get a token. Required to do any communication.
/// If or is null. /// /// If or is incorrect. /// ///
public LogOn ( string logOnEmail, string password ) : LogOnResult
logOnEmail string /// User's email address. ///
password string /// User's password. ///
return LogOnResult

MoveItems() public method

Move items from one project to another.
public MoveItems ( int itemIds, int fromProjectId, int toProjectId ) : void
itemIds int /// The item Ids. ///
fromProjectId int /// The from Project Id. ///
toProjectId int /// The to Project Id. ///
return void

Register() public static method

Registers a new user account with Todoist. The connection is secured with https.
/// Throws if the registration failed. ///
public static Register ( string email, string fullName, string password, string timeZone ) : void
email string /// The new user's email address. ///
fullName string /// The new user's full name. ///
password string /// The new user's password. ///
timeZone string /// The new user's time zone, e.g. "Europe/Copenhagen". ///
return void

UncompleteItems() public method

"Un-complete" items and move them to the active projects.
public UncompleteItems ( int itemIds ) : void
itemIds int /// The item ids, which are to be "un-completed". ///
return void

UpdateItem() public method

Update an existing item.
public UpdateItem ( int itemId, string content, int priority, int indent, bool isCollapsed ) : void
itemId int /// The item to update. ///
content string /// The new content/text. To add the item to a label, append "@labelname". ///
priority int /// The new priority. ///
indent int /// The new indent-level. ///
isCollapsed bool /// Toggle collapsed. ///
return void

UpdateItemOrdering() public method

Update the order of a project's tasks.
public UpdateItemOrdering ( int projectId, int itemIds ) : void
projectId int /// The project to update. ///
itemIds int /// The item ids in the order wished. ///
return void

UpdateLabelColor() public method

Update the color of a specified label.
public UpdateLabelColor ( string name, LabelColor color ) : void
name string /// The name of the label to update. ///
color LabelColor /// The new color. ///
return void

UpdateLabelName() public method

Update the name of a specified label.
public UpdateLabelName ( string oldName, string newName ) : void
oldName string /// The old name of the label. ///
newName string /// The new name of the label. ///
return void

UpdateProject() public method

Update an existing project.
public UpdateProject ( int projectId, string name, TodoistColor color, int indent, int itemOrder, bool isCollapsed, bool isGroup ) : void
projectId int /// The id of the project that is to be updated. ///
name string /// New name. ///
color TodoistColor /// New color. ///
indent int /// New indent level. ///
itemOrder int /// New way of sorting tasks. ///
isCollapsed bool /// Toggle collapse. ///
isGroup bool /// Toggle group. ///
return void

UpdateProjectOrdering() public method

Updates how the projects are ordered.
public UpdateProjectOrdering ( int order ) : void
order int /// A JSON list of the project's order, could be [3,2,9,7] ///
return void

UpdateRecurringDate() public method

Update recurring dates and set them to next date regarding an item's date_string.
public UpdateRecurringDate ( int itemIds ) : void
itemIds int /// The ids of the items to update. ///
return void

UpdateUser() public method

Update user
public UpdateUser ( string newEmail, string newFullName, string newPassword, string newTimeZone, DateFormat newDateFormat, TimeFormat newTimeFormat, StartPage newStartPage ) : void
newEmail string /// New email ///
newFullName string /// New name ///
newPassword string /// New password ///
newTimeZone string /// New timezone ///
newDateFormat DateFormat /// New dateformat ///
newTimeFormat TimeFormat /// New timeformat ///
newStartPage StartPage /// New startpage ///
return void

User() public method

Initializes a new instance of the User class.
public User ( ) : System
return System