adapdev-commits Mailing List for Adapdev.NET (Page 30)
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-04-14 03:32:56
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Data Modified Files: Adapdev.Data.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Data.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Adapdev.Data.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Adapdev.Data.csproj 13 Apr 2005 04:23:37 -0000 1.5 --- Adapdev.Data.csproj 14 Apr 2005 03:32:04 -0000 1.6 *************** *** 90,93 **** --- 90,98 ---- HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.OracleClient.dll" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:55
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Tests Modified Files: Adapdev.Tests.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Tests/Adapdev.Tests.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.Tests.csproj 28 Feb 2005 01:55:12 -0000 1.2 --- Adapdev.Tests.csproj 14 Apr 2005 03:32:05 -0000 1.3 *************** *** 90,93 **** --- 90,98 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:55
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.NVelocity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.NVelocity Modified Files: Adapdev.NVelocity.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.NVelocity.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.NVelocity/Adapdev.NVelocity.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Adapdev.NVelocity.csproj 17 Mar 2005 12:50:12 -0000 1.3 --- Adapdev.NVelocity.csproj 14 Apr 2005 03:32:04 -0000 1.4 *************** *** 80,83 **** --- 80,88 ---- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:52
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Data.Tests Modified Files: Adapdev.Data.Tests.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Data.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests/Adapdev.Data.Tests.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Adapdev.Data.Tests.csproj 25 Mar 2005 02:14:28 -0000 1.3 --- Adapdev.Data.Tests.csproj 14 Apr 2005 03:32:04 -0000 1.4 *************** *** 95,98 **** --- 95,103 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:45
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.CodeGen.Tests Modified Files: Adapdev.CodeGen.Tests.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.CodeGen.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen.Tests/Adapdev.CodeGen.Tests.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.CodeGen.Tests.csproj 28 Feb 2005 01:54:38 -0000 1.2 --- Adapdev.CodeGen.Tests.csproj 14 Apr 2005 03:32:03 -0000 1.3 *************** *** 90,93 **** --- 90,98 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:44
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Cache.Tests Modified Files: Adapdev.Cache.Tests.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Cache.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache.Tests/Adapdev.Cache.Tests.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.Cache.Tests.csproj 28 Feb 2005 01:54:38 -0000 1.2 --- Adapdev.Cache.Tests.csproj 14 Apr 2005 03:32:02 -0000 1.3 *************** *** 90,93 **** --- 90,98 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:44
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.CodeGen Modified Files: Adapdev.CodeGen.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.CodeGen.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.CodeGen/Adapdev.CodeGen.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.CodeGen.csproj 28 Feb 2005 01:54:38 -0000 1.2 --- Adapdev.CodeGen.csproj 14 Apr 2005 03:32:03 -0000 1.3 *************** *** 116,119 **** --- 116,124 ---- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\VJSharpCodeProvider.DLL" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:44
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Cache Modified Files: Adapdev.Cache.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Cache.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Cache/Adapdev.Cache.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.Cache.csproj 28 Feb 2005 01:54:38 -0000 1.2 --- Adapdev.Cache.csproj 14 Apr 2005 03:32:03 -0000 1.3 *************** *** 85,88 **** --- 85,93 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:16
|
Update of /cvsroot/adapdev/Adapdev/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src Modified Files: AdapdevAssemblyInfo.cs AdapdevFramework.suo Log Message: Revisions for Zanebug v1.5 Index: AdapdevAssemblyInfo.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevAssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AdapdevAssemblyInfo.cs 10 Apr 2005 03:39:58 -0000 1.2 --- AdapdevAssemblyInfo.cs 14 Apr 2005 03:32:07 -0000 1.3 *************** *** 14,18 **** [assembly: AssemblyCopyright("2004 Adapdev Technologies, LLC")] [assembly: AssemblyTrademark("")] ! [assembly: AssemblyCulture("")] // --- 14,18 ---- [assembly: AssemblyCopyright("2004 Adapdev Technologies, LLC")] [assembly: AssemblyTrademark("")] ! [assembly: AssemblyCulture("")] // *************** *** 56,58 **** [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("..\\..\\..\\adapdev.snk")] ! [assembly: AssemblyKeyName("")] \ No newline at end of file --- 56,59 ---- [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("..\\..\\..\\adapdev.snk")] ! [assembly: AssemblyKeyName("")] ! [assembly: log4net.Config.DOMConfigurator(ConfigFileExtension="log4net",Watch=true)] \ No newline at end of file Index: AdapdevFramework.suo =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevFramework.suo,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 Binary files /tmp/cvskWdI4b and /tmp/cvswXUaIZ differ |
From: Sean M. <int...@us...> - 2005-04-14 03:32:16
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Windows.Forms Modified Files: Adapdev.Windows.Forms.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Windows.Forms.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/Adapdev.Windows.Forms.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Adapdev.Windows.Forms.csproj 12 Apr 2005 10:22:57 -0000 1.3 --- Adapdev.Windows.Forms.csproj 14 Apr 2005 03:32:07 -0000 1.4 *************** *** 100,103 **** --- 100,108 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:16
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev Modified Files: Adapdev.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/Adapdev.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Adapdev.csproj 12 Apr 2005 10:22:59 -0000 1.3 --- Adapdev.csproj 14 Apr 2005 03:32:08 -0000 1.4 *************** *** 95,98 **** --- 95,103 ---- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Microsoft.VisualBasic.dll" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:16
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Web.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Web.Tests Modified Files: Adapdev.Web.Tests.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Web.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Web.Tests/Adapdev.Web.Tests.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.Web.Tests.csproj 28 Feb 2005 01:55:12 -0000 1.2 --- Adapdev.Web.Tests.csproj 14 Apr 2005 03:32:06 -0000 1.3 *************** *** 90,93 **** --- 90,98 ---- Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:15
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Windows.Forms.Tests Modified Files: Adapdev.Windows.Forms.Tests.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Windows.Forms.Tests.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms.Tests/Adapdev.Windows.Forms.Tests.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.Windows.Forms.Tests.csproj 28 Feb 2005 01:55:12 -0000 1.2 --- Adapdev.Windows.Forms.Tests.csproj 14 Apr 2005 03:32:06 -0000 1.3 *************** *** 80,83 **** --- 80,88 ---- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:15
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.UnitTest.Core Modified Files: AbstractTest.cs Adapdev.UnitTest.Core.csproj TestRunner.cs TestSuiteBuilder.cs TextFormatter.cs Log Message: Revisions for Zanebug v1.5 Index: TestSuiteBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestSuiteBuilder.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestSuiteBuilder.cs 28 Feb 2005 01:32:23 -0000 1.1.1.1 --- TestSuiteBuilder.cs 14 Apr 2005 03:32:05 -0000 1.2 *************** *** 39,42 **** --- 39,43 ---- using System.IO; using System.Reflection; + using log4net; using NUnit.Framework; *************** *** 46,51 **** --- 47,57 ---- public class TestSuiteBuilder : MarshalByRefObject { + // unique id for the specified test private int id = 0; + // list of assembly dependencies for the current assembly private Hashtable dependencyList = new Hashtable(); + // create the logger + private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + // setup the logging levels public TestSuite BuildAssemblies(params string[] assemblies) *************** *** 67,79 **** --- 73,98 ---- public TestAssembly BuildAssembly(string assemblyName) { + // set delegate to probe for an assembly when it's not found in the base path AppDomain.CurrentDomain.AssemblyResolve +=new ResolveEventHandler(CurrentDomain_AssemblyResolve); + // switch the current directory to the assemblies location + // needed to find related files for the specified assembly FileInfo fi = new FileInfo(assemblyName); string orig = Environment.CurrentDirectory; Environment.CurrentDirectory = fi.DirectoryName; + if(log.IsInfoEnabled) + { + log.Info("Building assembly: " + assemblyName); + log.Info("Environment Directory: " + orig); + log.Info("Assembly Directory: " + fi.DirectoryName); + } + + // add the assembly to the AssemblyCache Assembly assembly = AssemblyCache.Add(assemblyName.ToLower(), assemblyName); + // find any assembly dependencies this.FindDependencies(assembly, dependencyList); + // Build the TestAssembly information TestAssembly ta = new TestAssembly(); ta.AssemblyName = fi.Name; *************** *** 85,88 **** --- 104,108 ---- ta.Id = id++; + // Build the TestFixtures foreach (Type t in assembly.GetExportedTypes()) { *************** *** 90,94 **** --- 110,117 ---- } + // restore the original environment Environment.CurrentDirectory = orig; + // if(this._debugMode) log.Debug(ta.ToString()); + return ta; } *************** *** 101,104 **** --- 124,128 ---- ) { + // Build the TestFixture tf = new Adapdev.UnitTest.Core.TestFixture(); tf.Parent = ta; *************** *** 106,109 **** --- 130,134 ---- tf.Name = t.Name; tf.Namespace = t.Namespace; + tf.FullName = t.FullName; tf.Id = id++; *************** *** 143,146 **** --- 168,172 ---- } } + // if(this._debugMode) log.Debug(tf.ToString()); return tf; } *************** *** 152,155 **** --- 178,182 ---- t.Method = m.Name; t.Name = m.Name; + t.FullName = tf.FullName + "." + m.Name; t.Id = id++; this.ProcessTestAttribute(m, t); *************** *** 320,323 **** --- 347,351 ---- 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); } *************** *** 326,329 **** --- 354,358 ---- { AssemblyName assemblyName = assembly.GetName(); + // if(this._infoMode) log.Info("Probing for: " + assemblyName); if (! dependencyList.Contains(assemblyName.FullName)) { Index: TestRunner.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestRunner.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestRunner.cs 28 Feb 2005 01:32:22 -0000 1.1.1.1 --- TestRunner.cs 14 Apr 2005 03:32:05 -0000 1.2 *************** *** 43,46 **** --- 43,47 ---- using Adapdev; using Adapdev.Diagnostics; + using log4net; public delegate double ThreadedTestHandler(MethodInfo method, object o); *************** *** 55,61 **** private TestEventDispatcher _dispatcher = null; - private RunMode _mode = RunMode.NotRunning; /// <summary> /// The list of assemblies to load --- 56,67 ---- private TestEventDispatcher _dispatcher = null; private RunMode _mode = RunMode.NotRunning; + // create the logger + private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + // setup the logging levels + private bool _debugMode = log.IsDebugEnabled; + private bool _infoMode = log.IsInfoEnabled; + /// <summary> /// The list of assemblies to load *************** *** 127,130 **** --- 133,138 ---- tar.Location = ta.Location; + // if(this._debugMode) log.Debug("Running TA " + ta.Name); + if(_dispatcher != null) _dispatcher.OnTestAssemblyStarted(new TestAssemblyEventArgs(ta)); for (int i = 1; i <= ta.RepeatCount; i++) *************** *** 160,163 **** --- 168,173 ---- Assembly a = AssemblyCache.Get(tf.Parent.OriginalPath); + // if(this._debugMode) log.Debug("Running TF " + tf.Name); + if(_dispatcher != null)_dispatcher.OnTestFixtureStarted(new TestFixtureEventArgs(tf)); for (int j = 1; j <= tf.RepeatCount; j++) *************** *** 179,182 **** --- 189,194 ---- tr.Description = test.Description; + // if(this._debugMode) log.Debug("Running T " + test.Name); + if (!test.Ignore && test.ShouldRun) { *************** *** 357,361 **** foreach (BaseTestHelper t in tf.GetFixtureSetUps()) { - // Console.WriteLine(t.Method); if(_dispatcher != null)_dispatcher.OnBaseTestHelperStarted(new BaseTestHelperEventArgs(t)); MethodInfo m = type.GetMethod(t.Method); --- 369,372 ---- *************** *** 368,372 **** foreach (BaseTestHelper t in tf.GetFixtureTearDowns()) { - // Console.WriteLine(t.Method); if(_dispatcher != null)_dispatcher.OnBaseTestHelperStarted(new BaseTestHelperEventArgs(t)); MethodInfo m = type.GetMethod(t.Method); --- 379,382 ---- *************** *** 393,397 **** foreach (TestHelper t in tf.GetTestTearDowns()) { - // Console.WriteLine(t.Method); if (t.Test.Length < 1 || t.Test.ToLower().Equals(name.ToLower())) { --- 403,406 ---- Index: Adapdev.UnitTest.Core.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/Adapdev.UnitTest.Core.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.UnitTest.Core.csproj 28 Feb 2005 01:55:12 -0000 1.2 --- Adapdev.UnitTest.Core.csproj 14 Apr 2005 03:32:05 -0000 1.3 *************** *** 94,97 **** --- 94,103 ---- AssemblyName = "nunit.framework" HintPath = "..\..\lib\nunit.framework.dll" + Private = "True" + /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" /> </References> Index: AbstractTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/AbstractTest.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AbstractTest.cs 28 Feb 2005 01:32:20 -0000 1.1.1.1 --- AbstractTest.cs 14 Apr 2005 03:32:05 -0000 1.2 *************** *** 58,61 **** --- 58,62 ---- protected TestState _testState = TestState.Untested; protected AbstractTestResult _result = null; + protected string _fullName = String.Empty; public AbstractTest() *************** *** 151,154 **** --- 152,161 ---- } + public string FullName + { + get{return this._fullName;} + set{this._fullName = value;} + } + public abstract int GetTestCount(); } Index: TextFormatter.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TextFormatter.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TextFormatter.cs 28 Feb 2005 01:32:23 -0000 1.1.1.1 --- TextFormatter.cs 14 Apr 2005 03:32:05 -0000 1.2 *************** *** 55,59 **** } ! sb.Append(this.GetSummary(results) + "\r\n"); } --- 55,59 ---- } ! sb.Append(this.GetSummary(results)); } *************** *** 65,75 **** sb.Append("SUMMARY\r\n"); sb.Append("========================================\r\n"); ! return String.Format("Total Failed: {0}\r\n" + ! "Total Passed: {1}\r\n" + ! "Total Ignored: {2}\r\n"+ ! "Percent Passed: {3}\r\n" + ! "Percent Failed: {4}\r\n", ! ts.TotalFailed, ts.TotalPassed, ts.TotalIgnored, ts.PercentPassed.ToString("P"), --- 65,72 ---- 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"), *************** *** 85,112 **** { Debug.Assert(tar != null); ! foreach(AbstractTestIteration ati in tar.Iterations) { ! if(tar.Iterations.Count > 1) sb.Append(this.GetNesting(nesting) + "Iteration: " + ati.Iteration + "\r\n"); ! sb.AppendFormat(this.GetNesting(nesting + 1) + this.GetMarker(tar) + "{0} - {1}\r\n", tar.Name, tar.State); ! if((tar is TestResult) && ((tar as TestResult).Description.Length > 0)) sb.AppendFormat(this.GetNesting(nesting + 2) + "Description: {0}\r\n", (tar as TestResult).Description); ! ! if(showFailure && (ati is TestIteration)) { ! TestIteration ti = ati as TestIteration; ! if(ti.Result.Length > 0) sb.Append(this.GetOutput("Result: " + this.GetDivider() + ti.Result + "\r\n", nesting + 2)); ! if(ti.FullStackTrace.Length > 0) sb.Append(this.GetOutput("StackTrace: " + this.GetDivider() + ti.FullStackTrace + "\r\n", nesting + 2)); ! } ! if(showOutput && ati.ConsoleOutput.Length > 0) ! { ! sb.Append(this.GetOutput("Output: " + this.GetDivider() + ati.AllOutput, nesting + 2)); ! } ! if(ati is CompositeAbstractTestIteration) ! { ! foreach(AbstractTestResult result in (ati as CompositeAbstractTestIteration).GetTestResults()) ! { ! this.GetDetailedSummary(result, showOutput, showFailure, nesting + 1); } } --- 82,112 ---- { Debug.Assert(tar != null); ! if(!(tar.State == TestState.Ignore)) { ! foreach(AbstractTestIteration ati in tar.Iterations) { ! if(tar.Iterations.Count > 1) sb.Append(this.GetNesting(nesting) + "Iteration: " + ati.Iteration + "\r\n"); ! sb.AppendFormat(this.GetNesting(nesting + 1) + this.GetMarker(tar) + "{0} - {1}\r\n", tar.Name, tar.State); ! if((tar is TestResult) && ((tar as TestResult).Description.Length > 0)) sb.AppendFormat(this.GetNesting(nesting + 2) + "Description: {0}\r\n", (tar as TestResult).Description); ! if(showFailure && (ati is TestIteration)) ! { ! TestIteration ti = ati as TestIteration; ! if(ti.Result.Length > 0) sb.Append(this.GetOutput("Result: " + this.GetDivider() + ti.Result + "\r\n", nesting + 2)); ! if(ti.FullStackTrace.Length > 0) sb.Append(this.GetOutput("StackTrace: " + this.GetDivider() + ti.FullStackTrace + "\r\n", nesting + 2)); ! } ! ! if(showOutput && ati.ConsoleOutput.Length > 0) ! { ! sb.Append(this.GetOutput("Output: " + this.GetDivider() + ati.AllOutput, nesting + 2)); ! } ! if(ati is CompositeAbstractTestIteration) ! { ! foreach(AbstractTestResult result in (ati as CompositeAbstractTestIteration).GetTestResults()) ! { ! this.GetDetailedSummary(result, showOutput, showFailure, nesting + 1); ! } } } |
From: Sean M. <int...@us...> - 2005-04-14 03:32:15
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.UnitTest Modified Files: Adapdev.UnitTest.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.UnitTest.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest/Adapdev.UnitTest.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.UnitTest.csproj 28 Feb 2005 01:55:12 -0000 1.2 --- Adapdev.UnitTest.csproj 14 Apr 2005 03:32:06 -0000 1.3 *************** *** 80,83 **** --- 80,88 ---- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Sean M. <int...@us...> - 2005-04-14 03:32:15
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29338/src/Adapdev.Web Modified Files: Adapdev.Web.csproj Log Message: Revisions for Zanebug v1.5 Index: Adapdev.Web.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Web/Adapdev.Web.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.Web.csproj 28 Feb 2005 01:55:12 -0000 1.2 --- Adapdev.Web.csproj 14 Apr 2005 03:32:06 -0000 1.3 *************** *** 85,88 **** --- 85,93 ---- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Web.dll" /> + <Reference + Name = "log4net" + AssemblyName = "log4net" + HintPath = "..\..\lib\log4net.dll" + /> </References> </Build> |
From: Trevor L. <tre...@us...> - 2005-04-13 04:24:33
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7596/src/Adapdev.Data.Tests Modified Files: SchemaBuilderTest.cs Log Message: Index: SchemaBuilderTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data.Tests/SchemaBuilderTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SchemaBuilderTest.cs 10 Apr 2005 09:59:05 -0000 1.2 --- SchemaBuilderTest.cs 13 Apr 2005 04:23:36 -0000 1.3 *************** *** 52,60 **** Assert.AreEqual(0, ct.Count, "Should be zero items after deleting the item"); ! ct.Add(new DbConnectionType("zarniwoop",DbType.SQLSERVER, "OLEDB",true, true, true, true)); ! ct.Add(new DbConnectionType("beeblebrox",DbType.SQLSERVER, "OLEDB",true, true, true, true)); ! ct.Add(new DbConnectionType("magrathea",DbType.SQLSERVER, "OLEDB",true, true, true, true)); ! ct.Add(new DbConnectionType("marvin",DbType.SQLSERVER, "OLEDB",true, true, true, true)); ! ct.Add(new DbConnectionType("vogon",DbType.SQLSERVER, "OLEDB",true, true, true, true)); Assert.AreEqual("beeblebrox", ct.GetByIndex(0).Name); --- 52,60 ---- Assert.AreEqual(0, ct.Count, "Should be zero items after deleting the item"); ! ct.Add(new DbConnectionType("zarniwoop",DbType.SQLSERVER, "OLEDB",true, true, true, true, false)); ! ct.Add(new DbConnectionType("beeblebrox",DbType.SQLSERVER, "OLEDB",true, true, true, true, false)); ! ct.Add(new DbConnectionType("magrathea",DbType.SQLSERVER, "OLEDB",true, true, true, true, false)); ! ct.Add(new DbConnectionType("marvin",DbType.SQLSERVER, "OLEDB",true, true, true, true, false)); ! ct.Add(new DbConnectionType("vogon",DbType.SQLSERVER, "OLEDB",true, true, true, true, false)); Assert.AreEqual("beeblebrox", ct.GetByIndex(0).Name); *************** *** 73,77 **** Assert.IsNotNull(ct); ! ct = new DbConnectionType("TestType",DbType.SQLSERVER, "OLEDB", true, true, true, true); Assert.IsFalse(ct.SupportsFile); Assert.IsTrue(ct.SupportsServer); --- 73,77 ---- Assert.IsNotNull(ct); ! ct = new DbConnectionType("TestType",DbType.SQLSERVER, "OLEDB", true, true, true, true, false); Assert.IsFalse(ct.SupportsFile); Assert.IsTrue(ct.SupportsServer); *************** *** 87,91 **** [ExpectedException(typeof(ApplicationException))] public void ConnectionTypeInternalFails() { ! DbConnectionType ct = new DbConnectionType("TestType",DbType.SQLSERVER, "OLEDB", true, true, true, true); Assert.AreEqual("OLEDB", ct.InternalProviderName); Assert.IsNull(ct.InternalProvider); --- 87,91 ---- [ExpectedException(typeof(ApplicationException))] public void ConnectionTypeInternalFails() { ! DbConnectionType ct = new DbConnectionType("TestType",DbType.SQLSERVER, "OLEDB", true, true, true, true, false); Assert.AreEqual("OLEDB", ct.InternalProviderName); Assert.IsNull(ct.InternalProvider); *************** *** 102,106 **** Assert.AreEqual(0, cp.Count, "Should be zero items after deleting the item"); ! DbConnectionType ct = new DbConnectionType("TestType",DbType.SQLSERVER,"OLEDB", true, true, true, true); ct.Providers = cp; --- 102,106 ---- Assert.AreEqual(0, cp.Count, "Should be zero items after deleting the item"); ! DbConnectionType ct = new DbConnectionType("TestType",DbType.SQLSERVER,"OLEDB", true, true, true, true, false); ct.Providers = cp; *************** *** 124,128 **** public void ConnectionProvider() { ! DbConnectionType ct = new DbConnectionType("TestType",DbType.SQLSERVER,"OLEDB", true, true, true, true); DbConnectionProvider cp = new DbConnectionProvider(); Assert.IsNotNull(cp); --- 124,128 ---- public void ConnectionProvider() { ! DbConnectionType ct = new DbConnectionType("TestType",DbType.SQLSERVER,"OLEDB", true, true, true, true, false); DbConnectionProvider cp = new DbConnectionProvider(); Assert.IsNotNull(cp); |
From: Trevor L. <tre...@us...> - 2005-04-13 04:24:09
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7596/src/Adapdev.Windows.Forms Modified Files: DatabaseSetting.cs DatabaseWizard.cs DatabaseWizard.resx DatabaseWizardForm.cs Log Message: Index: DatabaseWizardForm.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/DatabaseWizardForm.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DatabaseWizardForm.cs 10 Apr 2005 09:59:22 -0000 1.2 --- DatabaseWizardForm.cs 13 Apr 2005 04:23:42 -0000 1.3 *************** *** 12,16 **** public class DatabaseWizardForm : System.Windows.Forms.Form { ! private Adapdev.Windows.Forms.DatabaseWizard databaseWizard1; private System.Windows.Forms.Button btnSave; private System.Windows.Forms.Button btnCancel; --- 12,16 ---- public class DatabaseWizardForm : System.Windows.Forms.Form { ! private Adapdev.Windows.Forms.DatabaseWizard databaseWizard; private System.Windows.Forms.Button btnSave; private System.Windows.Forms.Button btnCancel; *************** *** 27,31 **** // InitializeComponent(); ! this.databaseWizard1.SetDatabaseSetting(setting); // --- 27,31 ---- // InitializeComponent(); ! this.databaseWizard.SetDatabaseSetting(setting); // *************** *** 40,54 **** public void SetDatabaseSetting(DatabaseSetting setting) { ! this.databaseWizard1.SetDatabaseSetting(setting); } public DatabaseSetting GetDatabaseSetting() { ! return this.databaseWizard1.GetDatabaseSetting(); } public DatabaseWizard DatabaseWizard { ! get{return this.databaseWizard1;} } --- 40,54 ---- public void SetDatabaseSetting(DatabaseSetting setting) { ! this.databaseWizard.SetDatabaseSetting(setting); } public DatabaseSetting GetDatabaseSetting() { ! return this.databaseWizard.GetDatabaseSetting(); } public DatabaseWizard DatabaseWizard { ! get{return this.databaseWizard;} } *************** *** 75,79 **** private void InitializeComponent() { ! this.databaseWizard1 = new Adapdev.Windows.Forms.DatabaseWizard(); this.btnSave = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); --- 75,79 ---- private void InitializeComponent() { ! this.databaseWizard = new Adapdev.Windows.Forms.DatabaseWizard(); this.btnSave = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); *************** *** 82,94 **** // databaseWizard1 // ! this.databaseWizard1.ConnectionName = ""; ! this.databaseWizard1.DbLocation = ""; ! this.databaseWizard1.DbName = ""; ! this.databaseWizard1.Location = new System.Drawing.Point(0, 0); ! this.databaseWizard1.Name = "databaseWizard1"; ! this.databaseWizard1.Password = ""; ! this.databaseWizard1.Size = new System.Drawing.Size(504, 272); ! this.databaseWizard1.TabIndex = 0; ! this.databaseWizard1.Username = ""; // // btnSave --- 82,94 ---- // databaseWizard1 // ! this.databaseWizard.ConnectionName = ""; ! this.databaseWizard.DbLocation = ""; ! this.databaseWizard.DbName = ""; ! this.databaseWizard.Location = new System.Drawing.Point(0, 0); ! this.databaseWizard.Name = "databaseWizard1"; ! this.databaseWizard.Password = ""; ! this.databaseWizard.Size = new System.Drawing.Size(504, 272); ! this.databaseWizard.TabIndex = 0; ! this.databaseWizard.Username = ""; // // btnSave *************** *** 114,118 **** this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnSave); ! this.Controls.Add(this.databaseWizard1); this.Name = "DatabaseWizardForm"; this.Text = "DatabaseWizard"; --- 114,118 ---- this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnSave); ! this.Controls.Add(this.databaseWizard); this.Name = "DatabaseWizardForm"; this.Text = "DatabaseWizard"; Index: DatabaseWizard.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/DatabaseWizard.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DatabaseWizard.cs 10 Apr 2005 09:59:22 -0000 1.2 --- DatabaseWizard.cs 13 Apr 2005 04:23:42 -0000 1.3 *************** *** 41,45 **** private readonly int iconSelected = 1; ! private DbConnectionProvider _connectionProvider; private ProviderConfig _providersConfig = new ProviderConfig(); --- 41,45 ---- private readonly int iconSelected = 1; ! private DbConnectionProvider _connectionProvider = null; private ProviderConfig _providersConfig = new ProviderConfig(); *************** *** 47,53 **** // This call is required by the Windows.Forms Form Designer. InitializeComponent(); - this.UseDatabaseServer(); this.BuildConnectionsTree(this.tvConnectionTypes); ! this.SetGUIProperties(_connectionProvider=null); // TODO: Add any initialization after the InitializeComponent call --- 47,52 ---- // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.BuildConnectionsTree(this.tvConnectionTypes); ! this.SetGUIProperties(DbConnectionTypes.UnknownConnectionType()); // TODO: Add any initialization after the InitializeComponent call *************** *** 366,381 **** #region Form Event Handlers - private void UseDatabaseServer() { - this.lblLocation.Text = "Server"; - this.btnOpenFile.Visible = false; - this.btnOpenFile.Enabled = false; - } - - private void UseDatabaseFile() { - this.lblLocation.Text = "Database File"; - this.btnOpenFile.Visible = true; - this.btnOpenFile.Enabled = true; - } - private void btnOpenFile_Click(object sender, EventArgs e) { if (_connectionProvider != null) { --- 365,368 ---- *************** *** 487,507 **** public string GetConnectionString() { ! return _connectionProvider.ConnectionString(this.tbLocation.Text, this.tbName.Text, this.tbUsername.Text, this.tbPassword.Text); } public string GetInternalProviderConnectionString() { ! return _connectionProvider.InternalProviderString(this.tbLocation.Text, this.tbName.Text, this.tbUsername.Text, this.tbPassword.Text); ! } ! ! public Adapdev.Data.DbProviderType GetInternalProviderProviderType() { ! return _connectionProvider.InternalProvider.ProviderType; ! } ! ! public Adapdev.Data.DbProviderType GetDbConnectionProviderType() { ! return _connectionProvider.ProviderType; ! } ! ! public Adapdev.Data.DbType GetDbConnectionDatabaseType() { ! return _connectionProvider.DbType; } --- 474,482 ---- public string GetConnectionString() { ! return (_connectionProvider == null) ? string.Empty : _connectionProvider.ConnectionString(this.tbLocation.Text, this.tbName.Text, this.tbUsername.Text, this.tbPassword.Text); } public string GetInternalProviderConnectionString() { ! return (_connectionProvider == null) ? string.Empty : _connectionProvider.InternalProviderString(this.tbLocation.Text, this.tbName.Text, this.tbUsername.Text, this.tbPassword.Text); } *************** *** 516,520 **** _connectionProvider = _providersConfig.ConnectionTypes[settings.ConnectionRef].Providers[settings.ProviderRef]; FindConnectionInList(_connectionProvider); ! SetGUIProperties (_connectionProvider); } catch (Exception ex) { MessageBox.Show(this, "Unable to load settings. \nMessage: " + ex.Message, "Failure!", MessageBoxButtons.OK, MessageBoxIcon.Error); --- 491,495 ---- _connectionProvider = _providersConfig.ConnectionTypes[settings.ConnectionRef].Providers[settings.ProviderRef]; FindConnectionInList(_connectionProvider); ! SetGUIProperties (_connectionProvider.Parent); } catch (Exception ex) { MessageBox.Show(this, "Unable to load settings. \nMessage: " + ex.Message, "Failure!", MessageBoxButtons.OK, MessageBoxIcon.Error); *************** *** 565,592 **** /// <param name="treeView">TreeView control to populate</param> public void BuildConnectionsTree ( System.Windows.Forms.TreeView treeView) { ! foreach (DictionaryEntry entryType in this._providersConfig.ConnectionTypes) { ! DbConnectionType dbType = (DbConnectionType)entryType.Value; ! TreeNode parent = new TreeNode(dbType.Name); ! parent.Tag = null; ! parent.ImageIndex = iconDatabase; ! parent.SelectedImageIndex = iconDatabase; ! foreach (DictionaryEntry entryProvider in dbType.Providers) { ! DbConnectionProvider dbProvider = (DbConnectionProvider)entryProvider.Value; ! if (dbProvider.Enabled) { ! TreeNode child = new TreeNode(dbProvider.Name); ! child.Tag = dbProvider; ! child.ImageIndex = iconProvider; ! child.SelectedImageIndex = iconSelected; ! parent.Nodes.Add(child); } } - if (parent.Nodes.Count == 0) { - parent.ImageIndex = iconDisabled; - parent.SelectedImageIndex = iconDisabled; - } - treeView.Nodes.Add(parent); } } --- 540,569 ---- /// <param name="treeView">TreeView control to populate</param> public void BuildConnectionsTree ( System.Windows.Forms.TreeView treeView) { ! if (_providersConfig != null) { ! foreach (DictionaryEntry entryType in this._providersConfig.ConnectionTypes) { ! DbConnectionType dbType = (DbConnectionType)entryType.Value; ! TreeNode parent = new TreeNode(dbType.Name); ! parent.Tag = null; ! parent.ImageIndex = iconDatabase; ! parent.SelectedImageIndex = iconDatabase; ! foreach (DictionaryEntry entryProvider in dbType.Providers) { ! DbConnectionProvider dbProvider = (DbConnectionProvider)entryProvider.Value; ! if (dbProvider.Enabled) { ! TreeNode child = new TreeNode(dbProvider.Name); ! child.Tag = dbProvider; ! child.ImageIndex = iconProvider; ! child.SelectedImageIndex = iconSelected; ! parent.Nodes.Add(child); ! } } + if (parent.Nodes.Count == 0) { + parent.ImageIndex = iconDisabled; + parent.SelectedImageIndex = iconDisabled; + } + treeView.Nodes.Add(parent); } } } *************** *** 601,606 **** } else { _connectionProvider = obj as DbConnectionProvider; } - SetGUIProperties (_connectionProvider); } --- 578,583 ---- } else { _connectionProvider = obj as DbConnectionProvider; + if (_connectionProvider != null) SetGUIProperties (_connectionProvider.Parent); } } *************** *** 608,630 **** /// Depending on the selected Connection/Provider, sets the relevant UI controls enabled/disabled /// </summary> ! /// <param name="provider">A reference to a DbConnectionProvider instance</param> ! private void SetGUIProperties ( DbConnectionProvider provider) { ! if (provider != null) { SetPromptState(true); - if (provider.Parent.SupportsServer == true) { - this.UseDatabaseServer(); - } else { - this.UseDatabaseFile(); - } ! SetPromptLocationState(true); ! SetPromptNameState(provider.Parent.SupportsName); ! SetPromptUsernameState(provider.Parent.SupportsUserID); ! SetPromptPasswordState(provider.Parent.SupportsPassword); this.tbConnectionString.Text = GetConnectionString(); } else { SetPromptState (false); - this.UseDatabaseServer(); this.tbConnectionString.Text = String.Empty; } --- 585,603 ---- /// Depending on the selected Connection/Provider, sets the relevant UI controls enabled/disabled /// </summary> ! /// <param name="connectionType">A reference to a DbConnectionProvider instance</param> ! private void SetGUIProperties ( DbConnectionType connectionType) { ! if (connectionType != null) { ! SetPromptLabels(connectionType); SetPromptState(true); ! SetPromptState(true, this.lblLocation, this.tbLocation); ! SetPromptState(connectionType.SupportsName, this.lblName, this.tbName); ! SetPromptState(connectionType.SupportsUserID, this.lblUsername, this.tbUsername); ! SetPromptState(connectionType.SupportsPassword, this.lblPassword, this.tbPassword); this.tbConnectionString.Text = GetConnectionString(); } else { + SetPromptLabels(DbConnectionTypes.UnknownConnectionType()); SetPromptState (false); this.tbConnectionString.Text = String.Empty; } *************** *** 632,639 **** private void SetPromptState ( bool state ) { ! SetPromptLocationState (state); ! SetPromptNameState (state); ! SetPromptUsernameState (state); ! SetPromptPasswordState (state); this.btnTestConnection.Enabled = state; --- 605,612 ---- private void SetPromptState ( bool state ) { ! SetPromptState (state, this.lblLocation, this.tbLocation); ! SetPromptState (state, this.lblName, this.tbName); ! SetPromptState (state, this.lblUsername, this.tbUsername); ! SetPromptState (state, this.lblPassword, this.tbPassword); this.btnTestConnection.Enabled = state; *************** *** 642,666 **** } ! private void SetPromptLocationState ( bool state ) { ! this.tbLocation.Enabled = state; ! this.lblLocation.Enabled = state; ! } ! ! private void SetPromptNameState ( bool state ) { ! this.tbName.Enabled = state; ! this.lblName.Enabled = state; ! if (!state) this.tbName.Text = ""; ! } ! ! private void SetPromptUsernameState ( bool state ) { ! this.tbUsername.Enabled = state; ! this.lblUsername.Enabled = state; ! if (!state) this.tbUsername.Text = ""; } ! private void SetPromptPasswordState ( bool state ) { ! this.tbPassword.Enabled = state; ! this.lblPassword.Enabled = state; ! if (!state) this.tbPassword.Text = ""; } --- 615,637 ---- } ! private void SetPromptLabels(DbConnectionType connectionType) { ! if (connectionType.SupportsFile) { ! this.lblLocation.Text = connectionType.PromptFile; ! this.btnOpenFile.Visible = true; ! this.btnOpenFile.Enabled = true; ! } else { ! this.lblLocation.Text = connectionType.PromptServer; ! this.btnOpenFile.Visible = false; ! this.btnOpenFile.Enabled = false; ! } ! this.lblName.Text = connectionType.PromptName; ! this.lblUsername.Text = connectionType.PromptUserID; ! this.lblPassword.Text = connectionType.PromptPassword; } ! private void SetPromptState ( bool state, System.Windows.Forms.Label label, System.Windows.Forms.TextBox text ) { ! text.Enabled = state; ! label.Enabled = state; ! if (!state) text.Text = ""; } Index: DatabaseSetting.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/DatabaseSetting.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DatabaseSetting.cs 12 Apr 2005 10:22:57 -0000 1.4 --- DatabaseSetting.cs 13 Apr 2005 04:23:42 -0000 1.5 *************** *** 17,20 **** --- 17,21 ---- private string refConnection; private string refProvider; + private string filter; private DbType dbType; private DbProviderType dbProviderType; *************** *** 45,48 **** --- 46,54 ---- } + public string Filter { + get { return filter; } + set { filter = value; } + } + public string ConnectionType { get { return connectionType; } Index: DatabaseWizard.resx =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/DatabaseWizard.resx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DatabaseWizard.resx 10 Apr 2005 09:59:22 -0000 1.2 --- DatabaseWizard.resx 13 Apr 2005 04:23:42 -0000 1.3 *************** *** 125,128 **** --- 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> *************** *** 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> --- 134,137 ---- *************** *** 157,161 **** MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZT eXN0ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMA ! AAAqDwAAAk1TRnQBSQFMAgEBBAEAAQkBAAEEAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgD AAFAAwABMAMAAQEBAAEYBgABJP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/ AP8A/wD/AEIAAQIBcwGoAQIBcwGoAQIBcwGoAQIBcwGoAQIBcwGoAQIBcwGoIQABAwEMAaEBAwEMAaFa --- 157,161 ---- MC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZT eXN0ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMA ! AAAsDwAAAk1TRnQBSQFMAgEBBAEAAQkBAAEEAQABEAEAARABAAT/ARkBEAj/AUIBTQE2BwABNgMAASgD AAFAAwABMAMAAQEBAAEYBgABJP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/ AP8A/wD/AEIAAQIBcwGoAQIBcwGoAQIBcwGoAQIBcwGoAQIBcwGoAQIBcwGoIQABAwEMAaEBAwEMAaFa *************** *** 221,225 **** AQIAAeABBwHAAQABgAEBAgAB4AEHAcABAAGAAQEBAAEBAeABBwHAAQkBgAEBAQABAwHgAQcBwAEPAYAB AQEAAQcB4AEHAcABDwGAAQEBAAEPAeABBwHAAQ8BgAEBAQABPwHgAQcBwAEPAYABAwEAAT8B4AEHAcAB ! DwGAAX8BAAE/AeABBwHAAQ8BgAF/AYABfwHwAQ8B4AEfAcAB/wHAAf8B+AEfAfABPws= </value> </data> --- 221,225 ---- AQIAAeABBwHAAQABgAEBAgAB4AEHAcABAAGAAQEBAAEBAeABBwHAAQkBgAEBAQABAwHgAQcBwAEPAYAB AQEAAQcB4AEHAcABDwGAAQEBAAEPAeABBwHAAQ8BgAEBAQABPwHgAQcBwAEPAYABAwEAAT8B4AEHAcAB ! DwGAAX8BAAE/AeABBwHAAQ8BgAF/AYABfwHwAQ8B4AEfAcAB/wHAAf8B+AEfAfABPxYACw== </value> </data> *************** *** 398,401 **** --- 398,404 ---- <value>True</value> </data> + <data name="$this.Name"> + <value>DatabaseWizard</value> + </data> <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>80</value> *************** *** 410,416 **** <value>Private</value> </data> - <data name="$this.Name"> - <value>DatabaseWizard</value> - </data> <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>8, 8</value> --- 413,416 ---- |
From: Trevor L. <tre...@us...> - 2005-04-13 04:24:08
|
Update of /cvsroot/adapdev/Adapdev/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7596/src Modified Files: AdapdevFramework.suo Log Message: Index: AdapdevFramework.suo =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevFramework.suo,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 Binary files /tmp/cvsWTNjEl and /tmp/cvsgd15C1 differ |
From: Trevor L. <tre...@us...> - 2005-04-13 04:24:07
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7596/src/Adapdev.Data/Schema Modified Files: SchemaBuilder.cs Log Message: Index: SchemaBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Schema/SchemaBuilder.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SchemaBuilder.cs 12 Apr 2005 10:22:56 -0000 1.4 --- SchemaBuilder.cs 13 Apr 2005 04:23:41 -0000 1.5 *************** *** 23,27 **** public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString) { ! return SchemaBuilder.CreateDatabaseSchema(oledbConnectionString, Adapdev.Data.DbType.ACCESS, DbProviderType.OLEDB, null); } --- 23,27 ---- public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString) { ! return SchemaBuilder.CreateDatabaseSchema(oledbConnectionString, Adapdev.Data.DbType.ACCESS, DbProviderType.OLEDB, "", null); } *************** *** 32,38 **** /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> ! public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString, string databaseType, string providerType, Adapdev.IProgressCallback progress) { ! return SchemaBuilder.CreateDatabaseSchema(oledbConnectionString, DbTypeConverter.Convert(databaseType), DbProviderTypeConverter.Convert(providerType), progress); } --- 32,38 ---- /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> ! public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString, string databaseType, string providerType, string schemaFilter, Adapdev.IProgressCallback progress) { ! return SchemaBuilder.CreateDatabaseSchema(oledbConnectionString, DbTypeConverter.Convert(databaseType), DbProviderTypeConverter.Convert(providerType), schemaFilter, progress); } *************** *** 43,47 **** /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> ! public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString, Adapdev.Data.DbType databaseType, DbProviderType providerType, Adapdev.IProgressCallback progress) { int recordCount = 0; --- 43,47 ---- /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> ! public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString, Adapdev.Data.DbType databaseType, DbProviderType providerType, string schemaFilter, Adapdev.IProgressCallback progress) { int recordCount = 0; *************** *** 54,58 **** } ! DataTable schemaTables = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Tables, "","","",""); DatabaseSchema di = new DatabaseSchema(); if (schemaTables.Rows.Count > 0) { --- 54,58 ---- } ! DataTable schemaTables = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Tables, "",schemaFilter,"",""); DatabaseSchema di = new DatabaseSchema(); if (schemaTables.Rows.Count > 0) { |
From: Trevor L. <tre...@us...> - 2005-04-13 04:23:52
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7596/src/Adapdev.Data/Xml Modified Files: ProviderConfig.cs ProviderConfig.xml ProviderConfig.xsd ProviderConfig.xsx ProviderInfo.cs Log Message: Index: ProviderConfig.xsd =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderConfig.xsd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProviderConfig.xsd 10 Apr 2005 09:59:22 -0000 1.1 --- ProviderConfig.xsd 13 Apr 2005 04:23:42 -0000 1.2 *************** *** 10,13 **** --- 10,23 ---- <xs:complexType> <xs:sequence> + <xs:element name="settings" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:attribute name="file" form="unqualified" type="xs:string" /> + <xs:attribute name="server" form="unqualified" type="xs:string" /> + <xs:attribute name="name" form="unqualified" type="xs:string" /> + <xs:attribute name="userid" form="unqualified" type="xs:string" /> + <xs:attribute name="password" form="unqualified" type="xs:string" /> + <xs:attribute name="filter" form="unqualified" type="xs:string" /> + </xs:complexType> + </xs:element> <xs:element name="providers" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> *************** *** 15,25 **** <xs:element name="provider" nillable="true" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> ! <xs:simpleContent msdata:ColumnName="provider_Text" msdata:Ordinal="1"> <xs:extension base="xs:string"> ! <xs:attribute name="name" type="xs:string" use="required"/> ! <xs:attribute name="type" form="unqualified" type="xs:string" use="required"/> ! <xs:attribute name="allowEmptyParameters" form="unqualified" type="xs:Boolean" use="optional"/> ! <xs:attribute name="enabled" type="xs:Boolean" use="optional"/> ! <xs:attribute name="fileMask" type="xs:Boolean" use="optional"/> </xs:extension> </xs:simpleContent> --- 25,35 ---- <xs:element name="provider" nillable="true" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> ! <xs:simpleContent msdata:ColumnName="provider_Text" msdata:Ordinal="3"> <xs:extension base="xs:string"> ! <xs:attribute name="name" form="unqualified" type="xs:string" /> ! <xs:attribute name="type" form="unqualified" type="xs:string" /> ! <xs:attribute name="allowEmptyParameters" form="unqualified" type="xs:string" /> ! <xs:attribute name="enabled" form="unqualified" type="xs:string" /> ! <xs:attribute name="fileMask" form="unqualified" type="xs:string" /> </xs:extension> </xs:simpleContent> *************** *** 30,40 **** </xs:element> </xs:sequence> ! <xs:attribute name="name" form="unqualified" type="xs:string" use="required"/> ! <xs:attribute name="type" form="unqualified" type="xs:string" use="required"/> ! <xs:attribute name="internalProvider" type="xs:string" use="required"/> ! <xs:attribute name="supportsServer" form="unqualified" type="xs:Boolean" /> ! <xs:attribute name="supportsName" form="unqualified" type="xs:Boolean" /> ! <xs:attribute name="supportsUserID" form="unqualified" type="xs:Boolean" /> ! <xs:attribute name="supportsPassword" form="unqualified" type="xs:Boolean" /> </xs:complexType> </xs:element> --- 40,46 ---- </xs:element> </xs:sequence> ! <xs:attribute name="name" form="unqualified" type="xs:string" /> ! <xs:attribute name="type" form="unqualified" type="xs:string" /> ! <xs:attribute name="internalProvider" form="unqualified" type="xs:string" /> </xs:complexType> </xs:element> Index: ProviderConfig.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderConfig.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProviderConfig.cs 10 Apr 2005 09:59:22 -0000 1.1 --- ProviderConfig.cs 13 Apr 2005 04:23:42 -0000 1.2 *************** *** 2,23 **** using System.Reflection; using System.Xml; using System.IO; using System.Text.RegularExpressions; ! namespace Adapdev.Data ! { /// <summary> /// DBConnectionManager manages the loading of the ADAPDEV.XML file into the DBConnection* classes /// </summary> ! public class ProviderConfig { private DbConnectionTypes _connectionTypes = null; ! public ProviderConfig() { ! _connectionTypes = LoadConfig (FindConfigFile()); ! } ! ! public ProviderConfig( string config) { ! _connectionTypes = LoadConfig (config); } --- 2,21 ---- using System.Reflection; using System.Xml; + using System.Data; using System.IO; using System.Text.RegularExpressions; ! namespace Adapdev.Data { /// <summary> /// DBConnectionManager manages the loading of the ADAPDEV.XML file into the DBConnection* classes /// </summary> ! [System.ComponentModel.DesignerCategoryAttribute("code")] ! public class ProviderConfig : DataSet { private DbConnectionTypes _connectionTypes = null; ! public ProviderConfig() : this( FindConfigFile() ) { } ! public ProviderConfig( string config ) { ! _connectionTypes = LoadConfig ( config ); } *************** *** 35,206 **** private DbConnectionTypes LoadConfig ( string config ) { - DbConnectionTypes _connectionTypes = null; - - // Load the config file into a XML Document instance try { ! XmlTextReader reader = new XmlTextReader(config); ! XmlDocument document = new XmlDocument(); ! try { ! document.Load(reader); ! } ! catch (Exception ex) { ! throw new ApplicationException(String.Format("Could not load the ProviderConfig.xml configuration file: {0}\n{1}", config, ex.Message)); } ! XmlNodeReader nodeReader = new XmlNodeReader(document); ! _connectionTypes = LoadNodes (nodeReader); } catch (Exception ex) { throw new ApplicationException(String.Format("Could not reference the ProviderConfig.xml configuration file: {0}\n{1}", config, ex.Message)); } - return _connectionTypes; } /// <summary> ! /// Load the Connection Type infromation from the XML Stream /// </summary> ! /// <param name="reader">A Node Reader Node</param> ! /// <returns>A Collection of Connection Types</returns> ! private DbConnectionTypes LoadNodes (XmlNodeReader reader) { ! DbConnectionTypes _connectionTypes = new DbConnectionTypes(); try { ! reader.MoveToContent(); ! while (reader.Read()) { ! switch (reader.NodeType) { ! case XmlNodeType.Element: ! if (reader.Name == "connection") { ! DbConnectionType _connectionType = new DbConnectionType(); ! if (reader.MoveToFirstAttribute()) { ! do { ! switch (reader.Name.ToLower()) { ! case "name": ! _connectionType.Name = reader.Value; ! break; ! case "type": ! _connectionType.DbTypeName = reader.Value; ! break; ! case "internalprovider": ! _connectionType.InternalProviderName = reader.Value; ! break; ! case "supportsserver": ! _connectionType.SupportsServer = Convert.ToBoolean(reader.Value); ! break; ! case "supportsname": ! _connectionType.SupportsName = Convert.ToBoolean(reader.Value); ! break; ! case "supportsuserid": ! _connectionType.SupportsUserID = Convert.ToBoolean(reader.Value); ! break; ! case "supportspassword": ! _connectionType.SupportsPassword = Convert.ToBoolean(reader.Value); ! break; ! default: ! break; ! } ! } while (reader.MoveToNextAttribute()); ! } ! // Read the child <provider> elements for this connection ! reader.Read(); ! LoadProviders(_connectionType, _connectionType.Providers, reader.ReadOuterXml()); ! ! // Ensure that the connection object has a name. If none was provider, ! // set the connection name to the database name. ! if (_connectionType.Name.Equals("")) { ! _connectionType.Name = _connectionType.DbTypeName; ! } ! ! // Ensure the connection name is unique in the collection ! int index = 0; ! while (_connectionTypes.Contains(_connectionType.Name) && index < 100) { ! _connectionType.Name = _connectionType.Name + Convert.ToString(index++); ! } ! if (index > 99) throw new ApplicationException("Internal error occured building a unique Connection Name."); ! _connectionTypes.Add(_connectionType); ! } ! break; ! } ! } ! } catch (Exception ex) { ! throw new ApplicationException(String.Format("Invalid ProviderConfig.xml (Providers) Configuration File (statement: {0})\n{1}",reader.ToString(),ex.Message)); ! } ! return _connectionTypes; } /// <summary> ! /// Load a "providers" section from the Config File /// </summary> ! /// <param name="providers"></param> ! /// <param name="providersXML"></param> ! private void LoadProviders(DbConnectionType connection, DbConnectionProviders providers, string providersXML) { ! XmlTextReader reader = new XmlTextReader(new StringReader(providersXML)); ! DbConnectionProvider _connectionProvider = null; ! ! try { ! while (reader.Read()) { ! switch (reader.NodeType) { ! case XmlNodeType.Element: ! if (reader.Name == "provider") { ! _connectionProvider = new DbConnectionProvider(); ! if (reader.MoveToFirstAttribute()) { ! do { ! switch (reader.Name.ToLower()) { ! case "name": ! _connectionProvider.Name = reader.Value; ! break; ! case "type": ! _connectionProvider.ProviderTypeName = reader.Value; ! break; ! case "filemask": ! _connectionProvider.FileMask = reader.Value; ! break; ! case "allowEmptyParameters": ! _connectionProvider.AllowEmptyParameters = Convert.ToBoolean(reader.Value); ! break; ! case "enabled": ! _connectionProvider.Enabled = Convert.ToBoolean(reader.Value); ! break; ! default: ! break; ! } ! } while (reader.MoveToNextAttribute()); ! ! // Store the Parent so this instance can reference the parent ! _connectionProvider.Parent = connection; ! ! // Ensure that the provider object has a name. If none was provider, ! // set the provider name to the database name. ! if (_connectionProvider.Name.Equals("")) { ! _connectionProvider.Name = _connectionProvider.DbTypeName; ! } ! ! // Ensure the Provider name is unique in the collection ! int index = 0; ! while (providers.Contains(_connectionProvider.Name) && index < 100) { ! _connectionProvider.Name = _connectionProvider.Name + Convert.ToString(index++); ! } ! if (index > 99) throw new ApplicationException("Internal error occured building a unique Provider Name."); ! } ! } ! break; ! ! case XmlNodeType.Text: ! if (_connectionProvider != null) { ! string connectionTemplate = Regex.Replace(reader.Value, @"[\r\t\n]", ""); ! _connectionProvider.Template = connectionTemplate.Trim(); ! } ! break; ! ! case XmlNodeType.EndElement: ! if (_connectionProvider != null) { ! providers.Add(_connectionProvider); ! } ! _connectionProvider = null; ! break; ! } ! } ! } catch (Exception ex) { ! throw new ApplicationException(String.Format("Invalid ProviderConfig.xml (Provider) Configuration File (statement: {0})\n{1}",reader.ToString(),ex.Message)); ! } finally { ! _connectionProvider = null; } } --- 33,131 ---- private DbConnectionTypes LoadConfig ( string config ) { try { ! this.ReadXml(config); ! DbConnectionTypes connectionTypes = new DbConnectionTypes(); ! DataRow connectionsRow = this.Tables["connections"].Rows[0]; ! ! // Read the available connections from the connections collection ! // -------------------------------------------------------------- ! foreach (DataRow connectionRow in connectionsRow.GetChildRows("connections_connection")) { ! ! DbConnectionType connectionType = new DbConnectionType(); ! connectionType.Name = connectionRow["name"].ToString(); ! connectionType.DbTypeName = connectionRow["type"].ToString(); ! connectionType.InternalProviderName = connectionRow["internalProvider"].ToString(); ! ! // Read the Settings for this connection type ! // -------------------------------------------------------------- ! 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()); ! } ! } ! ! // Read each of the Providers Details ! // -------------------------------------------------------------- ! foreach (DataRow providersRow in connectionRow.GetChildRows("connection_providers")) { ! foreach (DataRow providerRow in providersRow.GetChildRows("providers_provider")) { ! ! DbConnectionProvider connectionProvider = new DbConnectionProvider(); ! connectionProvider.Name = providerRow["name"].ToString(); ! connectionProvider.ProviderTypeName = providerRow["type"].ToString(); ! connectionProvider.Parent = connectionType; ! 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(); ! ! connectionType.Providers.Add(connectionProvider); ! } ! } ! connectionTypes.Add(connectionType); } ! return connectionTypes; } catch (Exception ex) { throw new ApplicationException(String.Format("Could not reference the ProviderConfig.xml configuration file: {0}\n{1}", config, ex.Message)); } } /// <summary> ! /// Returns the State if defined for a property. If it is false, return false ! /// otherwise return true. /// </summary> ! /// <param name="setting"></param> ! /// <returns></returns> ! private bool GetSettingState(string setting) { try { ! return Convert.ToBoolean(setting); ! } catch { ! return true; ! } } /// <summary> ! /// Return the setting for a property. If the property was "false" return a empty string ! /// or if the property was "true" return a empty string, otherwise return the contents. /// </summary> ! /// <param name="setting"></param> ! /// <returns></returns> ! private string GetSettingValue(string setting) { ! if (GetSettingState(setting)) { ! if (setting.ToLower() != "true") return setting.Trim(); } + return string.Empty; } *************** *** 212,216 **** string configFile = String.Empty; string possibleConfig = String.Empty; ! // Look in the current application folder for the file if (configFile == String.Empty) { --- 137,141 ---- string configFile = String.Empty; string possibleConfig = String.Empty; ! // Look in the current application folder for the file if (configFile == String.Empty) { *************** *** 220,224 **** } } ! // If not found there, then override with a hardcoded default // TODO: Allow this to be overriden with the commandline --- 145,149 ---- } } ! // If not found there, then override with a hardcoded default // TODO: Allow this to be overriden with the commandline *************** *** 229,233 **** } } ! if (configFile == String.Empty) { throw new ApplicationException(String.Format("Could not find the ProviderConfig.xml configuration file.\n It should exist in {0}", AppDomain.CurrentDomain.BaseDirectory)); --- 154,158 ---- } } ! if (configFile == String.Empty) { throw new ApplicationException(String.Format("Could not find the ProviderConfig.xml configuration file.\n It should exist in {0}", AppDomain.CurrentDomain.BaseDirectory)); *************** *** 235,239 **** return configFile; } - } ! } --- 160,163 ---- return configFile; } } ! } \ No newline at end of file Index: ProviderInfo.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderInfo.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ProviderInfo.cs 28 Feb 2005 01:31:49 -0000 1.1.1.1 --- ProviderInfo.cs 13 Apr 2005 04:23:42 -0000 1.2 *************** *** 15,19 **** using System.Runtime.Serialization; - [Serializable()] [System.ComponentModel.DesignerCategoryAttribute("code")] --- 15,18 ---- Index: ProviderConfig.xsx =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderConfig.xsx,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProviderConfig.xsx 10 Apr 2005 09:59:22 -0000 1.1 --- ProviderConfig.xsx 13 Apr 2005 04:23:42 -0000 1.2 *************** *** 1,11 **** <?xml version="1.0" encoding="utf-8"?> <!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> ! <XSDDesignerLayout layoutVersion="2" viewPortLeft="0" viewPortTop="0" zoom="100"> ! <connections_XmlElement left="317" top="254" width="5292" height="2963" selected="0" zOrder="1" index="0" expanded="1"> ! <connection_XmlElement left="317" top="3725" width="5292" height="2963" selected="0" zOrder="2" index="0" expanded="1"> ! <providers_XmlElement left="317" top="7196" width="5292" height="2963" selected="0" zOrder="5" index="0" expanded="1"> ! <provider_XmlElement left="317" top="10667" width="5292" height="2963" selected="0" zOrder="8" index="0" expanded="1" /> ! </providers_XmlElement> ! </connection_XmlElement> ! </connections_XmlElement> ! </XSDDesignerLayout> \ No newline at end of file --- 1,3 ---- <?xml version="1.0" encoding="utf-8"?> <!--This file is auto-generated by the XML Schema Designer. It holds layout information for components on the designer surface.--> ! <XSDDesignerLayout /> \ No newline at end of file Index: ProviderConfig.xml =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Xml/ProviderConfig.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ProviderConfig.xml 12 Apr 2005 10:22:57 -0000 1.3 --- ProviderConfig.xml 13 Apr 2005 04:23:42 -0000 1.4 *************** *** 7,18 **** Defining a connection string, use the following field replacement tokens: ! {0} Server Name or file location ! {1} Data Source or Initial Catalog Name ! {2} User Name or UserID to connect as ! {3} Password Note: When specifying a Driver={name} you must specify using {{ eg: Driver={{SQL Server}} --> ! <connection name="SQL Server" type="SQLSERVER" internalProvider="OLEDB" supportsServer="true" supportsName="true" supportsUserID="true" supportsPassword="true"> <providers> <provider name="Sql Connect" type="SQLSERVER" allowEmptyParameters="true"> --- 7,25 ---- Defining a connection string, use the following field replacement tokens: ! {0} Server Name or file location ! {1} Data Source or Initial Catalog Name ! {2} User Name or UserID to connect as ! {3} Password ! ! Available Settings are: ! <server file="true">Prompt</server> ! <name>Prompt<name> ! <userid>Prompt</userid> ! <password>Prompt</password> Note: When specifying a Driver={name} you must specify using {{ eg: Driver={{SQL Server}} --> ! <connection name="SQL Server" type="SQLSERVER" internalProvider="OLEDB"> ! <settings file="false" server="true" name="true" userid="true" password="true"/> <providers> <provider name="Sql Connect" type="SQLSERVER" allowEmptyParameters="true"> *************** *** 28,32 **** </connection> ! <connection name="SQL Server - Trusted" type="SQLSERVER" internalProvider="OLEDB" supportsServer="true" supportsName="true" supportsUserID="false" supportsPassword="false"> <providers> <provider name="Sql Connect" type="SQLSERVER"> --- 35,40 ---- </connection> ! <connection name="SQL Server - Trusted" type="SQLSERVER" internalProvider="OLEDB"> ! <settings file="false" server="true" name="true" userid="false" password="false"/> <providers> <provider name="Sql Connect" type="SQLSERVER"> *************** *** 42,46 **** </connection> ! <connection name="Microsoft Access" type="ACCESS" internalProvider="OLEDB" supportsServer="false" supportsName="false" supportsUserID="true" supportsPassword="true"> <providers> <provider name="ODBC" type="ODBC" enabled="false"> --- 50,55 ---- </connection> ! <connection name="Microsoft Access" type="ACCESS" internalProvider="OLEDB"> ! <settings file="true" server="false" name="false" userid="true" password="true"/> <providers> <provider name="ODBC" type="ODBC" enabled="false"> *************** *** 56,60 **** </connection> ! <connection name="Oracle" type="ORACLE" internalProvider="OLEDB (Microsoft)" supportsServer="true" supportsName="true" supportsUserID="true" supportsPassword="true"> <providers> <provider name="Oracle Connect" type="ORACLE" enabled="true"> --- 65,70 ---- </connection> ! <connection name="Oracle" type="ORACLE" internalProvider="OLEDB (Microsoft)"> ! <settings file="false" server="true" name="false" userid="true" password="true" filter="Schema"/> <providers> <provider name="Oracle Connect" type="ORACLE" enabled="true"> *************** *** 73,77 **** </connection> ! <connection name="Oracle - Trusted" type="ORACLE" internalProvider="OLEDB (Oracle)" supportsServer="true" supportsName="false" supportsUserID="false" supportsPassword="false"> <providers> <provider name="Oracle Connect" type="ORACLE" enabled="false"> --- 83,88 ---- </connection> ! <connection name="Oracle - Trusted" type="ORACLE" internalProvider="OLEDB (Oracle)"> ! <settings file="false" server="true" name="Schema" userid="true" password="true"/> <providers> <provider name="Oracle Connect" type="ORACLE" enabled="false"> |
From: Trevor L. <tre...@us...> - 2005-04-13 04:23:52
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7596/src/Adapdev.Data Modified Files: Adapdev.Data.csproj DbConnectionProvider.cs DbConnectionType.cs DbConnectionTypes.cs DbProviderType.cs DbProviderTypeConverter.cs DbType.cs DbTypeConverter.cs Log Message: Index: DbConnectionProvider.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DbConnectionProvider.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DbConnectionProvider.cs 10 Apr 2005 09:59:21 -0000 1.1 --- DbConnectionProvider.cs 13 Apr 2005 04:23:37 -0000 1.2 *************** *** 175,179 **** /// </summary> public DbConnectionType Parent { ! get { return _parent; } set { _parent = value; } } --- 175,184 ---- /// </summary> public DbConnectionType Parent { ! get { ! if (_parent == null) ! return DbConnectionTypes.UnknownConnectionType(); ! else ! return _parent; ! } set { _parent = value; } } Index: DbProviderType.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DbProviderType.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DbProviderType.cs 28 Feb 2005 01:31:46 -0000 1.1.1.1 --- DbProviderType.cs 13 Apr 2005 04:23:41 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- public enum DbProviderType { + UNKNOWN, DB2, MYSQL, Index: DbTypeConverter.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DbTypeConverter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DbTypeConverter.cs 10 Apr 2005 09:59:21 -0000 1.2 --- DbTypeConverter.cs 13 Apr 2005 04:23:41 -0000 1.3 *************** *** 12,15 **** --- 12,17 ---- switch (s.Trim().ToLower()) { + case "unknown": + return DbType.UNKNOWN; case "access": return DbType.ACCESS; *************** *** 30,33 **** --- 32,37 ---- public static string Convert(DbType t) { switch (t) { + case DbType.UNKNOWN: + return "UNKNOWN"; case DbType.ACCESS: return "ACCESS"; Index: DbProviderTypeConverter.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DbProviderTypeConverter.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DbProviderTypeConverter.cs 10 Apr 2005 09:59:21 -0000 1.2 --- DbProviderTypeConverter.cs 13 Apr 2005 04:23:41 -0000 1.3 *************** *** 12,15 **** --- 12,17 ---- switch (s.Trim().ToLower()) { + case "unknown": + return DbProviderType.UNKNOWN; case "db2": return DbProviderType.DB2; *************** *** 33,36 **** --- 35,40 ---- switch (t) { + case DbProviderType.UNKNOWN: + return "UNKNOWN"; case DbProviderType.ODBC: return "ODBC"; Index: DbConnectionType.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DbConnectionType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DbConnectionType.cs 10 Apr 2005 09:59:21 -0000 1.1 --- DbConnectionType.cs 13 Apr 2005 04:23:37 -0000 1.2 *************** *** 13,32 **** private DbConnectionProviders _dbProviders; ! private bool _supportsServer = true; ! private bool _supportsName = true; ! private bool _supportsUserID = true; ! private bool _supportsPassword = true; public DbConnectionType() { _dbProviders = new DbConnectionProviders(); } ! public DbConnectionType( string name, DbType dbType, string provider, bool supportsServer, bool supportsName, bool supportsUserID, bool supportsPassword) : this() { Name = name; InternalProviderName= provider; DbType = dbType; ! SupportsServer = supportsServer; ! SupportsName = supportsName; ! SupportsUserID = supportsUserID; ! SupportsPassword = supportsPassword; } --- 13,57 ---- private DbConnectionProviders _dbProviders; ! private readonly string _defaultFile = "File Location"; ! private readonly string _defaultServer = "Server"; ! private readonly string _defaultName = "Database Name"; ! private readonly string _defaultUserID = "User ID"; ! private readonly string _defaultPassword= "Password"; ! private readonly string _defaultFilter = "Filter"; ! ! private string _promptFile = string.Empty; ! private string _promptServer = string.Empty; ! private string _promptName = string.Empty; ! private string _promptUserID = string.Empty; ! private string _promptPassword = string.Empty; ! private string _promptFilter = string.Empty; ! ! private bool _supportsServer = false; ! private bool _supportsName = false; ! private bool _supportsUserID = false; ! private bool _supportsPassword = false; ! private bool _supportsFilter = false; public DbConnectionType() { _dbProviders = new DbConnectionProviders(); } ! ! public DbConnectionType( string name, DbType dbType, DbProviderType provider) : this(name, dbType, DbProviderTypeConverter.Convert(provider)) { } ! ! public DbConnectionType( string name, DbType dbType, string provider) : this() { Name = name; InternalProviderName= provider; DbType = dbType; ! } ! ! public DbConnectionType( string name, DbType dbType, string provider, bool supportsServer, bool supportsName, bool supportsUserID, bool supportsPassword, bool supportsFilter) : this() { ! Name = name; ! InternalProviderName= provider; ! DbType = dbType; ! _supportsServer = supportsServer; ! _supportsName = supportsName; ! _supportsUserID = supportsUserID; ! _supportsPassword = supportsPassword; ! _supportsFilter = supportsFilter; } *************** *** 108,111 **** --- 133,141 ---- } + public string PromptServer { + get { return (_promptServer == string.Empty ? _defaultServer : _promptServer).Trim() + ":"; } + set { _promptServer = value; } + } + /// <summary> /// Returns true if this connection type supports a Name or Initial Catalog *************** *** 116,119 **** --- 146,154 ---- } + public string PromptName { + get { return (_promptName == string.Empty ? _defaultName : _promptName).Trim() + ":"; } + set { _promptName = value; } + } + /// <summary> /// Returns true if this connection type supports a UserID (Trusted do not) *************** *** 124,127 **** --- 159,167 ---- } + public string PromptUserID { + get { return (_promptUserID == string.Empty ? _defaultUserID : _promptUserID).Trim() + ":"; } + set { _promptUserID = value; } + } + /// <summary> /// Returns true if this connection type supports a Password *************** *** 132,135 **** --- 172,193 ---- } + public string PromptPassword { + get { return (_promptPassword == string.Empty ? _defaultPassword : _promptPassword).Trim() + ":"; } + set { _promptPassword = value; } + } + + /// <summary> + /// Returns true if this connection type supports a Password + /// </summary> + public bool SupportsFilter { + get { return _supportsFilter; } + set { _supportsFilter = value; } + } + + public string PromptFilter { + get { return (_promptFilter == string.Empty ? _defaultFilter : _promptFilter).Trim() + ":"; } + set { _promptFilter = value; } + } + /// <summary> /// Returns true if this connection type supports a File DNS specifier. If Server is false *************** *** 140,143 **** --- 198,206 ---- set { _supportsServer = !value; } } + + public string PromptFile { + get { return (_promptFile == string.Empty ? _defaultFile : _promptFile).Trim() + ":"; } + set { _promptFile = value; } + } } } Index: DbType.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DbType.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DbType.cs 28 Feb 2005 01:31:46 -0000 1.1.1.1 --- DbType.cs 13 Apr 2005 04:23:41 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- public enum DbType { + UNKNOWN, ACCESS, SQLSERVER, Index: Adapdev.Data.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Adapdev.Data.csproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Adapdev.Data.csproj 10 Apr 2005 09:59:06 -0000 1.4 --- Adapdev.Data.csproj 13 Apr 2005 04:23:37 -0000 1.5 *************** *** 111,114 **** --- 111,119 ---- /> <File + RelPath = "BinaryDataTable.resx" + DependentUpon = "BinaryDataTable.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "CommandTextViewer.cs" SubType = "Code" *************** *** 462,469 **** <File RelPath = "Xml\ProviderConfig.cs" ! SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Xml\ProviderConfig.xml" BuildAction = "Content" --- 467,479 ---- <File RelPath = "Xml\ProviderConfig.cs" ! SubType = "code" BuildAction = "Compile" /> <File + RelPath = "Xml\ProviderConfig.resx" + DependentUpon = "ProviderConfig.cs" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "Xml\ProviderConfig.xml" BuildAction = "Content" Index: DbConnectionTypes.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/DbConnectionTypes.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DbConnectionTypes.cs 10 Apr 2005 09:59:21 -0000 1.1 --- DbConnectionTypes.cs 13 Apr 2005 04:23:37 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- [Serializable] public class DbConnectionTypes : IDictionary, ICloneable { + #region Member Variables private const int DEFAULT_CAPACITY = 16; *************** *** 1369,1372 **** --- 1370,1379 ---- } #endregion + + #region Miscellaneous + public static DbConnectionType UnknownConnectionType () { + return new DbConnectionType("UnKnown", DbType.UNKNOWN, DbProviderType.UNKNOWN); + } + #endregion } } |
From: Trevor L. <tre...@us...> - 2005-04-12 10:23:37
|
Update of /cvsroot/adapdev/Adapdev/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23402/src Modified Files: AdapdevFramework.suo Log Message: Added Progress Dialog and threaded control for loading tables. Index: AdapdevFramework.suo =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/AdapdevFramework.suo,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 Binary files /tmp/cvsxDdgnK and /tmp/cvsOWtSZo differ |
From: Trevor L. <tre...@us...> - 2005-04-12 10:23:37
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23402/src/Adapdev.Windows.Forms Modified Files: Adapdev.Windows.Forms.csproj DatabaseSetting.cs Log Message: Added Progress Dialog and threaded control for loading tables. Index: Adapdev.Windows.Forms.csproj =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/Adapdev.Windows.Forms.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Adapdev.Windows.Forms.csproj 28 Feb 2005 01:55:12 -0000 1.2 --- Adapdev.Windows.Forms.csproj 12 Apr 2005 10:22:57 -0000 1.3 *************** *** 219,222 **** --- 219,232 ---- BuildAction = "None" /> + <File + RelPath = "Progress\ProgressWindow.cs" + SubType = "Form" + BuildAction = "Compile" + /> + <File + RelPath = "Progress\ProgressWindow.resx" + DependentUpon = "ProgressWindow.cs" + BuildAction = "EmbeddedResource" + /> </Include> </Files> Index: DatabaseSetting.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Windows.Forms/DatabaseSetting.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DatabaseSetting.cs 11 Apr 2005 11:24:05 -0000 1.3 --- DatabaseSetting.cs 12 Apr 2005 10:22:57 -0000 1.4 *************** *** 81,87 **** public DatabaseSchema GetDatabaseSchema() { ! DatabaseSchema schema = SchemaBuilder.CreateDatabaseSchema(this.OleDbConnectionString, this.DbType, this.DbProviderType); ! schema.ConnectionString = this.ConnectionString; ! return schema; } } --- 81,88 ---- public DatabaseSchema GetDatabaseSchema() { ! //TODO: Fix this --> DatabaseSchema schema = SchemaBuilder.CreateDatabaseSchema(this.OleDbConnectionString, this.DbType, this.DbProviderType); ! // schema.ConnectionString = this.ConnectionString; ! // return schema; ! return null; } } |
From: Trevor L. <tre...@us...> - 2005-04-12 10:23:37
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23402/src/Adapdev.Data/Schema Modified Files: SchemaBuilder.cs Log Message: Added Progress Dialog and threaded control for loading tables. Index: SchemaBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.Data/Schema/SchemaBuilder.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SchemaBuilder.cs 11 Apr 2005 11:24:04 -0000 1.3 --- SchemaBuilder.cs 12 Apr 2005 10:22:56 -0000 1.4 *************** *** 7,11 **** using Adapdev.Data; using Adapdev.Data.Sql; ! /// <summary> /// SchemaBuilder builds the schema for a specified database --- 7,11 ---- using Adapdev.Data; using Adapdev.Data.Sql; ! /// <summary> /// SchemaBuilder builds the schema for a specified database *************** *** 13,16 **** --- 13,17 ---- public class SchemaBuilder { + private static Adapdev.IProgressCallback _callback; private static DbProviderType dbProviderType; *************** *** 22,26 **** public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString) { ! return SchemaBuilder.CreateDatabaseSchema(oledbConnectionString, Adapdev.Data.DbType.ACCESS, DbProviderType.OLEDB); } --- 23,27 ---- public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString) { ! return SchemaBuilder.CreateDatabaseSchema(oledbConnectionString, Adapdev.Data.DbType.ACCESS, DbProviderType.OLEDB, null); } *************** *** 31,37 **** /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> ! public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString, string databaseType, string providerType) { ! return SchemaBuilder.CreateDatabaseSchema(oledbConnectionString, DbTypeConverter.Convert(databaseType), DbProviderTypeConverter.Convert(providerType)); } --- 32,38 ---- /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> ! public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString, string databaseType, string providerType, Adapdev.IProgressCallback progress) { ! return SchemaBuilder.CreateDatabaseSchema(oledbConnectionString, DbTypeConverter.Convert(databaseType), DbProviderTypeConverter.Convert(providerType), progress); } *************** *** 42,134 **** /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> ! public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString, Adapdev.Data.DbType databaseType, DbProviderType providerType) { dbProviderType = providerType; ! DataTable schemaTables = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Tables, ""); 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"; ! } ! // 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) ! { ! TableSchema ti = CreateTableSchema(dr); ! CreateColumnSchemas(ti, oledbConnectionString, databaseType); ! di.AddTable(ti); } - } ! // Get the primary key information ! DataTable pkeys = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Primary_Keys, ""); ! foreach (DataRow dr in pkeys.Rows) ! { ! string pkTable = dr["TABLE_NAME"].ToString(); ! 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, ""); ! foreach (DataRow dr in fkeys.Rows) ! { ! string fkTable = dr["FK_TABLE_NAME"].ToString(); ! TableSchema tif = di[fkTable]; ! if (tif != null) ! { ! ColumnSchema ci = tif[dr["FK_COLUMN_NAME"].ToString()]; ! if (ci != null) ! { ! ci.IsForeignKey = true; ! tif.AddColumn(ci); } } - } ! // Get the foreign key associations ! foreach (DataRow dr in fkeys.Rows) ! { ! // 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)); } } } - return di; } --- 43,151 ---- /// <param name="providerType">The DbProviderType to set the DatabaseSchema to</param> /// <returns></returns> ! public static DatabaseSchema CreateDatabaseSchema(string oledbConnectionString, Adapdev.Data.DbType databaseType, DbProviderType providerType, Adapdev.IProgressCallback progress) { + int recordCount = 0; dbProviderType = providerType; + _callback = progress as Adapdev.IProgressCallback; ! if (_callback != null) { ! _callback.SetText("Obtaining Schema Details",""); ! _callback.SetAutoClose(ProgressAutoCloseTypes.WaitOnEnd); ! } + DataTable schemaTables = SchemaBuilder.GetOleDbSchema(oledbConnectionString, OleDbSchemaGuid.Tables, "","","",""); 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; } return di; } *************** *** 203,207 **** } catch (Exception ex) { schemaTable = null; ! //throw new ApplicationException ("Could not retrieve column information for table " + tableName + "\n\n" + ex.Message, ex); } return schemaTable; --- 220,224 ---- } catch (Exception ex) { schemaTable = null; ! if (_callback != null) _callback.AddMessage(ProgressMessageTypes.Warning, "Could not load Column information for " + tableName); } return schemaTable; *************** *** 215,232 **** /// <param name="filter"></param> /// <returns></returns> ! public static DataTable GetOleDbSchema(string oledbConnectionString, Guid guid, string filter) ! { ! DataTable schemaTable; OleDbConnection conn = new OleDbConnection(oledbConnectionString); - conn.Open(); ! if (filter.Length > 0) ! { ! schemaTable = conn.GetOleDbSchemaTable(guid, ! new object[] {null, null, null, filter}); ! } ! else ! { ! schemaTable = conn.GetOleDbSchemaTable(guid, null); } conn.Close(); --- 232,257 ---- /// <param name="filter"></param> /// <returns></returns> ! public static DataTable GetOleDbSchema(string oledbConnectionString, Guid guid, string filterCatalog, string filterSchema, string filterName, string filterType) { ! DataTable schemaTable = null; OleDbConnection conn = new OleDbConnection(oledbConnectionString); 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,242 **** StringBuilder sb = new StringBuilder(); DataTable schemaTable; ! schemaTable = GetOleDbSchema(oledbConnection, guid, filter); foreach (DataRow row in schemaTable.Rows) --- 263,267 ---- StringBuilder sb = new StringBuilder(); DataTable schemaTable; ! schemaTable = GetOleDbSchema(oledbConnection, guid, "","","",filter); foreach (DataRow row in schemaTable.Rows) *************** *** 258,261 **** --- 283,323 ---- } + + 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; + } + + private static bool EndProgress (string message, bool ok) { + if (_callback != null) { + if (_callback.IsAborting) return false; + _callback.SetText(message,""); + _callback.SetRange(0, 1); + if (ok) { + _callback.StepTo(1); + } else { + _callback.StepTo(0); + _callback.AddMessage(ProgressMessageTypes.Critical,"No database schema information found."); + } + } + return true; + } + + private static bool IncrProgress(string message, ref int count) + { + if (_callback != null) { + if (_callback.IsAborting) return false; + _callback.SetText(message); + _callback.StepTo(count++); + } + return true; + } + public static StringBuilder PrintReaderSchema(string oledbConnectionString, string table, Adapdev.Data.DbType databaseType) { |