Exemplo n.º 1
0
        public override IValuePresentation PresentValue(IStringValueRole <TValue> valueRole, IMetadataTypeLite instanceType,
                                                        IPresentationOptions options, IUserDataHolder dataHolder, CancellationToken token)
        {
            // Note that ValueFlags.IsString will add the "View" link to see a string in a popup. We don't need this
            var text = valueRole.GetString();

            return(SimplePresentation.CreateSuccess(ValuePresentationPart.Default(text),
                                                    valueRole.ValueReference.DefaultFlags | ValueFlags.NoChildren, instanceType, text));
        }
        public override IValuePresentation PresentValue(IStringValueRole <TValue> valueRole, IMetadataTypeLite instanceType,
                                                        IPresentationOptions options, IUserDataHolder dataHolder, CancellationToken token)
        {
            // Present the value's string as plain text, without any syntax highlighting or quote handling. Don't use
            // ValueFlags.IsString, as it will add an unnecessary "View" link - our text is always short
            var text = valueRole.GetString();

            return(SimplePresentation.CreateSuccess(ValuePresentationPart.Default(text),
                                                    valueRole.ValueReference.DefaultFlags | ValueFlags.NoChildren, instanceType, text));
        }
Exemplo n.º 3
0
 public override bool IsApplicable(IStringValueRole <TValue> role, IMetadataTypeLite instanceType, IPresentationOptions options,
                                   IUserDataHolder dataHolder)
 {
     return(myUnityOptions.ExtensionsEnabled && role.ValueReference is NamedReferenceDecorator <TValue>);
 }