private void OnExpressionBuilderComboBoxSelectedIndexChanged(object sender, EventArgs e)
 {
     if (!this._internalChange)
     {
         this._currentSheet = null;
         if (this._expressionBuilderComboBox.SelectedItem != this.NoneItem)
         {
             this._currentEditor = (ExpressionEditor)this._expressionEditors[this._expressionBuilderComboBox.SelectedItem.ToString()];
             if (this._currentNode != null)
             {
                 if (this._currentNode.IsBound)
                 {
                     ExpressionBinding binding = this._currentNode.Binding;
                     if (this._expressionEditors[binding.ExpressionPrefix] == this._currentEditor)
                     {
                         this._currentSheet = this._currentEditor.GetExpressionEditorSheet(binding.Expression, base.ServiceProvider);
                     }
                 }
                 if (this._currentSheet == null)
                 {
                     this._currentSheet = this._currentEditor.GetExpressionEditorSheet(string.Empty, base.ServiceProvider);
                 }
                 this._currentNode.IsValid = this._currentSheet.IsValid;
             }
         }
         this.SaveCurrentExpressionBinding();
         this._expressionBuilderPropertyGrid.SelectedObject = this._currentSheet;
         this.UpdateUIState();
     }
 }
        private void OnBindablePropsTreeAfterSelect(object sender, TreeViewEventArgs e)
        {
            BindablePropertyNode selectedNode = (BindablePropertyNode)this._bindablePropsTree.SelectedNode;

            if (this._currentNode != selectedNode)
            {
                this._currentNode = selectedNode;
                if ((this._currentNode != null) && this._currentNode.IsBound)
                {
                    ExpressionBinding binding = this._currentNode.Binding;
                    if (!this._currentNode.IsGenerated)
                    {
                        ExpressionEditor editor = (ExpressionEditor)this._expressionEditors[binding.ExpressionPrefix];
                        if (editor == null)
                        {
                            UIServiceHelper.ShowMessage(base.ServiceProvider, System.Design.SR.GetString("ExpressionBindingsDialog_UndefinedExpressionPrefix", new object[] { binding.ExpressionPrefix }), System.Design.SR.GetString("ExpressionBindingsDialog_Text", new object[] { this.Control.Site.Name }), MessageBoxButtons.OK);
                            editor = new GenericExpressionEditor();
                        }
                        this._currentEditor  = editor;
                        this._currentSheet   = this._currentEditor.GetExpressionEditorSheet(binding.Expression, base.ServiceProvider);
                        this._internalChange = true;
                        try
                        {
                            foreach (ExpressionItem item in this._expressionBuilderComboBox.Items)
                            {
                                if (string.Equals(item.ToString(), binding.ExpressionPrefix, StringComparison.OrdinalIgnoreCase))
                                {
                                    this._expressionBuilderComboBox.SelectedItem = item;
                                }
                            }
                            this._currentNode.IsValid = this._currentSheet.IsValid;
                        }
                        finally
                        {
                            this._internalChange = false;
                        }
                    }
                }
                else
                {
                    this._expressionBuilderComboBox.SelectedItem = this.NoneItem;
                    this._currentEditor = null;
                    this._currentSheet  = null;
                }
                this._expressionBuilderPropertyGrid.SelectedObject = this._currentSheet;
                this.UpdateUIState();
            }
        }
 private void OnExpressionBuilderComboBoxSelectedIndexChanged(object sender, EventArgs e)
 {
     if (!this._internalChange)
     {
         this._currentSheet = null;
         if (this._expressionBuilderComboBox.SelectedItem != this.NoneItem)
         {
             this._currentEditor = (ExpressionEditor) this._expressionEditors[this._expressionBuilderComboBox.SelectedItem.ToString()];
             if (this._currentNode != null)
             {
                 if (this._currentNode.IsBound)
                 {
                     ExpressionBinding binding = this._currentNode.Binding;
                     if (this._expressionEditors[binding.ExpressionPrefix] == this._currentEditor)
                     {
                         this._currentSheet = this._currentEditor.GetExpressionEditorSheet(binding.Expression, base.ServiceProvider);
                     }
                 }
                 if (this._currentSheet == null)
                 {
                     this._currentSheet = this._currentEditor.GetExpressionEditorSheet(string.Empty, base.ServiceProvider);
                 }
                 this._currentNode.IsValid = this._currentSheet.IsValid;
             }
         }
         this.SaveCurrentExpressionBinding();
         this._expressionBuilderPropertyGrid.SelectedObject = this._currentSheet;
         this.UpdateUIState();
     }
 }
 private void OnBindablePropsTreeAfterSelect(object sender, TreeViewEventArgs e)
 {
     BindablePropertyNode selectedNode = (BindablePropertyNode) this._bindablePropsTree.SelectedNode;
     if (this._currentNode != selectedNode)
     {
         this._currentNode = selectedNode;
         if ((this._currentNode != null) && this._currentNode.IsBound)
         {
             ExpressionBinding binding = this._currentNode.Binding;
             if (!this._currentNode.IsGenerated)
             {
                 ExpressionEditor editor = (ExpressionEditor) this._expressionEditors[binding.ExpressionPrefix];
                 if (editor == null)
                 {
                     UIServiceHelper.ShowMessage(base.ServiceProvider, System.Design.SR.GetString("ExpressionBindingsDialog_UndefinedExpressionPrefix", new object[] { binding.ExpressionPrefix }), System.Design.SR.GetString("ExpressionBindingsDialog_Text", new object[] { this.Control.Site.Name }), MessageBoxButtons.OK);
                     editor = new GenericExpressionEditor();
                 }
                 this._currentEditor = editor;
                 this._currentSheet = this._currentEditor.GetExpressionEditorSheet(binding.Expression, base.ServiceProvider);
                 this._internalChange = true;
                 try
                 {
                     foreach (ExpressionItem item in this._expressionBuilderComboBox.Items)
                     {
                         if (string.Equals(item.ToString(), binding.ExpressionPrefix, StringComparison.OrdinalIgnoreCase))
                         {
                             this._expressionBuilderComboBox.SelectedItem = item;
                         }
                     }
                     this._currentNode.IsValid = this._currentSheet.IsValid;
                 }
                 finally
                 {
                     this._internalChange = false;
                 }
             }
         }
         else
         {
             this._expressionBuilderComboBox.SelectedItem = this.NoneItem;
             this._currentEditor = null;
             this._currentSheet = null;
         }
         this._expressionBuilderPropertyGrid.SelectedObject = this._currentSheet;
         this.UpdateUIState();
     }
 }