다음을 통해 공유


DataDOMEvent.NewValue 속성

데이터 유효성 검사 이벤트 중에 업데이트 또는 삽입되는 XML DOM(Document Object Model) 노드의 값을 가져옵니다.

이 속성은 CLS 규격이 아닙니다.  

네임스페이스: Microsoft.Office.Interop.InfoPath.SemiTrust
어셈블리: Microsoft.Office.Interop.InfoPath.SemiTrust(microsoft.office.interop.infopath.semitrust.dll)

구문

<DispIdAttribute(7)> _
ReadOnly Property NewValue As Object

Dim instance As DataDOMEvent
Dim value As Object

value = instance.NewValue
[DispIdAttribute(7)] 
Object NewValue { get; }

주의

NewValue 속성은 기존 값 대신 사용할 XML DOM 노드의 값을 포함합니다. XML DOM 노드의 원래 값을 가져오려면 OldValue 속성을 사용합니다.

중요:

이 멤버는 현재 열려 있는 양식과 같은 도메인에서 실행하는 양식 또는 도메인 간 권한이 부여된 양식에서만 액세스할 수 있습니다.

예제

다음 예제에서는 DataDOMEventObject 개체의 OldValue 속성을 사용하여 XML DOM 노드의 원래 값과 NewValue를 함께 표시합니다.

thisXDocument.UI.Alert("Original value: " + e.OldValue.ToString() + "\nNew value: " + e.NewValue.ToString());

다음 예제에서는 DataDOMEventNewValue 속성이 빈 값인지 확인합니다. 비어 있지 않으면 "FirstName" 및 "Lastname" 필드가 지워집니다.

 if (e.IsUndoRedo)
 {
  // An undo or redo operation has occurred and the DOM is read-only.
  return;
 }

 // A field change has occurred and the DOM is writable. Write code here to respond
 // to the changes.
 if (e.NewValue.ToString() == "")
 return;

 if (thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Employees/@FirstName").text != "")
thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Employees/@FirstName").text = "";

 if (thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Employees/@LastName").text != "")
thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:queryFields/q:Employees/@LastName").text = "";

참고 항목

참조

DataDOMEvent 인터페이스
DataDOMEvent 구성원
Microsoft.Office.Interop.InfoPath.SemiTrust 네임스페이스