本文整理汇总了C#中System.Windows.Controls.Label.CheckAccess方法的典型用法代码示例。如果您正苦于以下问题:C# Label.CheckAccess方法的具体用法?C# Label.CheckAccess怎么用?C# Label.CheckAccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Label
的用法示例。
在下文中一共展示了Label.CheckAccess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: writeInfo
public void writeInfo(MainWindow con, Label tsslInfo, string text)
{
if (!tsslInfo.CheckAccess())
{
con.Dispatcher.Invoke(DispatcherPriority.Send,
(Action)delegate
{
tsslInfo.Content = text;
});
}
else
tsslInfo.Content = text;
}
示例2: start
public void start(string ip_adress, Action nasluch,
Label tsslInfo, Button btnLoguj)
{
if (!tsslInfo.CheckAccess() && !btnLoguj.CheckAccess())
{
con.Dispatcher.Invoke(DispatcherPriority.Send,
(Action)delegate
{
btnLoguj.IsDefault = true;
tsslInfo.Content = "Trwa łączenie.....";
try
{
tcpclnt = new TcpClient();
tcpclnt.Connect(IPAddress.Parse(ip_adress), 9999);
//tcpclnt.Connect("127.0.0.1", 9999);
thread = new Thread(new ThreadStart(nasluch)) { IsBackground = true };
thread.Start();
}
catch (Exception e)
{
tsslInfo.Content = "Error ";
log.nextLog();
log.write(e.ToString());
}
});
}
else
{
btnLoguj.IsDefault = true;
tsslInfo.Content = "Trwa łączenie.....";
try
{
tcpclnt = new TcpClient();
tcpclnt.Connect(IPAddress.Parse(ip_adress), 9999);
//tcpclnt.Connect("127.0.0.1", 9999);
thread = new Thread(new ThreadStart(nasluch)) { IsBackground = true };
thread.Start();
}
catch (Exception e)
{
tsslInfo.Content = "Error ";
log.nextLog();
log.write(e.ToString());
}
}
}
示例3: UpdateLabel
public static void UpdateLabel( Label label, string content )
{
if (label.CheckAccess()) myUpdateLabel( label, content );
else label.Dispatcher.BeginInvoke( new dUpdateLabel( myUpdateLabel ), new object[] { label, content } );
}