Skip to content

Instantly share code, notes, and snippets.

@Stasonix
Created July 12, 2012 08:46
Show Gist options
  • Save Stasonix/3096771 to your computer and use it in GitHub Desktop.
Save Stasonix/3096771 to your computer and use it in GitHub Desktop.
global arrays C#
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