Beispiel #1
0
        /// <summary>
        /// Creates a <c ref="ManageActions" />
        /// </summary>
        /// <param name="viewer"></param>
        public ManageActions(TextViewer viewer)
        {
            InitializeComponent();
            BackColor = (Color)Logview4netSettings.Instance["BaseColor"];

            actionManager.LoadConfiguration(viewer);
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new <see cref="ActionConfigurator"/> instance.
        /// </summary>
        public ActionConfigurator(TextViewer viewer)
        {
            _viewer = viewer;
            _viewer.Txt.BackColorChanged += new EventHandler(txt_BackColorChanged);

            PreInitializeComponent();
            txtExample.BackColor = _viewer.Txt.BackColor;
        }
Beispiel #3
0
 /// <summary>
 /// Creates a new <see cref="textConfigurator"/> instance.
 /// </summary>
 /// <param name="viewer">Viewer.</param>
 public textConfigurator(TextViewer viewer)
 {
     _viewer = viewer;
     PreInitializeComponent();
 }
Beispiel #4
0
 /// <summary>
 /// Creates a new <see cref="textConfigurator"/> instance.
 /// </summary>
 public textConfigurator()
 {
     _viewer = new TextViewer();
     PreInitializeComponent();
 }
Beispiel #5
0
        /// <summary>
        /// Loads the configuration for the ActionManager
        /// </summary>
        /// <param name="viewer"></param>
        public void LoadConfiguration(TextViewer viewer)
        {
            _viewer = viewer;

            Controls.Clear();

            //Loop through all actions and add thier configurators to controls
            //Also add 'Add' and 'Delete' buttons
            foreach (var a in _viewer.Actions)
            {
                var ac = new ActionConfigurator(a, _viewer);
                Controls.Add(ac);

                if (Controls.Count == 1)
                {
                    ac.ShowHeaders = true;
                }
                else
                {
                    ac.Top         = Controls[Controls.Count - 2].Bottom + 3;
                    ac.ShowHeaders = false;
                }

                ac.Visible = true;

                //Delete button
                var b = new Button();
                Controls.Add(b);
                b.Top     = ac.Bottom - 27;
                b.Left    = ac.Left + ac.Width + 3;
                b.Size    = new Size(25, 25);
                b.Visible = true;
                b.Tag     = ac;
                b.Image   = Resources.cross;
                b.Click  += new EventHandler(delete_Click);
                toolTip1.SetToolTip(b, "Remove action from session.");
                if ((b.Right + 7) > ClientRectangle.Width)
                {
                    var foo = (b.Right + 7) - ClientRectangle.Width;
                    Width += foo;
                }
            }

            //This is the configurator for a new action
            var ac1 = new ActionConfigurator(_viewer);

            _newAction = ac1;
            Controls.Add(ac1);
            ac1.ShowHeaders = false;
            if (Controls.Count < 2)
            {
                ac1.Top         = 12;
                ac1.ShowHeaders = true;
            }
            else
            {
                ac1.Top = Controls[Controls.Count - 2].Bottom + 12;
            }
            ac1.Visible = true;

            var c = new Button();

            _newButton = c;
            Controls.Add(c);
            c.Top  = ac1.Bottom - 27;
            c.Left = ac1.Left + ac1.Width + 3;
            c.Size = new Size(25, 25);
            toolTip1.SetToolTip(c, "Add action to session.");
            c.Visible = true;
            c.Tag     = ac1;
            c.Image   = Resources.add;
            c.Click  += new EventHandler(add_Click);

            Invalidate();
        }