private void AddTag(bool onstart)
{
if (tagList.InvokeRequired)
tagList.Invoke(new Action(() => BlockUI(onstart)));
else
BlockUI(onstart);
}
private void button1_Click(object sender, System.EventArgs e)
{
var t = new Thread(new ThreadStart(() =>
{
if (button3.InvokeRequired)
{
button3.Invoke(new Action(() =>
{
button1.Text = "new button1 name";
button2.Text = "new button2 name";
button3.Text = "new button3 name";
}));
}
else
{
button1.Text = "new button1 name";
button2.Text = "new button2 name";
button3.Text = "new button3 name";
}
}));
t.Start();
}
private void button1_Click(object sender, System.EventArgs e)
{
var t = new Thread(new ThreadStart(() =>
{
if (InvokeRequired)
{
Invoke(new Action(() =>
{
button1.Text = "new button1 name";
button2.Text = "new button2 name";
button3.Text = "new button3 name";
}));
}
else
{
button1.Text = "new button1 name";
button2.Text = "new button2 name";
button3.Text = "new button3 name";
}
}));
t.Start();
}
dynamic myDinamic = GetDynamic();
myDynamic.SomeMethod();
for (int i = 0; i < RowCount - 1; i++)
{
SortRows(i);
for (int j = i + 1; j < RowCount; j++)
{
if (Matrix[i][i] != 0) //если главный элемент не 0, то производим вычисления
{
double MultElement = Matrix[j][i] / Matrix[i][i];
for (int k = i; k < ColumCount; k++)
Matrix[j][k] -= Matrix[i][k] * MultElement;
RightPart[j] -= RightPart[i] * MultElement;
}
//для нулевого главного элемента просто пропускаем данный шаг
}
}
Parallel.For(0, (int)RowCount, i =>
{
SortRows(i);
for (int j = i + 1; j < RowCount; j++)
{
if (Matrix[i][i] != 0) //если главный элемент не 0, то производим вычисления
{
double MultElement = Matrix[j][i] / Matrix[i][i];
for (int k = i; k < ColumCount; k++)
Matrix[j][k] -= Matrix[i][k] * MultElement;
RightPart[j] -= RightPart[i] * MultElement;
}
//для нулевого главного элемента просто пропускаем данный шаг
}
});
var client = new POPClient();
client.Connect("pop.gmail.com", 995, true);
client.Authenticate("admin@bendytree.com", "YourPasswordHere");
var count = client.GetMessageCount();
Message message = client.GetMessage(count);
Console.WriteLine(message.Headers.Subject);
using System;
using System.Linq;
using System.Xml.Linq;
namespace ConsoleApplication11
{
internal class Program
{
private static void Main(string[] args)
{
var xml = XDocument.Load("XMLFile1.xml");
Console.WriteLine(GetErrorText(706, xml));
Console.ReadLine();
}
private static string GetErrorText(int name, XDocument xDoc)
{
return xDoc.Root.Elements().First(el => int.Parse(el.Attribute("name").Value) == name).Value;
}
}
}
[DllImport("user32.dll", SetLastError = true)]
public static extern UInt32 SendInput(UInt32 numberOfInputs, INPUT[] inputs, Int32 sizeOfInputStructure);
public class MyScrollableControl : ScrollableControl
{
protected override void OnMouseClick(MouseEventArgs e)
{
var local = new Point(e.X - AutoScrollPosition.X,
e.Y - AutoScrollPosition.Y);
base.OnMouseClick(e);
}
}