DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Package Functions | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Client.DeveelDbParameterCollection Class Reference
Inheritance diagram for Deveel.Data.Client.DeveelDbParameterCollection:

Public Member Functions

override int Add (object value)
 
override bool Contains (object value)
 
override void Clear ()
 
override int IndexOf (object value)
 
override void Insert (int index, object value)
 
override void Remove (object value)
 
override void RemoveAt (int index)
 
override void RemoveAt (string parameterName)
 
override int IndexOf (string parameterName)
 
override IEnumerator GetEnumerator ()
 
override bool Contains (string value)
 
override void CopyTo (Array array, int index)
 
override void AddRange (Array values)
 

Protected Member Functions

override void SetParameter (int index, DbParameter value)
 
override void SetParameter (string parameterName, DbParameter value)
 
override DbParameter GetParameter (int index)
 
override DbParameter GetParameter (string parameterName)
 

Package Functions

 DeveelDbParameterCollection (DeveelDbCommand command)
 

Properties

DeveelDbCommand Command [get, set]
 
new DeveelDbParameter this[int offset] [get, set]
 
new DeveelDbParameter this[string name] [get, set]
 
QueryParameterStyle ParameterStyle [get]
 
override int Count [get]
 
override object SyncRoot [get]
 
override bool IsFixedSize [get]
 
override bool IsReadOnly [get]
 
override bool IsSynchronized [get]
 

Private Member Functions

void AssertValidName (string paramName)
 
DeveelDbParameter CreateParemeter (object value)
 
SqlTypeCode GetSqlType (object value)
 
DbType GetDbType (object value)
 
int AddValue (object value)
 
int AddDbDataParameter (IDbDataParameter parameter)
 
int AddParameter (DeveelDbParameter parameter)
 

Private Attributes

readonly List< DeveelDbParameterparameters
 

Detailed Description

Definition at line 29 of file DeveelDbParameterCollection.cs.

Constructor & Destructor Documentation

Deveel.Data.Client.DeveelDbParameterCollection.DeveelDbParameterCollection ( DeveelDbCommand  command)
inlinepackage

Definition at line 32 of file DeveelDbParameterCollection.cs.

32  {
33  if (command == null)
34  throw new ArgumentNullException("command");
35 
36  Command = command;
37  parameters = new List<DeveelDbParameter>();
38  }

Member Function Documentation

override int Deveel.Data.Client.DeveelDbParameterCollection.Add ( object  value)
inline

Definition at line 88 of file DeveelDbParameterCollection.cs.

88  {
89  if (value is DeveelDbParameter)
90  return AddParameter((DeveelDbParameter) value);
91  if (value is IDbDataParameter)
92  return AddDbDataParameter((IDbDataParameter) value);
93 
94  return AddValue(value);
95  }
int Deveel.Data.Client.DeveelDbParameterCollection.AddDbDataParameter ( IDbDataParameter  parameter)
inlineprivate

Definition at line 106 of file DeveelDbParameterCollection.cs.

106  {
107  AssertValidName(parameter.ParameterName);
108 
109  DeveelDbParameter dbParameter;
110  if (parameter is DeveelDbParameter) {
111  dbParameter = (DeveelDbParameter) parameter;
112  } else {
113  dbParameter = new DeveelDbParameter();
114  }
115 
116  parameters.Add(dbParameter);
117  return parameters.Count - 1;
118  }
int Deveel.Data.Client.DeveelDbParameterCollection.AddParameter ( DeveelDbParameter  parameter)
inlineprivate

Definition at line 120 of file DeveelDbParameterCollection.cs.

120  {
121  AssertValidName(parameter.ParameterName);
122  parameters.Add(parameter);
123  return parameters.Count - 1;
124  }
override void Deveel.Data.Client.DeveelDbParameterCollection.AddRange ( Array  values)
inline

Definition at line 243 of file DeveelDbParameterCollection.cs.

243  {
244  foreach (var value in values) {
245  Add(value);
246  }
247  }
int Deveel.Data.Client.DeveelDbParameterCollection.AddValue ( object  value)
inlineprivate

Definition at line 97 of file DeveelDbParameterCollection.cs.

