private void OnAttributeSelChanged(object sender, EventArgs args) { m_Attrib = m_AttributeCombo.GetSelectedAttribute(); UpdateWeightedWords(false); UpdateMatchList(); }
public List <string> GetWords(Task.Attribute attrib, IBlacklist exclusions, Boolean force) { if (force || (attrib != m_WordAttribute)) { m_Words = GetAttributeValues(attrib, exclusions); m_WordAttribute = attrib; } return(m_Words); }
public bool SetSelectedAttribute(Task.Attribute attrib) { var item = FindAttribute(attrib); if (item == null) { return(false); } // else SelectedItem = item; return(true); }
protected AttributeItem FindAttribute(Task.Attribute attrib) { foreach (AttributeItem item in Items) { if (item.Attrib == attrib) { return(item); } } // else return(null); }
public bool WantTaskUpdate(Task.Attribute attrib) { switch (attrib) { case Task.Attribute.Title: case Task.Attribute.Icon: case Task.Attribute.Color: return(true); } // all else return(AttributeComboBox.IsSupportedAttribute(attrib)); }
public bool WantTaskUpdate(Task.Attribute attrib) { switch (attrib) { case Task.Attribute.Title: case Task.Attribute.DoneDate: case Task.Attribute.DueDate: case Task.Attribute.StartDate: case Task.Attribute.AllocatedTo: case Task.Attribute.Icon: case Task.Attribute.TimeEstimate: return(true); } // all else return(false); }
// ------------------------------------------------------------- public WordCloudUIExtensionCore(IntPtr hwndParent, Translator trans) { m_HwndParent = hwndParent; m_Trans = trans; m_Attrib = Task.Attribute.Title; m_ExcludedWords = new CommonWords(); // English by default m_ControlsFont = new Font(FontName, 8, FontStyle.Regular); m_Splitting = false; m_InitialSplitPos = -1; m_SplitterColor = Color.Gray; m_SplitterWidth = DPIScaling.Scale(6); InitializeComponent(); RhinoLicensing.LicenseType licType = RhinoLicensing.GetLicense("3BDEF4EA-7B02-41E1-BE65-3E03025E1FFE"); }
private void AddAttribute(Task.Attribute attrib, List <Tuple <String, Task.Attribute> > attribs, bool atEnd) { var attribName = TaskList.GetAttributeName(attrib); if (!String.IsNullOrEmpty(attribName)) { var item = new Tuple <string, Task.Attribute>(m_Trans.Translate(attribName), attrib); if (atEnd) { attribs.Add(item); } else { attribs.Insert(0, item); } } }
// ------------------------------------------------------------- public WordCloudUIExtensionCore(String typeId, String uiName, IntPtr hwndParent, Translator trans) { m_TypeId = typeId; m_UiName = uiName; m_HwndParent = hwndParent; m_Trans = trans; m_Attrib = Task.Attribute.Title; m_ExcludedWords = new CommonWords(); // English by default m_ControlsFont = new Font(FontName, 8, FontStyle.Regular); m_Splitting = false; m_InitialSplitPos = -1; m_SplitterColor = Color.Gray; m_SplitterWidth = DPIScaling.Scale(6); InitializeComponent(); }
public bool WantTaskUpdate(Task.Attribute attrib) { switch (attrib) { // Note: lock state is always provided case Task.Attribute.Title: case Task.Attribute.Icon: case Task.Attribute.Flag: case Task.Attribute.Color: case Task.Attribute.DoneDate: case Task.Attribute.Position: case Task.Attribute.SubtaskDone: case Task.Attribute.ProjectName: return(true); } // all else return(false); }
// ---------------------- protected bool ExportTaskAttribute(Task task, Task.Attribute attrib, bool first, int depth, HtmlTextWriter html) { if (!Attribs.Contains(attrib)) { return(false); } PreExportTaskAttribute(first, html); var attribVal = GetAttributeValue(task, attrib); switch (Style) { case RenderStyle.Wrap: if (attrib == Task.Attribute.Comments) { html.WriteLine(); html.Write(attribVal); } else { if (!first) { html.Write(" | "); } html.Write("{0}: {1}", GetAttributeName(attrib), attribVal); } break; case RenderStyle.Table: html.Write(attribVal); break; case RenderStyle.Paragraph: html.Write("{0}: {1}", GetAttributeName(attrib), attribVal); break; } PostExportTaskAttribute(first, html); return(true); }
public List <string> GetAttributeValues(Task.Attribute attrib, IBlacklist exclusions) { var values = new List <string>(); switch (attrib) { case Task.Attribute.Title: values = ToWords(Title); break; case Task.Attribute.Comments: values = ToWords(Comments); break; case Task.Attribute.AllocatedTo: values = AllocTo; break; case Task.Attribute.Category: values = Category; break; case Task.Attribute.Tags: values = Tags; break; case Task.Attribute.DoneDate: values.Add(DoneDate); break; case Task.Attribute.DueDate: values.Add(DueDate); break; case Task.Attribute.StartDate: values.Add(StartDate); break; case Task.Attribute.AllocatedBy: values.Add(AllocBy); break; case Task.Attribute.Status: values.Add(Status); break; case Task.Attribute.CreationDate: values.Add(CreationDate); break; case Task.Attribute.CreatedBy: values.Add(CreatedBy); break; case Task.Attribute.Version: values.Add(Version); break; } values.RemoveAll(p => (p.Length < 2)); if (exclusions != null) { values.RemoveAll(p => (exclusions.Countains(p))); } return(values); }
protected String GetAttributeName(Task.Attribute attrib) { /* * switch (attrib) * { * case Task.Attribute.Title: return m_Trans.Translate("Title"); * case Task.Attribute.Position: return m_Trans.Translate("Position"); * case Task.Attribute.Id: return m_Trans.Translate("Id"); * case Task.Attribute.ParentId: return m_Trans.Translate("Parent Id"); * case Task.Attribute.Path: return m_Trans.Translate("Path"); * case Task.Attribute.Priority: return m_Trans.Translate("Priority"); * case Task.Attribute.Risk: return m_Trans.Translate("Risk"); * case Task.Attribute.Percent: return m_Trans.Translate("Percent"); * case Task.Attribute.TimeEstimate: return m_Trans.Translate("Time Estimate"); * case Task.Attribute.TimeSpent: return m_Trans.Translate("Time Spent"); * case Task.Attribute.CreationDate: return m_Trans.Translate("Creation Date"); * case Task.Attribute.CreatedBy: return m_Trans.Translate("Created By"); * case Task.Attribute.LastModifiedDate: return m_Trans.Translate("Last Modified Date"); * case Task.Attribute.LastModifiedBy: return m_Trans.Translate("Last Modified By"); * case Task.Attribute.StartDate: return m_Trans.Translate("Start Date"); * case Task.Attribute.DueDate: return m_Trans.Translate("Due Date"); * case Task.Attribute.DoneDate: return m_Trans.Translate("Done Date"); * case Task.Attribute.Recurrence: return m_Trans.Translate("Recurrence"); * case Task.Attribute.AllocatedTo: return m_Trans.Translate("Allocated To"); * case Task.Attribute.AllocatedBy: return m_Trans.Translate("Allocated By"); * case Task.Attribute.Status: return m_Trans.Translate("Status"); * case Task.Attribute.Category: return m_Trans.Translate("Category"); * case Task.Attribute.Tags: return m_Trans.Translate("Tags"); * case Task.Attribute.ExternalId: return m_Trans.Translate("ExternalId"); * case Task.Attribute.Cost: return m_Trans.Translate("Cost"); * case Task.Attribute.Version: return m_Trans.Translate("Version"); * case Task.Attribute.Flag: return m_Trans.Translate("Flag"); * case Task.Attribute.Dependency: return m_Trans.Translate("Dependency"); * case Task.Attribute.FileReference: return m_Trans.Translate("File Link"); * case Task.Attribute.SubtaskDone: return m_Trans.Translate("Subtask Done"); * case Task.Attribute.Comments: return m_Trans.Translate("Comments"); * } */ return(""); }
public static bool IsSupportedAttribute(Task.Attribute attrib) { switch (attrib) { case Task.Attribute.Title: case Task.Attribute.DoneDate: case Task.Attribute.DueDate: case Task.Attribute.StartDate: case Task.Attribute.AllocatedTo: case Task.Attribute.AllocatedBy: case Task.Attribute.Status: case Task.Attribute.Category: case Task.Attribute.Comments: case Task.Attribute.CreationDate: case Task.Attribute.CreatedBy: case Task.Attribute.Version: case Task.Attribute.Tags: return(true); } // all else return(false); }
public TaskAttribute(Task.Attribute id, String basePlaceholder) : this() { Id = id; Label = TaskList.GetAttributeName(id); BasePlaceholder = basePlaceholder; }
public Boolean AttributeHasValue(Task.Attribute attrib, String value, IBlacklist exclusions) { var words = GetWords(attrib, exclusions, false); return(words.Find(x => x.Equals(value, StringComparison.CurrentCultureIgnoreCase)) != null); }
public bool WantSortUpdate(Task.Attribute attrib) { return(false); }
protected String FormatTaskAttribute(Task task, Task.Attribute attrib, int depth) { var attribVal = GetAttributeValue(task, attrib); // extra processing String textColor = task.GetTextForeWebColor(); String backColor = task.GetTextBackWebColor(); bool bColor = true; bool bStrikeThru = (StrikeThruDone && (task.IsDone() || task.IsGoodAsDone())); bool bBlockQuote = false; bool wantIndent = false; switch (attrib) { case Task.Attribute.Position: wantIndent = (Style == RenderStyle.Table); break; case Task.Attribute.Title: wantIndent = ((Style == RenderStyle.Table) && !Attribs.Contains(Task.Attribute.Position)); break; case Task.Attribute.Priority: { /* * int nPriority = task.GetPriority(hTask, TRUE); * String sPriority; * * if (nPriority >= 0) * { * String sPriorityCol = pTasks->GetTaskPriorityWebColor(hTask); * sPriority.Format(_T("<font color='%s'>%d</font>"), sPriorityCol, nPriority); * * sItem = FormatAttribute(nAttrib, sAttribLabel, sPriority, FALSE); // FALSE = Don't encode * } */ } break; case Task.Attribute.FileReference: /* * if (!sItem.IsEmpty()) * { * // do it over creating a link for each file ref * String sFileRefs; * int nNumFileRefs = pTasks->GetTaskFileReferenceCount(hTask); * * for (int nFile = 0; nFile < nNumFileRefs; nFile++) * { * String sFilePath = pTasks->GetTaskFileReference(hTask, nFile), sFileName; * * if (PathIsURL(sFilePath)) * { * sFileName = sFilePath; * } * else * { * sFileName = FileMisc::GetFileNameFromPath(sFilePath); * * // handle the absence of a filename * if (sFileName.IsEmpty()) * sFileName = sFilePath; * } * * String sFileRef; * sFileRef.Format(_T("<a href=\"%s\">%s</a>"), sFilePath, sFileName); * * if (!sFileRefs.IsEmpty()) * sFileRefs += ' '; * * sFileRefs += sFileRef; * } * * sItem = FormatAttribute(nAttrib, sAttribLabel, sFileRefs, FALSE); // FALSE = Don't encode * bColor = FALSE; * } */ break; case Task.Attribute.Comments: /* * if (pTasks->TaskHasAttribute(hTask, TDL_TASKHTMLCOMMENTS)) * { * sItem = pTasks->GetTaskAttribute(hTask, TDL_TASKHTMLCOMMENTS); * sItem.TrimRight(); * * // note: we reset the font after the comments because the font * // face and size may well have been changed * if (!sItem.IsEmpty()) * sItem += DEFAULTFONT; * * bColor = FALSE; * bStrikeThru = FALSE; * bBlockQuote = (EXPORTSTYLE != STYLE_TABLE); * } * else if (!sItem.IsEmpty()) * { * // Note: Comments have already been HTML encoded * * // replace carriage returns with <br> * sItem.Replace(ENDL, _T("<br>")); * * // replace tab characters with multiple * sItem.Replace(_T("\t"), TAB); * * sTextColor = pTasks->IsTaskDone(hTask) ? COMMENTS_DONECOLOR : _T("#606060"); * sBackColor.Empty(); * bStrikeThru = FALSE; * } */ break; } if (wantIndent) { attribVal = (GetDepthIndent(depth) + attribVal); } return(attribVal); }
public TaskAttribute(Task.Attribute id, String label, String basePlaceholder) { Id = id; Label = label; BasePlaceholder = basePlaceholder; }
// ------------------------------------------------------ public Attribute(Task.Attribute id, String label, String placeHolderText) { Id = id; Label = label; PlaceHolderText = placeHolderText; }
public TaskAttribute(Task.Attribute attrib, String name) { Attribute = attrib; Name = name; }
public NeedAttributeValuesEventArgs(Task.Attribute a) { attrib = a; }
public bool WantTaskUpdate(Task.Attribute attrib) { return(m_MindMap.WantTaskUpdate(attrib)); }
private bool AddItem(Translator trans, string name, Task.Attribute attrib) { return(Items.Add(new AttributeItem(trans.Translate(name), attrib)) != -1); }
public AttributeItem(string name, Task.Attribute attrib) { Name = name; Attrib = attrib; }
protected String GetAttributeValue(Task task, Task.Attribute attrib) { switch (attrib) { case Task.Attribute.Title: return(task.GetTitle()); case Task.Attribute.Position: return(task.GetPositionString()); case Task.Attribute.Id: return(task.GetID().ToString()); case Task.Attribute.Path: return(task.GetPath(@"\")); case Task.Attribute.Percent: return(task.GetPercentDone(false).ToString()); case Task.Attribute.TimeEstimate: return(""); // task.GetTimeEstimate(); case Task.Attribute.TimeSpent: return(""); // task.GetTimeSpent(); case Task.Attribute.CreationDate: return(task.GetCreationDateString()); case Task.Attribute.CreatedBy: return(task.GetCreatedBy()); case Task.Attribute.LastModifiedDate: return(task.GetLastModifiedDateString()); case Task.Attribute.LastModifiedBy: return(task.GetLastModifiedBy()); case Task.Attribute.StartDate: return(task.GetStartDateString(false)); case Task.Attribute.DueDate: return(task.GetDueDateString(false)); case Task.Attribute.DoneDate: return(task.GetDoneDateString()); case Task.Attribute.Recurrence: return(""); // task.GetRecurrence(); case Task.Attribute.AllocatedBy: return(task.GetAllocatedBy()); case Task.Attribute.Status: return(task.GetStatus()); case Task.Attribute.ExternalId: return(task.GetExternalID()); case Task.Attribute.Cost: return(task.GetCost(false).ToString()); case Task.Attribute.Version: return(task.GetVersion()); case Task.Attribute.Flag: return(task.IsFlagged(false).ToString()); case Task.Attribute.SubtaskDone: return(""); // task.GetSubtaskDoneString(); case Task.Attribute.AllocatedTo: return(task.FormatAllocatedTo("+")); case Task.Attribute.Category: return(task.FormatCategory("+")); case Task.Attribute.Tags: return(task.FormatTag("+")); case Task.Attribute.Dependency: return(task.FormatDependency("+")); case Task.Attribute.FileReference: return(task.FormatFileReference("+")); case Task.Attribute.Priority: { Int32 priority = task.GetPriority(false); switch (priority) { case -1: return(""); case -2: return(""); // m_Trans.Translate("<none>"); } return(priority.ToString()); } break; case Task.Attribute.Risk: { Int32 priority = task.GetRisk(false); switch (priority) { case -1: return(""); case -2: return(""); // m_Trans.Translate("<none>"); } return(priority.ToString()); } break; case Task.Attribute.ParentId: { UInt32 parentId = task.GetParentID(); if (parentId != 0) { return(parentId.ToString()); } } break; case Task.Attribute.Comments: { String htmlComments = task.GetHtmlComments(); if (!String.IsNullOrEmpty(htmlComments)) { return(htmlComments); } } return(task.GetComments()); } return(""); }
public bool WantSortUpdate(Task.Attribute attrib) { return(true); // all updates }