Working on adding tool tips to tab controls in Public Property Editor
This commit is contained in:
parent
9544a84107
commit
7f07335f54
2 changed files with 22 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ either expressed or implied, of the FreeBSD Project.
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
|
|
@ -61,6 +62,26 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
// Enum keyed on name to friendly name
|
||||
var enumItems = Enum.GetNames(property.PropertyType).Select(enumName => (enumName, enumName.Replace('_', ' ')));
|
||||
|
||||
string GetDescription(Enum value)
|
||||
{
|
||||
var type = value.GetType();
|
||||
|
||||
var name = Enum.GetName(type, value);
|
||||
|
||||
if (name != null)
|
||||
{
|
||||
if (Attribute.GetCustomAttribute(property, property.PropertyType) is DescriptionAttribute attr)
|
||||
{
|
||||
return attr.Description;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
var enumDescriptions = Enum.GetValues(property.PropertyType);
|
||||
|
||||
|
||||
switch (enumDisplayAttibute.Mode)
|
||||
{
|
||||
case EnumDisplayAttribute.PresentationMode.IconRow:
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 5d5b72c45986bf1b5048dc43680a06677126c7ec
|
||||
Subproject commit 46598e782d08077aad9fc79234c0c8ebc64690c1
|
||||
Loading…
Add table
Add a link
Reference in a new issue