本文整理汇总了C#中Params.init方法的典型用法代码示例。如果您正苦于以下问题:C# Params.init方法的具体用法?C# Params.init怎么用?C# Params.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params.init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
private bool Init() {
this.Graph = this.Model as IGraph;
if (Graph == null)
throw new InconsistencyException("The model has not been set and the Graph property is hence 'null'");
m_depths = new float[10];
this.LayoutRoot = this.Controller.Model.LayoutRoot;//could be null if not set in the GUI
Graph.ClearSpanningTree();
Graph.MakeSpanningTree(LayoutRoot as INode);
//Trace.WriteLine((LayoutRoot as INode).ChildCount);
if (Graph.SpanningTree == null)
throw new InconsistencyException("The spanning tree is not set (se the root of the tree layout first)");
Pars = new Dictionary<string, Params>();
if (Graph.Nodes.Count == 0)
return false;
if (Graph.Edges.Count == 0) //this layout is base on embedded springs in the connections
return false;
Params par;
foreach (INode node in Graph.Nodes) {
par = new Params();
par.init(node);
Pars.Add(node.Uid.ToString(), par);
}
return true;
}