97  {
98  if (ParameterStyle != QueryParameterStyle.Marker)
99  throw new ArgumentException("Cannot add an unnamed parameter in this context.");
100 
101  var parameter = CreateParemeter(value);
102  parameters.Add(parameter);
103  return parameters.Count - 1;
104  }
QueryParameterStyle
In a SQL query object, this is the form of parameters passed from the client side to the server side...
void Deveel.Data.Client.DeveelDbParameterCollection.AssertValidName ( string  paramName)
inlineprivate

Definition at line 56 of file DeveelDbParameterCollection.cs.

56  {
57  if (ParameterStyle == QueryParameterStyle.Named) {
58  if (Contains(paramName))
59  throw new ArgumentException(String.Format("The parameter '{0}' already exists in the collection.", paramName));
60  } else {
61  if (!String.IsNullOrEmpty(paramName) ||
62  !String.Equals(paramName, QueryParameter.Marker))
63  throw new ArgumentException("Cannot specify the name of the parameter.");
64  }
65  }
A long string in the system.
QueryParameterStyle
In a SQL query object, this is the form of parameters passed from the client side to the server side...
override void Deveel.Data.Client.DeveelDbParameterCollection.Clear ( )
inline

Definition at line 135 of file DeveelDbParameterCollection.cs.

135  {
136  parameters.Clear();
137  }
override bool Deveel.Data.Client.DeveelDbParameterCollection.Contains ( object  value)
inline

Definition at line 126 of file DeveelDbParameterCollection.cs.

126  {
127  if (value is string)
128  return Contains((string) value);
129  if (value is IDbDataParameter)
130  return Contains(((IDbDataParameter) value).ParameterName);
131 
132  return false;
133  }
override bool Deveel.Data.Client.DeveelDbParameterCollection.Contains ( string  value)
inline

Definition at line 232 of file DeveelDbParameterCollection.cs.

232  {
233  if (ParameterStyle != QueryParameterStyle.Named)
234  return false;
235 
236  return parameters.Any(x => x.ParameterName == value);
237  }
QueryParameterStyle
In a SQL query object, this is the form of parameters passed from the client side to the server side...
override void Deveel.Data.Client.DeveelDbParameterCollection.CopyTo ( Array  array,
int  index 
)
inline

Definition at line 239 of file DeveelDbParameterCollection.cs.

239  {
240  throw new NotImplementedException();
241  }
DeveelDbParameter Deveel.Data.Client.DeveelDbParameterCollection.CreateParemeter ( object  value)
inlineprivate

Definition at line 67 of file DeveelDbParameterCollection.cs.

67  {
68  var dbType = GetDbType(value);
69  var sqlType = GetSqlType(value);
70 
71  return new DeveelDbParameter {
72  DbType = dbType,
73  SqlType = sqlType,
74  Direction = ParameterDirection.Input,
75  Value = value,
76  ParameterName = QueryParameter.Marker,
77  };
78  }
ParameterDirection
The possible directions of a procedure parameter.
Defines the properties of a specific SQL Type and handles the values compatible.
Definition: SqlType.cs:33
DbType Deveel.Data.Client.DeveelDbParameterCollection.GetDbType ( object  value)
inlineprivate

Definition at line 84 of file DeveelDbParameterCollection.cs.

84  {
85  throw new NotImplementedException();
86  }
override IEnumerator Deveel.Data.Client.DeveelDbParameterCollection.GetEnumerator ( )
inline

Definition at line 220 of file DeveelDbParameterCollection.cs.

220  {
221  return parameters.GetEnumerator();
222  }
override DbParameter Deveel.Data.Client.DeveelDbParameterCollection.GetParameter ( int  index)
inlineprotected

Definition at line 224 of file DeveelDbParameterCollection.cs.

224  {
225  throw new NotImplementedException();
226  }
override DbParameter Deveel.Data.Client.DeveelDbParameterCollection.GetParameter ( string  parameterName)
inlineprotected

Definition at line 228 of file DeveelDbParameterCollection.cs.

228  {
229  throw new NotImplementedException();
230  }
SqlTypeCode Deveel.Data.Client.DeveelDbParameterCollection.GetSqlType ( object  value)
inlineprivate

Definition at line 80 of file DeveelDbParameterCollection.cs.

80  {
81  throw new NotImplementedException();
82  }
override int Deveel.Data.Client.DeveelDbParameterCollection.IndexOf ( object  value)
inline

Definition at line 139 of file DeveelDbParameterCollection.cs.

