diff --git a/RepositoryPattern/frmMyStocks.Designer.cs b/RepositoryPattern/frmMyStocks.Designer.cs index 1028e00..e049892 100644 --- a/RepositoryPattern/frmMyStocks.Designer.cs +++ b/RepositoryPattern/frmMyStocks.Designer.cs @@ -34,6 +34,7 @@ namespace RepositoryPattern this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); this.columnHeader7 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader11 = new System.Windows.Forms.ColumnHeader(); this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); this.columnHeader4 = new System.Windows.Forms.ColumnHeader(); this.columnHeader5 = new System.Windows.Forms.ColumnHeader(); @@ -51,12 +52,15 @@ namespace RepositoryPattern this.chkAutoReload = new System.Windows.Forms.CheckBox(); this.lbUpdateTimes = new System.Windows.Forms.ListBox(); this.label4 = new System.Windows.Forms.Label(); - this.columnHeader11 = new System.Windows.Forms.ColumnHeader(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.label5 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.SuspendLayout(); // // lvMyStocks // - this.lvMyStocks.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.lvMyStocks.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lvMyStocks.BackColor = System.Drawing.SystemColors.InactiveCaption; this.lvMyStocks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { @@ -73,9 +77,10 @@ namespace RepositoryPattern this.columnHeader10}); this.lvMyStocks.GridLines = true; this.lvMyStocks.HideSelection = false; - this.lvMyStocks.Location = new System.Drawing.Point(12, 32); + this.lvMyStocks.Location = new System.Drawing.Point(14, 43); + this.lvMyStocks.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lvMyStocks.Name = "lvMyStocks"; - this.lvMyStocks.Size = new System.Drawing.Size(911, 278); + this.lvMyStocks.Size = new System.Drawing.Size(1191, 369); this.lvMyStocks.TabIndex = 0; this.lvMyStocks.UseCompatibleStateImageBehavior = false; this.lvMyStocks.View = System.Windows.Forms.View.Details; @@ -85,7 +90,7 @@ namespace RepositoryPattern // this.columnHeader1.Name = "columnHeader1"; this.columnHeader1.Text = "Stock Name"; - this.columnHeader1.Width = 80; + this.columnHeader1.Width = 120; // // columnHeader2 // @@ -97,24 +102,31 @@ namespace RepositoryPattern // this.columnHeader7.Name = "columnHeader7"; this.columnHeader7.Text = "Market price"; - this.columnHeader7.Width = 80; + this.columnHeader7.Width = 100; + // + // columnHeader11 + // + this.columnHeader11.Name = "columnHeader11"; + this.columnHeader11.Text = "Price Diff"; + this.columnHeader11.Width = 100; // // columnHeader3 // this.columnHeader3.Name = "columnHeader3"; this.columnHeader3.Text = "Amount Stk"; - this.columnHeader3.Width = 80; + this.columnHeader3.Width = 100; // // columnHeader4 // this.columnHeader4.Name = "columnHeader4"; this.columnHeader4.Text = "Buy Date"; - this.columnHeader4.Width = 80; + this.columnHeader4.Width = 100; // // columnHeader5 // this.columnHeader5.Name = "columnHeader5"; this.columnHeader5.Text = "Value diff"; + this.columnHeader5.Width = 100; // // columnHeader6 // @@ -126,7 +138,7 @@ namespace RepositoryPattern // this.columnHeader8.Name = "columnHeader8"; this.columnHeader8.Text = "Market Date"; - this.columnHeader8.Width = 80; + this.columnHeader8.Width = 100; // // columnHeader9 // @@ -141,17 +153,20 @@ namespace RepositoryPattern // // txtBuyTotal // - this.txtBuyTotal.Location = new System.Drawing.Point(163, 321); + this.txtBuyTotal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.txtBuyTotal.Location = new System.Drawing.Point(186, 428); + this.txtBuyTotal.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtBuyTotal.Name = "txtBuyTotal"; this.txtBuyTotal.ReadOnly = true; - this.txtBuyTotal.Size = new System.Drawing.Size(100, 23); + this.txtBuyTotal.Size = new System.Drawing.Size(114, 27); this.txtBuyTotal.TabIndex = 1; // // label1 // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label1.Location = new System.Drawing.Point(56, 319); + this.label1.Location = new System.Drawing.Point(64, 425); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(101, 21); this.label1.TabIndex = 2; @@ -159,9 +174,10 @@ namespace RepositoryPattern // // label2 // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label2.Location = new System.Drawing.Point(269, 319); + this.label2.Location = new System.Drawing.Point(307, 425); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(55, 21); this.label2.TabIndex = 4; @@ -169,17 +185,20 @@ namespace RepositoryPattern // // txtTotDiff // - this.txtTotDiff.Location = new System.Drawing.Point(330, 321); + this.txtTotDiff.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.txtTotDiff.Location = new System.Drawing.Point(377, 428); + this.txtTotDiff.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtTotDiff.Name = "txtTotDiff"; this.txtTotDiff.ReadOnly = true; - this.txtTotDiff.Size = new System.Drawing.Size(100, 23); + this.txtTotDiff.Size = new System.Drawing.Size(114, 27); this.txtTotDiff.TabIndex = 3; // // label3 // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); - this.label3.Location = new System.Drawing.Point(509, 319); + this.label3.Location = new System.Drawing.Point(582, 425); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(105, 21); this.label3.TabIndex = 6; @@ -187,10 +206,12 @@ namespace RepositoryPattern // // txtCurrValue // - this.txtCurrValue.Location = new System.Drawing.Point(620, 321); + this.txtCurrValue.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.txtCurrValue.Location = new System.Drawing.Point(709, 428); + this.txtCurrValue.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.txtCurrValue.Name = "txtCurrValue"; this.txtCurrValue.ReadOnly = true; - this.txtCurrValue.Size = new System.Drawing.Size(100, 23); + this.txtCurrValue.Size = new System.Drawing.Size(114, 27); this.txtCurrValue.TabIndex = 5; // // timer1 @@ -201,9 +222,10 @@ namespace RepositoryPattern // chkAutoReload // this.chkAutoReload.AutoSize = true; - this.chkAutoReload.Location = new System.Drawing.Point(13, 7); + this.chkAutoReload.Location = new System.Drawing.Point(15, 9); + this.chkAutoReload.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.chkAutoReload.Name = "chkAutoReload"; - this.chkAutoReload.Size = new System.Drawing.Size(121, 19); + this.chkAutoReload.Size = new System.Drawing.Size(148, 24); this.chkAutoReload.TabIndex = 7; this.chkAutoReload.Text = "Automatic Reload"; this.chkAutoReload.UseVisualStyleBackColor = true; @@ -211,32 +233,52 @@ namespace RepositoryPattern // // lbUpdateTimes // + this.lbUpdateTimes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.lbUpdateTimes.FormattingEnabled = true; - this.lbUpdateTimes.ItemHeight = 15; - this.lbUpdateTimes.Location = new System.Drawing.Point(14, 375); + this.lbUpdateTimes.ItemHeight = 20; + this.lbUpdateTimes.Location = new System.Drawing.Point(16, 500); + this.lbUpdateTimes.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.lbUpdateTimes.Name = "lbUpdateTimes"; - this.lbUpdateTimes.Size = new System.Drawing.Size(120, 94); + this.lbUpdateTimes.Size = new System.Drawing.Size(137, 124); this.lbUpdateTimes.TabIndex = 8; // // label4 // + this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(12, 354); + this.label4.Location = new System.Drawing.Point(14, 472); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(76, 15); + this.label4.Size = new System.Drawing.Size(97, 20); this.label4.TabIndex = 9; this.label4.Text = "LatestUpdate"; // - // columnHeader11 + // numericUpDown1 // - this.columnHeader11.Name = "columnHeader11"; - this.columnHeader11.Text = "Price Diff"; + this.numericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.numericUpDown1.Location = new System.Drawing.Point(161, 593); + this.numericUpDown1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(119, 27); + this.numericUpDown1.TabIndex = 10; + this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged); + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(160, 569); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(132, 20); + this.label5.TabIndex = 11; + this.label5.Text = "Uppdatering (min)"; // // frmMyStocks // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(935, 481); + this.ClientSize = new System.Drawing.Size(1217, 651); + this.Controls.Add(this.label5); + this.Controls.Add(this.numericUpDown1); this.Controls.Add(this.label4); this.Controls.Add(this.lbUpdateTimes); this.Controls.Add(this.chkAutoReload); @@ -247,10 +289,12 @@ namespace RepositoryPattern this.Controls.Add(this.label1); this.Controls.Add(this.txtBuyTotal); this.Controls.Add(this.lvMyStocks); + this.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point); this.Name = "frmMyStocks"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "frmMyStocks"; this.Shown += new System.EventHandler(this.frmMyStocks_Shown); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -280,5 +324,7 @@ namespace RepositoryPattern private System.Windows.Forms.ListBox lbUpdateTimes; private System.Windows.Forms.Label label4; private System.Windows.Forms.ColumnHeader columnHeader11; + private System.Windows.Forms.NumericUpDown numericUpDown1; + private System.Windows.Forms.Label label5; } } \ No newline at end of file diff --git a/RepositoryPattern/frmMyStocks.cs b/RepositoryPattern/frmMyStocks.cs index c1c5ed1..d910943 100644 --- a/RepositoryPattern/frmMyStocks.cs +++ b/RepositoryPattern/frmMyStocks.cs @@ -32,6 +32,8 @@ namespace RepositoryPattern _productRepository = productRepository; _stockMemberRepository = stockMemberRepository; _stockMarketRepository = stockMarketRepository; + numericUpDown1.Value = timer1.Interval / 60000; + numericUpDown1.Enabled = false; } @@ -120,6 +122,12 @@ namespace RepositoryPattern private void chkAutoReload_CheckedChanged(object sender, EventArgs e) { timer1.Enabled = chkAutoReload.Checked; + numericUpDown1.Enabled = chkAutoReload.Checked; + } + + private void numericUpDown1_ValueChanged(object sender, EventArgs e) + { + timer1.Interval = Convert.ToInt32(numericUpDown1.Value * 60000); } } } diff --git a/StockDal/StockMarketRepository.cs b/StockDal/StockMarketRepository.cs index d260625..693759d 100644 --- a/StockDal/StockMarketRepository.cs +++ b/StockDal/StockMarketRepository.cs @@ -59,7 +59,9 @@ namespace StockDal { TextResults.Append(appendText + "\r\n"); } + htmlDocument1 = null; } + htmlDocument = null; TextResults.Append("\r\n"); }