/// <summary> /// Gets the or make role. /// </summary> /// <param name="tup">The tup.</param> /// <param name="mainRole">The main role.</param> /// <returns></returns> public measureSystemRoleEntry GetOrMakeRole(Tuple <Enum, String, String, String, String> tup, measureSystemRoleEntry mainRole = null) { if (tup == null) { return(mainRole); } if (roles.ContainsKey(tup.Item1.ToString())) { return(roles[tup.Item1.ToString()]); } else { measureSystemRoleEntry nr = null; if (mainRole == null) { nr = new measureSystemRoleEntry(tup.Item2, tup.Item3, tup.Item1.toStringSafe()); } else { nr = mainRole.Clone() as measureSystemRoleEntry; nr.letter = tup.Item2; nr.symbol = tup.Item3; nr.name = tup.Item1.ToString(); } nr.setFormat(tup.Item4, tup.Item5); return(nr); } }
//public measureInfo AddStringFormat(Enum name, String itemFormat, Int32 wrapWidth, Int32 wrapHeight, String sufix) //{ //} /// <summary> /// Adds the role. /// </summary> /// <param name="name">The name.</param> /// <param name="letter">The letter.</param> /// <param name="symbol">The symbol.</param> /// <returns></returns> public measureSystemRoleEntry AddRole(String name = "width", String letter = "w", String symbol = "↔") { measureSystemRoleEntry output = new measureSystemRoleEntry(letter, symbol, name); roles.Add(name, output); return(output); }