139  {
140  if (value is string)
141  return IndexOf((string) value);
142  if (value is IDbDataParameter)
143  return IndexOf(((IDbDataParameter) value).ParameterName);
144 
145  return -1;
146  }
override int Deveel.Data.Client.DeveelDbParameterCollection.IndexOf ( string  parameterName)
inline

Definition at line 208 of file DeveelDbParameterCollection.cs.

208  {
209  if (ParameterStyle != QueryParameterStyle.Named)
210  return -1;
211 
212  for (int i = 0; i < parameters.Count; i++) {
213  if (parameters[i].ParameterName == parameterName)
214  return i;
215  }
216 
217  return -1;
218  }
QueryParameterStyle
In a SQL query object, this is the form of parameters passed from the client side to the server side...
override void Deveel.Data.Client.DeveelDbParameterCollection.Insert ( int  index,
object  value 
)
inline

Definition at line 148 of file DeveelDbParameterCollection.cs.

148  {
149  throw new NotImplementedException();
150  }
override void Deveel.Data.Client.DeveelDbParameterCollection.Remove ( object  value)
inline

Definition at line 152 of file DeveelDbParameterCollection.cs.

152  {
153  if (value is string) {
154  var paramName = (string) value;
155  RemoveAt(paramName);
156  } else if (value is int) {
157  var index = (int) value;
158  RemoveAt(index);
159  } else if (value is IDbDataParameter) {
160  var param = (IDbDataParameter) value;
161  throw new NotImplementedException();
162  }
163  }
override void Deveel.Data.Client.DeveelDbParameterCollection.RemoveAt ( int  index)
inline

Definition at line 165 of file DeveelDbParameterCollection.cs.

165  {
166  if (index < 0 || index >= parameters.Count)
167  throw new ArgumentOutOfRangeException("index");
168 
169  parameters.RemoveAt(index);
170  }
override void Deveel.Data.Client.DeveelDbParameterCollection.RemoveAt ( string  parameterName)
inline

Definition at line 172 of file DeveelDbParameterCollection.cs.

172  {
173  var index = IndexOf(parameterName);
174  if (index == -1)
175  return;
176 
177  RemoveAt(index);
178  }
override void Deveel.Data.Client.DeveelDbParameterCollection.SetParameter ( int  index,
DbParameter  value 
)
inlineprotected

Definition at line 180 of file DeveelDbParameterCollection.cs.

180  {
181  throw new NotImplementedException();
182  }
override void Deveel.Data.Client.DeveelDbParameterCollection.SetParameter ( string  parameterName,
DbParameter  value 
)
inlineprotected

Definition at line 184 of file DeveelDbParameterCollection.cs.

184  {
185  throw new NotImplementedException();
186  }

Member Data Documentation

readonly List<DeveelDbParameter> Deveel.Data.Client.DeveelDbParameterCollection.parameters
private

Definition at line 30 of file DeveelDbParameterCollection.cs.

Property Documentation

DeveelDbCommand Deveel.Data.Client.DeveelDbParameterCollection.Command
getsetprivate

Definition at line 40 of file DeveelDbParameterCollection.cs.

override int Deveel.Data.Client.DeveelDbParameterCollection.Count
get

Definition at line 188 of file DeveelDbParameterCollection.cs.

override bool Deveel.Data.Client.DeveelDbParameterCollection.IsFixedSize
get

Definition at line 196 of file DeveelDbParameterCollection.cs.

override bool Deveel.Data.Client.DeveelDbParameterCollection.IsReadOnly
get

Definition at line 200 of file DeveelDbParameterCollection.cs.

override bool Deveel.Data.Client.DeveelDbParameterCollection.IsSynchronized
get

Definition at line 204 of file DeveelDbParameterCollection.cs.

QueryParameterStyle Deveel.Data.Client.DeveelDbParameterCollection.ParameterStyle
getprivate

Definition at line 52 of file DeveelDbParameterCollection.cs.

override object Deveel.Data.Client.DeveelDbParameterCollection.SyncRoot
get

Definition at line 192 of file DeveelDbParameterCollection.cs.

new DeveelDbParameter Deveel.Data.Client.DeveelDbParameterCollection.this[int offset]
getset

Definition at line 42 of file DeveelDbParameterCollection.cs.

new DeveelDbParameter Deveel.Data.Client.DeveelDbParameterCollection.this[string name]
getset

Definition at line 47 of file DeveelDbParameterCollection.cs.


The documentation for this class was generated from the following file: