Ejemplo n.º 1
0
        /// <summary>
        ///     Updates the SelectedValue property based on what is present in the SelectedItems property.
        /// </summary>
        private void UpdateSelectedValue()
        {
            string newValue = String.Join(Delimiter, SelectedItems.Cast <object>().Select(GetItemValue));

            if (String.IsNullOrEmpty(SelectedValue) || !SelectedValue.Equals(newValue))
            {
                _ignoreSelectedValueChanged = true;
                SelectedValue = newValue;
                _ignoreSelectedValueChanged = false;
            }
        }
Ejemplo n.º 2
0
        private void UpdateSelectedValue()
        {
            string text = string.Join(Delimiter, from object x in SelectedItems
                                      select GetItemValue(x));

            if (string.IsNullOrEmpty(SelectedValue) || !SelectedValue.Equals(text))
            {
                _ignoreSelectedValueChanged = true;
                SelectedValue = text;
                _ignoreSelectedValueChanged = false;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Updates the SelectedValue property based on what is present in the SelectedItems property.
        /// </summary>
        private void UpdateSelectedValue()
        {
#if VS2008
            string newValue = String.Join(Delimiter, SelectedItems.Cast <object>().Select(x => GetItemValue(x).ToString()).ToArray());
#else
            string newValue = String.Join(Delimiter, SelectedItems.Cast <object>().Select(x => GetItemValue(x)));
#endif
            if (String.IsNullOrEmpty(SelectedValue) || !SelectedValue.Equals(newValue))
            {
                _ignoreSelectedValueChanged = true;
                SelectedValue = newValue;
                _ignoreSelectedValueChanged = false;
            }
        }
        private void UpdateSelectedValue()
        {
            //get out of here if we don't want to set the SelectedValue
            if (_ignoreSetSelectedValue)
            {
                return;
            }

            _surpressSelectedValueChanged = true;

            string newValue = String.Join(Delimiter, SelectedItems.Cast <object>().Select(x => GetItemValue(x).ToString()).ToArray());

            if (String.IsNullOrEmpty(SelectedValue) || !SelectedValue.Equals(newValue))
            {
                SelectedValue = newValue;
            }

            _surpressSelectedValueChanged = false;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Compares the provided value with the component's selected value.
 /// </summary>
 /// <param name="expectedValue">Value that the component is expected to have.</param>
 /// <returns>true if expectedValue equals the selected value, otherwise false</returns>
 protected virtual bool CheckSelectedValue(T expectedValue)
 {
     return(SelectedValue.Equals(expectedValue));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 构造值绑定的特性,默认使用 <see cref="T:Microsoft.AspNetCore.Components.BindConverter" /> 类型。
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="sequence"></param>
 protected override void BuildValueBindingAttribute(RenderTreeBuilder builder, int sequence) => builder.AddAttribute(sequence++, "checked", SelectedValue?.Equals(CurrentValue));