Created
July 12, 2012 08:46
-
-
Save Stasonix/3096771 to your computer and use it in GitHub Desktop.
global arrays C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Globalization; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
using Microsoft.Practices.ServiceLocation; | |
namespace WindowsFormsApplication1 | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
ServiceLocator.Current.GetInstance<IArray>(); | |
textBox1.Text = "массив создан"; | |
} | |
private void button2_Click(object sender, EventArgs e) | |
{ | |
textBox1.Text = null; | |
var arr = ServiceLocator.Current.GetInstance<IArray>().GetArray(); | |
for (int i = 0; i < 10; i++) | |
{ | |
for (int j = 0; j < 10; j++) | |
{ | |
textBox1.Text += arr[i, j].ToString(); | |
textBox1.Text += "-"; | |
} | |
textBox1.Text += Environment.NewLine; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment