本文整理汇总了C#中System.Windows.Forms.TreeView.invokeOnThread方法的典型用法代码示例。如果您正苦于以下问题:C# TreeView.invokeOnThread方法的具体用法?C# TreeView.invokeOnThread怎么用?C# TreeView.invokeOnThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TreeView
的用法示例。
在下文中一共展示了TreeView.invokeOnThread方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addExtraFileReferencesToSelectedNode
public static void addExtraFileReferencesToSelectedNode(TreeView treeView, string file)
{
if (treeView != null)
treeView.invokeOnThread(
() =>
{
addExtraFileReferencesToTreeNode(treeView.SelectedNode, file);
});
}
示例2: addErrorsListToTreeView
public static void addErrorsListToTreeView(TreeView tvCompilationErrors, StringBuilder sbErrorMessage)
{
tvCompilationErrors.invokeOnThread(
() =>
{
if (sbErrorMessage == null)
return;
tvCompilationErrors.Nodes.Clear();
addErrorsListToTreeView(sbErrorMessage.ToString(), tvCompilationErrors);
});
}
示例3: addAssembliesWithUnitTestsToTreeView
public static void addAssembliesWithUnitTestsToTreeView(List<string> assembliesWithUnitTests, TreeView treeView, bool clearLoadedList)
{
treeView.invokeOnThread(
() =>
{
if (clearLoadedList)
treeView.Nodes.Clear();
treeView.Tag = assembliesWithUnitTests;
foreach (var assembly in assembliesWithUnitTests)
treeView.Nodes.Add(assembly);
});
}
示例4: onSpringMvcMappingsTreeSelect
private void onSpringMvcMappingsTreeSelect(TreeView treeView)
{
treeView.invokeOnThread(
() =>
{
if (treeView.SelectedNode != null && treeView.SelectedNode.Tag != null)
{
if (treeView.SelectedNode.Tag is SpringMvcController)
showDetailsForSpringMvcController((SpringMvcController)treeView.SelectedNode.Tag);
}
});
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:12,代码来源:ascx_JoinControllersWithFindings.Controllers.cs
示例5: onSpringMvcMappingsTreeViewSelect
public void onSpringMvcMappingsTreeViewSelect(TreeView treeView, bool openPageWhenControllerIsSelected)
{
treeView.invokeOnThread(
() =>
{
if (treeView.SelectedNode != null && treeView.SelectedNode.Tag != null)
{
if (treeView.SelectedNode.Tag is SpringMvcController)
showDetailsForSpringMvcController((SpringMvcController)treeView.SelectedNode.Tag, openPageWhenControllerIsSelected);
}
});
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:12,代码来源:ascx_ExploitSpringMvc.Controllers.cs
示例6: getAssembliesToLoad
private static List<Assembly> getAssembliesToLoad(TreeView tvTreeView)
{
return (List<Assembly>)tvTreeView.invokeOnThread(
() =>
{
if (tvTreeView.Nodes.Count ==0)
return getDefaultLoadedAssemblies();
var assembliesToLoad = new List<Assembly>();
foreach(TreeNode treeNode in tvTreeView.Nodes)
if (treeNode.Checked && treeNode.Tag !=null && treeNode.Tag is Assembly)
assembliesToLoad.Add((Assembly)treeNode.Tag);
return assembliesToLoad;
});
}
示例7: populateTreeNodeCollectionWithVariables
public static void populateTreeNodeCollectionWithVariables(TreeView targetTreeView, TreeNodeCollection nodes, List<O2MDbgVariable> o2MDbgvariables)
{
targetTreeView.invokeOnThread(
() =>
{
nodes.Clear();
foreach (var o2MDbgvariable in o2MDbgvariables)
{
// var nameLvSubItem = new ListViewItem.ListViewSubItem()
var nodeText =
string.Format("{0} = {1} : {2}", o2MDbgvariable.name, o2MDbgvariable.value,
o2MDbgvariable.type);
var newTreeNode = O2Forms.newTreeNode(nodes, nodeText, 0, o2MDbgvariable);
if (o2MDbgvariable.complexType)
newTreeNode.Nodes.Add("DymmyNode");
}
});
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:19,代码来源:ascx_Variables.Controllers.cs
示例8: setToolTipText
public static void setToolTipText(TreeView treeView, TreeNode treeNode, string toolTipText)
{
treeView.invokeOnThread(
() => treeNode.ToolTipText = toolTipText);
}
示例9: expandNodes
public static void expandNodes(TreeView targetTreeView)
{
if (targetTreeView != null)
targetTreeView.invokeOnThread(
()=>
{
foreach(TreeNode node in targetTreeView.Nodes)
node.Expand();
});
}
示例10: loadAssesmblyDataIntoTreeView
public Thread loadAssesmblyDataIntoTreeView(Assembly aAssemblyToLoad, TreeView tvTargetTreeView,
Label lbLastMethodExecuted, bool bOnlyShowStaticMethods)
{
tvTargetTreeView.Visible = false;
tvTargetTreeView.Nodes.Clear();
tvTargetTreeView.Sorted = true;
int iTypesAdded = 0;
return O2Thread.mtaThread(() =>
{
try
{
var treeNodesToAdd = new List<TreeNode>();
foreach (Type tType in aAssemblyToLoad.GetTypes())
{
if ((iTypesAdded++) % 500 == 0)
PublicDI.log.info("{0} types processed", iTypesAdded);
//vars.set_(tType.Name, tType); // set global variable of compiled code
//Callbacks.raiseEvent_ScriptCompiledSuccessfully(tType.Name);
TreeNode tnType = O2Forms.newTreeNode(tType.Name, tType.Name, 1, tType);
foreach (
MethodInfo mMethod in
tType.GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly |
((bOnlyShowStaticMethods) ? BindingFlags.Static : BindingFlags.Static | BindingFlags.Instance)))
{
if (mMethod.Name == lbLastMethodExecuted.Text)
lbLastMethodExecuted.Tag = mMethod;
//TreeNode tnMethod = O2Forms.newTreeNode(mMethod.Name, mMethod.Name, 2, mMethod);
TreeNode tnMethod =
O2Forms.newTreeNode(
new FilteredSignature(mMethod).getReflectorView(),
mMethod.Name, 2, mMethod);
tnType.Nodes.Add(tnMethod);
}
if (tnType.Nodes.Count > 0)
treeNodesToAdd.Add(tnType);
//O2Forms.addNodeToTreeNodeCollection(tvTargetTreeView, tvTargetTreeView.Nodes, tnType); // thread safe way to add nodes
}
PublicDI.log.info("{0} types processed , now loading them into treeView", iTypesAdded);
tvTargetTreeView.invokeOnThread(() =>
{
foreach (var treeNode in treeNodesToAdd)
tvTargetTreeView.Nodes.Add(treeNode);
PublicDI.log.info("All nodes loaded");
if (tvTargetTreeView.Nodes.Count > 0)
tvTargetTreeView.Nodes[0].Expand();
tvTargetTreeView.Visible = true;
});
}
catch (Exception ex)
{
PublicDI.log.ex(ex, "in loadAssesmblyDataIntoTreeView");
}
});
//if (tvTargetTreeView.GetNodeCount(true) < 20)
// tvTargetTreeView.ExpandAll();
//tvTargetTreeView.Visible = true;
}
示例11: addXLoadedRulesToTreeView
public static void addXLoadedRulesToTreeView(IEnumerable<ILoadedXRule> xLoadedRules, TreeView treeView, bool clearLoadedList)
{
treeView.invokeOnThread(
() =>
{
if (clearLoadedList)
treeView.Nodes.Clear();
treeView.Tag = xLoadedRules;
if (xLoadedRules != null)
foreach (var xLoadedRule in xLoadedRules)
{
var newTreeNode = O2Forms.newTreeNode(treeView.Nodes, xLoadedRule.ToString(), 0,
xLoadedRule);
foreach (var method in xLoadedRule.methods)
// only add methods that have no parameters
if (DI.reflection.getParametersType(method.Value).Count == 0)
O2Forms.newTreeNode(newTreeNode.Nodes, method.Key.Name, 0, method.Value);
}
});
}
示例12: mapAssembliesIntoXRules
public static void mapAssembliesIntoXRules(TreeView tvSource_Assemblies, TreeView tvTarget_XLoadedRules)
{
tvSource_Assemblies.invokeOnThread(
() =>
{
if (tvSource_Assemblies.Tag != null &&
tvSource_Assemblies.Tag is List<string>)
{
var xLoadedRules = mapUnitTestToXRules((List<string>)tvSource_Assemblies.Tag);
addXLoadedRulesToTreeView(xLoadedRules, tvTarget_XLoadedRules, true);
}
});
}
示例13: getTreeNodeAtDroppedOverPoint
public static TreeNode getTreeNodeAtDroppedOverPoint(TreeView tvTreeView, int iDroppedX, int iDroppedY)
{
return tvTreeView.invokeOnThread(
() =>{
Point pPointToString = tvTreeView.PointToScreen(tvTreeView.Location);
int iAdjustedX = tvTreeView.Left + iDroppedX - pPointToString.X;
int iAdjustedY = tvTreeView.Top + iDroppedY - pPointToString.Y;
//PublicDI.log.info("x:{0} y:{1} - {2}, {3}", x, y, tvCurrentFilters.Left, tvCurrentFilters.Top);
return tvTreeView.GetNodeAt(iAdjustedX, iAdjustedY);
});
}
示例14: loadInThread
public static void loadInThread(List<TreeNode> rootNodes,TreeView tvSearchResults)
{
tvSearchResults.invokeOnThread(
() =>
{
tvSearchResults.Visible = false;
tvSearchResults.Nodes.Clear();
tvSearchResults.Nodes.AddRange(rootNodes.ToArray());
tvSearchResults.Visible = true;
});
}
示例15: selectTreeNodeAtDroppedOverPoint
public static TreeView selectTreeNodeAtDroppedOverPoint(TreeView tvTreeView, int iDroppedX, int iDroppedY)
{
return tvTreeView.invokeOnThread(
() =>{
TreeNode tnDraggedTarget = getTreeNodeAtDroppedOverPoint(tvTreeView, iDroppedX, iDroppedY);
if (tnDraggedTarget != null)
tvTreeView.SelectedNode = tnDraggedTarget;
return tvTreeView;
});
}