Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
410
Extending UltraTreeNode with IBindableComponent
posted

I am messing around with trying to extend the node with IBindableComponent....

 Has anyone tried this or have any examples?

 Thanks for any input...

Carson 

  • 410
    Verified Answer
    posted

     That wasnt that hard....now I can bind my node properties to the underlying object...

     Very nice...

    public class WhitNode:UltraTreeNode,IBindableComponent
        {

            //public new event EventHandler Disposed;
            private BindingContext bc;
            private ControlBindingsCollection cbc;
            //private ISite s;

            #region IBindableComponent Members

            BindingContext IBindableComponent.BindingContext
            {
                get
                {
                    if (bc == null) { bc = new BindingContext(); }
                    return bc;
                }
                set
                {
                    bc = value;
                }
            }
            public BindingContext BindingContext
            {
                get
                {
                    if (bc == null) { bc = new BindingContext(); }
                    return bc;
                }
                set
                {
                    bc = value;
                }
            }
            ControlBindingsCollection IBindableComponent.DataBindings
            {
                get
                {
                    if (cbc == null) { cbc = new ControlBindingsCollection(this); }
                    return cbc;
                }
            }
            public ControlBindingsCollection DataBindings
            {
                get
                {
                    if (cbc == null) { cbc = new ControlBindingsCollection(this); }
                    return cbc;
                }
            }
            #endregion

            #region IComponent Members

            event EventHandler IComponent.Disposed
            {
                add { throw new Exception("The method or operation is not implemented."); }
                remove { throw new Exception("The method or operation is not implemented."); }
            }

            ISite IComponent.Site
            {
                get
                {
                    return null;
                }
                set
                {
                   
                }
            }

            #endregion

            #region IDisposable Members

            void IDisposable.Dispose()
            {
                GC.SuppressFinalize(this);
            }

            #endregion
        }