Esempio n. 1
0
        public void AddItems(IOptionBuilderContext context, Type subjectType, object subject)
        {
            GenericOptionItem <StringTrimming> trimmingItem =
                new GenericOptionItem <StringTrimming>(StringFormatPropertyMapBuilder.TrimmingProperty);

            trimmingItem.SetAttribute(OptionItem.SUPPORT_NULL_VALUE_ATTRIBUTE, false);
            context.BindItem(trimmingItem, StringFormatPropertyMapBuilder.TrimmingProperty);

            GenericOptionItem <StringAlignment> alignmentItem =
                new GenericOptionItem <StringAlignment>(StringFormatPropertyMapBuilder.AlignmentProperty);

            alignmentItem.SetAttribute(OptionItem.SUPPORT_NULL_VALUE_ATTRIBUTE, false);
            context.BindItem(alignmentItem, StringFormatPropertyMapBuilder.AlignmentProperty);

            GenericOptionItem <StringAlignment> lineAlignItem =
                new GenericOptionItem <StringAlignment>(StringFormatPropertyMapBuilder.LineAlignmentProperty);

            lineAlignItem.SetAttribute(OptionItem.SUPPORT_NULL_VALUE_ATTRIBUTE, false);
            context.BindItem(lineAlignItem, StringFormatPropertyMapBuilder.LineAlignmentProperty);

            IList <StringFormatFlags> directionValues = new List <StringFormatFlags>(2);

            directionValues.Add(StringFormatFlags.DirectionRightToLeft);
            directionValues.Add(StringFormatFlags.DirectionVertical);

            CollectionOptionItem <StringFormatFlags> directionItem =
                new CollectionOptionItem <StringFormatFlags>(StringFormatPropertyMapBuilder.DirectionProperty, directionValues);

            directionItem.SetAttribute(OptionItem.SUPPORT_NULL_VALUE_ATTRIBUTE, true);
            directionItem.SetAttribute(OptionItem.NULL_VALUE_STRING_ATTRIBUTE, "LeftToRight");
            context.BindItem(directionItem, StringFormatPropertyMapBuilder.DirectionProperty);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds the currently valid <see cref="IPortStyle"/> items to the context.
        /// </summary>
        /// <remarks>
        /// Uses <see cref="ValidPortStyles"/>.
        /// </remarks>
        /// <param name="context">The context to use.</param>
        protected virtual void AddValidStyleItems(IOptionBuilderContext context)
        {
            CollectionOptionItem <Type> portStyleItems = new CollectionOptionItem <Type>(DefaultPortPropertyMapBuilder.PortStyleProperty, validPortStyles);

            portStyleItems.SetAttribute(CollectionOptionItem <Type> .USE_ONLY_DOMAIN_ATTRIBUTE, false);
            context.BindItem(portStyleItems, DefaultPortPropertyMapBuilder.PortStyleProperty);
        }
        /// <summary>
        /// Adds the currently valid <see cref="ILabelModel"/> items to the context.
        /// </summary>
        /// <remarks>
        /// Uses <see cref="ValidEdgeLabelModels"/>, <see cref="ValidNodeLabelModels"/>, and <see cref="ValidPortLabelModels"/>
        /// respectively.
        /// </remarks>
        /// <param name="context">The context to use.</param>
        protected virtual void AddValidModelsItems(IOptionBuilderContext context)
        {
            CollectionOptionItem <Type> edgeLabelModelItem =
                new CollectionOptionItem <Type>(DefaultLabelPropertyMapBuilder.EdgeLabelModelProperty, validEdgeLabelModels);

            edgeLabelModelItem.SetAttribute(CollectionOptionItem <Type> .USE_ONLY_DOMAIN_ATTRIBUTE, false);
            context.BindItem(edgeLabelModelItem, DefaultLabelPropertyMapBuilder.EdgeLabelModelProperty);
            CollectionOptionItem <Type> nodeLabelModelItem =
                new CollectionOptionItem <Type>(DefaultLabelPropertyMapBuilder.NodeLabelModelProperty, validNodeLabelModels);

            nodeLabelModelItem.SetAttribute(CollectionOptionItem <Type> .USE_ONLY_DOMAIN_ATTRIBUTE, false);
            context.BindItem(nodeLabelModelItem, DefaultLabelPropertyMapBuilder.NodeLabelModelProperty);
            CollectionOptionItem <Type> portLabelModelItem =
                new CollectionOptionItem <Type>(DefaultLabelPropertyMapBuilder.PortLabelModelProperty, validPortLabelModels);

            portLabelModelItem.SetAttribute(CollectionOptionItem <Type> .USE_ONLY_DOMAIN_ATTRIBUTE, false);
            context.BindItem(portLabelModelItem, DefaultLabelPropertyMapBuilder.PortLabelModelProperty);
        }