private static Color getProjectColor(ref Toggl.TogglAutocompleteView item) { var projectColourString = string.IsNullOrEmpty(item.ProjectColor) ? "#999999" : item.ProjectColor; var projectColor = (Color)(ColorConverter.ConvertFromString(projectColourString) ?? Color.FromRgb(153, 153, 153)); return(projectColor); }
private static SolidColorBrush getProjectColorBrush(ref Toggl.TogglAutocompleteView item) { var colourString = string.IsNullOrEmpty(item.ProjectColor) ? "#999999" : item.ProjectColor; var color = (Color)(ColorConverter.ConvertFromString(colourString) ?? Color.FromRgb(153, 153, 153)); return(new SolidColorBrush(color)); }
public static ProjectLabelViewModel ToProjectLabelViewModel(this Toggl.TogglAutocompleteView item) { return(new ProjectLabelViewModel( item.ProjectLabel, item.TaskLabel, item.ClientLabel, item.ProjectColor, item.WorkspaceName, item.ProjectID, item.TaskID)); }
public ProjectEntry Initialised(Toggl.TogglAutocompleteView item, Action selectWithClick, string overideText = null) { var colorBrush = Utils.ProjectColorBrushFromString(item.ProjectColor); colorBrush.Freeze(); this.projectColor.Background = colorBrush; this.project.Text = overideText ?? item.ProjectLabel; this.task.Text = string.IsNullOrEmpty(item.TaskLabel) ? "" : "- " + item.TaskLabel; this.setClickAction(selectWithClick); return(this); }
private static Toggl.TogglAutocompleteView CreateProjectItem(Toggl.TogglAutocompleteView from) { var projectItemCopy = from; projectItemCopy.Description = string.Empty; projectItemCopy.TaskID = 0ul; projectItemCopy.TaskLabel = string.Empty; projectItemCopy.ProjectAndTaskLabel = projectItemCopy.ProjectLabel; projectItemCopy.Text = projectItemCopy.ProjectLabel; projectItemCopy.Type = 2; return(projectItemCopy); }
public void DescriptionAutoCompleteConfirm(IAutoCompleteItem e) { var asItem = e as IModelItem <Toggl.TogglAutocompleteView>; if (asItem == null) { return; } var item = asItem.Model; SetDescription(item.Description); ProjectLabelViewModel = item.ToProjectLabelViewModel(); completedProject = item; }
private void setText(Toggl.TogglAutocompleteView item) { if (string.IsNullOrEmpty(item.ProjectLabel)) { this.project.Visibility = Visibility.Collapsed; } else { this.project.Text = "• " + item.ProjectLabel; this.project.Foreground = getProjectColorBrush(ref item); this.project.Visibility = Visibility.Visible; } setOptionalTextBlockText(this.description, item.Description); setOptionalTextBlockText(this.task, string.IsNullOrEmpty(item.TaskLabel) ? "" : "- " + item.TaskLabel); setOptionalTextBlockText(this.client, string.IsNullOrEmpty(item.ClientLabel) ? "" : "- " + item.ClientLabel); }
public TaskEntry Initialised(Toggl.TogglAutocompleteView item, Action selectWithClick) { this.task.Text = item.TaskLabel; this.setClickAction(selectWithClick); return(this); }
public void clearSelectedProject() { ProjectLabelViewModel = null; completedProject = default; }
public TimerEntry Initialised(Toggl.TogglAutocompleteView item, Action selectWithClick) { this.setText(item); this.setClickAction(selectWithClick); return(this); }
public ProjectInfo(Toggl.TogglAutocompleteView item) { this.projectId = item.ProjectID; this.taskId = item.TaskID; }
private static SolidColorBrush getProjectColorBrush(ref Toggl.TogglAutocompleteView item) { return(getProjectColorBrush(item.ProjectColor)); }
public CountedAutoCompleteView(int count, Toggl.TogglAutocompleteView view) { this.Count = count; this.View = view; }