Пример #1
0
        public DefaultEditValueForm(DataVaultUIContext context, IValue value)
        {
            DataVaultUIContext = context.AssertNotNull();
            Value   = value.AssertNotNull();
            Wrapper = value.GetTypeToken2() == "binary" ? null : ContentTypes.ApplyCType(value);

            InitializeComponent();
            DefaultSize  = new Size(Size.Width, Size.Height - _panelBinary.Height);
            InflatedSize = new Size(DefaultSize.Width + 300, DefaultSize.Height + 400);

            _cbType.Items.Add(Resources.ValueType_NotSelected);
            ContentTypes.All.ForEach(w => _cbType.Items.Add(w.LocTypeName));
            _cbType.Items.Add(Resources.ValueType_Binary);
            if (Wrapper is UnknownContentTypeAppliedToValue)
            {
                _cbType.Items.Add(Value.LocalizedTypeToken());
            }
            _cbType.SelectedIndex = 0;

            _tbName.Text         = Value.Name.ResolveIfSpecial();
            _cbType.SelectedItem = Value.LocalizedTypeToken();

            _tbValueTyped.Text  = Wrapper == null ? null : Wrapper.AsLocalizedString;
            _tbValueBinary.Text = Resources.BinaryType_ContentNotEditedYet;
        }
Пример #2
0
        protected ContentTypeAppliedToValue(IValue untyped)
        {
            Untyped = untyped.AssertNotNull();

            var ctypeAttr = this.GetType().Attr <ContentTypeAttribute>();

            CType = ctypeAttr.Token.GetCTypeFromToken();
        }
Пример #3
0
        public DefaultEditValueForm(DataVaultUIContext context, IValue value)
        {
            DataVaultUIContext = context.AssertNotNull();
            Value = value.AssertNotNull();
            Wrapper = value.GetTypeToken2() == "binary" ? null : ContentTypes.ApplyCType(value);

            InitializeComponent();
            DefaultSize = new Size(Size.Width, Size.Height - _panelBinary.Height);
            InflatedSize = new Size(DefaultSize.Width + 300, DefaultSize.Height + 400);

            _cbType.Items.Add(Resources.ValueType_NotSelected);
            ContentTypes.All.ForEach(w => _cbType.Items.Add(w.LocTypeName));
            _cbType.Items.Add(Resources.ValueType_Binary);
            if (Wrapper is UnknownContentTypeAppliedToValue) _cbType.Items.Add(Value.LocalizedTypeToken());
            _cbType.SelectedIndex = 0;

            _tbName.Text = Value.Name.ResolveIfSpecial();
            _cbType.SelectedItem = Value.LocalizedTypeToken();

            _tbValueTyped.Text = Wrapper == null ? null : Wrapper.AsLocalizedString;
            _tbValueBinary.Text = Resources.BinaryType_ContentNotEditedYet;
        }
 public UnknownContentTypeAppliedToValue(UnknownContentType ctype, IValue untyped)
 {
     Untyped = untyped.AssertNotNull();
     CType   = ctype;
     Content = untyped.ContentString;
 }
 public UnknownContentTypeAppliedToValue(UnknownContentType ctype, IValue untyped)
 {
     Untyped = untyped.AssertNotNull();
     CType = ctype;
     Content = untyped.ContentString;
 }