Exemplo n.º 1
0
 private void PathCombo_SelectedPathChanged(object sender, EventArgs e)
 {
     // since we're creating a new instance of BuilderSource here, we can let it handle
     // creating the UIElement in the case where the SelectedBuilder stays the same
     // (otherwise in some cases the field path would change, but the SelectedBuilder
     // would stay the same and not recreate a new UIElement)
     BuilderSource = new BindingList <ParameterBuilder>(_builderFactory.Build(_pathCombo.SelectedPath));
 }
Exemplo n.º 2
0
        public virtual bool CanCopyFrom(IPartView other)
        {
            if (other == null || !(other is IPartViewNode))
            {
                return(false);
            }

            // ensure we can represent the path
            var node = (IPartViewNode)other;

            if (Paths.Contains(node.SelectedPath))
            {
                // ensure there is a builder that can represent the incoming builder
                return(_builderFactory.Build(node.SelectedPath).Contains(node.SelectedBuilder));

                // value and parser are irrelevant here
            }

            return(false);
        }