Exemple #1
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static TaskFacade getInstance()
 {
     return(cInstance ?? (cInstance = new TaskFacade()));
 }
Exemple #2
0
        public ManageSessions(PluginSessionsUC pPluginMain)
        {
            InitializeComponent();

            cPluginMain = pPluginMain;

            #region DGV Header definitions

            DataGridViewTextBoxColumn cSessionNameCol = new DataGridViewTextBoxColumn();
            cSessionNameCol.DataPropertyName           = "sessionname";
            cSessionNameCol.Name                       = "sessionname";
            cSessionNameCol.HeaderText                 = "Session name";
            cSessionNameCol.ReadOnly                   = true;
            cSessionNameCol.Visible                    = true;
            cSessionNameCol.Width                      = 120;
            cSessionNameCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            DGV_SessionPatterns.Columns.Add(cSessionNameCol);

            DataGridViewTextBoxColumn cHTTPHostCol = new DataGridViewTextBoxColumn();
            cHTTPHostCol.DataPropertyName           = "httphost";
            cHTTPHostCol.Name                       = "httphost";
            cHTTPHostCol.HeaderText                 = "HTTP Host regex";
            cHTTPHostCol.ReadOnly                   = true;
            cHTTPHostCol.Visible                    = true;
            cHTTPHostCol.Width                      = 180;
            cHTTPHostCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            DGV_SessionPatterns.Columns.Add(cHTTPHostCol);

            DataGridViewTextBoxColumn cWebPageCol = new DataGridViewTextBoxColumn();
            cWebPageCol.DataPropertyName           = "webpage";
            cWebPageCol.Name                       = "webpage";
            cWebPageCol.HeaderText                 = "Web page";
            cWebPageCol.ReadOnly                   = true;
            cWebPageCol.Visible                    = true;
            cWebPageCol.Width                      = 180;
            cWebPageCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            DGV_SessionPatterns.Columns.Add(cWebPageCol);

            DataGridViewTextBoxColumn cSessionPatternRegexCol = new DataGridViewTextBoxColumn();
            cSessionPatternRegexCol.DataPropertyName = "sessionpatternstring";
            cSessionPatternRegexCol.Name             = "sessionpatternstring";
            cSessionPatternRegexCol.HeaderText       = "Session regex";
            cSessionPatternRegexCol.ReadOnly         = true;
            cSessionPatternRegexCol.Visible          = true;
            //cSessionPatternRegexCol.Width = 90;
            cSessionPatternRegexCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
            cSessionPatternRegexCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
            DGV_SessionPatterns.Columns.Add(cSessionPatternRegexCol);

            cSessionPatternRecords         = new BindingList <SessionPattern>();
            DGV_SessionPatterns.DataSource = cSessionPatternRecords;
            #endregion

            cTask = TaskFacade.getInstance();
            cTask.addObserver(this);

            try
            {
                cTask.readSessionPatterns();
            }
            catch (FileNotFoundException lEx)
            {
                cPluginMain.PluginHost.LogMessage(String.Format("ManageSessions() : {0}", lEx.Message));
            }
            catch (DirectoryNotFoundException lEx)
            {
                cPluginMain.PluginHost.LogMessage(String.Format("ManageSessions() : {0}", lEx.Message));
            }
            catch (Exception lEx)
            {
                MessageBox.Show("Error ocurred: " + lEx.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                cPluginMain.PluginHost.LogMessage(String.Format("ManageSessions() : {0}", lEx.Message));
            }

            initInputFields();
        }
Exemple #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public static TaskFacade getInstance()
 {
     return cInstance ?? (cInstance = new TaskFacade());
 }
Exemple #4
0
        public ManageSessions(PluginSessionsUC pPluginMain)
        {
            InitializeComponent();

              cPluginMain = pPluginMain;

              #region DGV Header definitions

              DataGridViewTextBoxColumn cSessionNameCol = new DataGridViewTextBoxColumn();
              cSessionNameCol.DataPropertyName = "sessionname";
              cSessionNameCol.Name = "sessionname";
              cSessionNameCol.HeaderText = "Session name";
              cSessionNameCol.ReadOnly = true;
              cSessionNameCol.Visible = true;
              cSessionNameCol.Width = 120;
              cSessionNameCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
              DGV_SessionPatterns.Columns.Add(cSessionNameCol);

              DataGridViewTextBoxColumn cHTTPHostCol = new DataGridViewTextBoxColumn();
              cHTTPHostCol.DataPropertyName = "httphost";
              cHTTPHostCol.Name = "httphost";
              cHTTPHostCol.HeaderText = "HTTP Host regex";
              cHTTPHostCol.ReadOnly = true;
              cHTTPHostCol.Visible = true;
              cHTTPHostCol.Width = 180;
              cHTTPHostCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
              DGV_SessionPatterns.Columns.Add(cHTTPHostCol);

              DataGridViewTextBoxColumn cWebPageCol = new DataGridViewTextBoxColumn();
              cWebPageCol.DataPropertyName = "webpage";
              cWebPageCol.Name = "webpage";
              cWebPageCol.HeaderText = "Web page";
              cWebPageCol.ReadOnly = true;
              cWebPageCol.Visible = true;
              cWebPageCol.Width = 180;
              cWebPageCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
              DGV_SessionPatterns.Columns.Add(cWebPageCol);

              DataGridViewTextBoxColumn cSessionPatternRegexCol = new DataGridViewTextBoxColumn();
              cSessionPatternRegexCol.DataPropertyName = "sessionpatternstring";
              cSessionPatternRegexCol.Name = "sessionpatternstring";
              cSessionPatternRegexCol.HeaderText = "Session regex";
              cSessionPatternRegexCol.ReadOnly = true;
              cSessionPatternRegexCol.Visible = true;
              //cSessionPatternRegexCol.Width = 90;
              cSessionPatternRegexCol.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
              cSessionPatternRegexCol.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;
              DGV_SessionPatterns.Columns.Add(cSessionPatternRegexCol);

              cSessionPatternRecords = new BindingList<SessionPattern>();
              DGV_SessionPatterns.DataSource = cSessionPatternRecords;
              #endregion

              cTask = TaskFacade.getInstance();
              cTask.addObserver(this);

              try
              {
            cTask.readSessionPatterns();
              }
              catch (FileNotFoundException lEx)
              {
            cPluginMain.PluginHost.LogMessage(String.Format("ManageSessions() : {0}", lEx.Message));
              }
              catch (DirectoryNotFoundException lEx)
              {
            cPluginMain.PluginHost.LogMessage(String.Format("ManageSessions() : {0}", lEx.Message));
              }
              catch (Exception lEx)
              {
            MessageBox.Show("Error ocurred: " + lEx.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            cPluginMain.PluginHost.LogMessage(String.Format("ManageSessions() : {0}", lEx.Message));
              }

              initInputFields();
        }