【问题标题】:Control dependency tree logic - find circular dependencies控制依赖树逻辑 - 查找循环依赖
【发布时间】:2012-03-14 10:31:00
【问题描述】:

我创建了一个应用程序,用户可以在其中创建模型。该模型是带有一些公式的控件的集合。例如,

Control1 = 1 + 2
Control2 = {Control1} + 5
Control3 = {Control2} / {Control1}
Control4 = {Control2} * {Control1}
Control5 = 6 + 1
Control6 = {Control5} + {Control3}
Control7 = {Control6} + {Control8}
Control8 = {Control6} + {Control7}

等等……

如果您在上面的例子中看到,Control7 和 Control8 之间存在循环依赖关系。我需要在公式中构建这种依赖顺序的树。我使用正则表达式来识别公式中的控件名称。

谁能帮我在c#中找到这些循环依赖

【问题讨论】:

    标签: c# .net c#-4.0 c#-3.0 circular-dependency


    【解决方案1】:

    我建议您创建所有模型的图形表示。

    之后,您可以运行一些机器来检查评估顺序(这可能会有所帮助:http://en.wikipedia.org/wiki/Dependency_graph)。换句话说,通过基本应用图论,您可以找出依赖关系。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-09
      • 2013-12-10
      • 1970-01-01
      • 2010-09-12
      • 2021-10-02
      • 1970-01-01
      相关资源
      最近更新 更多