2016-01-21 73 views

回答

0

我不认为有这个选项可以设置,但你可以尝试模板包。

此特殊包用作所有新元素的模板,因此它也可以设置isQuery属性。

如果这不起作用,您可以制作一个小脚本作为解决方法为每个吸气剂设置它。

财产EA.Method.IsQuery在API中可用。 因此,一个VBScript脚本来更新这可能是类似于

option explicit 

!INC Local Scripts.EAConstants-VBScript 

' 
' Script Name: Set IsQuery Getter 
' Author: Geert Bellekens 
' Purpose: sets the IsQuery property to true for all operations in the selected package with stereotype "property get" 
' Date: 2016-01-22 
' 
sub main 
    dim selectedPackage as EA.Package 
    set selectedPackage = Repository.GetTreeSelectedPackage() 
    dim element as EA.Element 
    dim operation as EA.Method 
    for each element in selectedPackage.Elements 
     for each operation in element.Methods 
      if operation.Stereotype = "property get" then 
       operation.IsQuery = true 
       operation.Update 
      end if 
     next 
    next 
end sub 

main 
+0

谢谢,我会看看它。 – NapOli1084

+0

模板包似乎不起作用,即使您从拥有该属性的属性中复制属性,您创建的任何新属性都具有不带IsQuery标记的getter。我将不得不看脚本,但由于我还没有做任何可能需要一些时间。 – NapOli1084

+0

我在我的答案中增加了一个小例子脚本。我只是不确定关于“吸气”操作的刻板印象。 –