示例#1
0
        public BSMOperator(Vector grid, GeneralizedBlackScholesProcess process, double residualTime) : base(grid.size())
        {
            LogGrid logGrid = new LogGrid(grid);
            var     cc      = new PdeConstantCoeff <PdeBSM>(process, residualTime, process.stateVariable().link.value());

            cc.generateOperator(residualTime, logGrid, this);
        }
示例#2
0
 private void OnLogViewCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (LogGrid.Items.Count > 0)
     {
         LogGrid.ScrollIntoView(LogGrid.Items[LogGrid.Items.Count - 1]);
     }
 }
示例#3
0
 void ShowSearchProgressBar(bool Show)
 {
     if (LogGrid.InvokeRequired)
     {
         ShowSearchProgressBar_d CALL_d = new ShowSearchProgressBar_d(ShowSearchProgressBar);
         LogGrid.Invoke(CALL_d, new object[] { Show });
     }
     else
     {
         SearchProgressBar.Visible = Show;
     }
 }
示例#4
0
 void EndLogSearch()
 {
     if (LogGrid.InvokeRequired)
     {
         EndLogSearch_d CALL_d = new EndLogSearch_d(EndLogSearch);
         LogGrid.Invoke(CALL_d, new object[] { });
     }
     else
     {
         SearchProgressBar.Visible = false;
         SearchBtn.Text            = "Search with this Filter";
     }
 }
示例#5
0
 void EndLogLoad()
 {
     if (LogGrid.InvokeRequired)
     {
         EndLogLoad_d CALL_d = new EndLogLoad_d(EndLogLoad);
         LogGrid.Invoke(CALL_d, new object[] { });
     }
     else
     {
         LoadLogProgressBar.Visible = false;
         LogDisplayTabs.Visible     = true;
     }
 }
示例#6
0
 void ShowRows(List <object[]> Rows)
 {
     if (LogGrid.InvokeRequired)
     {
         ShowRows_d CALL_d = new ShowRows_d(ShowRows);
         LogGrid.Invoke(CALL_d, new object[] { Rows });
     }
     else
     {
         foreach (object[] Row in Rows)
         {
             LogGrid.Rows.Add(Row);
         }
     }
     SearchResultsCountLbl.Text = string.Format("Search Results Count: {0}", LogGrid.Rows.Count);
 }
示例#7
0
        /// <summary>
        /// The BindGrid sub is used to bind the event log entries with the data grid
        /// This could be done directly but we chose to use an intermediate data view
        /// filled with the event log entries. This allows us to filter on the source
        /// the entries we pass to the data view and ultimately to sort the dataview
        /// </summary>
        private void BindGrid()
        {
            Message.Text = string.Empty;
            try
            {
                DataTable myDataTable;
                DataRow   myDataRow;
                EventLog  myEventLog = new EventLog();
                string    myEventLogSource;
                myEventLog.MachineName = MachineName.Text;
                myEventLog.Log         = LogName.SelectedItem.Text;
                myEventLogSource       = LogSource.SelectedItem.Text;

                myDataTable = new DataTable();
                myDataTable.Columns.Add(new DataColumn("EntryType", typeof(EventLogEntryType)));
                myDataTable.Columns.Add(new DataColumn("TimeGenerated", typeof(DateTime)));
                myDataTable.Columns.Add(new DataColumn("Source", typeof(string)));
                myDataTable.Columns.Add(new DataColumn("EventID", typeof(int)));
                myDataTable.Columns.Add(new DataColumn("Message", typeof(string)));
                // Fill the data table with the event log entries
                foreach (EventLogEntry myEventLogEntry in myEventLog.Entries)
                {
                    if ((myEventLogSource == "(all)") || (myEventLogSource == myEventLogEntry.Source))
                    {
                        myDataRow    = myDataTable.NewRow();
                        myDataRow[0] = myEventLogEntry.EntryType;
                        myDataRow[1] = myEventLogEntry.TimeGenerated;
                        myDataRow[2] = myEventLogEntry.Source;
                        myDataRow[3] = myEventLogEntry.InstanceId;
                        myDataRow[4] = myEventLogEntry.Message;
                        myDataTable.Rows.Add(myDataRow);
                    }
                } //
                // return a data view of the data table
                DataView myDataView = new DataView(myDataTable);
                // Sort the data view on specified column
                myDataView.Sort = sortField + " " + sortDirection;
                // Bind the data view with the data grid
                LogGrid.DataSource = myDataView;
                LogGrid.DataBind();
            }
            catch
            {
                Message.Text = "Unknown error while binding event log entries to the data grid";
            }
        }
示例#8
0
        private void RefreshTeachersListThreadDoWork()
        {
            List <string>[] Lista = new List <string> [5];
            Lista = msql.SelectTeachersList();

            LogGrid.Invoke(new Action(delegate()
            {
                TeachersGrid.Rows.Clear();
                for (int i = 0; i < Lista[0].Count; i++)
                {
                    TeachersGrid.Rows.Add(Lista[0][i], Lista[1][i], Lista[2][i], Lista[3][i], Lista[4][i]);
                }
            }));

            RefreshSubjectsList.Invoke(new Action(delegate()
            {
                RefreshTeachers.Enabled = true;
            }));
        }
示例#9
0
        private void RefreshLogThreadDoWork()
        {
            List <string>[] Lista = new List <string> [6];
            Lista = msql.SelectLog(Convert.ToInt32(numericUpDown1.Value));

            LogGrid.Invoke(new Action(delegate()
            {
                LogGrid.Rows.Clear();
                for (int i = 0; i < Lista[0].Count; i++)
                {
                    LogGrid.Rows.Add(Lista[0][i], Lista[1][i], Lista[2][i], Lista[3][i], Lista[4][i], Lista[5][i]);
                }
            }));

            RefreshUsers.Invoke(new Action(delegate()
            {
                RefreshLog.Enabled = true;
            }));
        }
