문제

WSDL Importer Wizard가 인터페이스를 생성 할 때 모든 속성에는 인덱스 옵션이 있지만 코드와 invokeregistry 장치를 읽으면 실제로 필요한 것이 무엇인지 알 수 없습니까?

이와 같이

  Login = class(TRemotable)
  private
    [...] 
  published
    property User: string Index (IS_OPTN) read GetUser write SetUser stored User_Specified;
    [...]
  end;

MVP 프레임 워크와 통합하기 위해이 장치를 변경 하고이 클래스에 몇 가지 인터페이스를 추가하고 싶기 때문에 요청합니다.

도움이 되었습니까?

해결책 2

이 질문에 대한 자세한 설명을 찾았습니다.인덱스를 사용하면 여러 속성이 동일한 액세스 방법을 공유 할 수 있습니다.

좋은 예, Delphi 2009 도움말 :

type 
   TRectangle = class 
     private 
       FCoordinates: array[0..3] of Longint; 
       function GetCoordinate(Index: Integer): Longint; 
       procedure SetCoordinate(Index: Integer; Value: Longint); 
     public 
       property Left: Longint index 0 read GetCoordinate write SetCoordinate; 
       property Top: Longint index 1 read GetCoordinate write SetCoordinate; 
       property Right: Longint index 2 read GetCoordinate write SetCoordinate; 
       property Bottom: Longint index 3 read GetCoordinate write SetCoordinate; 
       property Coordinates[Index: Integer]: Longint read GetCoordinate write SetCoordinate; 
       ... 
   end;

모든 속성은 동일한 메소드 액세스를 공유합니다.

다른 팁

IS_OPTN은 사용자 속성에 액세스 할 때 '인덱스'매개 변수를 통해 GetUser 및 SetUser로 전달됩니다.

getters/setters는 아마도 다음과 같습니다.

function GetUser(Index:Integer):String;
procedure SetUser(Index:Integer;const value:string);

따라서 이것으로 생각하십시오.

MyString := MyLogin.user;
// is translated to:
MyString := getUser(IS_OPTN);

그리고

MyLogin.user := 'me'; 
// is translated to:
SetUser(IS_OPTN,'me');

예, 필요합니다. 이 정보를 사용하면 Evemple IS_OPTN의 경우 Tremotable의 클래스는 속성이 XML을 구축하는 데 선택적 인 경우 선택 사항 인 경우 값이 저장된 경우에만 추가됩니다. 귀하의 경우 :

property User: string Index (IS_OPTN) read GetUser write SetUser stored User_Specified

요소 사용자 if xml에 추가됩니다 user_specified 진실. 그만큼 user_specified Setter SetUser가 수행하기 때문에 사용자에게 값을 설정하면 자동으로 TRUE가됩니다.

따라서 구성 요소 SOAP 예제가 XML을 빌드하면 옵션 (IS_OPTN)이므로 저장된 경우에만 요소가 추가됩니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top