How can I update the Name of a Petrel Window?

后端 未结 1 991
忘掉有多难
忘掉有多难 2021-01-26 07:34

I am trying to update the Name/Display Name of a Petrel Window after the Save event.

I implemented my own NameInfo class that inherits from the NameInfo abstract class.<

1条回答
  •  悲&欢浪女
    2021-01-26 08:07

    How do you create your NameInfo in your custom window? You need to pass the custom window object to MyNameInfo such that you can call OnNameChanged(window) on the custom window object. Here's an example:

    private MyNameInfo nameInfo = null;
    public NameInfo NameInfo
    {
      get
      {
        if (null == nameInfo)
        {
          nameInfo = new MyNameInfo(this);
        }
        return nameInfo;
      }
    }
    

    And then in your setter of the Name property of MyNameInfo,

    set
    {
       name = value;
       displayName = value;
       typeName = value;
       OnNameChanged(this.window);
    }
    

    0 讨论(0)
提交回复
热议问题