public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }
            if (!(value is TreeNavigationItem))
            {
                return(null);
            }
            TreeNavigationItem treeNavigationItem = value as TreeNavigationItem;

            if (NavigationType.TYPE_ELEMENT.Equals(treeNavigationItem.Type))
            {
                CompositeTypeElementTreeNavigationItem compositeTypeElementTreeNavigationItem = (CompositeTypeElementTreeNavigationItem)treeNavigationItem;
                return(compositeTypeElementTreeNavigationItem.Name + " : " + compositeTypeElementTreeNavigationItem.ElementTypeName);
            }
            else if (NavigationType.COMPOSITE_PRESET_ELEMENT.Equals(treeNavigationItem.Type))
            {
                CompositePresetElementTreeNavigationItem compositePresetElementTreeNavigationItem = (CompositePresetElementTreeNavigationItem)treeNavigationItem;
                return(compositePresetElementTreeNavigationItem.CompositeTypeElementName + " : " + compositePresetElementTreeNavigationItem.CompositeTypeElementElementTypeName + " <- " + compositePresetElementTreeNavigationItem.AssociatedPresetName);
            }
            return(treeNavigationItem.Name);
        }
Exemplo n.º 2
0
        private GenerateCodeTypeElementTreeNavigationItem CreateGenerateCodeTypeElementTreeNavigationItem(CompositeTypeElementTreeNavigationItem compositeTypeElementTreeNavigationItem)
        {
            GenerateCodeTypeElementTreeNavigationItem generateCodeTypeElementTreeNavigationItem = new GenerateCodeTypeElementTreeNavigationItem();

            generateCodeTypeElementTreeNavigationItem.CompositeTypeElementTreeNavigationItem = compositeTypeElementTreeNavigationItem;
            generateCodeTypeElementTreeNavigationItem.ColumnName = CreateColumnName(compositeTypeElementTreeNavigationItem.Name);
            generateCodeTypeElementTreeNavigationItem.Generate   = true;
            return(generateCodeTypeElementTreeNavigationItem);
        }