Example #1
0
    // Methods to populate a tool tip data object
    // Tool tip data cannot have two elements of the same type
    // By default overwriting is also disabled, so that elements are not overwritten by mistake
    // Returns true or false based on whether data was succssfully added or not
    // TODO: need to replace bool with status codes
    public bool AddElement(ToolTipElementID elementID, string elementToAdd, bool overwrite = false)
    {
        if (toolTipElementsDict == null)
        {
            //Invalid data
            return(false);
        }

        if (!overwrite && toolTipElementsDict.ContainsKey(elementID))
        {
            return(false);
        }

        toolTipElementsDict.Add(elementID, elementToAdd);
        return(true);
    }
Example #2
0
 public string GetElement(ToolTipElementID elementID)
 {
     return(toolTipElementsDict [elementID]);
 }
Example #3
0
 //Methods to query and get data elements
 public bool HasElement(ToolTipElementID elementID)
 {
     return(toolTipElementsDict.ContainsKey(elementID));
 }