protected override EditorControlBase CreateEditorControl(ITypeDescriptorContext context, IServiceProvider provider, IWindowsFormsEditorService editorService)
        {
            ArgumentUtility.CheckNotNull("context", context);
            ArgumentUtility.CheckNotNull("provider", provider);
            ArgumentUtility.CheckNotNull("editorService", editorService);

            IBusinessObjectClassSource propertySource = context.Instance as IBusinessObjectClassSource;

            if (propertySource == null)
            {
                throw new InvalidOperationException("Cannot use PropertyPathPickerEditor for objects other than IBusinessObjectClassSource.");
            }

            return(new PropertyPathPickerControl(propertySource, provider, editorService));
        }
        public PropertyPathPickerControl(IBusinessObjectClassSource classSource, IServiceProvider provider, IWindowsFormsEditorService editorService)
            : base(provider, editorService)
        {
            ArgumentUtility.CheckNotNull("classSource", classSource);

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _classSource = classSource;

            if (_classSource != null && _classSource.BusinessObjectClass != null)
            {
                PathTree.PathSeparator = classSource.BusinessObjectClass.BusinessObjectProvider.GetPropertyPathSeparator().ToString();
            }

            FillTree();
        }