示例#10
0
 void ShowStep0Error(string Text)
 {
     if (LogGrid.InvokeRequired)
     {
         ShowStep0Error_d CALL_d = new ShowStep0Error_d(ShowStep0Error);
         LogGrid.Invoke(CALL_d, new object[] { Text });
     }
     else
     {
         this.Step0StatusTB.Text = Text;
         if (Text.Length == 0)
         {
             this.Step0StatusTB.Visible = false;
         }
         else
         {
             this.Step0StatusTB.ForeColor = Color.Red;
             this.Step0StatusTB.Visible   = true;
         }
     }
 }
示例#11
0
文件: FormLog.cs 项目: kayb1/dummy
        public FormLog()
        {
            InitializeComponent();

            // 로그 그리드 세팅
            LogGrid.SetGridDebug(GridLog);

            #region 폼 위치/사이즈 복원

            if (Properties.Settings.Default.FORM_LOG_LEFT >= 0)
            {
                this.Left = Properties.Settings.Default.FORM_LOG_LEFT;
            }
            else
            {
                this.Left = Screen.PrimaryScreen.Bounds.Width - this.Width;
            }

            if (Properties.Settings.Default.FORM_LOG_TOP >= 0)
            {
                this.Top = Properties.Settings.Default.FORM_LOG_TOP;
            }
            else
            {
                this.Top = Screen.PrimaryScreen.Bounds.Height - 300 - 29 - this.Height;
            }

            if (Properties.Settings.Default.FORM_LOG_WIDTH >= 0 && Properties.Settings.Default.FORM_LOG_HEIGHT >= 0)
            {
                this.Size = new System.Drawing.Size(
                    Properties.Settings.Default.FORM_LOG_WIDTH,
                    Properties.Settings.Default.FORM_LOG_HEIGHT
                    );
            }

            #endregion
        }
示例#12
0
        public LogView()
        {
            InitializeComponent();

            #region Log File események
            EventAggregator.Instance.Subscribe <LogFileAppEvent>(e =>
            {
                switch (e.ChangingType)
                {
                case FileChangingType.LoadComplete:
                    {
                        LogGrid.Source          = e.LogFile.Messages;
                        DescriptionView.Content = e.LogFile.Info.Description;
                        DescriptionView.LogName = e.LogFile.Name;
                        LogGrid.AllowClick      = true;
                        //LogGrid.TimestampFormat = "HH";
                        break;
                    }

                case FileChangingType.Loading:
                    {
                        LogGrid.AllowClick      = false;
                        LogGrid.Source          = null;
                        DescriptionView.Content = "";
                        DescriptionView.LogName = "*";
                        break;
                    }

                case FileChangingType.LoadCorrupted:
                    {
                        LogGrid.AllowClick      = true;
                        LogGrid.Source          = null;
                        DescriptionView.Content = "";
                        DescriptionView.LogName = "Loading Corrupted... Please try again.";
                        break;
                    }

                case FileChangingType.UnLoadComplete:
                    {
                        LogGrid.AllowClick      = true;
                        LogGrid.Source          = null;
                        DescriptionView.Content = "";
                        DescriptionView.LogName = "*";
                        break;
                    }

                default:
                    {
                        break;
                    }
                }
            });
            #endregion

            #region Project File események
            EventAggregator.Instance.Subscribe <StorageAppEvent>((e1) =>
            {
                switch (e1.ChangingType)
                {
                case FileChangingType.Loading:
                    {
                        LogGrid.GridLayout = null;
                        LogGrid.DefaultLayout();

                        break;
                    }

                case FileChangingType.LoadComplete:
                    {
                        LogGrid.CustomArbIdColumns = e1.Storage.CustomArbIdColumns;
                        LogGrid.GridLayout         = e1.Storage.LogGridLayout;
                        LogGrid.TimestampFormat    = e1.Storage.Parameters.TimestampFormat;

                        break;
                    }

                case FileChangingType.Saving:
                    {
                        LogGrid.GridLayout.CopyTo(e1.Storage.LogGridLayout);
                        break;
                    }

                case FileChangingType.ContentChanged:
                    {
                        if (e1.Details.DataObjects == DataObjects.ParameterProperty)
                        {
                            if (e1.Details.PropertyDescriptor.Name == PropertyPlus.GetPropertyName(() => e1.Storage.Parameters.ArbitrationIdFormat) ||
                                e1.Details.PropertyDescriptor.Name == PropertyPlus.GetPropertyName(() => e1.Storage.Parameters.DataFormat))
                            {
                                /*Converterek miatt újra kell rajzolni a Grid-et*/
                                /*Ez kritikus! ha egy sor törlésekor jön egy esemény ami frssíti a DGV-az DGV hibhoz vezet!*/
                                LogGrid.Refresh();
                            }

                            if (e1.Details.PropertyDescriptor.Name == PropertyPlus.GetPropertyName(() => e1.Storage.Parameters.TimestampFormat))
                            {
                                LogGrid.TimestampFormat = e1.Storage.Parameters.TimestampFormat;
                            }
                        }
                        break;
                    }
                }
            });
            #endregion
        }
示例#13
0
 private void buttonToolStripAutoColumnWidth_Click(object sender, EventArgs e)
 {
     LogGrid.ColumnsAutoSizeAll();
 }