确定 MS Project 任务沿袭

发布于 2024-07-13 04:12:09 字数 359 浏览 10 评论 0原文

我有一个 MS 项目文件,我正在使用主互操作程序集来解析该文件。 如何确定任务的沿袭? 我依赖于 WBS 代码,但是客户端已经开始摆弄这个字段,它不再代表数据的层次结构。

编辑:我所说的沿袭是指一种识别任务在层次结构中存在位置的方法。 默认情况下,WBS 代码完美地模仿了这一点。

我需要此信息来确定任务的父级是什么。

示例

  • A
  • B
    • B1
    • B2
    • B3
  • C

B3 的 Lineage 为 2.3(如果我们按 1 计算,如项目)

I have a MS Project file which I am using the Primary Interop Assemblies to parse. How can I determine the lineage of a task? I was relying on the WBS code, however the client has started to fiddle with this field and it no longer represents the hierarchy of the data.

Edit: By lineage I mean a way to identify where in the hierarchy the task exists. By default the WBS code mimics this perfectly.

I need this information to determine what is the parent for a task.

Example

  • A
  • B
    • B1
    • B2
    • B3
  • C

The Lineage for B3 would be 2.3 (If we counted by 1, like project)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小情绪 2024-07-20 04:12:09

尝试 Task 对象的 OutlineNumber 属性和 PredecessorTasks 集合。

HTM

科尔比非洲

Try the Task object's OutlineNumber property and the PredecessorTasks collection.

HTM

Colby Africa

卷耳 2024-07-20 04:12:09

使用“OutlineChildren”属性:

// from caller:
ListTasks(prj.OutlineChildren, "");

void ListTasks(Tasks lst, string indent)
{
    foreach (Microsoft.Office.Interop.MSProject.Task t in lst) {
        Log(indent + t.Start + " - " + t.Name);
        ListTasks(t.OutlineChildren, indent + "    ");
    }
}

它创建缩进的任务树。

Use 'OutlineChildren' property:

// from caller:
ListTasks(prj.OutlineChildren, "");

void ListTasks(Tasks lst, string indent)
{
    foreach (Microsoft.Office.Interop.MSProject.Task t in lst) {
        Log(indent + t.Start + " - " + t.Name);
        ListTasks(t.OutlineChildren, indent + "    ");
    }
}

It creates indented tree of tasks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文