Пример #1
0
		public TreeNode AddItem(TreeNode parent, string text, IConfigContentEditor editor)
		{
			if (String.IsNullOrEmpty(text))
				throw new NullParameterException("Can not add item to configuration dialog.Text is null or empty.");

			if (editor == null )
				return null;

			UserControl uc = editor as UserControl;
			if (uc == null)
				return null;

			TreeNode node = null;
			if (parent == null)
				node = _moduleOptionsRoot.Nodes.Add(text,text);
			else
				node = parent.Nodes.Add(text,text);

			node.Text = text;
			node.ImageIndex = 2;
			node.SelectedImageIndex = 0;
			node.Tag = editor;
			_configItems.Add(editor);

			uc.Hide();
			uc.Parent = panContent;
			uc.Dock = DockStyle.Fill;

			return node;
		}
Пример #2
0
        public TreeNode AddItem(TreeNode parent, string text, IConfigContentEditor editor)
        {
            if (frmConfigurationDlg.Instance == null)
            {
                throw new InvalidOperationException("AddFolder operation is valid only when dialog is opened!");
            }

            return(frmConfigurationDlg.Instance.AddItem(parent, text, editor));
        }
Пример #3
0
    private void ShowSelectedContent( TreeNode node )
    {
      if (node == null)
      {
        return;
      }

      if ((node.Tag == null) || !(node.Tag is IConfigContentEditor))
      {
        return;
      }


      IConfigContentEditor configItem = (node.Tag as IConfigContentEditor);

      if (_currentItem == configItem)
      {
        return;
      }

      if (_currentItem != null)
      {
        _currentItem.HideContent();
      }

      _currentItem = configItem;
      if (!_currentItem.ContentLoaded)
      {
        _currentItem.LoadContent();
      }

      if(_currentItem == _opCodeCompletionLists)
      {
        this.AcceptButton = null;
      }
      else
      {
        this.AcceptButton = btnSave;
      }

      lblIntro.SendToBack();
      kryptonHeader1.Text = node.Text;
      configItem.ShowContent();
      kryptonHeader1.SendToBack();
    }