本文整理汇总了C#中System.Windows.Controls.DataGrid.GetCell方法的典型用法代码示例。如果您正苦于以下问题:C# DataGrid.GetCell方法的具体用法?C# DataGrid.GetCell怎么用?C# DataGrid.GetCell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.DataGrid
的用法示例。
在下文中一共展示了DataGrid.GetCell方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateProcessID
private void UpdateProcessID(DataGrid dgrid, Process process, int lcid, bool isDebugConsole, int selectedIndex)
{
if (dgrid.Dispatcher.CheckAccess())
{
int pid = process.Id;
TextBlock tb = new TextBlock();
tb.Text = pid.ToString();
dgrid.GetCell(selectedIndex, 4).Content = tb;
listLanguages.FirstOrDefault(lng => lng.UniversalID == lcid).PID = pid.ToString();
UpdateProcessInRegistry(process, lcid, isDebugConsole);
}
else
{
dgrid.Dispatcher.Invoke(
new Action<DataGrid, Process, int, bool, int>((c, p, l, i, d)
=> UpdateProcessID(dgrid, process, lcid, isDebugConsole, selectedIndex)),
new object[] { dgrid, process, lcid, isDebugConsole, selectedIndex });
}
}
示例2: ChangeLaunchButtonText
private void ChangeLaunchButtonText(DataGrid dgrid, string text, bool isEnable, int selectedIndex)
{
if (dgrid.Dispatcher.CheckAccess())
{
var cp = (ContentPresenter)dgrid.GetCell(selectedIndex, 5).Content;
TextBlock tbLaunchName = (TextBlock)cp.ContentTemplate.FindName("tbLaunchName", cp);
tbLaunchName.IsEnabled = isEnable;
tbLaunchName.Text = text;
}
else
{
dgrid.Dispatcher.Invoke(
new Action<DataGrid, string, bool, int>((c, s, i, d)
=> ChangeLaunchButtonText(dgrid, text, isEnable, selectedIndex)),
new object[] { dgrid, text, isEnable, selectedIndex });
}
}
示例3: ChangeRPLaunchButtonText
private void ChangeRPLaunchButtonText(DataGrid dgrid, string text, bool isEnable, int selectedIndex)
{
var cp = (ContentPresenter)dgrid.GetCell(selectedIndex, 3).Content;
TextBlock tbLaunchName = (TextBlock)cp.ContentTemplate.FindName("tbLaunchName", cp);
tbLaunchName.IsEnabled = isEnable;
tbLaunchName.Text = text;
}
示例4: UpdateRPProcessID
private void UpdateRPProcessID(DataGrid dgrid, Process process, int lcid, int selectedIndex)
{
int pid = process.Id;
var cp = (ContentPresenter)dgrid.GetCell(selectedIndex, 3).Content;
TextBlock tbLaunchName = (TextBlock)cp.ContentTemplate.FindName("tbLaunchName", cp);
tbLaunchName.Tag = pid;
listRPLanguages.FirstOrDefault(lng => lng.UniversalID == lcid).PID = pid.ToString();
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\Reporting\\" + pid.ToString(), "LCID", lcid, RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\Reporting\\" + pid.ToString(), "SessionID", process.SessionId.ToString(), RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\Reporting\\" + pid.ToString(), "UserName", WindowsIdentity.GetCurrent().Name, RegistryValueKind.String);
}
示例5: UpdateCPProcessID
private void UpdateCPProcessID(DataGrid dgrid, Process process, int lcid, int selectedIndex, string appletTitle)
{
int pid = process.Id;
var cp = (ContentPresenter)dgrid.GetCell(selectedIndex, 3).Content;
TextBlock tbLaunchName = (TextBlock)cp.ContentTemplate.FindName("tbLaunchName", cp);
tbLaunchName.Tag = pid;
listCPLanguages.FirstOrDefault(lng => lng.UniversalID == lcid).PID = pid.ToString();
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\ControlPanelApplet\\" + process.Id.ToString(), "AppletTitle", appletTitle, RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\ControlPanelApplet\\" + process.Id.ToString(), "LCID", lcid, RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\ControlPanelApplet\\" + process.Id.ToString(), "SessionID", process.SessionId.ToString(), RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\ControlPanelApplet\\" + process.Id.ToString(), "UserName", WindowsIdentity.GetCurrent().Name, RegistryValueKind.String);
if (!dictCurrentCPInfo.ContainsKey(pid))
{
CPAppletInfo info = new CPAppletInfo();
info.LCID = lcid;
info.ProcessID = pid;
info.SessionID = process.SessionId;
info.UserName = WindowsIdentity.GetCurrent().Name;
info.AppletTitle = appletTitle;
dictCurrentCPInfo.Add(pid, info);
}
}
示例6: ChangeSCLaunchButtonText
private void ChangeSCLaunchButtonText(DataGrid dgrid, string text, bool isEnable, int selectedIndex, bool isNewVersion)
{
int columnIndex = isNewVersion ? 3 : 4;
string tbLaunchNameStr = isNewVersion ? "tbLaunchNewVersionName" : "tbLaunchOldVersionName";
var cp = (ContentPresenter)dgrid.GetCell(selectedIndex, columnIndex).Content;
TextBlock tbLaunchName = (TextBlock)cp.ContentTemplate.FindName(tbLaunchNameStr, cp);
tbLaunchName.IsEnabled = isEnable;
tbLaunchName.Text = text;
}
示例7: UpdateSCProcessID
private void UpdateSCProcessID(DataGrid dgrid, Process process, int lcid, bool isDebugConsole, int selectedIndex, bool isNewVersion)
{
int pid = process.Id;
int columnIndex = isNewVersion ? 3 : 4;
string tbLaunchNameStr = isNewVersion ? "tbLaunchNewVersionName" : "tbLaunchOldVersionName";
var cp = (ContentPresenter)dgrid.GetCell(selectedIndex, columnIndex).Content;
TextBlock tbLaunchName = (TextBlock)cp.ContentTemplate.FindName(tbLaunchNameStr, cp);
tbLaunchName.Tag = pid;
if (isNewVersion)
{
listClientLanguages.FirstOrDefault(lng => lng.UniversalID == lcid).PIDNewVersion = pid.ToString();
}
else
{
listClientLanguages.FirstOrDefault(lng => lng.UniversalID == lcid).PIDOldVersion = pid.ToString();
}
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\SoftwareCenter\\" + process.Id.ToString(), "LCID", lcid, RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\SoftwareCenter\\" + process.Id.ToString(), "IsDebugConsole", isDebugConsole, RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\SoftwareCenter\\" + process.Id.ToString(), "SessionID", process.SessionId.ToString(), RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\SoftwareCenter\\" + process.Id.ToString(), "UserName", WindowsIdentity.GetCurrent().Name, RegistryValueKind.String);
Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" + Settings.RegistrySettingName + "\\SoftwareCenter\\" + process.Id.ToString(), "IsNewVersion", isNewVersion, RegistryValueKind.String);
if (!dictCurrentSCInfo.ContainsKey(pid))
{
SoftwareCenterInfo info = new SoftwareCenterInfo();
info.IsDebugConsole = isDebugConsole;
info.IsNewVersion = isNewVersion;
info.LCID = lcid;
info.ProcessID = pid;
info.SessionID = process.SessionId;
info.UserName = WindowsIdentity.GetCurrent().Name;
dictCurrentSCInfo.Add(pid, info);
}
}