|
增加元件属性,用 "ComApi.InwGUIPropertyNode.SetUserDefined(0, "UserDefine", "UserPropn", Pvec);"已经可以实现,但怎么修改已有的属性,有大神知道吗?望给段代码参考下。
就像下面的代码:
public void Modify_Propertys(ModelItem oEF,ComApi.InwOaPropertyVec Pvec)
{
try
{
ComApi.InwOpState9 oState = ComApiBridge.State;
ComApi.InwOaPath oPath = ComApiBridge.ToInwOaPath(oEF);
ComApi.InwGUIPropertyNode2 propn =(ComApi.InwGUIPropertyNode2)oState.GetGUIPropertyNode(oPath, true);
ComApi.InwGUIAttributesColl A =propn.GUIAttributes();
ComApi.InwOaProperty C = (ComApi.InwOaProperty)oState.ObjectFactory(ComApi.nwEObjectType.eObjectType_nwOaProperty, null, null);
C.name = "1";
C.UserName = "2";
C.value = "3";
foreach (ComApi.InwGUIAttribute B in A)
{
B.Properties().Replace(1,C);
}
编译通过,执行返回"no implemoned",
最后一句代码改为 "B.Properties().Add(C)",可以执行,但特性表中没看到变化。 |
|