You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,68 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="TdsParameterSetter.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <owner current="true" primary="true">[....]</owner>
|
||||
// <owner current="true" primary="false">[....]</owner>
|
||||
// <owner current="true" primary="false">[....]</owner>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.Data.SqlClient {
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Diagnostics;
|
||||
|
||||
using Microsoft.SqlServer.Server;
|
||||
|
||||
// Simple Getter/Setter for structured parameters to allow using common ValueUtilsSmi code.
|
||||
// This is a stand-in to having a true SmiRequestExecutor class for TDS.
|
||||
internal class TdsParameterSetter : SmiTypedGetterSetter {
|
||||
|
||||
#region Private fields
|
||||
|
||||
private TdsRecordBufferSetter _target;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ctor & control
|
||||
|
||||
internal TdsParameterSetter(TdsParserStateObject stateObj, SmiMetaData md) {
|
||||
_target = new TdsRecordBufferSetter(stateObj, md);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region TypedGetterSetter overrides
|
||||
// Are calls to Get methods allowed?
|
||||
internal override bool CanGet {
|
||||
get {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Are calls to Set methods allowed?
|
||||
internal override bool CanSet {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// valid for structured types
|
||||
// This method called for both get and set.
|
||||
internal override SmiTypedGetterSetter GetTypedGetterSetter(SmiEventSink sink, int ordinal) {
|
||||
Debug.Assert(0==ordinal, "TdsParameterSetter only supports 0 for ordinal. Actual = " + ordinal);
|
||||
return _target;
|
||||
}
|
||||
|
||||
// Set value to null
|
||||
// valid for all types
|
||||
public override void SetDBNull(SmiEventSink sink, int ordinal) {
|
||||
Debug.Assert(0==ordinal, "TdsParameterSetter only supports 0 for ordinal. Actual = " + ordinal);
|
||||
|
||||
_target.EndElements(sink);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user