private void AddParameter(Parameter parameter)
 {
     try
     {
         this.IgnoreParameterChanges(true);
         ParameterListViewItem item = new ParameterListViewItem(parameter);
         this._parametersListView.BeginUpdate();
         try
         {
             this._parametersListView.Items.Add(item);
             item.Selected = true;
             item.Focused = true;
             item.EnsureVisible();
             this._parametersListView.Focus();
         }
         finally
         {
             this._parametersListView.EndUpdate();
         }
         item.Refresh();
         item.BeginEdit();
     }
     finally
     {
         this.IgnoreParameterChanges(false);
     }
     this.OnParametersChanged(this, EventArgs.Empty);
 }
 private void SetActiveEditParameterItem(ParameterListViewItem parameterItem, bool allowFocusChange)
 {
     if (parameterItem == null)
     {
         if (this._parameterEditor != null)
         {
             this._parameterEditor.Visible = false;
             this._parameterEditor = null;
         }
     }
     else
     {
         ParameterEditor editor = null;
         if (this._inAdvancedMode)
         {
             editor = this._advancedParameterEditor;
         }
         else if (parameterItem.Parameter != null)
         {
             if (parameterItem.Parameter.GetType() == typeof(Parameter))
             {
                 editor = this._staticParameterEditor;
             }
             else if (parameterItem.Parameter.GetType() == typeof(ControlParameter))
             {
                 editor = this._controlParameterEditor;
             }
             else if (parameterItem.Parameter.GetType() == typeof(FormParameter))
             {
                 editor = this._formParameterEditor;
             }
             else if (parameterItem.Parameter.GetType() == typeof(QueryStringParameter))
             {
                 editor = this._queryStringParameterEditor;
             }
             else if (parameterItem.Parameter.GetType() == typeof(CookieParameter))
             {
                 editor = this._cookieParameterEditor;
             }
             else if (parameterItem.Parameter.GetType() == typeof(SessionParameter))
             {
                 editor = this._sessionParameterEditor;
             }
             else if (parameterItem.Parameter.GetType() == typeof(ProfileParameter))
             {
                 editor = this._profileParameterEditor;
             }
             else if (parameterItem.Parameter.GetType() == typeof(RouteParameter))
             {
                 editor = this._routeParameterEditor;
             }
         }
         if (this._parameterEditor != editor)
         {
             if (this._parameterEditor != null)
             {
                 this._parameterEditor.Visible = false;
             }
             this._parameterEditor = editor;
         }
         if (this._parameterEditor != null)
         {
             this._parameterEditor.InitializeParameter(parameterItem);
             this._parameterEditor.Visible = true;
             if (allowFocusChange)
             {
                 this._parameterEditor.SetDefaultFocus();
             }
         }
     }
 }
 public void AddParameters(Parameter[] parameters)
 {
     try
     {
         this.IgnoreParameterChanges(true);
         this._parametersListView.BeginUpdate();
         ArrayList list = new ArrayList();
         try
         {
             foreach (Parameter parameter in parameters)
             {
                 ParameterListViewItem item = new ParameterListViewItem(parameter);
                 this._parametersListView.Items.Add(item);
                 list.Add(item);
             }
             if (this._parametersListView.Items.Count > 0)
             {
                 this._parametersListView.Items[0].Selected = true;
                 this._parametersListView.Items[0].Focused = true;
                 this._parametersListView.Items[0].EnsureVisible();
             }
             this._parametersListView.Focus();
         }
         finally
         {
             this._parametersListView.EndUpdate();
         }
         foreach (ParameterListViewItem item2 in list)
         {
             item2.Refresh();
         }
     }
     finally
     {
         this.IgnoreParameterChanges(false);
     }
     this.OnParametersChanged(this, EventArgs.Empty);
 }