Exemplo n.º 1
0
		/// <summary>
		/// Create a new command based on this one.
		/// </summary>
		/// <returns>A new NpgsqlCommand object.</returns>
		public NpgsqlCommand Clone()
		{
			// TODO: Add consistency checks.

			NpgsqlCommand clone = new NpgsqlCommand(CommandText, Connection, Transaction);
			clone.CommandTimeout = CommandTimeout;
			clone.CommandType = CommandType;
			clone.DesignTimeVisible = DesignTimeVisible;
			if (ExpectedTypes != null)
			{
				clone.ExpectedTypes = (Type[])ExpectedTypes.Clone();
			}
			foreach (NpgsqlParameter parameter in Parameters)
			{
				clone.Parameters.Add(parameter.Clone());
			}
			return clone;
		}
Exemplo n.º 2
0
 /// <summary>
 /// Add a custom expected type.
 /// </summary>
 /// <param name="exponent">The exponent of the type.</param>
 /// <param name="unitName">The name of the base unit.</param>
 public void AddCustomExpectedType(int exponent, string unitName)
 {
     ExpectedTypes.Add(new Tuple <int, UnitType, string>(exponent, UnitType.UT_Custom, unitName));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Add a standard expected type.
 /// </summary>
 /// <param name="exponent">The exponent of the type.</param>
 /// <param name="baseUnitType">The base unit type.</param>
 public void AddExpectedType(int exponent, UnitType baseUnitType)
 {
     ExpectedTypes.Add(new Tuple <int, UnitType, string>(exponent, baseUnitType, null));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Add a custom expected type.
 /// </summary>
 /// <param name="exponent">The exponent of the type.</param>
 /// <param name="unitName">The name of the base unit.</param>
 public void AddCustomExpectedType(int exponent, string unitName)
 {
     ExpectedTypes.Add(new Tuple <int, ForgeTypeId, string>(exponent, SpecTypeId.Custom, unitName));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Add a standard expected type.
 /// </summary>
 /// <param name="exponent">The exponent of the type.</param>
 /// <param name="specTypeId">The spec identifier.</param>
 public void AddExpectedType(int exponent, ForgeTypeId specTypeId)
 {
     ExpectedTypes.Add(new Tuple <int, ForgeTypeId, string>(exponent, specTypeId, null));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Add a custom expected type.
 /// </summary>
 /// <param name="exponent">The exponent of the type.</param>
 /// <param name="unitName">The name of the base unit.</param>
 public void AddCustomExpectedType(int exponent, string unitName)
 {
     ExpectedTypes.Add(Tuple.Create(exponent, SpecTypeId.Custom, unitName));
 }