adapdev-commits Mailing List for Adapdev.NET (Page 29)
Status: Beta
Brought to you by:
intesar66
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(26) |
Apr
(59) |
May
(37) |
Jun
(53) |
Jul
(13) |
Aug
(7) |
Sep
(5) |
Oct
(74) |
Nov
(404) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(10) |
Feb
(26) |
Mar
(64) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sean M. <int...@us...> - 2005-05-13 03:51:37
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10399/src/Adapdev Modified Files: Adapdev.csproj Added Files: ObjectSorter.cs SortableCollectionBase.cs Log Message: Added SortableCollectionBase Changed ObjectComparer to ObjectSorter Updated ProviderInfo to include Oracle Provider Data Types Added some missed sql types that require lengths for sp generation Index: Adapdev.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/Adapdev.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Adapdev.csproj 14 Apr 2005 03:32:08 -0000 1.4 --- Adapdev.csproj 13 May 2005 03:51:27 -0000 1.5 *************** *** 166,169 **** --- 166,174 ---- /> <File + RelPath = "SortableCollectionBase.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Util.cs" SubType = "Code" --- NEW FILE: ObjectSorter.cs --- // Original Copyright (c) 2003 Diego Mijelshon. http://www.codeproject.com/csharp/objectcomparer.asp #region Modified Copyright / License Information /* Copyright 2004 - 2005 Adapdev Technologies, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ============================ Author Log ============================ III Full Name SMM Sean McCormack (Adapdev) ============================ Change Log ============================ III MMDDYY Change */ #endregion using System; using System.Collections; using System.Reflection; namespace Adapdev { [Serializable] public class ObjectSorter : IComparer { #region methods /// <summary> /// Compares two objects and returns a value indicating whether one is less than, equal to or greater than the other. /// </summary> /// <param name="x">First object to compare.</param> /// <param name="y">Second object to compare.</param> /// <returns></returns> public int Compare(object x, object y) { //Get types of the objects Type typex = x.GetType(); Type typey = y.GetType(); for(int i = 0; i<Fields.Length; i++) { //Get each property by name PropertyInfo pix = typex.GetProperty(Fields[i]); PropertyInfo piy = typey.GetProperty(Fields[i]); //Get the value of the property for each object IComparable pvalx = (IComparable)pix.GetValue(x, null); object pvaly = piy.GetValue(y, null); //Compare values, using IComparable interface of the property's type int iResult = pvalx.CompareTo(pvaly); if (iResult != 0) { //Return if not equal if (Descending[i]) { //Invert order return -iResult; } else { return iResult; } } } //Objects have the same sort order return 0; } #endregion #region constructors /// <summary> /// Create a comparer for objects of arbitrary types having using the specified properties /// </summary> /// <param name="fields">Properties to sort objects by</param> public ObjectSorter(params string[] fields) : this(fields, new bool[fields.Length]) {} /// <summary> /// Create a comparer for objects of arbitrary types having using the specified properties and sort order /// </summary> /// <param name="fields">Properties to sort objects by</param> /// <param name="descending">Properties to sort in descending order</param> public ObjectSorter(string[] fields, bool[] descending) { Fields = fields; Descending = descending; } #endregion #region protected fields /// <summary> /// Properties to sort objects by /// </summary> protected string[] Fields; /// <summary> /// Properties to sort in descending order /// </summary> protected bool[] Descending; #endregion } } --- NEW FILE: SortableCollectionBase.cs --- // Copyright 2004 J. Ambrose - http://dotnettemplar.net/PermaLink.aspx?guid=1d32654f-9ed5-46e2-a815-4f70b762f734 using System; using System.Reflection; using System.CodeDom.Compiler; using Microsoft.CSharp; namespace Adapdev.Collections { /// <summary> /// Base class that provides T-SQL-like sorting capabilities. /// </summary> /// <remarks>This class is not thread safe; it depends on the /// underlying collection to remain static during sorting /// operations, therefore, use the <see cref="GetNewView"/> /// methods to get a shallow copy of the collection before /// attempting sort operations if the collection instance /// could be accessed by more than one thread in your /// application.</remarks> public class SortableCollectionBase : System.Collections.CollectionBase { #region Static Caches /// <summary> /// Comparer cache that stores instances of dynamically-created comparers. /// </summary> protected static System.Collections.Hashtable comparers = new System.Collections.Hashtable(100); /// <summary> /// Table for ensuring that we only generate a unique comparer once. /// </summary> protected static System.Collections.Hashtable comparerLocks = new System.Collections.Hashtable(10); /// <summary> /// Assembly path cache that stores the paths to the referenced assemblies /// to be used when compiling dynamically-created comparers. /// </summary> protected static System.Collections.Hashtable assemblyPaths = new System.Collections.Hashtable(10); #endregion #region GetNewView /// <summary> /// Gets a new <see cref="SortableCollectionBase"/> to /// provide a unique view of the underlying collection. /// </summary> /// <overload>Gets a view of the current collection.</overload> /// <returns>A new view of the underlying collection.</returns> /// <remarks>This would typically be used when needing to modify /// the collection for display purposes, such as sorting and the like. /// <p>It performs a shallow copy of the collection.</p></remarks> public SortableCollectionBase GetNewView() { SortableCollectionBase view = new SortableCollectionBase(); for (int i = 0; i < this.List.Count; i++) { view.List.Add(this.List[i]); } return view; } /// <summary> /// Gets a view of the current collection as /// the collection type specified. /// </summary> /// <overload>Gets a view of the current collection.</overload> /// <param name="collectionType">The type of collection to return.</param> /// <returns>A collection of the specified <i>collectionType</i> /// that contains a shallow copy of the items in this collection.</returns> /// <remarks> /// Constraints: A <see cref="NotSupportedException"/> will /// be thrown if any are not met. /// <ul> /// <li>The <i>collectionType</i> must implement a /// default constructor ("new" constraint).</li> /// <li>The <i>collectionType</i> must implement the /// <see cref="System.Collections.IList"/> interface.</li> /// </ul> /// </remarks> public System.Collections.IList GetNewView(System.Type collectionType) { return this.GetNewView(collectionType, null); } /// <summary> /// Gets a view of the current collection, sorted using the given <i>sortExpression</i>. /// </summary> /// <overload>Gets a view of the current collection.</overload> /// <param name="collectionType">The type of collection to return.</param> /// <param name="sortExpression"></param> /// <returns>A collection of the specified <i>collectionType</i> /// that contains a shallow copy of the items in this collection.</returns> /// <remarks> /// Constraints: A <see cref="NotSupportedException"/> will /// be thrown if any are not met. /// <ul> /// <li>The <i>collectionType</i> must implement a /// default constructor ("new" constraint).</li> /// <li>The <i>collectionType</i> must inherit from the /// <see cref="SortableCollectionBase"/> class.</li> /// </ul> /// </remarks> public System.Collections.IList GetNewView(System.Type collectionType, string sortExpression) { System.Reflection.ConstructorInfo ctor; // retrieve the property info for the specified property ctor = collectionType.GetConstructor(new System.Type[0]); if (ctor == null) throw new NotSupportedException( String.Format("The '{0}' type must have a public default constructor.", collectionType.FullName)); // get an instance of the collection type SortableCollectionBase view = ctor.Invoke(new object[] {}) as SortableCollectionBase; if (view == null) throw new NotSupportedException( String.Format("The '{0}' type must inherit from SortableCollectionBase.", collectionType.FullName)); for (int i = 0; i < this.List.Count; i++) view.InnerList.Add(base.List[i]); if (sortExpression != null) view.Sort(sortExpression); return view; } #endregion #region Sort /// <summary> /// Sorts the list by the given expression. /// </summary> /// <param name="sortExpression">A sort expression, e.g., MyProperty ASC, MyProp2 DESC.</param> /// <remarks> /// Valid sort expressions are comma-delimited lists of properties where each property /// can optionally be followed by a sort direction (ASC or DESC).<br /> /// Sort order is from left to right, i.e., properties to the left are sorted on first. /// <p>All properties sorted on must implement <see cref="IComparable"/> and meaningfully /// override <see cref="Object.Equals"/>.</p> /// <p>If <i>sortExpression</i> is null, an <see cref="ArgumentNullException"/> is thrown.<br /> /// If <i>sortExpression</i> is empty, an <see cref="ArgumentException"/> is thrown.<br /> /// Throws an <see cref="ApplicationException"/> if there are errors compiling the comparer /// or if a new instance of a dynamically-created comparer cannot be created /// for any of the sort properties.</p> /// <p>It is assumed that all objects in the collection are of the same type.</p> /// </remarks> public void Sort(string sortExpression) { #region Parameter Checks if (sortExpression == null) throw new ArgumentNullException("sortExpression", "Argument cannot be null."); #endregion this.InnerList.Sort(this.GetMultiComparer(this.List[0].GetType(), sortExpression)); } /// <summary> /// Gets an <see cref="System.Collections.IComparer"/> for the given type and sort expression. /// </summary> /// <param name="type">The type of object to be sorted.</param> /// <param name="sortExpression">A sort expression, e.g., MyProperty ASC, MyProp2 DESC.</param> /// <returns>An <see cref="System.Collections.IComparer"/> for the given type and sort expression.</returns> protected System.Collections.IComparer GetMultiComparer(System.Type type, string sortExpression) { // split the sort expression string by the commas string[] sorts = sortExpression.Split(','); // if no sorts are present, throw an exception if (sorts.Length == 0) throw new ArgumentException("No sorts were passed in the sort expression.", "sortExpression"); string typeName = type.FullName; // create a unique type name for the comparer based on the type and sort expression string comparerName = sortExpression.Replace(",", "").Replace(" ", "") + "Comparer", dynamicTypeName = typeName + "DynamicComparers." + comparerName; System.Collections.IComparer comparer = null; // check the comparers table for an existing comparer for this type and property if (!comparers.ContainsKey(dynamicTypeName)) // not found { object comparerLock; bool generate = false; // let threads pile up here waiting their turn to look at this collection lock (comparerLocks.SyncRoot) { // First, we see if the comparer lock for this // dynamicTypeName exists. comparerLock = comparerLocks[dynamicTypeName]; if (comparerLock == null) { // This is the first thread in here looking for this // dynamicTypeName, so it gets to be the one to // create the comparer for the dynamicTypeName. generate = true; // Add lock object for any future threads to see and // know that they won't need to generate the comparer. comparerLock = new object(); comparerLocks.Add(dynamicTypeName, comparerLock); } } // comparerLock will be unique per dynamicTypeName and, consequently, // per unique comparer. However, the code above only ensures // that only one thread will do the generation of the comparer. // We now need to lock the comparerLock for each dynamicTypeName to // make non generating threads wait on the thread that is doing the // generation, so we ensure that the comparer is generated for all // threads by the time we exit the following block. lock (comparerLock) { // This ensures only that first thread in actually does any generation. if (generate) { // declare the source code for the dynamic assembly string compareCode = @" using System; namespace [TypeName]DynamicComparers { public sealed class [ComparerName] : System.Collections.IComparer { public int Compare(object first, object second) { [TypeName] firstInstance = first as [TypeName]; if (firstInstance == null) throw new ArgumentNullException(""First object cannot be null."", ""first""); [TypeName] secondInstance = second as [TypeName]; if (secondInstance == null) throw new ArgumentNullException(""Second object cannot be null."", ""second""); int result = 0; [CompareCode] } } } "; System.Text.StringBuilder compareBuilder = new System.Text.StringBuilder(); string propertyName; bool desc; for (int sortIndex = 0; sortIndex < sorts.Length; sortIndex++) { // check current sort for null, continue if null if (sorts[sortIndex] == null) continue; // split current sort by space to distinguish property from asc/desc string[] sortValues = sorts[sortIndex].Trim().Split(' '); // if there are no values after split, leave -- should have at least the prop name if (sortValues.Length == 0) continue; // prop name will be first value propertyName = sortValues[0].Trim(); // ensure property exists on specified type PropertyInfo prop = type.GetProperty(propertyName); if (prop == null) throw new ArgumentException( String.Format("Specified property '{0}' is not a property of type '{1}'.", propertyName, type.FullName), "sortExpression"); // if there, the second will be asc/desc; compare to get whether or not this // sort is descending desc = (sortValues.Length > 1) ? (sortValues[1].Trim().ToUpper() == "DESC") : false; // if property type is reference type, we need to do null checking in the compare code bool checkForNull = !prop.PropertyType.IsValueType; // check for null if the property is a reference type if (checkForNull) compareBuilder.Append("\t\t\tif (firstInstance." + propertyName + " != null)\n\t"); // compare the property compareBuilder.Append("\t\t\tresult = firstInstance." + propertyName + ".CompareTo(secondInstance." + propertyName + ");"); // check for null on the second type, if necessary if (checkForNull) { // if second type is also null, return true; otherwise, the first instance is // less than the second because it is null compareBuilder.Append("\t\t\telse if (secondInstance." + propertyName + " == null)\n"); compareBuilder.Append("\t\t\t\tresult = 0; else result = -1;\n"); } // if the two are not equal, no further comparison is needed, just return the // current compare value and flip the sign, if the current sort is descending compareBuilder.Append("\t\t\tif (result !=0) return " + (desc ? "-" : "") + "(result);\n"); } // if all comparisons were equal, we'll need the next line to return that result compareBuilder.Append("\t\t\treturn result;"); // replace the type and comparer name placeholders in the source with real values // and insert the property comparisons compareCode = compareCode.Replace("[TypeName]", typeName).Replace("[ComparerName]", comparerName) .Replace("[CompareCode]", compareBuilder.ToString()); #if TRACE System.Diagnostics.Debug.WriteLine(compareCode); #endif // create a C# compiler instance ICodeCompiler compiler = new CSharpCodeProvider().CreateCompiler(); // create a compiler parameters collection CompilerParameters parameters = new CompilerParameters(); // add necessary assembly references for the source to compile string primeAssemblyPath = type.Assembly.Location.Replace("file:///", "").Replace("/", "\\"); parameters.ReferencedAssemblies.Add(primeAssemblyPath); foreach (System.Reflection.AssemblyName asm in type.Assembly.GetReferencedAssemblies()) parameters.ReferencedAssemblies.Add(this.GetAssemblyPath(asm)); // tell the compiler to generate the IL in memory parameters.GenerateInMemory = true; // compile the new dynamic assembly using the parameters and source from above CompilerResults compiled = compiler.CompileAssemblyFromSource(parameters, compareCode); // check for compiler errors if (compiled.Errors.HasErrors) { // build error message from compiler errors string message = "Could not generate a comparer for '{0}'. Errors:\n"; for (int i = 0; i < compiled.Errors.Count; i++) message += compiled.Errors[i].ErrorText + "\n"; // throw an exception with the relevant information throw new ApplicationException( String.Format(message, dynamicTypeName)); } // get an instance of the new type as IComparer comparer = compiled.CompiledAssembly.CreateInstance(dynamicTypeName) as System.Collections.IComparer; // throw an exception if getting the new instance fails if (comparer == null) throw new ApplicationException( String.Format("Could not instantiate the dynamic type '{0}'.", dynamicTypeName)); // add the new comparer to the comparers table lock (comparers) comparers.Add(dynamicTypeName, comparer); } // (generate) } // comparer lock } // comparers cache check // At this point, we should be sure that a comparer has been generated for the // requested dynamicTypeName and stuck in the cache. If we're the thread that // did the generating, comparer will not be null, and we can just return it. // If comparer hasn't been assigned (via generating it above), get it from the cache. if (comparer == null) { // get the comparer from the cache comparer = comparers[dynamicTypeName] as System.Collections.IComparer; // throw an exception if the comparer cannot be retrieved if (comparer == null) throw new ApplicationException( String.Format("Could not retrieve the dynamic type '{0}'.", dynamicTypeName)); } // return the comparer return comparer; } /// <summary> /// Loads the given assembly to get its path (for dynamic compilation reference). /// </summary> /// <param name="assembly">AssemblyName instance to load assembly from.</param> /// <returns>The path for the given assembly or an empty /// string if it can't load/locate it.</returns> protected string GetAssemblyPath(System.Reflection.AssemblyName assembly) { string assemblyFullName = assembly.FullName; string path = string.Empty; path = (string)assemblyPaths[assemblyFullName]; if (path == null) { lock (assemblyPaths.SyncRoot) { path = (string)assemblyPaths[assemblyFullName]; if (path == null) { System.Reflection.Assembly asm = System.Reflection.Assembly.Load(assembly); if (asm != null) { path = asm.Location.Replace("file:///", "").Replace("/", "\\"); } assemblyPaths.Add(assemblyFullName, path); } } } return path; } #endregion } } |
From: Sean M. <int...@us...> - 2005-05-13 03:51:36
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10399/src/Adapdev.Data/Xml Modified Files: ProviderInfo.xml Log Message: Added SortableCollectionBase Changed ObjectComparer to ObjectSorter Updated ProviderInfo to include Oracle Provider Data Types Added some missed sql types that require lengths for sp generation Index: ProviderInfo.xml =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderInfo.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ProviderInfo.xml 27 Apr 2005 04:36:02 -0000 1.3 --- ProviderInfo.xml 13 May 2005 03:51:27 -0000 1.4 *************** *** 547,551 **** <ProviderInfo Name="oracle"> <Type> ! <Id>1</Id> <Name>CHAR</Name> <Object>String</Object> --- 547,551 ---- <ProviderInfo Name="oracle"> <Type> ! <Id>129</Id> <Name>CHAR</Name> <Object>String</Object> *************** *** 565,569 **** </Type> <Type> ! <Id>3</Id> <Name>VARCHAR2</Name> <Object>String</Object> --- 565,569 ---- </Type> <Type> ! <Id>12</Id> <Name>VARCHAR2</Name> <Object>String</Object> *************** *** 574,578 **** </Type> <Type> ! <Id>4</Id> <Name>NVARCHAR2</Name> <Object>String</Object> --- 574,578 ---- </Type> <Type> ! <Id>202</Id> <Name>NVARCHAR2</Name> <Object>String</Object> *************** *** 583,587 **** </Type> <Type> ! <Id>5</Id> <Name>VARCHAR</Name> <Object>String</Object> --- 583,587 ---- </Type> <Type> ! <Id>200</Id> <Name>VARCHAR</Name> <Object>String</Object> *************** *** 592,605 **** </Type> <Type> ! <Id>6</Id> ! <Name>NVARCHAR</Name> ! <Object>String</Object> ! <Prefix>'</Prefix> ! <Postfix>'</Postfix> ! <Default>""</Default> ! <TestDefault>"test"</TestDefault> ! </Type> ! <Type> ! <Id>7</Id> <Name>LONG</Name> <Object>Int32</Object> --- 592,596 ---- </Type> <Type> ! <Id>201</Id> <Name>LONG</Name> <Object>Int32</Object> *************** *** 610,614 **** </Type> <Type> ! <Id>8</Id> <Name>NUMBER</Name> <Object>Decimal</Object> --- 601,605 ---- </Type> <Type> ! <Id>131</Id> <Name>NUMBER</Name> <Object>Decimal</Object> *************** *** 619,623 **** </Type> <Type> ! <Id>9</Id> <Name>DATE</Name> <Object>DateTime</Object> --- 610,614 ---- </Type> <Type> ! <Id>135</Id> <Name>DATE</Name> <Object>DateTime</Object> *************** *** 673,677 **** </Type> <Type> ! <Id>15</Id> <Name>RAW</Name> <Object>Byte[]</Object> --- 664,668 ---- </Type> <Type> ! <Id>128</Id> <Name>RAW</Name> <Object>Byte[]</Object> *************** *** 682,686 **** </Type> <Type> ! <Id>16</Id> <Name>LONGRAW</Name> <Object>Byte[]</Object> --- 673,677 ---- </Type> <Type> ! <Id>205</Id> <Name>LONGRAW</Name> <Object>Byte[]</Object> *************** *** 700,704 **** </Type> <Type> ! <Id>18</Id> <Name>BLOB</Name> <Object>OracleLob</Object> --- 691,695 ---- </Type> <Type> ! <Id>205</Id> <Name>BLOB</Name> <Object>OracleLob</Object> *************** *** 718,722 **** </Type> <Type> ! <Id>20</Id> <Name>CLOB</Name> <Object>OracleLob</Object> --- 709,713 ---- </Type> <Type> ! <Id>201</Id> <Name>CLOB</Name> <Object>OracleLob</Object> *************** *** 736,740 **** </Type> <Type> ! <Id>22</Id> <Name>FLOAT</Name> <Object>Single</Object> --- 727,731 ---- </Type> <Type> ! <Id>5</Id> <Name>FLOAT</Name> <Object>Single</Object> *************** *** 754,758 **** </Type> <Type> ! <Id>24</Id> <Name>INT32</Name> <Object>Int32</Object> --- 745,749 ---- </Type> <Type> ! <Id>3</Id> <Name>INT32</Name> <Object>Int32</Object> *************** *** 772,776 **** </Type> <Type> ! <Id>26</Id> <Name>NCLOB</Name> <Object>OracleLob</Object> --- 763,767 ---- </Type> <Type> ! <Id>203</Id> <Name>NCLOB</Name> <Object>OracleLob</Object> *************** *** 781,793 **** </Type> <Type> - <Id>27</Id> - <Name>ROWID</Name> - <Object>String</Object> - <Prefix>'</Prefix> - <Postfix>'</Postfix> - <Default>""</Default> - <TestDefault>"rowid"</TestDefault> - </Type> - <Type> <Id>28</Id> <Name>SBYTE</Name> --- 772,775 ---- *************** *** 816,819 **** --- 798,819 ---- <TestDefault>0</TestDefault> </Type> + <Type> + <Id>14</Id> + <Name>DECIMAL</Name> + <Object>Decimal</Object> + <Prefix></Prefix> + <Postfix></Postfix> + <Default>0</Default> + <TestDefault>0.00</TestDefault> + </Type> + <Type> + <Id>131</Id> + <Name>SMALLINT</Name> + <Object>Int32</Object> + <Prefix></Prefix> + <Postfix></Postfix> + <Default>0</Default> + <TestDefault>0</TestDefault> + </Type> </ProviderInfo> <ProviderInfo Name="dbtype_oledb"> |
From: Sean M. <int...@us...> - 2005-05-13 03:51:36
|
Update of /cvsroot/adapdev/Adapdev/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10399/src Modified Files: AdapdevFramework.suo Log Message: Added SortableCollectionBase Changed ObjectComparer to ObjectSorter Updated ProviderInfo to include Oracle Provider Data Types Added some missed sql types that require lengths for sp generation Index: AdapdevFramework.suo =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevFramework.suo,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 Binary files /tmp/cvsJ97zBm and /tmp/cvsVyrmaH differ |
From: Sean M. <int...@us...> - 2005-05-13 03:51:35
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10399/src/Adapdev.Data/Schema Modified Files: SchemaBuilder.cs Log Message: Added SortableCollectionBase Changed ObjectComparer to ObjectSorter Updated ProviderInfo to include Oracle Provider Data Types Added some missed sql types that require lengths for sp generation Index: SchemaBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Schema/SchemaBuilder.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SchemaBuilder.cs 14 Apr 2005 03:43:40 -0000 1.6 --- SchemaBuilder.cs 13 May 2005 03:51:26 -0000 1.7 *************** *** 226,235 **** } /// <summary> ! /// Gets the OleDbConnection.GetOleDbSchemaTable for a specified connection /// </summary> ! /// <param name="oledbConnectionString">The connectoin to use</param> ! /// <param name="guid"></param> ! /// <param name="filter"></param> /// <returns></returns> public static DataTable GetOleDbSchema(string oledbConnectionString, Guid guid, string filterCatalog, string filterSchema, string filterName, string filterType) { --- 226,239 ---- } + /// <summary> ! /// Gets the OLE db schema. /// </summary> ! /// <param name="oledbConnectionString">Oledb connection string.</param> ! /// <param name="guid">GUID.</param> ! /// <param name="filterCatalog">Filter catalog.</param> ! /// <param name="filterSchema">Filter schema.</param> ! /// <param name="filterName">Name of the filter.</param> ! /// <param name="filterType">Filter type.</param> /// <returns></returns> public static DataTable GetOleDbSchema(string oledbConnectionString, Guid guid, string filterCatalog, string filterSchema, string filterName, string filterType) { *************** *** 239,243 **** try { ! schemaTable = conn.GetOleDbSchemaTable(guid, getFilters(guid, filterCatalog, filterSchema, filterName, filterType)); } catch (Exception ex) { if (_callback != null) _callback.AddMessage(ProgressMessageTypes.Critical, "Error obtaining Schema Information: " + ex.Message); --- 243,247 ---- try { ! schemaTable = conn.GetOleDbSchemaTable(guid, GetFilters(guid, filterCatalog, filterSchema, filterName, filterType)); } catch (Exception ex) { if (_callback != null) _callback.AddMessage(ProgressMessageTypes.Critical, "Error obtaining Schema Information: " + ex.Message); *************** *** 247,251 **** } ! private static object[] getFilters(Guid guid, string filterCatalog, string filterSchema, string filterName, string filterType) { // Different OleDbSchemaGuid's require a different number of parameters. // These parameter depend on what we are trying to retirve from the database --- 251,255 ---- } ! private static object[] GetFilters(Guid guid, string filterCatalog, string filterSchema, string filterName, string filterType) { // Different OleDbSchemaGuid's require a different number of parameters. // These parameter depend on what we are trying to retirve from the database |
From: Sean M. <int...@us...> - 2005-05-13 03:51:35
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10399/src/Adapdev.Data.Tests Modified Files: Adapdev.Data.Tests.csproj Log Message: Added SortableCollectionBase Changed ObjectComparer to ObjectSorter Updated ProviderInfo to include Oracle Provider Data Types Added some missed sql types that require lengths for sp generation Index: Adapdev.Data.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests/Adapdev.Data.Tests.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Adapdev.Data.Tests.csproj 14 Apr 2005 03:32:04 -0000 1.4 --- Adapdev.Data.Tests.csproj 13 May 2005 03:51:26 -0000 1.5 *************** *** 111,114 **** --- 111,119 ---- /> <File + RelPath = "ProviderInfoManagerTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SchemaBuilderTest.cs" SubType = "Code" |
From: Sean M. <int...@us...> - 2005-05-13 03:51:34
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10399/src/Adapdev.CodeGen Modified Files: NVelocityTableCodeTemplate.cs Log Message: Added SortableCollectionBase Changed ObjectComparer to ObjectSorter Updated ProviderInfo to include Oracle Provider Data Types Added some missed sql types that require lengths for sp generation Index: NVelocityTableCodeTemplate.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen/NVelocityTableCodeTemplate.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NVelocityTableCodeTemplate.cs 1 May 2005 02:39:28 -0000 1.5 --- NVelocityTableCodeTemplate.cs 13 May 2005 03:51:26 -0000 1.6 *************** *** 316,325 **** switch(c.DataType.ToLower()) { case "char": case "nchar": case "nvarchar": case "varchar": return "(" + c.Length + ")"; - break; } return String.Empty; --- 316,326 ---- switch(c.DataType.ToLower()) { + case "binary": case "char": case "nchar": case "nvarchar": + case "varbinary": case "varchar": return "(" + c.Length + ")"; } return String.Empty; *************** *** 377,389 **** foreach(ColumnSchema cs in al) { ! if(i < al.Count) ! { ! sb.Append(this.GetParameterText(cs) + "," + Environment.NewLine); ! } ! else { ! sb.Append(this.GetParameterText(cs) + Environment.NewLine); } - i++; } return sb.ToString(); --- 378,393 ---- foreach(ColumnSchema cs in al) { ! if(cs.IsActive) { ! if(i < al.Count) ! { ! sb.Append(this.GetParameterText(cs) + "," + Environment.NewLine); ! } ! else ! { ! sb.Append(this.GetParameterText(cs) + Environment.NewLine); ! } ! i++; } } return sb.ToString(); |
From: Sean M. <int...@us...> - 2005-05-01 02:39:38
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14658/src/Adapdev.CodeGen Modified Files: NVelocityTableCodeTemplate.cs Log Message: Fixed issue with .ToOADate() - now works correctly with Sql Server and Access Index: NVelocityTableCodeTemplate.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen/NVelocityTableCodeTemplate.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NVelocityTableCodeTemplate.cs 27 Apr 2005 04:36:02 -0000 1.4 --- NVelocityTableCodeTemplate.cs 1 May 2005 02:39:28 -0000 1.5 *************** *** 300,306 **** /// <param name="c">C.</param> /// <returns></returns> ! public string GetParameterValue(ColumnSchema c) { ! if (c.NetType.Equals("System.DateTime")) return c.Alias + ".Subtract(new TimeSpan(2,0,0,0)).ToOADate()"; else return c.Alias; } --- 300,312 ---- /// <param name="c">C.</param> /// <returns></returns> ! public string GetParameterValue(DatabaseSchema d, ColumnSchema c) { ! if (c.NetType.Equals("System.DateTime")) ! { ! if(d.DatabaseType == Adapdev.Data.DbType.SQLSERVER) ! return c.Alias + ".Subtract(new TimeSpan(2,0,0,0)).ToOADate()"; ! else ! return c.Alias + ".ToOADate()"; ! } else return c.Alias; } |
From: Sean M. <int...@us...> - 2005-04-27 04:52:46
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17852/src/Adapdev.UnitTest.Core Modified Files: TestRunner.cs Log Message: Index: TestRunner.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestRunner.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestRunner.cs 27 Apr 2005 04:36:02 -0000 1.3 --- TestRunner.cs 27 Apr 2005 04:52:33 -0000 1.4 *************** *** 281,285 **** if(test.ExpectedExceptionMessage.Length > 0) { ! if(test.ExpectedExceptionMessage.ToLower() == e.InnerException.Message) { ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown. Message: " + e.InnerException.Message; --- 281,285 ---- if(test.ExpectedExceptionMessage.Length > 0) { ! if(test.ExpectedExceptionMessage.ToLower() == e.InnerException.Message.ToLower()) { ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown. Message: " + e.InnerException.Message; |
From: Sean M. <int...@us...> - 2005-04-27 04:36:14
|
Update of /cvsroot/adapdev/Adapdev/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11385/src Modified Files: AdapdevFramework.suo Log Message: Added stored procedure parameter lengths for appropriate types for Codus Added external config file support for Zanebug Added ExpectedException message support Index: AdapdevFramework.suo =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevFramework.suo,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 Binary files /tmp/cvsYnxQIc and /tmp/cvsUWxeCU differ |
From: Sean M. <int...@us...> - 2005-04-27 04:36:14
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11385/src/Adapdev.Data/Xml Modified Files: ProviderInfo.xml Log Message: Added stored procedure parameter lengths for appropriate types for Codus Added external config file support for Zanebug Added ExpectedException message support Index: ProviderInfo.xml =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderInfo.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProviderInfo.xml 10 Apr 2005 09:59:22 -0000 1.2 --- ProviderInfo.xml 27 Apr 2005 04:36:02 -0000 1.3 *************** *** 1,1383 **** ! <?xml version="1.0" encoding="utf-8"?> <ProvidersInfo xmlns="http://tempuri.org/ProviderInfo.xsd"> ! <ProviderInfo Name="oledb"> ! <Type> ! <Id>20</Id> ! <Name>BigInt</Name> ! <Object>Int64</Object> ! <Prefix> ! </Prefix> ! <Postfix> [...2611 lines suppressed...] ! <Id>23</Id> ! <Name>UInt64</Name> ! <Object>UInt64</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! <Type> ! <Id>24</Id> ! <Name>VarNumeric</Name> ! <Object>VarNumeric</Object> ! <Prefix></Prefix> ! <Postfix></Postfix> ! <Default>0</Default> ! <TestDefault>0</TestDefault> ! </Type> ! </ProviderInfo> </ProvidersInfo> \ No newline at end of file |
From: Sean M. <int...@us...> - 2005-04-27 04:36:14
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11385/src/Adapdev.UnitTest Modified Files: ExpectedExceptionAttribute.cs Log Message: Added stored procedure parameter lengths for appropriate types for Codus Added external config file support for Zanebug Added ExpectedException message support Index: ExpectedExceptionAttribute.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest/ExpectedExceptionAttribute.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ExpectedExceptionAttribute.cs 28 Feb 2005 01:32:19 -0000 1.1.1.1 --- ExpectedExceptionAttribute.cs 27 Apr 2005 04:36:03 -0000 1.2 *************** *** 56,60 **** public sealed class ExpectedExceptionAttribute : Attribute { ! private string expectedException; /// <summary> --- 56,61 ---- public sealed class ExpectedExceptionAttribute : Attribute { ! private string expectedException = String.Empty; ! private string message = String.Empty; /// <summary> *************** *** 66,69 **** --- 67,76 ---- } + public string Message + { + get { return this.message;} + set { this.message = value;} + } + /// <summary> /// Constructor *************** *** 74,77 **** --- 81,90 ---- expectedException = exception.FullName; } + + public ExpectedExceptionAttribute(Type exception, string message) + { + this.expectedException = exception.FullName; + this.message = message; + } } } \ No newline at end of file |
From: Sean M. <int...@us...> - 2005-04-27 04:36:13
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11385/src/Adapdev.UnitTest.Core Modified Files: Test.cs TestAssembly.cs TestFixture.cs TestRunner.cs TestSuiteBuilder.cs Log Message: Added stored procedure parameter lengths for appropriate types for Codus Added external config file support for Zanebug Added ExpectedException message support Index: TestSuiteBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestSuiteBuilder.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestSuiteBuilder.cs 23 Apr 2005 04:54:13 -0000 1.3 --- TestSuiteBuilder.cs 27 Apr 2005 04:36:02 -0000 1.4 *************** *** 300,303 **** --- 300,304 ---- t.ExpectedExceptionType = a.ExceptionType; + t.ExpectedExceptionMessage = a.Message; } else if (TypeHelper.HasCustomAttribute(m, typeof (NUnit.Framework.ExpectedExceptionAttribute))) *************** *** 307,310 **** --- 308,312 ---- t.ExpectedExceptionType = a.ExceptionType.FullName; + t.ExpectedExceptionMessage = a.ExpectedMessage; } return; Index: TestAssembly.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestAssembly.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestAssembly.cs 28 Feb 2005 01:32:21 -0000 1.1.1.1 --- TestAssembly.cs 27 Apr 2005 04:36:02 -0000 1.2 *************** *** 52,55 **** --- 52,56 ---- protected string _location = String.Empty; protected string _original = String.Empty; + protected string _configFile = String.Empty; public TestAssembly() *************** *** 63,66 **** --- 64,73 ---- } + public string ConfigFile + { + get { return _configFile; } + set { _configFile = value; } + } + public string Path { *************** *** 121,125 **** foreach (TestFixture t in this.GetTestFixtures()) { ! count += t.GetTestCount(); } return count*this.RepeatCount; --- 128,135 ---- foreach (TestFixture t in this.GetTestFixtures()) { ! if(t.ShouldRun) ! { ! count += t.GetTestCount(); ! } } return count*this.RepeatCount; Index: TestFixture.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestFixture.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestFixture.cs 28 Feb 2005 01:32:22 -0000 1.1.1.1 --- TestFixture.cs 27 Apr 2005 04:36:02 -0000 1.2 *************** *** 163,167 **** foreach (Test t in this.GetTests()) { ! count += t.GetTestCount(); } return count*this.RepeatCount; --- 163,170 ---- foreach (Test t in this.GetTests()) { ! if(t.ShouldRun) ! { ! count += t.GetTestCount(); ! } } return count*this.RepeatCount; Index: Test.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/Test.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Test.cs 28 Feb 2005 01:32:21 -0000 1.1.1.1 --- Test.cs 27 Apr 2005 04:36:02 -0000 1.2 *************** *** 52,55 **** --- 52,56 ---- protected string _category = ""; protected string _exceptionType = null; + protected string _exceptionMessage = null; protected TestFixture _parent = null; *************** *** 70,73 **** --- 71,80 ---- } + public string ExpectedExceptionMessage + { + get{return this._exceptionMessage;} + set{this._exceptionMessage = value;} + } + public bool IsFixtureSetUp { Index: TestRunner.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestRunner.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestRunner.cs 14 Apr 2005 03:32:05 -0000 1.2 --- TestRunner.cs 27 Apr 2005 04:36:02 -0000 1.3 *************** *** 133,137 **** tar.Location = ta.Location; ! // if(this._debugMode) log.Debug("Running TA " + ta.Name); if(_dispatcher != null) _dispatcher.OnTestAssemblyStarted(new TestAssemblyEventArgs(ta)); --- 133,137 ---- tar.Location = ta.Location; ! if(this._debugMode) log.Debug("Running TA " + ta.Name); if(_dispatcher != null) _dispatcher.OnTestAssemblyStarted(new TestAssemblyEventArgs(ta)); *************** *** 168,172 **** Assembly a = AssemblyCache.Get(tf.Parent.OriginalPath); ! // if(this._debugMode) log.Debug("Running TF " + tf.Name); if(_dispatcher != null)_dispatcher.OnTestFixtureStarted(new TestFixtureEventArgs(tf)); --- 168,172 ---- Assembly a = AssemblyCache.Get(tf.Parent.OriginalPath); ! if(this._debugMode) log.Debug("Running TF " + tf.Name); if(_dispatcher != null)_dispatcher.OnTestFixtureStarted(new TestFixtureEventArgs(tf)); *************** *** 189,193 **** tr.Description = test.Description; ! // if(this._debugMode) log.Debug("Running T " + test.Name); if (!test.Ignore && test.ShouldRun) --- 189,193 ---- tr.Description = test.Description; ! if(this._debugMode) log.Debug("Running T " + test.Name); if (!test.Ignore && test.ShouldRun) *************** *** 279,295 **** if (e.InnerException.GetType().IsSubclassOf(t) || e.InnerException.GetType() == t) { ! ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown. Message: " + e.InnerException.Message; ! ti.ExceptionType = e.InnerException.GetType().FullName; ! ti.FullStackTrace = e.InnerException.StackTrace; ! ti.State = TestState.Pass; ! ti.MemoryUsed = (kEnd - kStart)/1024; } else { ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was NOT thrown. Message: " + e.InnerException.Message; - ti.ExceptionType = e.InnerException.GetType().FullName; - ti.FullStackTrace = e.InnerException.StackTrace; ti.State = TestState.Fail; } } // TODO : Fix incrementing of tests in GUI when IgnoreException is thrown --- 279,305 ---- if (e.InnerException.GetType().IsSubclassOf(t) || e.InnerException.GetType() == t) { ! if(test.ExpectedExceptionMessage.Length > 0) ! { ! if(test.ExpectedExceptionMessage.ToLower() == e.InnerException.Message) ! { ! ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown. Message: " + e.InnerException.Message; ! ti.State = TestState.Pass; ! } ! else ! { ! ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown, but wrong message. Message: " + e.InnerException.Message + " - Expected: " + test.ExpectedExceptionMessage; ! ti.State = TestState.Fail; ! } ! } } else { ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was NOT thrown. Message: " + e.InnerException.Message; ti.State = TestState.Fail; } + ti.ExceptionType = e.InnerException.GetType().FullName; + ti.FullStackTrace = e.InnerException.StackTrace; + ti.MemoryUsed = (kEnd - kStart)/1024; + } // TODO : Fix incrementing of tests in GUI when IgnoreException is thrown |
From: Sean M. <int...@us...> - 2005-04-27 04:36:13
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11385/src/Adapdev.CodeGen Modified Files: NVelocityTableCodeTemplate.cs Log Message: Added stored procedure parameter lengths for appropriate types for Codus Added external config file support for Zanebug Added ExpectedException message support Index: NVelocityTableCodeTemplate.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen/NVelocityTableCodeTemplate.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NVelocityTableCodeTemplate.cs 25 Mar 2005 02:14:28 -0000 1.3 --- NVelocityTableCodeTemplate.cs 27 Apr 2005 04:36:02 -0000 1.4 *************** *** 302,309 **** public string GetParameterValue(ColumnSchema c) { ! if (c.NetType.Equals("System.DateTime")) return c.Alias + ".ToOADate()"; else return c.Alias; } /// <summary> /// Gets or sets the template file. --- 302,328 ---- public string GetParameterValue(ColumnSchema c) { ! if (c.NetType.Equals("System.DateTime")) return c.Alias + ".Subtract(new TimeSpan(2,0,0,0)).ToOADate()"; else return c.Alias; } + public string GetParameterLength(ColumnSchema c) + { + switch(c.DataType.ToLower()) + { + case "char": + case "nchar": + case "nvarchar": + case "varchar": + return "(" + c.Length + ")"; + break; + } + return String.Empty; + } + + public string GetParameterText(ColumnSchema cs) + { + return this.GetParameterName(cs.Name) + " " + cs.DataType.ToLower() + this.GetParameterLength(cs); + } + /// <summary> /// Gets or sets the template file. *************** *** 354,362 **** if(i < al.Count) { ! sb.Append(this.GetParameterName(cs.Name) + " " + cs.DataType.ToLower() + "," + Environment.NewLine); } else { ! sb.Append(this.GetParameterName(cs.Name) + " " + cs.DataType.ToLower() + Environment.NewLine); } i++; --- 373,381 ---- if(i < al.Count) { ! sb.Append(this.GetParameterText(cs) + "," + Environment.NewLine); } else { ! sb.Append(this.GetParameterText(cs) + Environment.NewLine); } i++; *************** *** 375,383 **** if(i < ts.SortedColumns.Count) { ! sb.Append(this.GetParameterName(columnSchema.Name) + " " + columnSchema.DataType.ToLower() + "," + Environment.NewLine); } else { ! sb.Append(this.GetParameterName(columnSchema.Name) + " " + columnSchema.DataType.ToLower() + Environment.NewLine); } } --- 394,402 ---- if(i < ts.SortedColumns.Count) { ! sb.Append(this.GetParameterText(columnSchema) + "," + Environment.NewLine); } else { ! sb.Append(this.GetParameterText(columnSchema) + Environment.NewLine); } } |
From: Sean M. <int...@us...> - 2005-04-24 04:59:20
|
Update of /cvsroot/adapdev/Adapdev/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13773/src Modified Files: AdapdevFramework.suo Log Message: Fixed issue w/ quotes not being recognized for command line args Modified text output format for Zanebug Index: AdapdevFramework.suo =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevFramework.suo,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 Binary files /tmp/cvs1HmAkj and /tmp/cvsaKmKFC differ |
From: Sean M. <int...@us...> - 2005-04-24 04:59:20
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13773/src/Adapdev Modified Files: CommandLineParser.cs CommandLineSwitchRecord.cs Log Message: Fixed issue w/ quotes not being recognized for command line args Modified text output format for Zanebug Index: CommandLineParser.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/CommandLineParser.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CommandLineParser.cs 28 Feb 2005 01:31:36 -0000 1.1.1.1 --- CommandLineParser.cs 24 Apr 2005 04:59:09 -0000 1.2 *************** *** 81,85 **** private void ExtractApplicationName() { ! Regex r = new Regex(@"^(?<commandLine>("".+""|(\S)+))(?<remainder>.+)", RegexOptions.ExplicitCapture); Match m = r.Match(_commandLine); --- 81,85 ---- private void ExtractApplicationName() { ! Regex r = new Regex(@"^(?<commandLine>(""[^\""]+""|(\S)+))(?<remainder>.+)", RegexOptions.ExplicitCapture); Match m = r.Match(_commandLine); Index: CommandLineSwitchRecord.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/CommandLineSwitchRecord.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CommandLineSwitchRecord.cs 28 Feb 2005 01:31:37 -0000 1.1.1.1 --- CommandLineSwitchRecord.cs 24 Apr 2005 04:59:09 -0000 1.2 *************** *** 170,174 **** strPatternEnd = @")(?<value>(\+|-){0,1}))"; else if ( Type == typeof(string) ) ! strPatternEnd = @")(?::|\s+))((?:"")(?<value>.+)(?:"")|(?<value>\S+))"; else if ( Type == typeof(int) ) strPatternEnd = @")(?::|\s+))((?<value>(-|\+)[0-9]+)|(?<value>[0-9]+))"; --- 170,174 ---- strPatternEnd = @")(?<value>(\+|-){0,1}))"; else if ( Type == typeof(string) ) ! strPatternEnd = @")(?::|\s+))((?:"")(?<value>[^\""]+)(?:"")|(?<value>\S+))"; else if ( Type == typeof(int) ) strPatternEnd = @")(?::|\s+))((?<value>(-|\+)[0-9]+)|(?<value>[0-9]+))"; |
From: Sean M. <int...@us...> - 2005-04-24 04:59:20
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13773/src/Adapdev.UnitTest.Core Modified Files: TextFormatter.cs Log Message: Fixed issue w/ quotes not being recognized for command line args Modified text output format for Zanebug Index: TextFormatter.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TextFormatter.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextFormatter.cs 17 Apr 2005 05:42:54 -0000 1.3 --- TextFormatter.cs 24 Apr 2005 04:59:08 -0000 1.4 *************** *** 65,69 **** sb.Append("SUMMARY\r\n"); sb.Append("========================================\r\n"); ! return String.Format("Passed\tFailed\tIgnored:\r\n{0}\t{1}\t{2}\r\n" + "Percent Passed: {3}\r\n", ts.TotalPassed, --- 65,69 ---- sb.Append("SUMMARY\r\n"); sb.Append("========================================\r\n"); ! return String.Format("P\t\tF\t\tI\r\n{0}\t\t{1}\t\t{2}\r\n" + "Percent Passed: {3}\r\n", ts.TotalPassed, |
From: Sean M. <int...@us...> - 2005-04-23 04:54:22
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25984/src/Adapdev Modified Files: AppDomainManager.cs Log Message: Index: AppDomainManager.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/AppDomainManager.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AppDomainManager.cs 28 Feb 2005 01:31:36 -0000 1.1.1.1 --- AppDomainManager.cs 23 Apr 2005 04:54:14 -0000 1.2 *************** *** 40,43 **** --- 40,45 ---- namespace Adapdev { + using log4net; + /// <summary> /// Summary description for Class1. *************** *** 55,58 **** --- 57,63 ---- private string basedir = String.Empty; + // create the logger + private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + /// <summary> /// Creates a new <see cref="AppDomainManager"/> instance. *************** *** 74,78 **** /// </summary> /// <param name="basedir">Basedir.</param> ! /// <param name="domainName">Name of the domain.</param> /// <param name="shadowCopyDirectories">Shadow copy directories.</param> public AppDomainManager(string basedir, string configFile, params string[] shadowCopyDirectories) : this(basedir, "Test", configFile, shadowCopyDirectories){} --- 79,83 ---- /// </summary> /// <param name="basedir">Basedir.</param> ! /// <param name="configFile">Name of the configuration file to use.</param> /// <param name="shadowCopyDirectories">Shadow copy directories.</param> public AppDomainManager(string basedir, string configFile, params string[] shadowCopyDirectories) : this(basedir, "Test", configFile, shadowCopyDirectories){} *************** *** 81,85 **** /// Creates a new <see cref="AppDomainManager"/> instance. /// </summary> ! /// <param name="domainName">Name of the domain.</param> /// <param name="shadowCopyDirectories">Shadow copy directories.</param> public AppDomainManager(string basedir, params string[] shadowCopyDirectories) : this(basedir, "Test", shadowCopyDirectories){} --- 86,90 ---- /// Creates a new <see cref="AppDomainManager"/> instance. /// </summary> ! /// <param name="basedir">The base directory to use.</param> /// <param name="shadowCopyDirectories">Shadow copy directories.</param> public AppDomainManager(string basedir, params string[] shadowCopyDirectories) : this(basedir, "Test", shadowCopyDirectories){} *************** *** 96,99 **** --- 101,106 ---- this.domainType = DomainType.Remote; + if(log.IsDebugEnabled) log.Debug("Loading new AppDomainManager"); + Evidence baseEvidence = AppDomain.CurrentDomain.Evidence; Evidence evidence = new Evidence(baseEvidence); *************** *** 104,107 **** --- 111,121 ---- if(configurationFile.Length > 0) setup.ConfigurationFile = configurationFile; + if(log.IsDebugEnabled) + { + log.Debug("ApplicationBase: " + setup.ApplicationBase); + log.Debug("ApplicationName: " + setup.ApplicationName); + log.Debug("ConfigurationFile: " + setup.ConfigurationFile); + } + if(shadowCopyDirectories != null && shadowCopyDirectories.Length >= 0) { *************** *** 146,149 **** --- 160,164 ---- { string assemblyDirectory = Path.GetDirectoryName( path ); + if(log.IsDebugEnabled)log.Debug("Adding " + path); if(this.domainType == DomainType.Local) *************** *** 199,202 **** --- 214,225 ---- if(!(this.domainName == String.Empty) && !unloaded) { + if(log.IsDebugEnabled) + { + foreach(AssemblyInfo a in this.GetLoadedAssemblies()) + { + log.Debug("Unloading: " + a.Name + " - " + a.Version + " - " + a.Location); + } + } + // Must unload AppDomain first, before you can delete the shadow copy directory AppDomain.Unload(this.domain); *************** *** 208,211 **** --- 231,235 ---- unloaded = true; + if(log.IsDebugEnabled) log.Debug("Domain unloaded."); } } *************** *** 283,287 **** { if(guid.Length > 0) ! return Path.Combine(Path.GetTempPath(),guid); return String.Empty; } --- 307,311 ---- { if(guid.Length > 0) ! return Path.Combine(Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "zanebugcache"),guid); return String.Empty; } *************** *** 318,321 **** --- 342,346 ---- return domain.CreateInstanceAndUnwrap(name, classname); } + } |
From: Sean M. <int...@us...> - 2005-04-23 04:54:22
|
Update of /cvsroot/adapdev/Adapdev/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25984/src Modified Files: AdapdevAssemblyInfo.cs AdapdevFramework.suo Log Message: Index: AdapdevAssemblyInfo.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevAssemblyInfo.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AdapdevAssemblyInfo.cs 14 Apr 2005 03:32:07 -0000 1.3 --- AdapdevAssemblyInfo.cs 23 Apr 2005 04:54:13 -0000 1.4 *************** *** 57,59 **** [assembly: AssemblyKeyFile("..\\..\\..\\adapdev.snk")] [assembly: AssemblyKeyName("")] ! [assembly: log4net.Config.DOMConfigurator(ConfigFileExtension="log4net",Watch=true)] \ No newline at end of file --- 57,59 ---- [assembly: AssemblyKeyFile("..\\..\\..\\adapdev.snk")] [assembly: AssemblyKeyName("")] ! [assembly: log4net.Config.DOMConfigurator(Watch=true)] \ No newline at end of file Index: AdapdevFramework.suo =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevFramework.suo,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 Binary files /tmp/cvsXmgoIS and /tmp/cvs8q3Inq differ |
From: Sean M. <int...@us...> - 2005-04-23 04:54:22
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25984/src/Adapdev.UnitTest.Core Modified Files: LocalTestEngine.cs TestSuiteBuilder.cs Log Message: Index: TestSuiteBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestSuiteBuilder.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestSuiteBuilder.cs 14 Apr 2005 03:32:05 -0000 1.2 --- TestSuiteBuilder.cs 23 Apr 2005 04:54:13 -0000 1.3 *************** *** 65,69 **** ts.AddTestAssembly(this.BuildAssembly(assemblyName)); } ! catch(FileNotFoundException){} } --- 65,72 ---- ts.AddTestAssembly(this.BuildAssembly(assemblyName)); } ! catch(FileNotFoundException) ! { ! log.Error("Assembly couldn't be found: " + assemblyName); ! } } *************** *** 75,78 **** --- 78,82 ---- // set delegate to probe for an assembly when it's not found in the base path AppDomain.CurrentDomain.AssemblyResolve +=new ResolveEventHandler(CurrentDomain_AssemblyResolve); + AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(CurrentDomain_AssemblyLoad); // switch the current directory to the assemblies location *************** *** 96,117 **** // Build the TestAssembly information TestAssembly ta = new TestAssembly(); ! ta.AssemblyName = fi.Name; ! ta.AssemblyFullName = assembly.FullName; ! ta.Name = assembly.GetName().Name; ! ta.Path = assembly.Location; ! ta.Location = fi.DirectoryName; ! ta.OriginalPath = assemblyName; ! ta.Id = id++; ! ! // Build the TestFixtures ! foreach (Type t in assembly.GetExportedTypes()) { ! ta.AddTestFixture(this.BuildTestFixture(t, ta, assembly)); ! } ! // restore the original environment ! Environment.CurrentDirectory = orig; ! // if(this._debugMode) log.Debug(ta.ToString()); return ta; } --- 100,127 ---- // Build the TestAssembly information TestAssembly ta = new TestAssembly(); ! try { ! ta.AssemblyName = fi.Name; ! ta.AssemblyFullName = assembly.FullName; ! ta.Name = assembly.GetName().Name; ! ta.Path = assembly.Location; ! ta.Location = fi.DirectoryName; ! ta.OriginalPath = assemblyName; ! ta.Id = id++; ! // Build the TestFixtures ! foreach (Type t in assembly.GetExportedTypes()) ! { ! ta.AddTestFixture(this.BuildTestFixture(t, ta, assembly)); ! } + // restore the original environment + Environment.CurrentDirectory = orig; + if(log.IsDebugEnabled) log.Debug(ta.ToString()); + } + catch (Exception e) + { + log.Error("Unable to create TestAssembly", e); + } return ta; } *************** *** 124,172 **** ) { ! // Build the TestFixture ! tf = new Adapdev.UnitTest.Core.TestFixture(); ! tf.Parent = ta; ! tf.Class = t.Name; ! tf.Name = t.Name; ! tf.Namespace = t.Namespace; ! tf.FullName = t.FullName; ! tf.Id = id++; ! this.ProcessCommonAttributes(t, tf); ! foreach (MethodInfo mi in t.GetMethods()) ! { ! if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.TestAttribute))) ! { ! tf.AddTest(this.BuildTest(mi, tf)); ! } ! else if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestFixtureSetUpAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.TestFixtureSetUpAttribute))) ! { ! tf.AddFixtureSetUp(this.BuildBaseTestHelper(mi, tf)); ! } ! else if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestFixtureTearDownAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.TestFixtureTearDownAttribute))) ! { ! tf.AddFixtureTearDown(this.BuildBaseTestHelper(mi, tf)); ! } ! else if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestSetUpAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.SetUpAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.SetUpAttribute)) ! ) ! { ! tf.AddTestSetUp(this.BuildTestHelper(mi, tf)); ! } ! else if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestTearDownAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TearDownAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.TearDownAttribute)) ! ) { ! tf.AddTestTearDown(this.BuildTestHelper(mi, tf)); } } } ! // if(this._debugMode) log.Debug(tf.ToString()); return tf; } --- 134,196 ---- ) { ! try ! { ! if(log.IsDebugEnabled) log.Debug("Building TestFixture " + t.FullName); ! // Build the TestFixture ! tf = new Adapdev.UnitTest.Core.TestFixture(); ! tf.Parent = ta; ! tf.Class = t.Name; ! tf.Name = t.Name; ! tf.Namespace = t.Namespace; ! tf.FullName = t.FullName; ! tf.Id = id++; ! this.ProcessCommonAttributes(t, tf); ! foreach (MethodInfo mi in t.GetMethods()) { ! if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.TestAttribute))) ! { ! if(log.IsDebugEnabled) log.Debug("Building Test " + mi.Name); ! tf.AddTest(this.BuildTest(mi, tf)); ! } ! else if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestFixtureSetUpAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.TestFixtureSetUpAttribute))) ! { ! if(log.IsDebugEnabled) log.Debug("Building TestFixtureSetUp " + mi.Name); ! tf.AddFixtureSetUp(this.BuildBaseTestHelper(mi, tf)); ! } ! else if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestFixtureTearDownAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.TestFixtureTearDownAttribute))) ! { ! if(log.IsDebugEnabled) log.Debug("Building TestFixtureTearDown " + mi.Name); ! tf.AddFixtureTearDown(this.BuildBaseTestHelper(mi, tf)); ! } ! else if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestSetUpAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.SetUpAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.SetUpAttribute)) ! ) ! { ! if(log.IsDebugEnabled) log.Debug("Building TestSetUp " + mi.Name); ! tf.AddTestSetUp(this.BuildTestHelper(mi, tf)); ! } ! else if (TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TestTearDownAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (Adapdev.UnitTest.TearDownAttribute)) ! || TypeHelper.HasCustomAttribute(mi, typeof (NUnit.Framework.TearDownAttribute)) ! ) ! { ! if(log.IsDebugEnabled) log.Debug("Building TestTearDown " + mi.Name); ! tf.AddTestTearDown(this.BuildTestHelper(mi, tf)); ! } } + if(log.IsDebugEnabled) log.Debug(tf.ToString()); + } + catch(Exception ex) + { + log.Error("Problem loading TestFixture", ex); } } ! return tf; } *************** *** 186,189 **** --- 210,215 ---- this.ProcessMaxKAttribute(m, t); this.ProcessMinOperationsPerSecondAttribute(m, t); + + if(log.IsDebugEnabled) log.Debug("Test built: " + t.ToString()); return t; } *************** *** 343,352 **** } ! private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { string lostNamespace = args.Name.Split((",").ToCharArray())[0]; string lostAssemblyFilename = Path.Combine(Environment.CurrentDirectory, lostNamespace + ".dll"); ! // if(this._infoMode) log.Info("Searching for: " + lostAssemblyFilename); ! return Assembly.LoadFile(lostAssemblyFilename); } --- 369,382 ---- } ! public Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { string lostNamespace = args.Name.Split((",").ToCharArray())[0]; string lostAssemblyFilename = Path.Combine(Environment.CurrentDirectory, lostNamespace + ".dll"); ! ! if(log.IsInfoEnabled)log.Info("Not found. Trying to resolve " + lostAssemblyFilename); ! Assembly a = Assembly.LoadFile(lostAssemblyFilename); ! if(a != null && log.IsInfoEnabled) log.Info("Found. Loaded " + a.GetName().Name + " - " + a.GetName().Version + " - " + a.Location); ! ! return a; } *************** *** 354,358 **** { AssemblyName assemblyName = assembly.GetName(); ! // if(this._infoMode) log.Info("Probing for: " + assemblyName); if (! dependencyList.Contains(assemblyName.FullName)) { --- 384,388 ---- { AssemblyName assemblyName = assembly.GetName(); ! if(log.IsInfoEnabled) log.Info("Probing for: " + assemblyName); if (! dependencyList.Contains(assemblyName.FullName)) { *************** *** 365,368 **** --- 395,403 ---- } } + + public void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args) + { + if(log.IsInfoEnabled) log.Info("Loading: " + args.LoadedAssembly.FullName); + } } } \ No newline at end of file Index: LocalTestEngine.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/LocalTestEngine.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** LocalTestEngine.cs 28 Feb 2005 01:32:21 -0000 1.1.1.1 --- LocalTestEngine.cs 23 Apr 2005 04:54:13 -0000 1.2 *************** *** 13,24 **** private TestSuite suite; private AppDomainManager manager; ! private string[] assemblies; private TestEventDispatcher dispatcher = null; ! public LocalTestEngine(params string[] assemblies) { manager = new AppDomainManager(); ! manager.AddAssemblies(assemblies); ! this.assemblies = assemblies; } --- 13,24 ---- private TestSuite suite; private AppDomainManager manager; ! private string assembly; private TestEventDispatcher dispatcher = null; ! public LocalTestEngine(string assembly) { manager = new AppDomainManager(); ! manager.AddAssemblies(this.assembly); ! this.assembly = assembly; } *************** *** 26,30 **** { TestRunner tr = new TestRunner(); ! this.suite = tr.BuildSuite(assemblies); if(this.dispatcher != null) tr.SetTestEventDispatcher(this.dispatcher); return tr.Run(suite); --- 26,30 ---- { TestRunner tr = new TestRunner(); ! this.suite = tr.BuildSuite(assembly); if(this.dispatcher != null) tr.SetTestEventDispatcher(this.dispatcher); return tr.Run(suite); *************** *** 48,58 **** { TestSuiteBuilder builder = new TestSuiteBuilder(); ! return builder.BuildAssemblies(this.assemblies); } public TestAssembly GetTestAssembly() { ! // TODO ! return null; } --- 48,58 ---- { TestSuiteBuilder builder = new TestSuiteBuilder(); ! return builder.BuildAssemblies(this.assembly); } public TestAssembly GetTestAssembly() { ! TestSuiteBuilder builder = new TestSuiteBuilder(); ! return builder.BuildAssembly(this.assembly); } |
From: Sean M. <int...@us...> - 2005-04-17 05:43:03
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13986/src/Adapdev.UnitTest.Core Modified Files: TextFormatter.cs Log Message: Index: TextFormatter.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TextFormatter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TextFormatter.cs 14 Apr 2005 03:32:05 -0000 1.2 --- TextFormatter.cs 17 Apr 2005 05:42:54 -0000 1.3 *************** *** 65,75 **** sb.Append("SUMMARY\r\n"); sb.Append("========================================\r\n"); ! return String.Format("Passed / Failed / Ignored: {0} / {1} / {2}\r\n" + ! "Percent Passed / Failed: {3} / {4}\r\n", ts.TotalPassed, ts.TotalFailed, ts.TotalIgnored, ! ts.PercentPassed.ToString("P"), ! ts.PercentFailed.ToString("P")); } --- 65,74 ---- sb.Append("SUMMARY\r\n"); sb.Append("========================================\r\n"); ! return String.Format("Passed\tFailed\tIgnored:\r\n{0}\t{1}\t{2}\r\n" + ! "Percent Passed: {3}\r\n", ts.TotalPassed, ts.TotalFailed, ts.TotalIgnored, ! ts.PercentPassed.ToString("P")); } |
From: Trevor L. <tre...@us...> - 2005-04-14 03:44:20
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3367/src/Adapdev.Data/Schema Modified Files: SchemaBuilder.cs Log Message: Changes to support filtering of Schemas for Oracle Index: SchemaBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Schema/SchemaBuilder.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SchemaBuilder.cs 13 Apr 2005 04:23:41 -0000 1.5 --- SchemaBuilder.cs 14 Apr 2005 03:43:40 -0000 1.6 *************** *** 56,148 **** DataTable schemaTables = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Tables, "",schemaFilter,"",""); DatabaseSchema di = new DatabaseSchema(); ! if (schemaTables.Rows.Count > 0) { ! //TODO: Note sure if this is valid. It does not work for Oracle DB's ! di.Name = schemaTables.Rows[0]["TABLE_CATALOG"].ToString(); ! if (di.Name == String.Empty) di.Name = "Unknown"; ! // Setup the Progress Display if one is defined. ! if (!StartProgress("Building Table Details",schemaTables.Rows.Count,ref recordCount)) return null; ! ! // Build the base schema information ! foreach (DataRow dr in schemaTables.Rows) { ! TableType tableType = TableTypeConverter.Convert(dr["TABLE_TYPE"].ToString()); ! if (tableType == TableType.TABLE || tableType == TableType.VIEW) { ! if (!IncrProgress(dr["TABLE_NAME"].ToString(), ref recordCount)) return null; ! TableSchema ti = CreateTableSchema(dr); ! CreateColumnSchemas(ti, oledbConnectionString, databaseType); ! di.AddTable(ti); } - } ! // Get the primary key information ! DataTable pkeys = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Primary_Keys, "","","",""); ! ! // Setup the Progress Display if one is defined. ! if (!StartProgress("Building Primary Key Details",pkeys.Rows.Count,ref recordCount)) return null; ! foreach (DataRow dr in pkeys.Rows) { ! string pkTable = dr["TABLE_NAME"].ToString(); ! if (!IncrProgress(dr["TABLE_NAME"].ToString(), ref recordCount)) return null; ! TableSchema tip = di[pkTable]; ! if (tip != null) { ! ColumnSchema ci = tip[dr["COLUMN_NAME"].ToString()]; ! if (ci != null) { ! ci.IsPrimaryKey = true; ! tip.AddColumn(ci); } } ! } ! ! // Get the foreign key information ! DataTable fkeys = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Foreign_Keys, "","","",""); ! ! // Setup the Progress Display if one is defined. ! if (!StartProgress("Building Foreign Key Details",fkeys.Rows.Count,ref recordCount)) return null; ! foreach (DataRow dr in fkeys.Rows) { ! string fkTable = dr["FK_TABLE_NAME"].ToString(); ! if (!IncrProgress(dr["FK_TABLE_NAME"].ToString(), ref recordCount)) return null; ! ! TableSchema tif = di[fkTable]; ! if (tif != null) { ! ColumnSchema ci = tif[dr["FK_COLUMN_NAME"].ToString()]; ! if (ci != null) { ! ci.IsForeignKey = true; ! tif.AddColumn(ci); } } - } ! // Setup the Progress Display if one is defined. ! if (!StartProgress("Building Foreign Key Relationships",fkeys.Rows.Count,ref recordCount)) return null; ! ! // Get the foreign key associations ! foreach (DataRow dr in fkeys.Rows) { ! if (!IncrProgress(dr["PK_TABLE_NAME"].ToString(), ref recordCount)) return null; ! // Get the name of the primary key table ! string pkTable = dr["PK_TABLE_NAME"].ToString(); ! // Get the name of the foreign key table ! string fkTable = dr["FK_TABLE_NAME"].ToString(); ! // Get the name of the foreign key column ! string fkColumn = dr["FK_COLUMN_NAME"].ToString(); ! // Get the table containing the primary key ! TableSchema tif = di[pkTable]; ! // Get the table containing the foreign key ! TableSchema fk = di[fkTable]; ! if (tif != null) { ! // Get the primary key ! ColumnSchema ci = tif[dr["PK_COLUMN_NAME"].ToString()]; ! // Get the foreign key ! ColumnSchema cf = fk[fkColumn]; ! if (ci != null) { ! // Add the association to the table and column containing the foreign key ! ci.ForeignKeyTables.Add(new ForeignKeyAssociation(ci, cf ,fk)); } } ! } ! if (!EndProgress("Finished Loading Tables",true)) return null; } else { if (!EndProgress("No database schema information found.",false)) return null; --- 56,149 ---- DataTable schemaTables = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Tables, "",schemaFilter,"",""); DatabaseSchema di = new DatabaseSchema(); ! if (schemaTables != null) { ! if (schemaTables.Rows.Count > 0) { ! //TODO: Note sure if this is valid. It does not work for Oracle DB's ! di.Name = schemaTables.Rows[0]["TABLE_CATALOG"].ToString(); ! if (di.Name == String.Empty) di.Name = "Unknown"; ! // Build the base schema information ! if (!StartProgress("Building Table Details",schemaTables.Rows.Count,ref recordCount)) return null; ! foreach (DataRow dr in schemaTables.Rows) { ! TableType tableType = TableTypeConverter.Convert(dr["TABLE_TYPE"].ToString()); ! if (tableType == TableType.TABLE || tableType == TableType.VIEW) { ! if (!IncrProgress(dr["TABLE_NAME"].ToString(), ref recordCount)) return null; ! TableSchema ti = CreateTableSchema(dr); ! CreateColumnSchemas(ti, oledbConnectionString, databaseType); ! di.AddTable(ti); ! } } ! // Get the primary key information ! DataTable pkeys = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Primary_Keys, "",schemaFilter,"",""); ! if (pkeys != null) { ! if (!StartProgress("Building Primary Key Details",pkeys.Rows.Count,ref recordCount)) return null; ! foreach (DataRow dr in pkeys.Rows) { ! string pkTable = dr["TABLE_NAME"].ToString(); ! if (!IncrProgress(dr["TABLE_NAME"].ToString(), ref recordCount)) return null; ! TableSchema tip = di[pkTable]; ! if (tip != null) { ! ColumnSchema ci = tip[dr["COLUMN_NAME"].ToString()]; ! if (ci != null) { ! ci.IsPrimaryKey = true; ! tip.AddColumn(ci); ! } ! } } } + + // Get the foreign key information + DataTable fkeys = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Foreign_Keys, "",schemaFilter,"",""); + if (fkeys != null) { + if (!StartProgress("Building Foreign Key Details",fkeys.Rows.Count,ref recordCount)) return null; + foreach (DataRow dr in fkeys.Rows) { + string fkTable = dr["FK_TABLE_NAME"].ToString(); + if (!IncrProgress(dr["FK_TABLE_NAME"].ToString(), ref recordCount)) return null; ! TableSchema tif = di[fkTable]; ! if (tif != null) { ! ColumnSchema ci = tif[dr["FK_COLUMN_NAME"].ToString()]; ! if (ci != null) { ! ci.IsForeignKey = true; ! tif.AddColumn(ci); ! } ! } } } ! // Setup the Progress Display if one is defined. ! if (fkeys != null) { ! if (!StartProgress("Building Foreign Key Relationships",fkeys.Rows.Count,ref recordCount)) return null; ! foreach (DataRow dr in fkeys.Rows) { ! if (!IncrProgress(dr["PK_TABLE_NAME"].ToString(), ref recordCount)) return null; ! // Get the name of the primary key table ! string pkTable = dr["PK_TABLE_NAME"].ToString(); ! // Get the name of the foreign key table ! string fkTable = dr["FK_TABLE_NAME"].ToString(); ! // Get the name of the foreign key column ! string fkColumn = dr["FK_COLUMN_NAME"].ToString(); ! // Get the table containing the primary key ! TableSchema tif = di[pkTable]; ! // Get the table containing the foreign key ! TableSchema fk = di[fkTable]; ! if (tif != null) { ! // Get the primary key ! ColumnSchema ci = tif[dr["PK_COLUMN_NAME"].ToString()]; ! // Get the foreign key ! ColumnSchema cf = fk[fkColumn]; ! if (ci != null) { ! // Add the association to the table and column containing the foreign key ! ci.ForeignKeyTables.Add(new ForeignKeyAssociation(ci, cf ,fk)); ! } ! } } } ! if (!EndProgress("Finished Loading Tables",true)) return null; ! } else { ! if (!EndProgress("No database schema information found.",false)) return null; ! } } else { if (!EndProgress("No database schema information found.",false)) return null; *************** *** 220,224 **** } catch (Exception ex) { schemaTable = null; ! if (_callback != null) _callback.AddMessage(ProgressMessageTypes.Warning, "Could not load Column information for " + tableName); } return schemaTable; --- 221,225 ---- } catch (Exception ex) { schemaTable = null; ! if (_callback != null) _callback.AddMessage(ProgressMessageTypes.Warning, "Could not load Column information for " + tableName + ". " + ex.Message); } return schemaTable; *************** *** 237,257 **** conn.Open(); - // Note: the Object parameters are as follows: - // TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE try { ! object[] filters = new object[] { ! filterCatalog == string.Empty ? null : filterCatalog, ! filterSchema == string.Empty ? null : filterSchema, ! filterName == string.Empty ? null : filterName, ! filterType == string.Empty ? null : filterType ! }; ! ! if (filters[0]==null && filters[1]==null && filters[2]==null && filters[3]==null) { ! schemaTable = conn.GetOleDbSchemaTable(guid, null); ! } else { ! schemaTable = conn.GetOleDbSchemaTable(guid, filters); ! } } catch (Exception ex) { ! Console.WriteLine(ex.Message); } conn.Close(); --- 238,245 ---- conn.Open(); try { ! schemaTable = conn.GetOleDbSchemaTable(guid, getFilters(guid, filterCatalog, filterSchema, filterName, filterType)); } catch (Exception ex) { ! if (_callback != null) _callback.AddMessage(ProgressMessageTypes.Critical, "Error obtaining Schema Information: " + ex.Message); } conn.Close(); *************** *** 259,262 **** --- 247,269 ---- } + private static object[] getFilters(Guid guid, string filterCatalog, string filterSchema, string filterName, string filterType) { + // Different OleDbSchemaGuid's require a different number of parameters. + // These parameter depend on what we are trying to retirve from the database + // so this function returns the correct parameter sets. + // This should be a Switch statement, but the compiler did not like it. + + filterCatalog = filterCatalog == string.Empty ? null : filterCatalog; + filterSchema = filterSchema == string.Empty ? null : filterSchema; + filterName = filterName == string.Empty ? null : filterName; + filterType = filterType == string.Empty ? null : filterType; + + if (guid.Equals(OleDbSchemaGuid.Tables)) return new object[] {filterCatalog, filterSchema, filterName, filterType}; + if (guid.Equals(OleDbSchemaGuid.Views)) return new object[] {filterCatalog, filterSchema, filterName}; + if (guid.Equals(OleDbSchemaGuid.Primary_Keys)) return new object[] {filterCatalog, filterSchema, filterName}; + if (guid.Equals(OleDbSchemaGuid.Foreign_Keys)) return new object[] {filterCatalog, filterSchema, filterName, filterCatalog, filterSchema, filterName}; + if (guid.Equals(OleDbSchemaGuid.Columns)) return new object[] {filterCatalog, filterSchema, filterName, string.Empty}; + return null; + } + public static StringBuilder PrintOleDbSchema(string oledbConnection, Guid guid, string filter) { *************** *** 286,294 **** private static bool StartProgress (string message, int max, ref int stepto) { ! if (_callback != null) { ! if (_callback.IsAborting) return false; ! _callback.SetText(message,""); ! _callback.SetRange(0, max); ! _callback.StepTo(stepto = 0); } return true; --- 293,303 ---- private static bool StartProgress (string message, int max, ref int stepto) { ! if (max > 0) { ! if (_callback != null) { ! if (_callback.IsAborting) return false; ! _callback.SetText(message,""); ! _callback.SetRange(0, max); ! _callback.StepTo(stepto = 0); ! } } return true; |
From: Trevor L. <tre...@us...> - 2005-04-14 03:44:20
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Sql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3367/src/Adapdev.Data/Sql Modified Files: QueryHelper.cs Log Message: Changes to support filtering of Schemas for Oracle Index: QueryHelper.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Sql/QueryHelper.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** QueryHelper.cs 10 Apr 2005 09:59:21 -0000 1.2 --- QueryHelper.cs 14 Apr 2005 03:43:41 -0000 1.3 *************** *** 157,160 **** --- 157,165 ---- } + public static string GetOracleLastInsertedCommand(string table, string column) { + string s = "SELECT MAX([" + column + "]) FROM " + table + ";"; + Console.WriteLine(s); + return s; + } } } \ No newline at end of file |
From: Trevor L. <tre...@us...> - 2005-04-14 03:43:55
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3367/src/Adapdev.Windows.Forms Modified Files: DatabaseWizard.cs DatabaseWizard.resx SmoothProgressBar.cs Log Message: Changes to support filtering of Schemas for Oracle Index: DatabaseWizard.resx =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/DatabaseWizard.resx,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DatabaseWizard.resx 13 Apr 2005 04:23:42 -0000 1.3 --- DatabaseWizard.resx 14 Apr 2005 03:43:43 -0000 1.4 *************** *** 125,131 **** <value>Private</value> </data> - <data name="btnNewDatabase.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> <data name="btnNewDatabase.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> --- 125,128 ---- *************** *** 134,137 **** --- 131,137 ---- <value>Private</value> </data> + <data name="btnNewDatabase.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> <data name="btnTestConnection.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> *************** *** 242,254 **** <value>Private</value> </data> ! <data name="tbLocation.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> ! <data name="tbLocation.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> <data name="tbLocation.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> <data name="btnOpenFile.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> --- 242,272 ---- <value>Private</value> </data> ! <data name="tbFilter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> ! <data name="tbFilter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> ! <value>Private</value> ! </data> ! <data name="tbFilter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> ! <value>False</value> ! </data> ! <data name="lblFilter.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> + <data name="lblFilter.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="lblFilter.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> <data name="tbLocation.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> </data> + <data name="tbLocation.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="tbLocation.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> <data name="btnOpenFile.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> Index: SmoothProgressBar.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/SmoothProgressBar.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SmoothProgressBar.cs 28 Feb 2005 01:32:46 -0000 1.1.1.1 --- SmoothProgressBar.cs 14 Apr 2005 03:43:43 -0000 1.2 *************** *** 239,242 **** --- 239,246 ---- } + public void Increment( int value ) { + this.val = this.val + value; + } + public Color ProgressBarColor { Index: DatabaseWizard.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/DatabaseWizard.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DatabaseWizard.cs 13 Apr 2005 04:23:42 -0000 1.3 --- DatabaseWizard.cs 14 Apr 2005 03:43:43 -0000 1.4 *************** *** 42,45 **** --- 42,47 ---- private DbConnectionProvider _connectionProvider = null; + private System.Windows.Forms.Label lblFilter; + private System.Windows.Forms.TextBox tbFilter; private ProviderConfig _providersConfig = new ProviderConfig(); *************** *** 48,52 **** InitializeComponent(); this.BuildConnectionsTree(this.tvConnectionTypes); ! this.SetGUIProperties(DbConnectionTypes.UnknownConnectionType()); // TODO: Add any initialization after the InitializeComponent call --- 50,54 ---- InitializeComponent(); this.BuildConnectionsTree(this.tvConnectionTypes); ! this.SetGUIProperties(null); // TODO: Add any initialization after the InitializeComponent call *************** *** 80,83 **** --- 82,87 ---- this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.tbFilter = new System.Windows.Forms.TextBox(); + this.lblFilter = new System.Windows.Forms.Label(); this.tbLocation = new System.Windows.Forms.TextBox(); this.btnOpenFile = new System.Windows.Forms.Button(); *************** *** 107,114 **** this.tbConnectionString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); ! this.tbConnectionString.Location = new System.Drawing.Point(112, 224); this.tbConnectionString.Name = "tbConnectionString"; this.tbConnectionString.ReadOnly = true; ! this.tbConnectionString.Size = new System.Drawing.Size(416, 20); this.tbConnectionString.TabIndex = 5; this.tbConnectionString.Text = ""; --- 111,118 ---- this.tbConnectionString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); ! this.tbConnectionString.Location = new System.Drawing.Point(112, 256); this.tbConnectionString.Name = "tbConnectionString"; this.tbConnectionString.ReadOnly = true; ! this.tbConnectionString.Size = new System.Drawing.Size(424, 20); this.tbConnectionString.TabIndex = 5; this.tbConnectionString.Text = ""; *************** *** 117,121 **** // this.lblConnection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); ! this.lblConnection.Location = new System.Drawing.Point(8, 224); this.lblConnection.Name = "lblConnection"; this.lblConnection.Size = new System.Drawing.Size(104, 23); --- 121,125 ---- // this.lblConnection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); ! this.lblConnection.Location = new System.Drawing.Point(8, 256); this.lblConnection.Name = "lblConnection"; this.lblConnection.Size = new System.Drawing.Size(104, 23); *************** *** 127,131 **** // this.btnNewDatabase.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); ! this.btnNewDatabase.Location = new System.Drawing.Point(112, 248); this.btnNewDatabase.Name = "btnNewDatabase"; this.btnNewDatabase.Size = new System.Drawing.Size(56, 23); --- 131,135 ---- // this.btnNewDatabase.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); ! this.btnNewDatabase.Location = new System.Drawing.Point(112, 280); this.btnNewDatabase.Name = "btnNewDatabase"; this.btnNewDatabase.Size = new System.Drawing.Size(56, 23); *************** *** 137,141 **** // this.btnTestConnection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); ! this.btnTestConnection.Location = new System.Drawing.Point(176, 248); this.btnTestConnection.Name = "btnTestConnection"; this.btnTestConnection.Size = new System.Drawing.Size(96, 23); --- 141,145 ---- // this.btnTestConnection.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); ! this.btnTestConnection.Location = new System.Drawing.Point(176, 280); this.btnTestConnection.Name = "btnTestConnection"; this.btnTestConnection.Size = new System.Drawing.Size(96, 23); *************** *** 155,158 **** --- 159,164 ---- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.tbFilter); + this.groupBox1.Controls.Add(this.lblFilter); this.groupBox1.Controls.Add(this.tbLocation); this.groupBox1.Controls.Add(this.btnOpenFile); *************** *** 167,175 **** this.groupBox1.Location = new System.Drawing.Point(248, 64); this.groupBox1.Name = "groupBox1"; ! this.groupBox1.Size = new System.Drawing.Size(280, 152); this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; this.groupBox1.Text = "Enter the Database Properties"; // // tbLocation // --- 173,200 ---- this.groupBox1.Location = new System.Drawing.Point(248, 64); this.groupBox1.Name = "groupBox1"; ! this.groupBox1.Size = new System.Drawing.Size(288, 184); this.groupBox1.TabIndex = 3; this.groupBox1.TabStop = false; this.groupBox1.Text = "Enter the Database Properties"; // + // tbFilter + // + this.tbFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbFilter.Location = new System.Drawing.Point(112, 152); + this.tbFilter.Name = "tbFilter"; + this.tbFilter.Size = new System.Drawing.Size(136, 20); + this.tbFilter.TabIndex = 12; + this.tbFilter.Text = ""; + this.tbFilter.TextChanged += new System.EventHandler(this.tbFilter_TextChanged); + // + // lblFilter + // + this.lblFilter.Location = new System.Drawing.Point(8, 152); + this.lblFilter.Name = "lblFilter"; + this.lblFilter.TabIndex = 11; + this.lblFilter.Text = "Schema Filter:"; + this.lblFilter.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // // tbLocation // *************** *** 178,184 **** this.tbLocation.Location = new System.Drawing.Point(112, 24); this.tbLocation.Name = "tbLocation"; ! this.tbLocation.Size = new System.Drawing.Size(128, 20); this.tbLocation.TabIndex = 3; this.tbLocation.Text = ""; // // btnOpenFile --- 203,210 ---- this.tbLocation.Location = new System.Drawing.Point(112, 24); this.tbLocation.Name = "tbLocation"; ! this.tbLocation.Size = new System.Drawing.Size(136, 20); this.tbLocation.TabIndex = 3; this.tbLocation.Text = ""; + this.tbLocation.TextChanged += new System.EventHandler(this.tbLocation_TextChanged); // // btnOpenFile *************** *** 205,211 **** this.tbName.Location = new System.Drawing.Point(112, 56); this.tbName.Name = "tbName"; ! this.tbName.Size = new System.Drawing.Size(128, 20); this.tbName.TabIndex = 6; this.tbName.Text = ""; // // lblPassword --- 231,238 ---- this.tbName.Location = new System.Drawing.Point(112, 56); this.tbName.Name = "tbName"; ! this.tbName.Size = new System.Drawing.Size(136, 20); this.tbName.TabIndex = 6; this.tbName.Text = ""; + this.tbName.TextChanged += new System.EventHandler(this.tbName_TextChanged); // // lblPassword *************** *** 239,245 **** this.tbPassword.Location = new System.Drawing.Point(112, 120); this.tbPassword.Name = "tbPassword"; ! this.tbPassword.Size = new System.Drawing.Size(128, 20); this.tbPassword.TabIndex = 10; this.tbPassword.Text = ""; // // tbUsername --- 266,273 ---- this.tbPassword.Location = new System.Drawing.Point(112, 120); this.tbPassword.Name = "tbPassword"; ! this.tbPassword.Size = new System.Drawing.Size(136, 20); this.tbPassword.TabIndex = 10; this.tbPassword.Text = ""; + this.tbPassword.TextChanged += new System.EventHandler(this.tbPassword_TextChanged); // // tbUsername *************** *** 249,255 **** this.tbUsername.Location = new System.Drawing.Point(112, 88); this.tbUsername.Name = "tbUsername"; ! this.tbUsername.Size = new System.Drawing.Size(128, 20); this.tbUsername.TabIndex = 8; this.tbUsername.Text = ""; // // groupBox2 --- 277,284 ---- this.tbUsername.Location = new System.Drawing.Point(112, 88); this.tbUsername.Name = "tbUsername"; ! this.tbUsername.Size = new System.Drawing.Size(136, 20); this.tbUsername.TabIndex = 8; this.tbUsername.Text = ""; + this.tbUsername.TextChanged += new System.EventHandler(this.tbUsername_TextChanged); // // groupBox2 *************** *** 261,265 **** this.groupBox2.Location = new System.Drawing.Point(248, 8); this.groupBox2.Name = "groupBox2"; ! this.groupBox2.Size = new System.Drawing.Size(280, 48); this.groupBox2.TabIndex = 44; this.groupBox2.TabStop = false; --- 290,294 ---- this.groupBox2.Location = new System.Drawing.Point(248, 8); this.groupBox2.Name = "groupBox2"; ! this.groupBox2.Size = new System.Drawing.Size(288, 48); this.groupBox2.TabIndex = 44; this.groupBox2.TabStop = false; *************** *** 272,276 **** this.tbConnectionName.Location = new System.Drawing.Point(112, 16); this.tbConnectionName.Name = "tbConnectionName"; ! this.tbConnectionName.Size = new System.Drawing.Size(160, 20); this.tbConnectionName.TabIndex = 1; this.tbConnectionName.Text = ""; --- 301,305 ---- this.tbConnectionName.Location = new System.Drawing.Point(112, 16); this.tbConnectionName.Name = "tbConnectionName"; ! this.tbConnectionName.Size = new System.Drawing.Size(168, 20); this.tbConnectionName.TabIndex = 1; this.tbConnectionName.Text = ""; *************** *** 291,297 **** | System.Windows.Forms.AnchorStyles.Right))); this.groupBox3.Controls.Add(this.tvConnectionTypes); ! this.groupBox3.Location = new System.Drawing.Point(8, 8); this.groupBox3.Name = "groupBox3"; ! this.groupBox3.Size = new System.Drawing.Size(232, 208); this.groupBox3.TabIndex = 45; this.groupBox3.TabStop = false; --- 320,326 ---- | System.Windows.Forms.AnchorStyles.Right))); this.groupBox3.Controls.Add(this.tvConnectionTypes); ! this.groupBox3.Location = new System.Drawing.Point(0, 8); this.groupBox3.Name = "groupBox3"; ! this.groupBox3.Size = new System.Drawing.Size(240, 240); this.groupBox3.TabIndex = 45; this.groupBox3.TabStop = false; *************** *** 309,313 **** this.tvConnectionTypes.Name = "tvConnectionTypes"; this.tvConnectionTypes.SelectedImageIndex = 1; ! this.tvConnectionTypes.Size = new System.Drawing.Size(216, 176); this.tvConnectionTypes.TabIndex = 1; this.tvConnectionTypes.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvConnectionTypes_AfterSelect); --- 338,342 ---- this.tvConnectionTypes.Name = "tvConnectionTypes"; this.tvConnectionTypes.SelectedImageIndex = 1; ! this.tvConnectionTypes.Size = new System.Drawing.Size(224, 208); this.tvConnectionTypes.TabIndex = 1; this.tvConnectionTypes.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvConnectionTypes_AfterSelect); *************** *** 323,327 **** this.Controls.Add(this.groupBox2); this.Name = "DatabaseWizard"; ! this.Size = new System.Drawing.Size(536, 272); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); --- 352,356 ---- this.Controls.Add(this.groupBox2); this.Name = "DatabaseWizard"; ! this.Size = new System.Drawing.Size(536, 304); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); *************** *** 353,356 **** --- 382,390 ---- } + public string Filter { + get { return this.tbFilter.Text; } + set { this.tbFilter.Text = value; } + } + public string ConnectionName { get { return this.tbConnectionName.Text; } *************** *** 358,361 **** --- 392,399 ---- } + public TextBox ConnectionControl { + get { return this.tbConnectionName; } + } + public TreeView TypesTreeView { get { return this.tvConnectionTypes; } *************** *** 379,387 **** private void btnTestConnection_Click(object sender, System.EventArgs e) { ! this.btnTestConnection.Enabled = false; ! if (this.TestConnection()) { ! MessageBox.Show(this, "Successfully connected!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); ! } ! this.btnTestConnection.Enabled = true; } --- 417,421 ---- private void btnTestConnection_Click(object sender, System.EventArgs e) { ! TestConnection(); } *************** *** 392,437 **** this.tbPassword.Text = ""; this.tbUsername.Text = ""; } #endregion #region Form KeyPress Handlers ! private void tbLocation_KeyPress(object sender, KeyPressEventArgs e) { ! this.DatabasePropertiesUC_KeyPress(sender, e); ! this.OnKeyPress(e); ! } ! private void DatabasePropertiesUC_KeyPress(object sender, KeyPressEventArgs e) { ! } ! ! private void tbUsername_KeyPress(object sender, KeyPressEventArgs e) { ! this.DatabasePropertiesUC_KeyPress(sender, e); ! this.OnKeyPress(e); ! } ! ! private void tbPassword_KeyPress(object sender, KeyPressEventArgs e) { ! this.DatabasePropertiesUC_KeyPress(sender, e); ! this.OnKeyPress(e); } ! private void tbName_KeyPress(object sender, KeyPressEventArgs e) { ! this.DatabasePropertiesUC_KeyPress(sender, e); ! this.OnKeyPress(e); } ! private void tbLocation_KeyUp(object sender, KeyEventArgs e) { ! this.OnKeyUp(e); } ! private void tbName_KeyUp(object sender, KeyEventArgs e) { ! this.OnKeyUp(e); } ! private void tbUsername_KeyUp(object sender, KeyEventArgs e) { ! this.OnKeyUp(e); } ! private void tbPassword_KeyUp(object sender, KeyEventArgs e) { ! this.OnKeyUp(e); ! } ! private void tbConnectionName_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) { } #endregion --- 426,456 ---- this.tbPassword.Text = ""; this.tbUsername.Text = ""; + this.tbFilter.Text = ""; } #endregion #region Form KeyPress Handlers ! private void DatabasePropertiesUC_TextChanged(object sender, System.EventArgs e) { ! this.tbConnectionString.Text = GetConnectionString(); } ! private void tbLocation_TextChanged(object sender, System.EventArgs e) { ! this.DatabasePropertiesUC_TextChanged(sender, e); } ! private void tbUsername_TextChanged(object sender, System.EventArgs e) { ! this.DatabasePropertiesUC_TextChanged(sender, e); } ! private void tbPassword_TextChanged(object sender, System.EventArgs e) { ! this.DatabasePropertiesUC_TextChanged(sender, e); } ! private void tbFilter_TextChanged(object sender, System.EventArgs e) { ! this.DatabasePropertiesUC_TextChanged(sender, e); } ! private void tbName_TextChanged(object sender, System.EventArgs e) { ! this.DatabasePropertiesUC_TextChanged(sender, e); } #endregion *************** *** 443,447 **** /// </summary> /// <returns>true if we can connect</returns> ! public bool TestConnection() { bool validSelected = false; bool validInternal = false; --- 462,480 ---- /// </summary> /// <returns>true if we can connect</returns> ! /// ! ! public void TestConnection() { ! this.btnTestConnection.Enabled = false; ! if (this.TestConnections()) { ! MessageBox.Show(this, "Successfully connected!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information); ! } ! this.btnTestConnection.Enabled = true; ! } ! ! /// <summary> ! /// This routine actually does the work of testing the Main and INternal connection methods. ! /// </summary> ! /// <returns>true if both connections were sucessfull</returns> ! public bool TestConnections() { bool validSelected = false; bool validInternal = false; *************** *** 483,490 **** public void SetDatabaseSetting(DatabaseSetting settings) { this.ConnectionName = settings.ConnectionName; ! this.DbLocation = settings.DatabaseLocation; ! this.DbName = settings.DatabaseName; ! this.Password = settings.Password; ! this.Username = settings.UserName; try { --- 516,524 ---- public void SetDatabaseSetting(DatabaseSetting settings) { this.ConnectionName = settings.ConnectionName; ! this.DbLocation = settings.DatabaseLocation; ! this.DbName = settings.DatabaseName; ! this.Password = settings.Password; ! this.Username = settings.UserName; ! this.Filter = settings.Filter; try { *************** *** 498,513 **** public DatabaseSetting GetDatabaseSetting() { ! DatabaseSetting ds = new DatabaseSetting(); ! ds.ConnectionName = this.ConnectionName; ds.DatabaseLocation = this.DbLocation; ! ds.DatabaseName = this.DbName; ! ds.Password = this.Password; ! ds.UserName = this.Username; ds.ConnectionString = this.GetConnectionString(); ds.OleDbConnectionString = this.GetInternalProviderConnectionString(); ! ds.DbProviderType = _connectionProvider.ProviderType; ! ds.DbType = _connectionProvider.DbType; ! ds.ConnectionRef = _connectionProvider.Parent.Name; ! ds.ProviderRef = _connectionProvider.Name; return ds; } --- 532,548 ---- public DatabaseSetting GetDatabaseSetting() { ! DatabaseSetting ds = new DatabaseSetting(); ! ds.ConnectionName = this.ConnectionName; ds.DatabaseLocation = this.DbLocation; ! ds.DatabaseName = this.DbName; ! ds.Password = this.Password; ! ds.UserName = this.Username; ! ds.Filter = this.Filter; ds.ConnectionString = this.GetConnectionString(); ds.OleDbConnectionString = this.GetInternalProviderConnectionString(); ! ds.DbProviderType = _connectionProvider.ProviderType; ! ds.DbType = _connectionProvider.DbType; ! ds.ConnectionRef = _connectionProvider.Parent.Name; ! ds.ProviderRef = _connectionProvider.Name; return ds; } *************** *** 576,579 **** --- 611,615 ---- if (obj == null) { _connectionProvider = null; + SetGUIProperties (null); } else { _connectionProvider = obj as DbConnectionProvider; *************** *** 595,598 **** --- 631,635 ---- SetPromptState(connectionType.SupportsUserID, this.lblUsername, this.tbUsername); SetPromptState(connectionType.SupportsPassword, this.lblPassword, this.tbPassword); + SetPromptState(connectionType.SupportsFilter, this.lblFilter, this.tbFilter); this.tbConnectionString.Text = GetConnectionString(); *************** *** 609,612 **** --- 646,650 ---- SetPromptState (state, this.lblUsername, this.tbUsername); SetPromptState (state, this.lblPassword, this.tbPassword); + SetPromptState (state, this.lblFilter, this.tbFilter); this.btnTestConnection.Enabled = state; *************** *** 633,641 **** text.Enabled = state; label.Enabled = state; - if (!state) text.Text = ""; } #endregion - } } --- 671,677 ---- |
From: Trevor L. <tre...@us...> - 2005-04-14 03:43:53
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/Progress In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3367/src/Adapdev.Windows.Forms/Progress Modified Files: ProgressWindow.cs ProgressWindow.resx Log Message: Changes to support filtering of Schemas for Oracle Index: ProgressWindow.resx =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/Progress/ProgressWindow.resx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProgressWindow.resx 12 Apr 2005 10:23:01 -0000 1.1 --- ProgressWindow.resx 14 Apr 2005 03:43:44 -0000 1.2 *************** *** 98,110 **** <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <data name="progressBar.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> - <data name="progressBar.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> - <data name="progressBar.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>Private</value> - </data> <data name="txtMessage1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> --- 98,101 ---- *************** *** 234,237 **** --- 225,237 ---- <value>Private</value> </data> + <data name="progressBar.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="progressBar.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="progressBar.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> *************** *** 249,252 **** --- 249,255 ---- <value>8, 8</value> </data> + <data name="$this.Name"> + <value>ProgressWindow</value> + </data> <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> *************** *** 258,264 **** <value>True</value> </data> - <data name="$this.Name"> - <value>ProgressWindow</value> - </data> <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Private</value> --- 261,264 ---- Index: ProgressWindow.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/Progress/ProgressWindow.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProgressWindow.cs 12 Apr 2005 10:23:01 -0000 1.1 --- ProgressWindow.cs 14 Apr 2005 03:43:44 -0000 1.2 *************** *** 5,8 **** --- 5,9 ---- using System; + using System.Drawing; using System.Windows.Forms; *************** *** 14,18 **** public class ProgressWindow : System.Windows.Forms.Form, IProgressCallback { - private System.Windows.Forms.ProgressBar progressBar; private System.ComponentModel.IContainer components; --- 15,18 ---- *************** *** 41,47 **** --- 41,50 ---- private int totalErrors = 0; + private bool firstMsg = true; + private System.Windows.Forms.Label txtMessage1; private System.Windows.Forms.ListView listView; private System.Windows.Forms.ColumnHeader ColumnHeader1; + private Adapdev.Windows.Forms.SmoothProgressBar progressBar; private System.Windows.Forms.Label txtMessage2; *************** *** 256,260 **** } listView.Items.Add(li); ! this.morelessButton.Enabled = !(this.listView.Items.Count == 0); } --- 259,267 ---- } listView.Items.Add(li); ! if (firstMsg = true) { ! firstMsg = false; ! this.morelessButton.Enabled = !(this.listView.Items.Count == 0); ! this.morelessButton.ForeColor = (this.listView.Items.Count == 0) ? Color.Black : Color.Red; ! } } *************** *** 298,306 **** Close(); } else { - Invoke( new MoreLessInvoker(DoSetMoreLess), new object[] { true } ); Invoke( new MethodInvoker( DoSetCompleted ) ); } break; } } else { Close(); --- 305,316 ---- Close(); } else { Invoke( new MethodInvoker( DoSetCompleted ) ); } break; } + if (totalErrors > 0) { + Invoke( new MoreLessInvoker(DoSetMoreLess), new object[] { true } ); + } + } else { Close(); *************** *** 376,380 **** this.components = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ProgressWindow)); - this.progressBar = new System.Windows.Forms.ProgressBar(); this.txtMessage1 = new System.Windows.Forms.Label(); this.cancelButton = new System.Windows.Forms.Button(); --- 386,389 ---- *************** *** 384,403 **** this.listView = new System.Windows.Forms.ListView(); this.ColumnHeader1 = new System.Windows.Forms.ColumnHeader(); this.SuspendLayout(); // - // progressBar - // - this.progressBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.progressBar.Location = new System.Drawing.Point(8, 48); - this.progressBar.Name = "progressBar"; - this.progressBar.Size = new System.Drawing.Size(326, 16); - this.progressBar.TabIndex = 1; - // // txtMessage1 // this.txtMessage1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); ! this.txtMessage1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.txtMessage1.Location = new System.Drawing.Point(8, 8); this.txtMessage1.Name = "txtMessage1"; --- 393,404 ---- this.listView = new System.Windows.Forms.ListView(); this.ColumnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.progressBar = new Adapdev.Windows.Forms.SmoothProgressBar(); this.SuspendLayout(); // // txtMessage1 // this.txtMessage1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); ! this.txtMessage1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.txtMessage1.Location = new System.Drawing.Point(8, 8); this.txtMessage1.Name = "txtMessage1"; *************** *** 411,415 **** this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancelButton.Enabled = false; ! this.cancelButton.Location = new System.Drawing.Point(262, 72); this.cancelButton.Name = "cancelButton"; this.cancelButton.TabIndex = 2; --- 412,416 ---- this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.cancelButton.Enabled = false; ! this.cancelButton.Location = new System.Drawing.Point(264, 64); this.cancelButton.Name = "cancelButton"; this.cancelButton.TabIndex = 2; *************** *** 420,424 **** // this.morelessButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); ! this.morelessButton.Location = new System.Drawing.Point(182, 72); this.morelessButton.Name = "morelessButton"; this.morelessButton.TabIndex = 4; --- 421,425 ---- // this.morelessButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); ! this.morelessButton.Location = new System.Drawing.Point(182, 64); this.morelessButton.Name = "morelessButton"; this.morelessButton.TabIndex = 4; *************** *** 453,463 **** this.listView.FullRowSelect = true; this.listView.GridLines = true; - this.listView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - this.listView.LabelWrap = false; this.listView.LargeImageList = this.imageList; ! this.listView.Location = new System.Drawing.Point(8, 104); this.listView.MultiSelect = false; this.listView.Name = "listView"; ! this.listView.Size = new System.Drawing.Size(328, 160); this.listView.SmallImageList = this.imageList; this.listView.StateImageList = this.imageList; --- 454,462 ---- this.listView.FullRowSelect = true; this.listView.GridLines = true; this.listView.LargeImageList = this.imageList; ! this.listView.Location = new System.Drawing.Point(8, 96); this.listView.MultiSelect = false; this.listView.Name = "listView"; ! this.listView.Size = new System.Drawing.Size(328, 168); this.listView.SmallImageList = this.imageList; this.listView.StateImageList = this.imageList; *************** *** 470,473 **** --- 469,483 ---- this.ColumnHeader1.Width = 500; // + // progressBar + // + this.progressBar.Location = new System.Drawing.Point(8, 40); + this.progressBar.Maximum = 100; + this.progressBar.Minimum = 0; + this.progressBar.Name = "progressBar"; + this.progressBar.ProgressBarColor = System.Drawing.Color.Blue; + this.progressBar.Size = new System.Drawing.Size(328, 16); + this.progressBar.TabIndex = 7; + this.progressBar.Value = 0; + // // ProgressWindow // *************** *** 475,483 **** this.ClientSize = new System.Drawing.Size(344, 278); this.ControlBox = false; this.Controls.Add(this.listView); this.Controls.Add(this.txtMessage2); this.Controls.Add(this.morelessButton); this.Controls.Add(this.cancelButton); - this.Controls.Add(this.progressBar); this.Controls.Add(this.txtMessage1); this.MaximizeBox = false; --- 485,493 ---- this.ClientSize = new System.Drawing.Size(344, 278); this.ControlBox = false; + this.Controls.Add(this.progressBar); this.Controls.Add(this.listView); this.Controls.Add(this.txtMessage2); this.Controls.Add(this.morelessButton); this.Controls.Add(this.cancelButton); this.Controls.Add(this.txtMessage1); this.MaximizeBox = false; |
From: Trevor L. <tre...@us...> - 2005-04-14 03:43:52
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3367/src/Adapdev.Data/Xml Modified Files: ProviderConfig.cs Log Message: Changes to support filtering of Schemas for Oracle Index: ProviderConfig.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderConfig.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProviderConfig.cs 13 Apr 2005 04:23:42 -0000 1.2 --- ProviderConfig.cs 14 Apr 2005 03:43:41 -0000 1.3 *************** *** 51,75 **** foreach (DataRow settingsRow in connectionRow.GetChildRows("connection_settings")) { if (settingsRow.Table.Columns.Contains("file")) { ! connectionType.SupportsFile = GetSettingState(settingsRow["file"].ToString()); connectionType.PromptFile = GetSettingValue(settingsRow["file"].ToString()); } if (settingsRow.Table.Columns.Contains("server")) { ! connectionType.SupportsServer = GetSettingState(settingsRow["server"].ToString()); connectionType.PromptServer = GetSettingValue(settingsRow["server"].ToString()); } if (settingsRow.Table.Columns.Contains("name")) { ! connectionType.SupportsName = GetSettingState(settingsRow["name"].ToString()); connectionType.PromptName = GetSettingValue(settingsRow["name"].ToString()); } if (settingsRow.Table.Columns.Contains("userid")) { ! connectionType.SupportsUserID = GetSettingState(settingsRow["userid"].ToString()); connectionType.PromptUserID = GetSettingValue(settingsRow["userid"].ToString()); } if (settingsRow.Table.Columns.Contains("password")) { ! connectionType.SupportsPassword = GetSettingState(settingsRow["password"].ToString()); connectionType.PromptPassword = GetSettingValue(settingsRow["password"].ToString()); } if (settingsRow.Table.Columns.Contains("filter")) { ! connectionType.SupportsFilter = GetSettingState(settingsRow["filter"].ToString()); connectionType.PromptFilter = GetSettingValue(settingsRow["filter"].ToString()); } --- 51,75 ---- foreach (DataRow settingsRow in connectionRow.GetChildRows("connection_settings")) { if (settingsRow.Table.Columns.Contains("file")) { ! connectionType.SupportsFile = GetSettingState(settingsRow["file"].ToString(),false); connectionType.PromptFile = GetSettingValue(settingsRow["file"].ToString()); } if (settingsRow.Table.Columns.Contains("server")) { ! connectionType.SupportsServer = GetSettingState(settingsRow["server"].ToString(),true); connectionType.PromptServer = GetSettingValue(settingsRow["server"].ToString()); } if (settingsRow.Table.Columns.Contains("name")) { ! connectionType.SupportsName = GetSettingState(settingsRow["name"].ToString(),true); connectionType.PromptName = GetSettingValue(settingsRow["name"].ToString()); } if (settingsRow.Table.Columns.Contains("userid")) { ! connectionType.SupportsUserID = GetSettingState(settingsRow["userid"].ToString(),true); connectionType.PromptUserID = GetSettingValue(settingsRow["userid"].ToString()); } if (settingsRow.Table.Columns.Contains("password")) { ! connectionType.SupportsPassword = GetSettingState(settingsRow["password"].ToString(),true); connectionType.PromptPassword = GetSettingValue(settingsRow["password"].ToString()); } if (settingsRow.Table.Columns.Contains("filter")) { ! connectionType.SupportsFilter = GetSettingState(settingsRow["filter"].ToString(),false); connectionType.PromptFilter = GetSettingValue(settingsRow["filter"].ToString()); } *************** *** 87,92 **** connectionProvider.Template = Regex.Replace(providerRow["provider_Text"].ToString(), @"[\r\t\n]", ""); ! if (providerRow.Table.Columns.Contains("allowEmptyParameters")) connectionProvider.AllowEmptyParameters = GetSettingState(providerRow["allowEmptyParameters"].ToString()); ! if (providerRow.Table.Columns.Contains("enabled")) connectionProvider.Enabled = GetSettingState(providerRow["enabled"].ToString()); if (providerRow.Table.Columns.Contains("fileMask")) connectionProvider.FileMask = providerRow["fileMask"].ToString(); --- 87,92 ---- connectionProvider.Template = Regex.Replace(providerRow["provider_Text"].ToString(), @"[\r\t\n]", ""); ! if (providerRow.Table.Columns.Contains("allowEmptyParameters")) connectionProvider.AllowEmptyParameters = GetSettingState(providerRow["allowEmptyParameters"].ToString(), true); ! if (providerRow.Table.Columns.Contains("enabled")) connectionProvider.Enabled = GetSettingState(providerRow["enabled"].ToString(),true); if (providerRow.Table.Columns.Contains("fileMask")) connectionProvider.FileMask = providerRow["fileMask"].ToString(); *************** *** 109,113 **** /// <param name="setting"></param> /// <returns></returns> ! private bool GetSettingState(string setting) { try { return Convert.ToBoolean(setting); --- 109,115 ---- /// <param name="setting"></param> /// <returns></returns> ! private bool GetSettingState(string setting, bool defaultFlag) { ! if (setting == null) return defaultFlag; ! if (setting.Equals(string.Empty)) return defaultFlag; try { return Convert.ToBoolean(setting); *************** *** 124,131 **** /// <returns></returns> private string GetSettingValue(string setting) { ! if (GetSettingState(setting)) { ! if (setting.ToLower() != "true") return setting.Trim(); } - return string.Empty; } --- 126,137 ---- /// <returns></returns> private string GetSettingValue(string setting) { ! if (setting == null) return string.Empty; ! if (setting.Equals(string.Empty)) return string.Empty; ! try { ! bool flag = Convert.ToBoolean(setting); ! return string.Empty; ! } catch { ! return setting.Trim(); } } |