Visual Basic (Declaration) | |
---|---|
Public MustOverride Function NewChangeGroup() As IChangeGroup |
C# | |
---|---|
public abstract IChangeGroup NewChangeGroup() |
C++/CLI | |
---|---|
public: abstract IChangeGroup^ NewChangeGroup(); |
Return Value
An IChangeGroup handle on which System.IDisposable.Dispose must be called to re-enable normal measurement updates.From the time the handle is obtained until the System.IDisposable.Dispose method on it is called, measurement updates are blocked. The update is performed when the System.IDisposable.Dispose method is called on the returned interface.
In the C# language, the "using" construct can be employed to automatically re-enable updates. The code looks like this: using (IChangeGroup changes = measurement.NewChangeGroup()) { // set all properties here }
When the "changes" variable falls out of scope at the end of the "using" block, the System.IDisposable.Dispose method is invoked automatically.
In other languages, it is highly recommended that a "try/finally" construct be employed to guarantee that System.IDisposable.Dispose is called regardless of the outcome of the parameter changes. In C# this would look as follows: IChangeGroup changes = measurement.NewChangeGroup(); try { // set all properties here } finally { if (changes != null) changes.Dispose(); }
Target Platforms: Windows 11 Professional or Enterprise; Windows 10 Professional, Enterprise, or Education (64-bit)