/
DataDOMEvent.xml
597 lines (591 loc) · 36.2 KB
/
DataDOMEvent.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
<Type Name="DataDOMEvent" FullName="Microsoft.Office.Interop.InfoPath.DataDOMEvent">
<TypeSignature Language="C#" Value="public interface DataDOMEvent : Microsoft.Office.Interop.InfoPath.DocActionEvent" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract DataDOMEvent implements class Microsoft.Office.Interop.InfoPath.DocActionEvent" />
<TypeSignature Language="DocId" Value="T:Microsoft.Office.Interop.InfoPath.DataDOMEvent" />
<TypeSignature Language="VB.NET" Value="Public Interface DataDOMEvent
Implements DocActionEvent" />
<TypeSignature Language="C++ CLI" Value="public interface class DataDOMEvent : Microsoft::Office::Interop::InfoPath::DocActionEvent" />
<TypeSignature Language="F#" Value="type DataDOMEvent = interface
 interface DocActionEvent" />
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Interfaces>
<Interface>
<InterfaceName>Microsoft.Office.Interop.InfoPath.DocActionEvent</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.Guid("096CD5E5-0786-11D1-95FA-0080C78EE3BB")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Runtime.InteropServices.TypeLibType(4288)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>This type is a wrapper for a COM interface implemented by a coclass that is required by managed code for COM interoperability. To access the members specified by this interface, use the type that wraps the coclass that implements this interface. For information about that type, including usage, remarks, and examples, see<see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" />.</summary>
<remarks>To be added.</remarks>
</Docs>
<Members>
<Member MemberName="IsUndoRedo">
<MemberSignature Language="C#" Value="public bool IsUndoRedo { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IsUndoRedo" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.IsUndoRedo" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property IsUndoRedo As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool IsUndoRedo { bool get(); };" />
<MemberSignature Language="F#" Value="member this.IsUndoRedo : bool" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.IsUndoRedo" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(5)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(5)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value indicating whether the data validation event occurs during an undo operation or a redo operation.</summary>
<value>To be added.</value>
<remarks>
<para>When an undo or a redo operation takes place, the form's underlying XML document is placed in a read-only state and cannot be modified. This can sometimes occur during an <see cref="E:Microsoft.Office.Interop.InfoPath._DataDOMEventSink_Event.OnAfterChange" /> event; when it does, the <b>IsUndoRedo</b> property is used to bypass the data validation that it contains.</para>
<para />
</remarks>
<example>
<para>In the following example, the <b>IsUndoRedo</b> property is used to determine whether the event is occurring during an undo or redo operation. If it is, the event handler is exited using the <b>return</b> statement, otherwise the custom function <b>Calculate</b> is called:</para>
<code>public void field1_OnAfterChange(DataDOMEvent e)
{
if (e.<span class="label">IsUndoRedo</span>)
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}
Calculate();
}</code>
</example>
</Docs>
</Member>
<Member MemberName="MatchExpression">
<MemberSignature Language="C#" Value="public string MatchExpression { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string MatchExpression" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.MatchExpression" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property MatchExpression As String" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ MatchExpression { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.MatchExpression : string" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.MatchExpression" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(2)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(2)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the XPath expression for the XML Document Object Model (DOM) node for which the event is currently being processed.</summary>
<value>To be added.</value>
<remarks>
<para>The XPath expression that the <b>MatchExpression</b> property contains points to an XML DOM node in the form's underlying XML document. This is the node that is currently being validated by the data validation event handler.</para>
<para />
</remarks>
<example>
<para>In the following example, the <b>MatchExpression</b> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to display the XPath expression of the XML DOM node that is currently being validated:</para>
<code>thisXDocument.UI.Alert("Match expression: " + e.<span class="label">MatchExpression</span>);</code>
</example>
</Docs>
</Member>
<Member MemberName="NewValue">
<MemberSignature Language="C#" Value="public object NewValue { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object NewValue" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.NewValue" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property NewValue As Object" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Object ^ NewValue { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.NewValue : obj" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.NewValue" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(7)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(7)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the value of an XML Document Object Model (DOM) node that is being updated or inserted during a data validation event.</summary>
<value>To be added.</value>
<remarks>
<para>The <b>NewValue</b> property contains the value of the XML DOM node that will replace the existing value. To get the original value of the XML DOM node, use the <see cref="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.OldValue" /> property.</para>
<para />
</remarks>
<example>
<para>In the following example, the <see cref="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.OldValue" /> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to display the original value of an XML DOM node, along with its <b>NewValue</b>:</para>
<code>thisXDocument.UI.Alert("Original value: " + e.OldValue.ToString() + "\nNew value: " + e.<span class="label">NewValue</span>.ToString());</code>
<para>In the following example, the <b>NewValue</b> property of the <b>DataDOMEvent</b> is checked for a blank value. If not blank, the "FirstName" and "Lastname" fields are cleared.</para>
<code> 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.<span class="label">NewValue</span>.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 = "";</code>
</example>
</Docs>
</Member>
<Member MemberName="OldValue">
<MemberSignature Language="C#" Value="public object OldValue { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object OldValue" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.OldValue" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property OldValue As Object" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Object ^ OldValue { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.OldValue : obj" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.OldValue" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(6)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(6)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the original value of an XML Document Object Model (DOM) node that is being updated or deleted during a data validation event.</summary>
<value>To be added.</value>
<remarks>
<para>The <b>OldValue</b> property contains the original value of the XML DOM node that will be replaced with a new value or deleted. To get the new value of the XML DOM node, use the <see cref="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.NewValue" /> property.</para>
<para />
</remarks>
<example>
<para>In the following example, the <b>OldValue</b> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to display the original value of an XML DOM node, along with its <see cref="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.NewValue" />:</para>
<code>thisXDocument.UI.Alert("Original value: " + e.<span class="label">OldValue</span>.ToString() + "\nNew value: " + e.NewValue.ToString());</code>
</example>
</Docs>
</Member>
<Member MemberName="Operation">
<MemberSignature Language="C#" Value="public string Operation { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Operation" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.Operation" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Operation As String" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ Operation { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Operation : string" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.Operation" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(4)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(4)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the type of action that is applied to an XML Document Object Model (DOM) node during a data validation event.</summary>
<value>To be added.</value>
<remarks>
<para>The values that the <b>Operation</b> property returns include <b>Insert</b>, <b>Update</b>, and <b>Delete</b>.</para>
<para />
</remarks>
<example>
<para>In the following example, the <b>Operation</b> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to check the type of action that is occurring to avoid multiple notifications for updates made to node values:</para>
<code>public void item_OnAfterChange(DataDOMEvent e)
{
if (!e.IsUndoRedo &amp;&amp; e.<span class="label">Operation</span> == "Delete"
&amp;&amp; e.Site.nodeName == "item" &amp;&amp;
e.Source.nodeName == "item")
{
Calculate();
}
}</code>
</example>
</Docs>
</Member>
<Member MemberName="Parent">
<MemberSignature Language="C#" Value="public Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode Parent { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode Parent" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.Parent" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Parent As IXMLDOMNode" />
<MemberSignature Language="C++ CLI" Value="public:
 property Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ Parent { Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Parent : Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.Parent" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(3)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(3)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the XML Document Object Model (DOM) node of the parent of the XML DOM node being changed during a data validation event.</summary>
<value>To be added.</value>
<remarks>
<para>After you have set a reference to the XML DOM node that the <b>Parent</b> property returns, you can use any of the properties and methods that are supported by the XML DOM. This can be especially useful during delete operations, because the <b>Parent</b> property maps to the location of the XML DOM node that was removed.</para>
<para />
</remarks>
<example>
<para>In the following partial example, the <b>Parent</b> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to check the name of the parent node; if it matches certain criteria, an error message is displayed:</para>
<code>public void shippingDate_OnBeforeChange(DataDOMEvent e)
{
if (e.<span class="label">Parent</span>.nodeName == "orderDate")
{
e.ReturnMessage = "You must delete the Ship Date before deleting the Order Date.";
e.ReturnStatus = false;
return;
}
}</code>
</example>
</Docs>
</Member>
<Member MemberName="ReportError">
<MemberSignature Language="C#" Value="public Microsoft.Office.Interop.InfoPath.ErrorObject ReportError (object varNode, string bstrShortErrorMessage, bool fSiteIndependent, string bstrDetailedErrorMessage = "", int lErrorCode = 0, string bstrType = "modeless");" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class Microsoft.Office.Interop.InfoPath.ErrorObject ReportError([in]object varNode, [in]string bstrShortErrorMessage, [in]bool fSiteIndependent, [in]string bstrDetailedErrorMessage, [in]int32 lErrorCode, [in]string bstrType) runtime managed" />
<MemberSignature Language="DocId" Value="M:Microsoft.Office.Interop.InfoPath.DataDOMEvent.ReportError(System.Object,System.String,System.Boolean,System.String,System.Int32,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Function ReportError (varNode As Object, bstrShortErrorMessage As String, fSiteIndependent As Boolean, Optional bstrDetailedErrorMessage As String = "", Optional lErrorCode As Integer = 0, Optional bstrType As String = "modeless") As ErrorObject" />
<MemberSignature Language="F#" Value="abstract member ReportError : obj * string * bool * string * int * string -> Microsoft.Office.Interop.InfoPath.ErrorObject" Usage="dataDOMEvent.ReportError (varNode, bstrShortErrorMessage, fSiteIndependent, bstrDetailedErrorMessage, lErrorCode, bstrType)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(8)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Microsoft.Office.Interop.InfoPath.ErrorObject</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="varNode" Type="System.Object" />
<Parameter Name="bstrShortErrorMessage" Type="System.String" />
<Parameter Name="fSiteIndependent" Type="System.Boolean" />
<Parameter Name="bstrDetailedErrorMessage" Type="System.String" />
<Parameter Name="lErrorCode" Type="System.Int32" />
<Parameter Name="bstrType" Type="System.String" />
</Parameters>
<Docs>
<param name="varNode">The XML Document Object Model (DOM) node that the error is associated with.</param>
<param name="bstrShortErrorMessage">The text to be used for the short error message.</param>
<param name="fSiteIndependent">Sets the condition for automatic deletion of the <b>Error</b> object. If <b>true</b>, the <b>Error</b> object will be deleted on change for any nodes that matched the XPath expression corresponding to the <b>Error</b> object. If <b>false</b>, the <b>Error</b> object will be deleted when the node returned by the <see cref="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.Site" /> property of a given event object has been changed.</param>
<param name="bstrDetailedErrorMessage">The text to be used for the detailed error message.</param>
<param name="lErrorCode">The number to be used as the error code.</param>
<param name="bstrType">Default value is "modeless". Determines whether the change in value will be automatically rejected or whether the user will be prompted to accept or reject the change. The other value is "modal".</param>
<summary>Creates an <see cref="T:Microsoft.Office.Interop.InfoPath.ErrorObject" /> object and adds it to the <see cref="T:Microsoft.Office.Interop.InfoPath.ErrorsCollection" /> collection.</summary>
<returns>The <see cref="T:Microsoft.Office.Interop.InfoPath.ErrorObject" /> object representing the newly created <b>Error</b>.</returns>
<remarks>
<para>When the <b>ReportError</b> method is called, Microsoft Office InfoPath 2003 creates an <b>Error</b> object and adds it to the <b>Errors</b> collection. Errors are removed from the collection when the validation constraint is no longer invalid. In certain cases they can be explicitly removed using the <see cref="M:Microsoft.Office.Interop.InfoPath.Errors.Delete(System.Object,System.String)" /> or <see cref="M:Microsoft.Office.Interop.InfoPath.Errors.DeleteAll" /> methods.</para>
<para>Errors can also be created using the <see cref="M:Microsoft.Office.Interop.InfoPath.Errors.Add(System.Object,System.String,System.String,System.String,System.Int32,System.String)" /> method.</para>
<para>
<b>Note</b>: Site-independent errors should be used when you want the errors to apply to all XML DOM nodes of the same type. If you want the error to apply to a specific XML DOM node, use site-dependent errors.</para>
<para>
<b>Note</b>: The <b>ReportError</b> method can only be used during the <see cref="E:Microsoft.Office.Interop.InfoPath._DataDOMEventSink_Event.OnValidate" /> event.</para>
<para />
</remarks>
<example>
<para>In the following example, the <see cref="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.Site" /> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to check the value of the node. If the data validation fails, the <b>ReportError</b> method is used to create a custom error.</para>
<code>public void field1_OnValidate(DataDOMEvent e)
{
if (int.Parse(e.Site.text) &gt; 50)
{
e.<span class="label">ReportError</span>(
e.Site,
"Invalid quantity. The total number of each type of block cannot exceed 50.",
false,
"",
2,
"modeless");
}
if (int.Parse(e.Site.text) &lt; 0)
{
e.ReportError(
e.Site,
"Invalid quantity. The total number of each type of block cannot be less than 0.",
false,
"",
2,
"modeless");
}
}</code>
</example>
</Docs>
</Member>
<Member MemberName="ReturnMessage">
<MemberSignature Language="C#" Value="public string ReturnMessage { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ReturnMessage" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.ReturnMessage" />
<MemberSignature Language="VB.NET" Value="Public Property ReturnMessage As String" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ ReturnMessage { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ReturnMessage : string with get, set" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.ReturnMessage" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(102)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(102)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>set: System.Runtime.InteropServices.DispId(102)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the error message that will be returned if the data validation event is not successful.</summary>
<value>To be added.</value>
<remarks>
<para>Used in conjunction with the <see cref="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.ReturnStatus" /> property, the <b>ReturnMessage</b> property displays a message box to the user with the specified text message.</para>
<para />
</remarks>
<example>
<para>In the following example, the <b>ReturnMessage</b> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to display a message to the user if the data validation for the XML DOM node fails:</para>
<code>public void qtty_OnBeforeChange(DataDOMEvent e)
{
if (e.NewValue.ToString() == "")
{
e.<span class="label">ReturnMessage</span> = "You must supply a value for this field.";
e.ReturnStatus = false;
return;
}
}</code>
</example>
</Docs>
</Member>
<Member MemberName="ReturnStatus">
<MemberSignature Language="C#" Value="public bool ReturnStatus { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool ReturnStatus" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.ReturnStatus" />
<MemberSignature Language="VB.NET" Value="Public Property ReturnStatus As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool ReturnStatus { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.ReturnStatus : bool with get, set" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.ReturnStatus" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:Microsoft.Office.Interop.InfoPath.DocActionEvent.ReturnStatus</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(101)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(101)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>set: System.Runtime.InteropServices.DispId(101)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating the return status of the data validation event.</summary>
<value>To be added.</value>
<remarks>
<para>For the <see cref="E:Microsoft.Office.Interop.InfoPath._DataDOMEventSink_Event.OnBeforeChange" /> event, if the <b>ReturnStatus</b> property is set to <b>false</b>, the changes to the XML Document Object Model (DOM) node are not accepted and the data validation event fails. If set to <b>true</b>, no data validation error has occurred and the data validation event is successful.</para>
<para />
</remarks>
<example>
<para>In the following example, the <b>ReturnStatus</b> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to indicate that the data validation event was not successful. The code also uses the <see cref="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.ReturnMessage" /> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object to display a message to the user.</para>
<code>public void RepVisitDt_OnBeforeChange(DataDOMEvent e)
{
if (e.NewValue.ToString() == "")
{
e.ReturnMessage = "You must supply a value for this field.";
e.<span class="label">ReturnStatus</span> = false;
}
}</code>
</example>
</Docs>
</Member>
<Member MemberName="Site">
<MemberSignature Language="C#" Value="public Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode Site { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode Site" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.Site" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Site As IXMLDOMNode" />
<MemberSignature Language="C++ CLI" Value="public:
 property Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ Site { Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Site : Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.Site" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(1)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(1)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the XML Document Object Model (DOM) node where the data validation event is currently being processed.</summary>
<value>To be added.</value>
<remarks>
<para>After you have set a reference to the XML DOM node that the <b>Site</b> property returns, you can use any of the properties and methods that are supported by the XML DOM.</para>
<para />
</remarks>
<example>
<para>In the following example, the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to check the value of the node using the <b>Site</b> property. If the data validation fails, the <see cref="M:Microsoft.Office.Interop.InfoPath.DataDOMEvent.ReportError(System.Object,System.String,System.Boolean,System.String,System.Int32,System.String)" /> method is used to create a custom error.</para>
<code>public void field1_OnValidate(DataDOMEvent e)
{
if(e.Site.text != "")
{
int quantity = int.Parse(e.Site.text.ToString());
if(quantity &gt; 50)
{
e.ReportError(e.Site, "Invalid quantity. The total number of each type of block cannot exceed 50.", false, "", 2,"modeless");
}
if(quantity &lt; 0)
{
e.ReportError(e.Site, "Invalid quantity. The total number of each type of block cannot be less than 0.", false,"", 2,"modeless");
}
}
}</code>
</example>
</Docs>
</Member>
<Member MemberName="Source">
<MemberSignature Language="C#" Value="public Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode Source { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode Source" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.Source" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Source As IXMLDOMNode" />
<MemberSignature Language="C++ CLI" Value="public:
 property Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ Source { Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNode ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Source : Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.Source" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:Microsoft.Office.Interop.InfoPath.DocActionEvent.Source</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(200)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(200)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the XML Document Object Model (DOM) where the data validation event is occurring.</summary>
<value>To be added.</value>
<remarks>
<para>After you have set a reference to the XML DOM node that the <b>Source</b> property returns, you can use any of the properties and methods that are supported by the XML DOM.</para>
<para />
</remarks>
<example>
<para>In the following example, the <b>Source</b> property of the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object is used to return a reference to the XML DOM node that caused the initial change. If the node name matches certain criteria, a custom function is called.</para>
<code>public void item_OnAfterChange(DataDOMEvent e)
{
if (!e.IsUndoRedo &amp;&amp; e.<span class="label">Source</span>.nodeName != "item")
{
Calculate(e.Site.parentNode);
}
}</code>
</example>
</Docs>
</Member>
<Member MemberName="XDocument">
<MemberSignature Language="C#" Value="public Microsoft.Office.Interop.InfoPath.XDocument XDocument { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class Microsoft.Office.Interop.InfoPath.XDocument XDocument" />
<MemberSignature Language="DocId" Value="P:Microsoft.Office.Interop.InfoPath.DataDOMEvent.XDocument" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property XDocument As XDocument" />
<MemberSignature Language="C++ CLI" Value="public:
 property Microsoft::Office::Interop::InfoPath::XDocument ^ XDocument { Microsoft::Office::Interop::InfoPath::XDocument ^ get(); };" />
<MemberSignature Language="F#" Value="member this.XDocument : Microsoft.Office.Interop.InfoPath.XDocument" Usage="Microsoft.Office.Interop.InfoPath.DataDOMEvent.XDocument" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:Microsoft.Office.Interop.InfoPath.DocActionEvent.XDocument</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>Microsoft.Office.Interop.InfoPath</AssemblyName>
<AssemblyVersion>15.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Runtime.InteropServices.DispId(100)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>get: System.Runtime.InteropServices.DispId(100)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>Microsoft.Office.Interop.InfoPath.XDocument</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the <see cref="T:Microsoft.Office.Interop.InfoPath.XDocument" /> object that is associated with the <see cref="T:Microsoft.Office.Interop.InfoPath.DataDOMEventObject" /> object during a data validation event.</summary>
<value>To be added.</value>
<remarks>
<para>After you have set a reference to the <b>XDocument</b> object that is returned, you can use any of the properties and methods that it provides.</para>
<para />
</remarks>
<example>
<para>In the following example, the <b>XDocument</b> property of the <b>DataDOMEvent</b> object is used to set a reference to the <b>XDocument</b> object:</para>
<code>public void qtty_OnBeforeChange(DataDOMEvent e)
{
XDocument doc = e.<span class="label">XDocument</span>;
}</code>
</example>
</Docs>
</Member>
</Members>
</Type>