You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(56) |
Nov
(13) |
Dec
(36) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(7) |
Feb
(55) |
Mar
(33) |
Apr
(71) |
May
(12) |
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Richard B. <rb...@us...> - 2004-12-17 00:29:32
|
Update of /cvsroot/jcframework/FrameworkMapper/AFMappingClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18233/AFMappingClasses Modified Files: CAssociationEntry.vb Log Message: Fixed an issue with drag and drop for associations Index: CAssociationEntry.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/AFMappingClasses/CAssociationEntry.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CAssociationEntry.vb 10 Dec 2004 04:31:13 -0000 1.1 +++ CAssociationEntry.vb 17 Dec 2004 00:29:17 -0000 1.2 @@ -101,30 +101,42 @@ #Region "IDataErrorInfo" <Browsable(False)> Public ReadOnly Property [Error]() As String Implements System.ComponentModel.IDataErrorInfo.Error Get - If _fromAttribute Is Nothing Then - Return "Missing FromAttribute" - End If - If _toAttribute Is Nothing Then - Return "Missing ToAttribute" - End If - If _parentAssociation Is Nothing Then - Return "Missing Association" - End If + 'If _fromAttribute Is Nothing Then + ' Return "Missing FromAttribute" + 'End If + 'If _toAttribute Is Nothing Then + ' Return "Missing ToAttribute" + 'End If + 'If _parentAssociation Is Nothing Then + ' Return "Missing Association" + 'End If Dim found As Integer = 0 - For Each ae As CAssociationEntry In _parentAssociation.Entries - If _fromAttribute.Name = ae.fromAttribute.Name Then - found += 1 - End If - Next + Try + For Each ae As CAssociationEntry In _parentAssociation.Entries + If _fromAttribute.Name = ae.fromAttribute.Name Then + found += 1 + End If + Next + Catch + End Try + If Not _fromAttribute Is Nothing And found = 0 Then + Return "From Attribute is not in the From Class" + End If If found > 1 Then Return "From Attribute appears more than once" End If found = 0 - For Each ae As CAssociationEntry In _parentAssociation.Entries - If _toAttribute.Name = ae.toAttribute.Name Then - found += 1 - End If - Next + Try + For Each ae As CAssociationEntry In _parentAssociation.Entries + If _toAttribute.Name = ae.toAttribute.Name Then + found += 1 + End If + Next + Catch + End Try + If Not _toAttribute Is Nothing And found = 0 Then + Return "To Attribute is not in the ToClass" + End If If found > 1 Then Return "To Attribute appears more than once" End If |
From: Richard B. <rb...@us...> - 2004-12-17 00:29:28
|
Update of /cvsroot/jcframework/FrameworkMapper In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18233 Modified Files: README.txt frmClassInfo.vb Log Message: Fixed an issue with drag and drop for associations Index: frmClassInfo.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmClassInfo.vb,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- frmClassInfo.vb 10 Dec 2004 04:31:12 -0000 1.2 +++ frmClassInfo.vb 17 Dec 2004 00:29:18 -0000 1.3 @@ -293,6 +293,16 @@ ListView1.EndUpdate() End Sub + Private Sub reloadListView(ByVal ass As CMappedAssociation) + reloadListView() + If Not ass Is Nothing Then + frmMain.fProperties.CurrentObject = ass + frmMain.fProperties.Refresh() + DataGrid2.DataSource = ass.Entries + End If + End Sub + + Private Sub DataGrid1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles DataGrid1.DragEnter If isOKToDrop(e) Then e.Effect = e.AllowedEffect @@ -394,7 +404,7 @@ ' We try to see if we can match all key fields in target class to fields in ' source class. if we can then we assume it's a 1-1 association ' - Dim i As Integer + Dim i As Integer = 0 Dim entryCol As New Collection For Each toAttr In cls.Attributes If toAttr.isKey Then @@ -410,7 +420,7 @@ Next End If Next - If entryCol.Count = i Then + If entryCol.Count = i And i > 0 Then 'Each entry was matched so populate attributes For Each entry In entryCol ass.Entries.Add(entry) @@ -455,7 +465,7 @@ End Try ass.Name = s MappedClass.Associations.Add(ass, s) - reloadListView() + reloadListView(ass) End If End Sub Index: README.txt =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/README.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README.txt 12 Oct 2004 23:10:17 -0000 1.1 +++ README.txt 17 Dec 2004 00:29:18 -0000 1.2 @@ -6,26 +6,60 @@ 1. Generate the AtomsFramework XML file 2. Generate vb/c# classes based on the mappings -3. Facilitate refactoring of code by allowing changes to be made to existing code +3. Generate scripts for databases +4. Facilitate refactoring of code by allowing changes to be made to existing code -In order for this product to work you will need to get a copy of DockPanelSuite from http://sourceforge.net/projects/dockpanelsuite/ (I'm using version 0.9.2.10) +---------------- +Prerequisites + +This program relies on other projects to work properly. You will need copies of + +1. DockPanelSuite from http://sourceforge.net/projects/dockpanelsuite/ (I'm using version 0.9.2.10 - the .dll is included with this distribution) +2. CodeSmith v2.6+ for codegeneration. http://www.ericjsmith.net/codesmith/ +3. WinMerge 2.0+ for viewing differences. http://winmerge.sourceforge.net/ + +When you start the program, you will need to indicate where CodeSmith and WinMerge are located. Go to the Tools->Options menu item and enter details as appropriate. --------------- -The roadmap for development is something like the following: +Documentation -1. Add support for WinMerge (or user selectable diff tool) so that you can visually see the difference between loaded XML file and generated XML file. +There's not a lot of documentation at this stage, but the basics steps to use the program are: -2. On generating the XML, generate to a temp file. Compare to original XML - if the same the delete temp file, otherwise show differences and save over the top of the original XML. +1. Create a new project, and set project properties for codesmith templates to use, and where files live, etc. Save the project. -3. Add support for code generation. I'd like to do it based on a user-selectable (and definable) template set. There should be a codesmith template available in the near future and I'd like to use this tool for generating if possible (why reinvent the wheel :-) +2. Add a database connection (MSSQL server only at this stage) -4. Use the diff tool to show differences between generated code and existing code so that refactoring shows exactly what has changed. +3. Create a new class, and map database fields to the class by either drag-dropping the whole table on the grid, drag-dropping individual fields, or manually entering details. -5. Try to generate SQL scripts for creating db schemas on target databases so that deployment of solutions on client machines is simpler. +4. Generate a new .XML mapping file by selecting Tools->Generate XML. NOTE: YOU MUST DO THIS TO SAVE CLASS CHANGES. -6. Visual representation of class associations instead of grid based ones. Maybe a nice drag/drop interface etc, using a subset of the UML notation. +5. Generate a business object. + +6. Rinse and Repeat :-) + +Please note that if you move the scripts to another directory, you should also copy the CodeSmithDataClasses.dll. This is a helper dll I've written to make scripts easier to write by referencing object structures... Codesmith needs this file in the same location as the .cst file it is executing otherwise it will complain. + +---------------- +Additions since 0.1 Pre-Alpha are + +1. Support added for WinMerge (or user selectable diff tool) so that you can visually see the difference between a generated file and the existing one. Applies to both XML Mapping files and business classes. + +2. Support for code generation via codesmith +3. A few bug fixes - but I'm sure I've introduced a lot more :-) + +---------------- +Still to come... +1. Scripts to generate SQL for creating db schemas + +2. Visual representation of class associations instead of grid based ones. Maybe a nice drag/drop interface etc, using a subset of the UML notation. + +3. Massive clean up + +4. Proper documentation + +5. Install kit. Any assistance and/or suggestions with this tool would be very appreciated and most welcome. |
From: Richard B. <rb...@us...> - 2004-12-17 00:28:50
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18057 Modified Files: CPersistenceBroker.vb Log Message: Error handling around the persistence broker. Fixed a problem in the deletePrivateObject Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- CPersistenceBroker.vb 15 Dec 2004 23:46:11 -0000 1.82 +++ CPersistenceBroker.vb 17 Dec 2004 00:28:37 -0000 1.83 @@ -193,12 +193,15 @@ Finally cm.RelationalDatabase.freeConnection(conn) outTicks = Now.Ticks - PCAverageTime.RawValue = outTicks - inTicks - PCAverageTimeBase.Increment() + Try + PCAverageTime.RawValue = outTicks - inTicks + PCAverageTimeBase.Increment() + Catch + End Try If Not x Is Nothing Then Throw x End If - End Try + End Try End SyncLock End Function @@ -273,7 +276,10 @@ Dim t As Type Dim resetLoadingFlag As Boolean - PCReads.Increment() + Try + PCReads.Increment() + Catch + End Try 'Storage for maps we will use to retrieve data (for the sql query) 'each entry will store the class map and the sql alias for the map @@ -288,7 +294,7 @@ Dim isfirst As Boolean = True Dim am As CAttributeMap - cm = obj.getClassMap + cm = obj.GetClassMap Debug.WriteLine("retrievePrivateObject: " & cm.Name) @@ -306,7 +312,10 @@ If t Is obj.GetObjectType Or t.IsSubclassOf(obj.GetObjectType) Then Debug.WriteLine("retrievePrivateObject: retreived from cache") obj = tmpObj - PCCacheHits.Increment() + Try + PCCacheHits.Increment() + Catch + End Try Return True End If End If @@ -347,7 +356,10 @@ 'Execute it and fill the data Dim rs As CResultset - PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try rs = conn.processSelectStatement(statement) Debug.WriteLine("Select statement returned " & rs.ResultSet.Tables(0).Rows.Count & " row(s)") If rs.ResultSet.Tables(0).Rows.Count > 0 Then @@ -383,9 +395,12 @@ cm3 = cm2 cm2 = cm2.SuperClass End While - obj.IsProxy = False 'Need to set non-proxy in case object is loaded via a retrieve criteria - m_cache.Add(obj) 'Add retrieved object to the cache - PCCacheSize.RawValue = m_cache.Count + obj.IsProxy = False 'Need to set non-proxy in case object is loaded via a retrieve criteria + m_cache.Add(obj) 'Add retrieved object to the cache + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try j = classMapCount + 1 Dim rw As DataRow @@ -414,11 +429,17 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj - PCCacheHits.Increment() + Try + PCCacheHits.Increment() + Catch + End Try Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If obj.SetAttributeValue(udamap.Target, targetobj.GetSourceObject) If Not targetobj.AssociationsLoaded Then @@ -448,11 +469,17 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj - PCCacheHits.Increment() + Try + PCCacheHits.Increment() + Catch + End Try Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If If Not targetobj.AssociationsLoaded Then If udamap.LazyLoad Then @@ -479,11 +506,17 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj - PCCacheHits.Increment() + Try + PCCacheHits.Increment() + Catch + End Try Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If If Not targetobj.AssociationsLoaded Then If udamap.LazyLoad Then @@ -515,11 +548,17 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj - PCCacheHits.Increment() + Try + PCCacheHits.Increment() + Catch + End Try Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If 'Need to determine if new object is already in the collection @@ -563,11 +602,17 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj - PCCacheHits.Increment() + Try + PCCacheHits.Increment() + Catch + End Try Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If 'Need to determine if new object is already in the collection '(prevents duplicates when multiple one-to-many associations exist) @@ -620,7 +665,10 @@ m_cache.ObjectsAreLoading = False End If m_cache.Add(obj) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try Return True End Function @@ -667,7 +715,10 @@ If Value.HasValidKey Then anObjPers = m_cache.Item(Value) If Not anObjPers Is Nothing Then - PCCacheHits.Increment() + Try + PCCacheHits.Increment() + Catch + End Try Value = anObjPers Value.IsDirty = False Value.OriginalCacheKey = New CCacheKey(Value) @@ -692,7 +743,10 @@ retrieveObject(Value, False, False) Else Value = anObjPers - PCCacheHits.Increment() + Try + PCCacheHits.Increment() + Catch + End Try End If Value.IsDirty = False 'After populating a new object Value.OriginalCacheKey = New CCacheKey(Value) @@ -724,7 +778,10 @@ anObjPers.OriginalCacheKey = New CCacheKey(anObjPers) col.Add(anObjPers.GetSourceObject) m_cache.Add(anObjPers) 'Add retrieved objects to the cache - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try cursor.nextCursor() End While End If @@ -777,8 +834,11 @@ End Try cm.RelationalDatabase.freeConnection(conn) outTicks = Now.Ticks - PCAverageTime.RawValue = outTicks - inTicks - PCAverageTimeBase.Increment() + Try + PCAverageTime.RawValue = outTicks - inTicks + PCAverageTimeBase.Increment() + Catch + End Try End SyncLock End Sub @@ -825,13 +885,19 @@ If obj.Persistent Then statement = cm.getUpdateSqlFor(obj) conn.processStatement(statement) - PCSQLHits.Increment() - PCUpdates.Increment() + Try + PCSQLHits.Increment() + PCUpdates.Increment() + Catch + End Try Else statement = cm.getInsertSqlFor(obj) conn.processStatement(statement) - PCSQLHits.Increment() - PCInserts.Increment() + Try + PCSQLHits.Increment() + PCInserts.Increment() + Catch + End Try If cm.getIdentitySize > 0 Then If CInt(cm.RelationalDatabase.getValueFor(obj.GetValueByAttribute(cm.getIdentityAttributeMap(1).Name))) = 0 Then obj.SetAttributeValue(cm.getIdentityAttributeMap(1).Name, cm.RelationalDatabase.getIdentityValue(conn)) @@ -849,13 +915,19 @@ If Not obj.GetObjectType.IsSubclassOf(GetType(CPersistentObject)) Then If Not obj.OriginalCacheKey Is Nothing Then m_cache.Remove(obj.OriginalCacheKey) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If End If obj.OriginalCacheKey = New CCacheKey(obj) If m_useCache Then m_cache.Add(obj) 'Add to the cache - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If End Sub @@ -899,19 +971,22 @@ Try deletePrivateObject(obj, conn, deleteSuperClass) conn.commit() - Catch ex As Exception + Catch ex As Exception x = New DeleteException(ex.Message, ex) conn.rollback() Finally cm.RelationalDatabase.freeConnection(conn) outTicks = Now.Ticks - PCAverageTime.RawValue = outTicks - inTicks - PCAverageTimeBase.Increment() - PCAverageTime.NextSample() + Try + PCAverageTime.RawValue = outTicks - inTicks + PCAverageTimeBase.Increment() + PCAverageTime.NextSample() + Catch + End Try If Not x Is Nothing Then Throw x End If - End Try + End Try End SyncLock End Sub @@ -930,7 +1005,10 @@ Public Sub deleteCachedObject(ByVal obj As IPersistableObject) If m_useCache Then m_cache.Remove(obj) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If End Sub @@ -971,7 +1049,11 @@ Dim myKeys(cm.AssociationMaps.Count) As String cm.AssociationMaps.Keys.CopyTo(myKeys, 0) - PCDeletes.Increment() + Try + PCDeletes.Increment() + Catch + End Try + For i = 0 To cm.AssociationMaps.Count - 1 udaMap = cm.AssociationMaps.Item(myKeys(i)) @@ -989,7 +1071,11 @@ col = obj.GetCollectionByAttribute(udaMap.Target) If Not col Is Nothing Then For k = 0 To col.Count - 1 - Value = col.Item(k) + If col.Item(k).GetType.IsSubclassOf(GetType(CPersistentObject)) Then + Value = col.Item(k) + Else + Value = Me.getInjectedObject(col.Item(k)) + End If If retrieveObject(Value, False, True) Then 'If Value.Retrieve Then deletePrivateObject(Value, conn, deleteSuperClass) @@ -1004,7 +1090,10 @@ Dim statement As CSqlStatement statement = clMap.getDeleteSqlFor(obj) - PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try conn.processStatement(statement) If deleteSuperClass Then @@ -1022,7 +1111,10 @@ obj.Persistent = False If m_useCache Then m_cache.Remove(obj) 'remove from the cache - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If colCriteriaParameters = Nothing End Sub @@ -1305,12 +1397,18 @@ ''' </history> '''----------------------------------------------------------------------------- Private Function processPrivateCriteria(ByVal pCriteria As CRetrieveCriteria, ByVal conn As _CConnection, ByVal fullObjects As Boolean) As CCursor - PCCriteria.Increment() + Try + PCCriteria.Increment() + Catch + End Try Dim statement As CSqlStatement statement = pCriteria.getSqlStatementParameters(fullObjects) - PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try Dim rs As CResultset rs = conn.processSelectStatement(statement) @@ -1338,12 +1436,18 @@ ''' </history> '''----------------------------------------------------------------------------- Private Function processCriteria(ByVal pCriteria As CRetrieveCriteria, ByVal colCriteriaParameters As Collection, ByVal conn As _CConnection) As CCursor - PCCriteria.Increment() + Try + PCCriteria.Increment() + Catch + End Try Dim statement As CSqlStatement statement = pCriteria.getSqlStatementParameters() - PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try Dim rs As CResultset rs = conn.processSelectStatement(statement) @@ -1386,7 +1490,10 @@ Public Sub addToCache(ByRef obj As CPersistentObject) If m_useCache Then m_cache.Add(obj) - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End If End Sub @@ -1403,7 +1510,11 @@ ''' </history> '''----------------------------------------------------------------------------- Public Function processMultiRetrieveCriteria(ByRef pCriteria As CMultiRetrieveCriteria, ByVal fullObjects As Boolean) As CCursor - PCCriteria.Increment() + Try + PCCriteria.Increment() + Catch + End Try + Dim clMap As CClassMap clMap = pCriteria.getFirstObject.GetClassMap @@ -1415,7 +1526,10 @@ statement = pCriteria.getSqlStatementParameters(fullObjects) conn.AutoCommit = False - PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try Dim cursor As CCursor Dim rs As CResultset @@ -1449,7 +1563,11 @@ ''' </history> '''----------------------------------------------------------------------------- Public Function processMultiSummaryCriteria(ByRef pCriteria As CMultiSummaryCriteria) As CCursor - PCCriteria.Increment() + Try + PCCriteria.Increment() + Catch + End Try + Dim clMap As CClassMap clMap = pCriteria.getFirstObject.GetClassMap @@ -1462,7 +1580,11 @@ conn.AutoCommit = False - PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try + Dim cursor As CCursor Dim rs As CResultset Try @@ -1515,7 +1637,11 @@ ''' </history> '''----------------------------------------------------------------------------- Public Function processSummaryCriteria(ByRef obj As CPersistentObject, ByRef pCriteria As CSummaryCriteria) As CCursor - PCCriteria.Increment() + Try + PCCriteria.Increment() + Catch + End Try + Dim clMap As CClassMap clMap = obj.getClassMap(obj) @@ -1528,7 +1654,11 @@ conn.AutoCommit = False - PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try + Dim cursor As CCursor Dim rs As CResultset Try @@ -1670,7 +1800,11 @@ conn = firstClassMap.RelationalDatabase.getConnection(Nothing) conn.AutoCommit = False - PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try + Dim cursor As CCursor Dim rs As CResultset rs = conn.processSelectStatement(statement) @@ -1683,9 +1817,9 @@ Return cursor Catch - firstClassMap.RelationalDatabase.freeConnection(conn) - Return Nothing - End Try + firstClassMap.RelationalDatabase.freeConnection(conn) + Return Nothing + End Try End Function @@ -2458,7 +2592,11 @@ cursor.ClassMap = Nothing cursor.HoldsProxies = False st.SqlString = SQLString - 'PCSQLHits.Increment() + Try + PCSQLHits.Increment() + Catch + End Try + cursor.ResultSet = database.getConnection(Nothing).processSelectStatement(st) Return cursor End Function @@ -2492,7 +2630,10 @@ m_databases = Nothing m_cache = Nothing m_disposed = True - PCCacheSize.RawValue = 0 + Try + PCCacheSize.RawValue = 0 + Catch + End Try End If End If End Sub @@ -2510,7 +2651,10 @@ Public Sub ClearCache() m_cache.Clear() - PCCacheSize.RawValue = m_cache.Count + Try + PCCacheSize.RawValue = m_cache.Count + Catch + End Try End Sub Public Sub GetObject(ByRef obj As Object) @@ -2677,98 +2821,102 @@ End Property Friend Sub InitPerformanceCounters() - If Not PerformanceCounterCategory.Exists("AtomsFramework") Then - - Dim CCDC As New CounterCreationDataCollection + Try + If Not PerformanceCounterCategory.Exists("AtomsFramework") Then - Dim SQLHitsCount64 As New CounterCreationData - SQLHitsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 - SQLHitsCount64.CounterHelp = "SQLStatements Executed per Sec." - SQLHitsCount64.CounterName = "PCSQLHits" - CCDC.Add(SQLHitsCount64) + Dim CCDC As New CounterCreationDataCollection - Dim CacheHitsCount64 As New CounterCreationData - CacheHitsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 - CacheHitsCount64.CounterHelp = "Cache Reads per Sec." - CacheHitsCount64.CounterName = "PCCacheHits" - CCDC.Add(CacheHitsCount64) + Dim SQLHitsCount64 As New CounterCreationData + SQLHitsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + SQLHitsCount64.CounterHelp = "SQLStatements Executed per Sec." + SQLHitsCount64.CounterName = "PCSQLHits" + CCDC.Add(SQLHitsCount64) - Dim InsertsCount64 As New CounterCreationData - InsertsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 - InsertsCount64.CounterHelp = "Inserts per Sec." - InsertsCount64.CounterName = "PCInserts" - CCDC.Add(InsertsCount64) + Dim CacheHitsCount64 As New CounterCreationData + CacheHitsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + CacheHitsCount64.CounterHelp = "Cache Reads per Sec." + CacheHitsCount64.CounterName = "PCCacheHits" + CCDC.Add(CacheHitsCount64) - Dim UpdatesCount64 As New CounterCreationData - UpdatesCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 - UpdatesCount64.CounterHelp = "Updates per Sec." - UpdatesCount64.CounterName = "PCUpdates" - CCDC.Add(UpdatesCount64) + Dim InsertsCount64 As New CounterCreationData + InsertsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + InsertsCount64.CounterHelp = "Inserts per Sec." + InsertsCount64.CounterName = "PCInserts" + CCDC.Add(InsertsCount64) - Dim ReadsCount64 As New CounterCreationData - ReadsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 - ReadsCount64.CounterHelp = "Reads per Sec." - ReadsCount64.CounterName = "PCReads" - CCDC.Add(ReadsCount64) + Dim UpdatesCount64 As New CounterCreationData + UpdatesCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + UpdatesCount64.CounterHelp = "Updates per Sec." + UpdatesCount64.CounterName = "PCUpdates" + CCDC.Add(UpdatesCount64) - Dim DeletesCount64 As New CounterCreationData - DeletesCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 - DeletesCount64.CounterHelp = "Deletes per Sec." - DeletesCount64.CounterName = "PCDeletes" - CCDC.Add(DeletesCount64) + Dim ReadsCount64 As New CounterCreationData + ReadsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + ReadsCount64.CounterHelp = "Reads per Sec." + ReadsCount64.CounterName = "PCReads" + CCDC.Add(ReadsCount64) - Dim CriteriaCount64 As New CounterCreationData - CriteriaCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 - CriteriaCount64.CounterHelp = "xCriteria per Sec." - CriteriaCount64.CounterName = "PCCriteria" - CCDC.Add(CriteriaCount64) + Dim DeletesCount64 As New CounterCreationData + DeletesCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + DeletesCount64.CounterHelp = "Deletes per Sec." + DeletesCount64.CounterName = "PCDeletes" + CCDC.Add(DeletesCount64) - Dim CacheSizeCount64 As New CounterCreationData - CacheSizeCount64.CounterType = PerformanceCounterType.NumberOfItems64 - CacheSizeCount64.CounterHelp = "Cache Size (No. of entries)" - CacheSizeCount64.CounterName = "PCCacheSize" - CCDC.Add(CacheSizeCount64) + Dim CriteriaCount64 As New CounterCreationData + CriteriaCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + CriteriaCount64.CounterHelp = "xCriteria per Sec." + CriteriaCount64.CounterName = "PCCriteria" + CCDC.Add(CriteriaCount64) - Dim AvgOpTimeCount64 As New CounterCreationData - AvgOpTimeCount64.CounterType = PerformanceCounterType.AverageTimer32 - AvgOpTimeCount64.CounterHelp = "Average Operation Time" - AvgOpTimeCount64.CounterName = "PCAverageTime" - CCDC.Add(AvgOpTimeCount64) + Dim CacheSizeCount64 As New CounterCreationData + CacheSizeCount64.CounterType = PerformanceCounterType.NumberOfItems64 + CacheSizeCount64.CounterHelp = "Cache Size (No. of entries)" + CacheSizeCount64.CounterName = "PCCacheSize" + CCDC.Add(CacheSizeCount64) - Dim BaseAvgOpTimeCount64 As New CounterCreationData - BaseAvgOpTimeCount64.CounterType = PerformanceCounterType.AverageBase - BaseAvgOpTimeCount64.CounterName = "Average Operation Time Count" - BaseAvgOpTimeCount64.CounterHelp = "PCAverageTimeBase" - CCDC.Add(BaseAvgOpTimeCount64) + Dim AvgOpTimeCount64 As New CounterCreationData + AvgOpTimeCount64.CounterType = PerformanceCounterType.AverageTimer32 + AvgOpTimeCount64.CounterHelp = "Average Operation Time" + AvgOpTimeCount64.CounterName = "PCAverageTime" + CCDC.Add(AvgOpTimeCount64) - ' Create the category. - PerformanceCounterCategory.Create("AtomsFramework", "Performance Counters for the AtomsFramework", CCDC) - End If + Dim BaseAvgOpTimeCount64 As New CounterCreationData + BaseAvgOpTimeCount64.CounterType = PerformanceCounterType.AverageBase + BaseAvgOpTimeCount64.CounterName = "Average Operation Time Count" + BaseAvgOpTimeCount64.CounterHelp = "PCAverageTimeBase" + CCDC.Add(BaseAvgOpTimeCount64) - Dim instanceName As String - instanceName = System.Diagnostics.Process.GetCurrentProcess.ProcessName - ' Create the counters. - PCSQLHits = New PerformanceCounter("AtomsFramework", "PCSQLHits", False) - PCCacheHits = New PerformanceCounter("AtomsFramework", "PCCacheHits", False) - PCInserts = New PerformanceCounter("AtomsFramework", "PCInserts", False) - PCUpdates = New PerformanceCounter("AtomsFramework", "PCUpdates", False) - PCReads = New PerformanceCounter("AtomsFramework", "PCReads", False) - PCDeletes = New PerformanceCounter("AtomsFramework", "PCDeletes", False) - PCCriteria = New PerformanceCounter("AtomsFramework", "PCCriteria", False) - PCCacheSize = New PerformanceCounter("AtomsFramework", "PCCacheSize", False) - PCAverageTime = New PerformanceCounter("AtomsFramework", "PCAverageTime", False) - PCAverageTimeBase = New PerformanceCounter("AtomsFramework", "PCAverageTimeBase", False) + ' Create the category. + PerformanceCounterCategory.Create("AtomsFramework", "Performance Counters for the AtomsFramework", CCDC) + End If - PCSQLHits.RawValue = 0 - PCCacheHits.RawValue = 0 - PCInserts.RawValue = 0 - PCUpdates.RawValue = 0 - PCReads.RawValue = 0 - PCDeletes.RawValue = 0 - PCCriteria.RawValue = 0 - PCCacheSize.RawValue = 0 - PCAverageTime.RawValue = 0 - PCAverageTimeBase.RawValue = 0 + Dim instanceName As String + instanceName = System.Diagnostics.Process.GetCurrentProcess.ProcessName + ' Create the counters. + PCSQLHits = New PerformanceCounter("AtomsFramework", "PCSQLHits", False) + PCCacheHits = New PerformanceCounter("AtomsFramework", "PCCacheHits", False) + PCInserts = New PerformanceCounter("AtomsFramework", "PCInserts", False) + PCUpdates = New PerformanceCounter("AtomsFramework", "PCUpdates", False) + PCReads = New PerformanceCounter("AtomsFramework", "PCReads", False) + PCDeletes = New PerformanceCounter("AtomsFramework", "PCDeletes", False) + PCCriteria = New PerformanceCounter("AtomsFramework", "PCCriteria", False) + PCCacheSize = New PerformanceCounter("AtomsFramework", "PCCacheSize", False) + PCAverageTime = New PerformanceCounter("AtomsFramework", "PCAverageTime", False) + PCAverageTimeBase = New PerformanceCounter("AtomsFramework", "PCAverageTimeBase", False) + PCSQLHits.RawValue = 0 + PCCacheHits.RawValue = 0 + PCInserts.RawValue = 0 + PCUpdates.RawValue = 0 + PCReads.RawValue = 0 + PCDeletes.RawValue = 0 + PCCriteria.RawValue = 0 + PCCacheSize.RawValue = 0 + PCAverageTime.RawValue = 0 + PCAverageTimeBase.RawValue = 0 + Catch ex As Exception + Trace.WriteLine("Could not create performance counters. If using ASP.NET please see http://objectsharp.com/Blogs/bruce/archive/2003/12/05/222.aspx" & _ + vbCrLf & ex.Message) + End Try End Sub End Class \ No newline at end of file |
From: Richard B. <rb...@us...> - 2004-12-15 23:46:25
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5669 Modified Files: AToMSFramework.vbproj CClassMap.vb CJoin.vb CPersistenceBroker.vb readme.html Added Files: XMLMapping.xsd XMLMapping.xsx Log Message: Fixed bug in SQL generation for joins to objects that have subclasses using shared table fields. Added XSD for XML mapping files. Index: AToMSFramework.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/AToMSFramework.vbproj,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- AToMSFramework.vbproj 18 Oct 2004 01:36:43 -0000 1.19 +++ AToMSFramework.vbproj 15 Dec 2004 23:46:04 -0000 1.20 @@ -80,7 +80,7 @@ <Reference Name = "ByteFX.MySqlClient" AssemblyName = "ByteFX.MySqlClient" - HintPath = "bin\ByteFX.MySqlClient.dll" + HintPath = "..\ByteFX.MySqlClient.76.NI\ByteFX.MySqlClient.dll" /> </References> <Imports> @@ -388,6 +388,15 @@ SubType = "Code" BuildAction = "Compile" /> + <File + RelPath = "XMLMapping.xsd" + BuildAction = "Content" + /> + <File + RelPath = "XMLMapping.xsx" + DependentUpon = "XMLMapping.xsd" + BuildAction = "None" + /> </Include> </Files> </VisualBasic> Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- CPersistenceBroker.vb 6 Dec 2004 00:57:05 -0000 1.81 +++ CPersistenceBroker.vb 15 Dec 2004 23:46:11 -0000 1.82 @@ -444,7 +444,7 @@ classMapCount += Me.getChildCountForMultipleInheritance(udamap.ForClass) classMapCount -= 1 'This is because we added one in the beginning of the for loop - If Not targetobj Is Nothing And targetobj.Persistent Then + If Not targetobj Is Nothing AndAlso targetobj.Persistent Then tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj @@ -511,7 +511,7 @@ 'update classMapCount with the child count number classMapCount += Me.getChildCountForMultipleInheritance(udamap.ForClass) classMapCount -= 1 'This is because we added one in the beginning of the for loop - If Not targetobj Is Nothing And targetobj.Persistent Then + If Not targetobj Is Nothing AndAlso targetobj.Persistent Then tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj @@ -2113,11 +2113,13 @@ Dim mapName As String For Each de In classMap.ChildrenMaps() cm = de.Value - classMapCount += 1 - mapName = "t" & classMapCount.ToString - rMaps.Add(mapName, cm) - joins = New CJoin(joins, cm, mapName, False) - Me.createJoinForMultipleInheritance(cm, classMapCount, joins, rMaps) + If cm.getReferenceSize > 0 Then + classMapCount += 1 + mapName = "t" & classMapCount.ToString + rMaps.Add(mapName, cm) + joins = New CJoin(joins, cm, mapName, False) + Me.createJoinForMultipleInheritance(cm, classMapCount, joins, rMaps) + End If Next End Sub @@ -2147,11 +2149,13 @@ For Each de In classMap.ChildrenMaps cm = de.Value - 'recursive call to retrieve base objects - obj = Me.createTargetObjectForMultipleInheritance(cm, objectType, classNameSpace, dataRow, joins, conn) - If Not obj Is Nothing And obj.Persistent Then - 'Found the obj - Return obj + If cm.getReferenceSize > 0 Then + 'recursive call to retrieve base objects + obj = Me.createTargetObjectForMultipleInheritance(cm, objectType, classNameSpace, dataRow, joins, conn) + If Not obj Is Nothing And obj.Persistent Then + 'Found the obj + Return obj + End If End If Next --- NEW FILE: XMLMapping.xsd --- <?xml version="1.0" encoding="utf-8" ?> <xs:schema id="XMLMapping" targetNamespace="http://tempuri.org/XMLMapping.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLMapping.xsd" xmlns:mstns="http://tempuri.org/XMLMapping.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="map"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element name="database" minOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" form="unqualified" type="paramNames" use="required" /> <xs:attribute name="value" form="unqualified" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="class" form="unqualified" type="DBClassType" use="required" /> </xs:complexType> </xs:element> <xs:element name="class"> <xs:complexType> <xs:sequence> <xs:element name="attribute" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="name" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="column" form="unqualified" type="xs:string" /> <xs:attribute name="find" form="unqualified" type="TrueFalse" /> <xs:attribute name="key" form="unqualified" type="keyType" /> <xs:attribute name="proxy" form="unqualified" type="TrueFalse" /> <xs:attribute name="timestamp" form="unqualified" type="TrueFalse" /> <xs:attribute name="reference" form="unqualified" type="xs:string" /> <xs:attribute name="identity" type="TrueFalse" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="table" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="database" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="namespace" form="unqualified" type="xs:string" /> <xs:attribute name="superclass" form="unqualified" type="xs:string" /> <xs:attribute name="readonly" type="TrueFalse" /> <xs:attribute name="modifyonly" type="TrueFalse" /> <xs:attribute name="owner" type="xs:string" /> <xs:attribute name="sharedtablefield" type="xs:string" /> <xs:attribute name="sharedtablevalue" type="xs:string" /> <xs:attribute name="assemblypath" type="xs:string" /> <xs:attribute name="superclassnamespace" type="xs:string" /> <xs:attribute name="factory" type="xs:string" /> </xs:complexType> </xs:element> <xs:element name="association"> <xs:complexType> <xs:sequence> <xs:element name="entry" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="fromAttribute" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="toAttribute" form="unqualified" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="fromClass" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="toClass" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="cardinality" form="unqualified" type="cardinality" use="required" /> <xs:attribute name="target" form="unqualified" type="xs:string" use="required" /> <xs:attribute name="retrieveAutomatic" form="unqualified" type="TrueFalse" use="required" /> <xs:attribute name="deleteAutomatic" form="unqualified" type="TrueFalse" use="required" /> <xs:attribute name="saveAutomatic" form="unqualified" type="TrueFalse" use="required" /> <xs:attribute name="inverse" form="unqualified" type="TrueFalse" /> <xs:attribute name="fromClassNameSpace" type="xs:string" /> <xs:attribute name="toClassNameSpace" type="xs:string" /> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> <xs:simpleType name="TrueFalse"> <xs:restriction base="xs:string"> <xs:enumeration value="true" /> <xs:enumeration value="false" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="cardinality"> <xs:restriction base="xs:string"> <xs:enumeration value="OneToOne" /> <xs:enumeration value="OneToMany" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="keyType"> <xs:restriction base="xs:string"> <xs:enumeration value="primary" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="DBClassType"> <xs:restriction base="xs:string"> <xs:enumeration value="CMsSqlDatabase" /> <xs:enumeration value="CMsAccessDatabase" /> <xs:enumeration value="CMySqlDatabase" /> <xs:enumeration value="CODBCDatabase" /> <xs:enumeration value="CMaxDBDatabase" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="paramNames"> <xs:restriction base="xs:string"> <xs:enumeration value="name" /> <xs:enumeration value="serverName" /> <xs:enumeration value="user" /> <xs:enumeration value="password" /> <xs:enumeration value="ansinulls" /> <xs:enumeration value="OIDTable" /> <xs:enumeration value="portNumber" /> <xs:enumeration value="option" /> </xs:restriction> </xs:simpleType> </xs:schema> Index: CJoin.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CJoin.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- CJoin.vb 25 Oct 2004 07:12:31 -0000 1.9 +++ CJoin.vb 15 Dec 2004 23:46:11 -0000 1.10 @@ -274,6 +274,7 @@ Dim db As _CRelationalDatabase Dim leftBracket As String = "(" Dim rightBracket As String = ")" + Dim isFirst As Boolean = True If LeftSide Is Nothing Then tm = CType(RightSide.Tables.Item(1), CTableMap) @@ -310,8 +311,10 @@ tm = CType(RightSide.Tables.Item(1), CTableMap) s = leftBracket & LeftSide.GetSQLString & " " & db.getClauseStringLeftJoin & " " & db.getClauseStringTableAlias(tm.Name, tm.TableOwner, TableAlias) & " " & db.getClauseStringOn & " " For i = 1 To cm.getReferenceSize - If i > 1 Then + If Not isFirst Then s = s & " " & db.getClauseStringAnd & " " + Else + isFirst = False End If s = s & cm.getReferenceAttributeMap(i).ColumnMap.getAliasQualifiedName(TableAlias) _ & " = " & cm.getReferenceAttributeMap(i).AttributeMap.ColumnMap.getAliasQualifiedName(Me.GetTableAlias(cm.SuperClass)) Index: readme.html =================================================================== RCS file: /cvsroot/jcframework/dotnet/readme.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- readme.html 6 Dec 2004 00:57:06 -0000 1.3 +++ readme.html 15 Dec 2004 23:46:12 -0000 1.4 @@ -117,7 +117,7 @@ <!-- BEGIN faq_block --> <table class="forumline" width="100%" cellspacing="1" cellpadding="2" border="0" align="center"> <tr> - <td class="catHead" height="28" align="center"><span class="cattitle">Atoms Framework 2.0 Release Candidate 2<br />Released: 10-Nov-2004</span></td> + <td class="catHead" height="28" align="center"><span class="cattitle">Atoms Framework 2.1<br />Released: xx-xxx-200x</span></td> </tr> <tr> <td align="center"> @@ -147,10 +147,43 @@ </span></td></tr> </table> </div> + <tr> + <td class="groupHeader" align="left" valign="top"> + <div onclick="return CFAQ.display('faq_a_notesv2.1', false);" style="width:100%;cursor:pointer;cursor:hand;"> + <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.1', true);" onfocus="this.blur();"><b>Changes in v2.1 (xx-xxx-xx)</b></a></span> + </div> + <div id="faq_a_notesv2.1" style="display:none;"> + <table class="details" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> + <tr class="tableCaption"><td colspan=3>Bugs:</td></tr> + <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> + <td class="colHeader">Description</td> + <td class="colHeader">Details</td> + </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">Incorrect SQL Generation</td> + <td>SQL generated for associations to classes with children using shared tables was broken. For now the child objects are not retrieved.<td> + </tr> + <tr class="tableCaption" valign="bottom"> + <td colspan=3><br/>Modifications</td> + </tr> + <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> + <td class="colHeader">Description</td> + <td class="colHeader">Details</td> + </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">XML Schema</td> + <td>Finally got around to creating an XML schema for the XML mapping files.<td> + </tr> + </table> + </div> + </td> + </tr> <tr> <td class="groupHeader" align="left" valign="top"> <div onclick="return CFAQ.display('faq_a_notesv2.0', false);" style="width:100%;cursor:pointer;cursor:hand;"> - <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.0', true);" onfocus="this.blur();"><b>Changes in v2.0 Final (xx-xx-04)</b></a></span> + <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.0', true);" onfocus="this.blur();"><b>Changes in v2.0 (07-Dec-04)</b></a></span> </div> <div id="faq_a_notesv2.0" style="display:none;"> <table class="details" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> @@ -183,7 +216,7 @@ </tr> <tr valign="top"> <td>N/A</td> - <td class="col1">Performance </td> + <td class="col1">Performance Monitoring</td> <td>Code has been added to allow various performance values to be measured in PerfMon. This includes cache hits, sql hits, retrieves, saves, deletes per second, etc. If you want more, just place a request on the web site.<td> </tr> <tr valign="top"> --- NEW FILE: XMLMapping.xsx --- <?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="-605" viewPortTop="4209" zoom="100"> <map_XmlElement left="6112" top="979" width="7567" height="2963" selected="0" zOrder="11" index="0" expanded="1"> <database_XmlElement left="398" top="4450" width="5292" height="2963" selected="0" zOrder="12" index="0" expanded="1"> <parameter_XmlElement left="398" top="7921" width="5292" height="2964" selected="0" zOrder="14" index="0" expanded="1" /> </database_XmlElement> <class_XmlElement left="6324" top="4450" width="7143" height="7196" selected="0" zOrder="16" index="1" expanded="1"> <attribute_XmlElement left="7250" top="12154" width="5291" height="4656" selected="0" zOrder="18" index="0" expanded="1" /> </class_XmlElement> <association_XmlElement left="14101" top="4450" width="5292" height="5926" selected="0" zOrder="20" index="2" expanded="1"> <entry_XmlElement left="14101" top="10884" width="5292" height="2963" selected="0" zOrder="22" index="0" expanded="1" /> </association_XmlElement> </map_XmlElement> <TrueFalse_XmlSimpleType left="15099" top="1079" width="5292" height="2540" selected="0" zOrder="24" index="1" expanded="1" /> <cardinality_XmlSimpleType left="19818" top="3758" width="5291" height="2963" selected="0" zOrder="25" index="2" expanded="1" /> <keyType_XmlSimpleType left="19844" top="6985" width="5291" height="2963" selected="0" zOrder="26" index="3" expanded="1" /> <DBClassType_XmlSimpleType left="479" top="11335" width="5292" height="2963" selected="0" zOrder="27" index="4" expanded="1" /> <paramNames_XmlSimpleType left="691" top="14583" width="5292" height="2963" selected="0" zOrder="29" index="5" expanded="1" /> </XSDDesignerLayout> Index: CClassMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CClassMap.vb,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- CClassMap.vb 16 Nov 2004 21:39:34 -0000 1.45 +++ CClassMap.vb 15 Dec 2004 23:46:05 -0000 1.46 @@ -2016,10 +2016,9 @@ statement.addSqlClause(m_joinSet.GetSQLString) statement.addSqlClause(" " & Me.RelationalDatabase.getClauseStringWhere & " ") - classMapCount = 1 Do + classMapCount = 1 mapName = "t" & classMapCount.ToString - classMapCount += 1 cm2 = rMaps(mapName) isfirst = True If Not cm2.SharedTableField Is Nothing Then |
Update of /cvsroot/jcframework/FrameworkMapper/WinFormsUI/Resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5004/WinFormsUI/Resources Added Files: DockPane.AutoHideNo.bmp DockPane.AutoHideYes.bmp DockPane.DocumentCloseDisabled.bmp DockPane.DocumentCloseEnabled.bmp DockPane.ScrollLeftDisabled.bmp DockPane.ScrollLeftEnabled.bmp DockPane.ScrollRightDisabled.bmp DockPane.ScrollRightEnabled.bmp DockPane.ToolWindowCloseDisabled.bmp DockPane.ToolWindowCloseEnabled.bmp Thumbs.db Log Message: Major update to incorporate CodeSmith scripts, and integration with WinMerge for viewing differences. --- NEW FILE: DockPane.ScrollRightEnabled.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.ScrollLeftDisabled.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.DocumentCloseDisabled.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Thumbs.db --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.ScrollRightDisabled.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.ScrollLeftEnabled.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.AutoHideYes.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.DocumentCloseEnabled.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.ToolWindowCloseEnabled.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.AutoHideNo.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: DockPane.ToolWindowCloseDisabled.bmp --- (This appears to be a binary file; contents omitted.) |
From: Richard B. <rb...@us...> - 2004-12-10 04:31:27
|
Update of /cvsroot/jcframework/FrameworkMapper/WinFormsUI/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5004/WinFormsUI/Win32 Added Files: Enums.cs Gdi32.cs Structs.cs User32.cs Log Message: Major update to incorporate CodeSmith scripts, and integration with WinMerge for viewing differences. --- NEW FILE: Structs.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.Drawing; using System.Runtime.InteropServices; namespace WeifenLuo.WinFormsUI.Win32 { [StructLayout(LayoutKind.Sequential)] internal struct MSG { public IntPtr hwnd; public int message; public IntPtr wParam; public IntPtr lParam; public int time; public int pt_x; public int pt_y; } [StructLayout(LayoutKind.Sequential)] internal struct PAINTSTRUCT { public IntPtr hdc; public int fErase; public Rectangle rcPaint; public int fRestore; public int fIncUpdate; public int Reserved1; public int Reserved2; public int Reserved3; public int Reserved4; public int Reserved5; public int Reserved6; public int Reserved7; public int Reserved8; } [StructLayout(LayoutKind.Sequential)] internal struct RECT { public int left; public int top; public int right; public int bottom; public override string ToString() { return "{left=" + left.ToString() + ", " + "top=" + top.ToString() + ", " + "right=" + right.ToString() + ", " + "bottom=" + bottom.ToString() + "}"; } } [StructLayout(LayoutKind.Sequential)] internal struct POINT { public int x; public int y; } [StructLayout(LayoutKind.Sequential)] internal struct SIZE { public int cx; public int cy; } [StructLayout(LayoutKind.Sequential, Pack=1)] internal struct BLENDFUNCTION { public byte BlendOp; public byte BlendFlags; public byte SourceConstantAlpha; public byte AlphaFormat; } [StructLayout(LayoutKind.Sequential)] internal struct TRACKMOUSEEVENTS { public const uint TME_HOVER = 0x00000001; public const uint TME_LEAVE = 0x00000002; public const uint TME_NONCLIENT = 0x00000010; public const uint TME_QUERY = 0x40000000; public const uint TME_CANCEL = 0x80000000; public const uint HOVER_DEFAULT = 0xFFFFFFFF; private uint cbSize; private uint dwFlags; private IntPtr hWnd; private uint dwHoverTime; public TRACKMOUSEEVENTS(uint dwFlags, IntPtr hWnd, uint dwHoverTime) { cbSize = 16; this.dwFlags = dwFlags; this.hWnd = hWnd; this.dwHoverTime = dwHoverTime; } } [StructLayout(LayoutKind.Sequential)] internal struct LOGBRUSH { public uint lbStyle; public uint lbColor; public uint lbHatch; } [StructLayout(LayoutKind.Sequential)] internal struct NCCALCSIZE_PARAMS { public RECT rgrc1; public RECT rgrc2; public RECT rgrc3; IntPtr lppos; } [StructLayout(LayoutKind.Sequential)] internal struct CWPRETSTRUCT { public int lResult; public int lParam; public int wParam; public int message; public IntPtr hwnd; } } --- NEW FILE: Gdi32.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.Runtime.InteropServices; using WeifenLuo.WinFormsUI.Win32; namespace WeifenLuo.WinFormsUI { internal class Gdi32 { [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern int CombineRgn(IntPtr dest, IntPtr src1, IntPtr src2, int flags); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern IntPtr CreateRectRgnIndirect(ref Win32.RECT rect); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern bool FillRgn(IntPtr hDC, IntPtr hrgn, IntPtr hBrush); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern int GetClipBox(IntPtr hDC, ref Win32.RECT rectBox); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern int SelectClipRgn(IntPtr hDC, IntPtr hRgn); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern IntPtr CreateBrushIndirect(ref LOGBRUSH brush); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern bool PatBlt(IntPtr hDC, int x, int y, int width, int height, uint flags); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern IntPtr DeleteObject(IntPtr hObject); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern bool DeleteDC(IntPtr hDC); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject); [DllImport("gdi32.dll", CharSet=CharSet.Auto)] public static extern IntPtr CreateCompatibleDC(IntPtr hDC); } } --- NEW FILE: User32.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.Drawing; using System.Runtime.InteropServices; using WeifenLuo.WinFormsUI.Win32; namespace WeifenLuo.WinFormsUI { internal class User32 { [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool AnimateWindow(IntPtr hWnd, uint dwTime, FlagsAnimateWindow dwFlags); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool DragDetect(IntPtr hWnd, Point pt); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr GetSysColorBrush(int index); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool InvalidateRect(IntPtr hWnd, ref RECT rect, bool erase); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr LoadCursor(IntPtr hInstance, uint cursor); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr SetCursor(IntPtr hCursor); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr GetFocus(); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr SetFocus(IntPtr hWnd); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool ReleaseCapture(); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool WaitMessage(); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool TranslateMessage(ref MSG msg); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool DispatchMessage(ref MSG msg); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool PostMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern uint SendMessage(IntPtr hWnd, int Msg, uint wParam, uint lParam); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern uint SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool GetMessage(ref MSG msg, int hWnd, uint wFilterMin, uint wFilterMax); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool PeekMessage(ref MSG msg, int hWnd, uint wFilterMin, uint wFilterMax, uint wFlag); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr BeginPaint(IntPtr hWnd, ref PAINTSTRUCT ps); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT ps); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr GetDC(IntPtr hWnd); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr GetWindowDC(IntPtr hWnd); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern int ShowWindow(IntPtr hWnd, short cmdShow); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndAfter, int X, int Y, int Width, int Height, FlagsSetWindowPos flags); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref POINT pptDst, ref SIZE psize, IntPtr hdcSrc, ref POINT pprSrc, Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool GetWindowRect(IntPtr hWnd, ref RECT rect); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool ClientToScreen(IntPtr hWnd, ref POINT pt); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool ScreenToClient(IntPtr hWnd, ref POINT pt); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool TrackMouseEvent(ref TRACKMOUSEEVENTS tme); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool redraw); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern ushort GetKeyState(int virtKey); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern IntPtr GetParent(IntPtr hWnd); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool DrawFocusRect(IntPtr hWnd, ref RECT rect); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool HideCaret(IntPtr hWnd); [DllImport("User32.dll", CharSet=CharSet.Auto)] public static extern bool ShowCaret(IntPtr hWnd); [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern bool SystemParametersInfo(SystemParametersInfoActions uAction, uint uParam, ref uint lpvParam, uint fuWinIni); [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern IntPtr WindowFromPoint(POINT point); } } --- NEW FILE: Enums.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; namespace WeifenLuo.WinFormsUI.Win32 { internal enum PeekMessageFlags { PM_NOREMOVE = 0, PM_REMOVE = 1, PM_NOYIELD = 2 } [Flags] internal enum FlagsSetWindowPos : uint { SWP_NOSIZE = 0x0001, SWP_NOMOVE = 0x0002, SWP_NOZORDER = 0x0004, SWP_NOREDRAW = 0x0008, SWP_NOACTIVATE = 0x0010, SWP_FRAMECHANGED = 0x0020, SWP_SHOWWINDOW = 0x0040, SWP_HIDEWINDOW = 0x0080, SWP_NOCOPYBITS = 0x0100, SWP_NOOWNERZORDER = 0x0200, SWP_NOSENDCHANGING = 0x0400, SWP_DRAWFRAME = 0x0020, SWP_NOREPOSITION = 0x0200, SWP_DEFERERASE = 0x2000, SWP_ASYNCWINDOWPOS = 0x4000 } internal enum SetWindowPosZ { HWND_TOP = 0, HWND_BOTTOM = 1, HWND_TOPMOST = -1, HWND_NOTOPMOST = -2 } internal enum ShowWindowStyles : short { SW_HIDE = 0, SW_SHOWNORMAL = 1, SW_NORMAL = 1, SW_SHOWMINIMIZED = 2, SW_SHOWMAXIMIZED = 3, SW_MAXIMIZE = 3, SW_SHOWNOACTIVATE = 4, SW_SHOW = 5, SW_MINIMIZE = 6, SW_SHOWMINNOACTIVE = 7, SW_SHOWNA = 8, SW_RESTORE = 9, SW_SHOWDEFAULT = 10, SW_FORCEMINIMIZE = 11, SW_MAX = 11 } internal enum WindowStyles : uint { WS_OVERLAPPED = 0x00000000, WS_POPUP = 0x80000000, WS_CHILD = 0x40000000, WS_MINIMIZE = 0x20000000, WS_VISIBLE = 0x10000000, WS_DISABLED = 0x08000000, WS_CLIPSIBLINGS = 0x04000000, WS_CLIPCHILDREN = 0x02000000, WS_MAXIMIZE = 0x01000000, WS_CAPTION = 0x00C00000, WS_BORDER = 0x00800000, WS_DLGFRAME = 0x00400000, WS_VSCROLL = 0x00200000, WS_HSCROLL = 0x00100000, WS_SYSMENU = 0x00080000, WS_THICKFRAME = 0x00040000, WS_GROUP = 0x00020000, WS_TABSTOP = 0x00010000, WS_MINIMIZEBOX = 0x00020000, WS_MAXIMIZEBOX = 0x00010000, WS_TILED = 0x00000000, WS_ICONIC = 0x20000000, WS_SIZEBOX = 0x00040000, WS_POPUPWINDOW = 0x80880000, WS_OVERLAPPEDWINDOW = 0x00CF0000, WS_TILEDWINDOW = 0x00CF0000, WS_CHILDWINDOW = 0x40000000 } internal enum WindowExStyles { WS_EX_DLGMODALFRAME = 0x00000001, WS_EX_NOPARENTNOTIFY = 0x00000004, WS_EX_TOPMOST = 0x00000008, WS_EX_ACCEPTFILES = 0x00000010, WS_EX_TRANSPARENT = 0x00000020, WS_EX_MDICHILD = 0x00000040, WS_EX_TOOLWINDOW = 0x00000080, WS_EX_WINDOWEDGE = 0x00000100, WS_EX_CLIENTEDGE = 0x00000200, WS_EX_CONTEXTHELP = 0x00000400, WS_EX_RIGHT = 0x00001000, WS_EX_LEFT = 0x00000000, WS_EX_RTLREADING = 0x00002000, WS_EX_LTRREADING = 0x00000000, WS_EX_LEFTSCROLLBAR = 0x00004000, WS_EX_RIGHTSCROLLBAR = 0x00000000, WS_EX_CONTROLPARENT = 0x00010000, WS_EX_STATICEDGE = 0x00020000, WS_EX_APPWINDOW = 0x00040000, WS_EX_OVERLAPPEDWINDOW = 0x00000300, WS_EX_PALETTEWINDOW = 0x00000188, WS_EX_LAYERED = 0x00080000 } internal enum VirtualKeys { VK_LBUTTON = 0x01, VK_CANCEL = 0x03, VK_BACK = 0x08, VK_TAB = 0x09, VK_CLEAR = 0x0C, VK_RETURN = 0x0D, VK_SHIFT = 0x10, VK_CONTROL = 0x11, VK_MENU = 0x12, VK_CAPITAL = 0x14, VK_ESCAPE = 0x1B, VK_SPACE = 0x20, VK_PRIOR = 0x21, VK_NEXT = 0x22, VK_END = 0x23, VK_HOME = 0x24, VK_LEFT = 0x25, VK_UP = 0x26, VK_RIGHT = 0x27, VK_DOWN = 0x28, VK_SELECT = 0x29, VK_EXECUTE = 0x2B, VK_SNAPSHOT = 0x2C, VK_HELP = 0x2F, VK_0 = 0x30, VK_1 = 0x31, VK_2 = 0x32, VK_3 = 0x33, VK_4 = 0x34, VK_5 = 0x35, VK_6 = 0x36, VK_7 = 0x37, VK_8 = 0x38, VK_9 = 0x39, VK_A = 0x41, VK_B = 0x42, VK_C = 0x43, VK_D = 0x44, VK_E = 0x45, VK_F = 0x46, VK_G = 0x47, VK_H = 0x48, VK_I = 0x49, VK_J = 0x4A, VK_K = 0x4B, VK_L = 0x4C, VK_M = 0x4D, VK_N = 0x4E, VK_O = 0x4F, VK_P = 0x50, VK_Q = 0x51, VK_R = 0x52, VK_S = 0x53, VK_T = 0x54, VK_U = 0x55, VK_V = 0x56, VK_W = 0x57, VK_X = 0x58, VK_Y = 0x59, VK_Z = 0x5A, VK_NUMPAD0 = 0x60, VK_NUMPAD1 = 0x61, VK_NUMPAD2 = 0x62, VK_NUMPAD3 = 0x63, VK_NUMPAD4 = 0x64, VK_NUMPAD5 = 0x65, VK_NUMPAD6 = 0x66, VK_NUMPAD7 = 0x67, VK_NUMPAD8 = 0x68, VK_NUMPAD9 = 0x69, VK_MULTIPLY = 0x6A, VK_ADD = 0x6B, VK_SEPARATOR = 0x6C, VK_SUBTRACT = 0x6D, VK_DECIMAL = 0x6E, VK_DIVIDE = 0x6F, VK_ATTN = 0xF6, VK_CRSEL = 0xF7, VK_EXSEL = 0xF8, VK_EREOF = 0xF9, VK_PLAY = 0xFA, VK_ZOOM = 0xFB, VK_NONAME = 0xFC, VK_PA1 = 0xFD, VK_OEM_CLEAR = 0xFE, VK_LWIN = 0x5B, VK_RWIN = 0x5C, VK_APPS = 0x5D, VK_LSHIFT = 0xA0, VK_RSHIFT = 0xA1, VK_LCONTROL = 0xA2, VK_RCONTROL = 0xA3, VK_LMENU = 0xA4, VK_RMENU = 0xA5 } internal enum Msgs { WM_NULL = 0x0000, WM_CREATE = 0x0001, WM_DESTROY = 0x0002, WM_MOVE = 0x0003, WM_SIZE = 0x0005, WM_ACTIVATE = 0x0006, WM_SETFOCUS = 0x0007, WM_KILLFOCUS = 0x0008, WM_ENABLE = 0x000A, WM_SETREDRAW = 0x000B, WM_SETTEXT = 0x000C, WM_GETTEXT = 0x000D, WM_GETTEXTLENGTH = 0x000E, WM_PAINT = 0x000F, WM_CLOSE = 0x0010, WM_QUERYENDSESSION = 0x0011, WM_QUIT = 0x0012, WM_QUERYOPEN = 0x0013, WM_ERASEBKGND = 0x0014, WM_SYSCOLORCHANGE = 0x0015, WM_ENDSESSION = 0x0016, WM_SHOWWINDOW = 0x0018, WM_WININICHANGE = 0x001A, WM_SETTINGCHANGE = 0x001A, WM_DEVMODECHANGE = 0x001B, WM_ACTIVATEAPP = 0x001C, WM_FONTCHANGE = 0x001D, WM_TIMECHANGE = 0x001E, WM_CANCELMODE = 0x001F, WM_SETCURSOR = 0x0020, WM_MOUSEACTIVATE = 0x0021, WM_CHILDACTIVATE = 0x0022, WM_QUEUESYNC = 0x0023, WM_GETMINMAXINFO = 0x0024, WM_PAINTICON = 0x0026, WM_ICONERASEBKGND = 0x0027, WM_NEXTDLGCTL = 0x0028, WM_SPOOLERSTATUS = 0x002A, WM_DRAWITEM = 0x002B, WM_MEASUREITEM = 0x002C, WM_DELETEITEM = 0x002D, WM_VKEYTOITEM = 0x002E, WM_CHARTOITEM = 0x002F, WM_SETFONT = 0x0030, WM_GETFONT = 0x0031, WM_SETHOTKEY = 0x0032, WM_GETHOTKEY = 0x0033, WM_QUERYDRAGICON = 0x0037, WM_COMPAREITEM = 0x0039, WM_GETOBJECT = 0x003D, WM_COMPACTING = 0x0041, WM_COMMNOTIFY = 0x0044 , WM_WINDOWPOSCHANGING = 0x0046, WM_WINDOWPOSCHANGED = 0x0047, WM_POWER = 0x0048, WM_COPYDATA = 0x004A, WM_CANCELJOURNAL = 0x004B, WM_NOTIFY = 0x004E, WM_INPUTLANGCHANGEREQUEST = 0x0050, WM_INPUTLANGCHANGE = 0x0051, WM_TCARD = 0x0052, WM_HELP = 0x0053, WM_USERCHANGED = 0x0054, WM_NOTIFYFORMAT = 0x0055, WM_CONTEXTMENU = 0x007B, WM_STYLECHANGING = 0x007C, WM_STYLECHANGED = 0x007D, WM_DISPLAYCHANGE = 0x007E, WM_GETICON = 0x007F, WM_SETICON = 0x0080, WM_NCCREATE = 0x0081, WM_NCDESTROY = 0x0082, WM_NCCALCSIZE = 0x0083, WM_NCHITTEST = 0x0084, WM_NCPAINT = 0x0085, WM_NCACTIVATE = 0x0086, WM_GETDLGCODE = 0x0087, WM_SYNCPAINT = 0x0088, WM_NCMOUSEMOVE = 0x00A0, WM_NCLBUTTONDOWN = 0x00A1, WM_NCLBUTTONUP = 0x00A2, WM_NCLBUTTONDBLCLK = 0x00A3, WM_NCRBUTTONDOWN = 0x00A4, WM_NCRBUTTONUP = 0x00A5, WM_NCRBUTTONDBLCLK = 0x00A6, WM_NCMBUTTONDOWN = 0x00A7, WM_NCMBUTTONUP = 0x00A8, WM_NCMBUTTONDBLCLK = 0x00A9, WM_KEYDOWN = 0x0100, WM_KEYUP = 0x0101, WM_CHAR = 0x0102, WM_DEADCHAR = 0x0103, WM_SYSKEYDOWN = 0x0104, WM_SYSKEYUP = 0x0105, WM_SYSCHAR = 0x0106, WM_SYSDEADCHAR = 0x0107, WM_KEYLAST = 0x0108, WM_IME_STARTCOMPOSITION = 0x010D, WM_IME_ENDCOMPOSITION = 0x010E, WM_IME_COMPOSITION = 0x010F, WM_IME_KEYLAST = 0x010F, WM_INITDIALOG = 0x0110, WM_COMMAND = 0x0111, WM_SYSCOMMAND = 0x0112, WM_TIMER = 0x0113, WM_HSCROLL = 0x0114, WM_VSCROLL = 0x0115, WM_INITMENU = 0x0116, WM_INITMENUPOPUP = 0x0117, WM_MENUSELECT = 0x011F, WM_MENUCHAR = 0x0120, WM_ENTERIDLE = 0x0121, WM_MENURBUTTONUP = 0x0122, WM_MENUDRAG = 0x0123, WM_MENUGETOBJECT = 0x0124, WM_UNINITMENUPOPUP = 0x0125, WM_MENUCOMMAND = 0x0126, WM_CTLCOLORMSGBOX = 0x0132, WM_CTLCOLOREDIT = 0x0133, WM_CTLCOLORLISTBOX = 0x0134, WM_CTLCOLORBTN = 0x0135, WM_CTLCOLORDLG = 0x0136, WM_CTLCOLORSCROLLBAR = 0x0137, WM_CTLCOLORSTATIC = 0x0138, WM_MOUSEMOVE = 0x0200, WM_LBUTTONDOWN = 0x0201, WM_LBUTTONUP = 0x0202, WM_LBUTTONDBLCLK = 0x0203, WM_RBUTTONDOWN = 0x0204, WM_RBUTTONUP = 0x0205, WM_RBUTTONDBLCLK = 0x0206, WM_MBUTTONDOWN = 0x0207, WM_MBUTTONUP = 0x0208, WM_MBUTTONDBLCLK = 0x0209, WM_MOUSEWHEEL = 0x020A, WM_PARENTNOTIFY = 0x0210, WM_ENTERMENULOOP = 0x0211, WM_EXITMENULOOP = 0x0212, WM_NEXTMENU = 0x0213, WM_SIZING = 0x0214, WM_CAPTURECHANGED = 0x0215, WM_MOVING = 0x0216, WM_DEVICECHANGE = 0x0219, WM_MDICREATE = 0x0220, WM_MDIDESTROY = 0x0221, WM_MDIACTIVATE = 0x0222, WM_MDIRESTORE = 0x0223, WM_MDINEXT = 0x0224, WM_MDIMAXIMIZE = 0x0225, WM_MDITILE = 0x0226, WM_MDICASCADE = 0x0227, WM_MDIICONARRANGE = 0x0228, WM_MDIGETACTIVE = 0x0229, WM_MDISETMENU = 0x0230, WM_ENTERSIZEMOVE = 0x0231, WM_EXITSIZEMOVE = 0x0232, WM_DROPFILES = 0x0233, WM_MDIREFRESHMENU = 0x0234, WM_IME_SETCONTEXT = 0x0281, WM_IME_NOTIFY = 0x0282, WM_IME_CONTROL = 0x0283, WM_IME_COMPOSITIONFULL = 0x0284, WM_IME_SELECT = 0x0285, WM_IME_CHAR = 0x0286, WM_IME_REQUEST = 0x0288, WM_IME_KEYDOWN = 0x0290, WM_IME_KEYUP = 0x0291, WM_MOUSEHOVER = 0x02A1, WM_MOUSELEAVE = 0x02A3, WM_CUT = 0x0300, WM_COPY = 0x0301, WM_PASTE = 0x0302, WM_CLEAR = 0x0303, WM_UNDO = 0x0304, WM_RENDERFORMAT = 0x0305, WM_RENDERALLFORMATS = 0x0306, WM_DESTROYCLIPBOARD = 0x0307, WM_DRAWCLIPBOARD = 0x0308, WM_PAINTCLIPBOARD = 0x0309, WM_VSCROLLCLIPBOARD = 0x030A, WM_SIZECLIPBOARD = 0x030B, WM_ASKCBFORMATNAME = 0x030C, WM_CHANGECBCHAIN = 0x030D, WM_HSCROLLCLIPBOARD = 0x030E, WM_QUERYNEWPALETTE = 0x030F, WM_PALETTEISCHANGING = 0x0310, WM_PALETTECHANGED = 0x0311, WM_HOTKEY = 0x0312, WM_PRINT = 0x0317, WM_PRINTCLIENT = 0x0318, WM_HANDHELDFIRST = 0x0358, WM_HANDHELDLAST = 0x035F, WM_AFXFIRST = 0x0360, WM_AFXLAST = 0x037F, WM_PENWINFIRST = 0x0380, WM_PENWINLAST = 0x038F, WM_APP = 0x8000, WM_USER = 0x0400 } internal enum Cursors : uint { IDC_ARROW = 32512U, IDC_IBEAM = 32513U, IDC_WAIT = 32514U, IDC_CROSS = 32515U, IDC_UPARROW = 32516U, IDC_SIZE = 32640U, IDC_ICON = 32641U, IDC_SIZENWSE = 32642U, IDC_SIZENESW = 32643U, IDC_SIZEWE = 32644U, IDC_SIZENS = 32645U, IDC_SIZEALL = 32646U, IDC_NO = 32648U, IDC_HAND = 32649U, IDC_APPSTARTING = 32650U, IDC_HELP = 32651U } internal enum TrackerEventFlags : uint { TME_HOVER = 0x00000001, TME_LEAVE = 0x00000002, TME_QUERY = 0x40000000, TME_CANCEL = 0x80000000 } internal enum MouseActivateFlags { MA_ACTIVATE = 1, MA_ACTIVATEANDEAT = 2, MA_NOACTIVATE = 3, MA_NOACTIVATEANDEAT = 4 } internal enum DialogCodes { DLGC_WANTARROWS = 0x0001, DLGC_WANTTAB = 0x0002, DLGC_WANTALLKEYS = 0x0004, DLGC_WANTMESSAGE = 0x0004, DLGC_HASSETSEL = 0x0008, DLGC_DEFPUSHBUTTON = 0x0010, DLGC_UNDEFPUSHBUTTON = 0x0020, DLGC_RADIOBUTTON = 0x0040, DLGC_WANTCHARS = 0x0080, DLGC_STATIC = 0x0100, DLGC_BUTTON = 0x2000 } internal enum UpdateLayeredWindowsFlags { ULW_COLORKEY = 0x00000001, ULW_ALPHA = 0x00000002, ULW_OPAQUE = 0x00000004 } internal enum AlphaFlags : byte { AC_SRC_OVER = 0x00, AC_SRC_ALPHA = 0x01 } internal enum RasterOperations : uint { SRCCOPY = 0x00CC0020, SRCPAINT = 0x00EE0086, SRCAND = 0x008800C6, SRCINVERT = 0x00660046, SRCERASE = 0x00440328, NOTSRCCOPY = 0x00330008, NOTSRCERASE = 0x001100A6, MERGECOPY = 0x00C000CA, MERGEPAINT = 0x00BB0226, PATCOPY = 0x00F00021, PATPAINT = 0x00FB0A09, PATINVERT = 0x005A0049, DSTINVERT = 0x00550009, BLACKNESS = 0x00000042, WHITENESS = 0x00FF0062 } internal enum BrushStyles { BS_SOLID = 0, BS_NULL = 1, BS_HOLLOW = 1, BS_HATCHED = 2, BS_PATTERN = 3, BS_INDEXED = 4, BS_DIBPATTERN = 5, BS_DIBPATTERNPT = 6, BS_PATTERN8X8 = 7, BS_DIBPATTERN8X8 = 8, BS_MONOPATTERN = 9 } internal enum HatchStyles { HS_HORIZONTAL = 0, HS_VERTICAL = 1, HS_FDIAGONAL = 2, HS_BDIAGONAL = 3, HS_CROSS = 4, HS_DIAGCROSS = 5 } internal enum CombineFlags { RGN_AND = 1, RGN_OR = 2, RGN_XOR = 3, RGN_DIFF = 4, RGN_COPY = 5 } internal enum HitTest { HTERROR = -2, HTTRANSPARENT = -1, HTNOWHERE = 0, HTCLIENT = 1, HTCAPTION = 2, HTSYSMENU = 3, HTGROWBOX = 4, HTSIZE = 4, HTMENU = 5, HTHSCROLL = 6, HTVSCROLL = 7, HTMINBUTTON = 8, HTMAXBUTTON = 9, HTLEFT = 10, HTRIGHT = 11, HTTOP = 12, HTTOPLEFT = 13, HTTOPRIGHT = 14, HTBOTTOM = 15, HTBOTTOMLEFT = 16, HTBOTTOMRIGHT = 17, HTBORDER = 18, HTREDUCE = 8, HTZOOM = 9 , HTSIZEFIRST = 10, HTSIZELAST = 17, HTOBJECT = 19, HTCLOSE = 20, HTHELP = 21 } internal enum SystemParametersInfoActions : uint { GetBeep = 1, SetBeep = 2, GetMouse = 3, SetMouse = 4, GetBorder = 5, SetBorder = 6, GetKeyboardSpeed = 10, SetKeyboardSpeed = 11, LangDriver = 12, IconHorizontalSpacing = 13, GetScreenSaveTimeout = 14, SetScreenSaveTimeout = 15, GetScreenSaveActive = 16, SetScreenSaveActive = 17, GetGridGranularity = 18, SetGridGranularity = 19, SetDeskWallPaper = 20, SetDeskPattern = 21, GetKeyboardDelay = 22, SetKeyboardDelay = 23, IconVerticalSpacing = 24, GetIconTitleWrap = 25, SetIconTitleWrap = 26, GetMenuDropAlignment = 27, SetMenuDropAlignment = 28, SetDoubleClkWidth = 29, SetDoubleClkHeight = 30, GetIconTitleLogFont = 31, SetDoubleClickTime = 32, SetMouseButtonSwap = 33, SetIconTitleLogFont = 34, GetFastTaskSwitch = 35, SetFastTaskSwitch = 36, SetDragFullWindows = 37, GetDragFullWindows = 38, GetNonClientMetrics = 41, SetNonClientMetrics = 42, GetMinimizedMetrics = 43, SetMinimizedMetrics = 44, GetIconMetrics = 45, SetIconMetrics = 46, SetWorkArea = 47, GetWorkArea = 48, SetPenWindows = 49, GetFilterKeys = 50, SetFilterKeys = 51, GetToggleKeys = 52, SetToggleKeys = 53, GetMouseKeys = 54, SetMouseKeys = 55, GetShowSounds = 56, SetShowSounds = 57, GetStickyKeys = 58, SetStickyKeys = 59, GetAccessTimeout = 60, SetAccessTimeout = 61, GetSerialKeys = 62, SetSerialKeys = 63, GetSoundsEntry = 64, SetSoundsEntry = 65, GetHighContrast = 66, SetHighContrast = 67, GetKeyboardPref = 68, SetKeyboardPref = 69, GetScreenReader = 70, SetScreenReader = 71, GetAnimation = 72, SetAnimation = 73, GetFontSmoothing = 74, SetFontSmoothing = 75, SetDragWidth = 76, SetDragHeight = 77, SetHandHeld = 78, GetLowPowerTimeout = 79, GetPowerOffTimeout = 80, SetLowPowerTimeout = 81, SetPowerOffTimeout = 82, GetLowPowerActive = 83, GetPowerOffActive = 84, SetLowPowerActive = 85, SetPowerOffActive = 86, SetCursors = 87, SetIcons = 88, GetDefaultInputLang = 89, SetDefaultInputLang = 90, SetLangToggle = 91, GetWindwosExtension = 92, SetMouseTrails = 93, GetMouseTrails = 94, ScreenSaverRunning = 97, GetMouseHoverTime = 0x0066 } [Flags] internal enum FlagsAnimateWindow : uint { AW_HOR_POSITIVE = 0x00000001, AW_HOR_NEGATIVE = 0x00000002, AW_VER_POSITIVE = 0x00000004, AW_VER_NEGATIVE = 0x00000008, AW_CENTER = 0x00000010, AW_HIDE = 0x00010000, AW_ACTIVATE = 0x00020000, AW_SLIDE = 0x00040000, AW_BLEND =0x00080000 } [Flags] internal enum FlagsDCX : uint { DCX_WINDOW = 0x1, DCX_CACHE = 0x2, DCX_NORESETATTRS = 0x4, DCX_CLIPCHILDREN = 0x8, DCX_CLIPSIBLINGS = 0x10, DCX_PARENTCLIP = 0x20, DCX_EXCLUDERGN = 0x40, DCX_INTERSECTRGN = 0x80, DCX_EXCLUDEUPDATE = 0x100, DCX_INTERSECTUPDATE = 0x200, DCX_LOCKWINDOWUPDATE = 0x400, DCX_NORECOMPUTE = 0x100000, DCX_VALIDATE = 0x200000 } } |
From: Richard B. <rb...@us...> - 2004-12-10 04:31:27
|
Update of /cvsroot/jcframework/FrameworkMapper/AFMappingClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5004/AFMappingClasses Added Files: AFMappingClasses.vbproj AssemblyInfo.vb CAssociationEntry.vb CAssociationEntryCollection.vb CAttributeList.vb CMappedAssociation.vb CMappedAttribute.vb CMappedAttributeCollection.vb CMappedClass.vb CMappedClassCollection.vb CMappedDatabase.vb CProject.vb MappedDatabaseList.vb XMLMapper.vb Log Message: Major update to incorporate CodeSmith scripts, and integration with WinMerge for viewing differences. --- NEW FILE: CMappedClassCollection.vb --- Public Class CMappedClassCollection Inherits CollectionBase Public Sub Add(ByVal a As CMappedClass) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As CMappedClass) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As CMappedClass Get Return CType(list.Item(index), CMappedClass) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As CMappedClass Get For Each ma As CMappedClass In Me If ma.ClassName = _name Then Return ma End If Next End Get End Property End Class --- NEW FILE: CMappedDatabase.vb --- Public Class CMappedDatabase Public dbname As String Public dbType As String Public serverName As String Public user As String Public password As String Public OIDTable As String Public portNumber As String Public options As String Public NameParam As String Public Expanded As Boolean Public AnsiNulls As Boolean = True Public tables As New dbTableCollection Public Sub getDBSchema() Select Case dbType Case "CMSSQLDatabase" GetMSSQLDB() Case Else End Select End Sub Private Sub GetMSSQLDB() Dim conn As New SqlClient.SqlConnection Try conn.ConnectionString = _ "Data Source=" & serverName & ";" & _ "Initial Catalog=" & NameParam & ";" & _ "Integrated Security=false;" & _ "Persist Security Info=False;" & _ "User Id=" & user & ";" & _ "Password=" & password conn.Open() Catch ex As SqlClient.SqlException MsgBox("Connection to " & serverName & " couldn't be established") Return End Try Dim schemaDA As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("SELECT * FROM INFORMATION_SCHEMA.TABLES " & _ "ORDER BY TABLE_TYPE, TABLE_NAME", _ conn) Dim schemaTable As DataTable = New DataTable schemaDA.Fill(schemaTable) tables = New dbTableCollection Dim table As dbTable Dim col As dbColumn For Each dr As DataRow In schemaTable.Rows table = New dbTable table.tableName = dr("TABLE_NAME") table.tableOwner = dr("TABLE_SCHEMA") If dr("TABLE_TYPE") = "BASE TABLE" Then table.tableType = "TABLE" Else table.tableType = "VIEW" End If table.parentDB = Me tables.Add(table) Dim fieldDA As SqlClient.SqlDataAdapter = _ New SqlClient.SqlDataAdapter("SELECT * FROM INFORMATION_SCHEMA.COLUMNS " & _ "where table_schema = '" & dr("TABLE_SCHEMA") & "' and Table_name = '" & dr("TABLE_NAME") & "' " & _ "ORDER BY ORDINAL_POSITION", _ conn) Dim schemaTableCols As DataTable = New DataTable fieldDA.Fill(schemaTableCols) For Each colrow As DataRow In schemaTableCols.Rows col = New dbColumn col.colName = colrow("COLUMN_NAME") col.colType = colrow("DATA_TYPE") Select Case col.colType Case "bigint" col.dotnetTypeName = "long" Case "binary" col.dotnetTypeName = "Object" Case "bit" col.dotnetTypeName = "Boolean" Case "char" col.dotnetTypeName = "String" Case "datetime" col.dotnetTypeName = "DateTime" Case "decimal" col.dotnetTypeName = "Decimal" Case "float" col.dotnetTypeName = "Double" Case "image" col.dotnetTypeName = "Byte()" Case "int" col.dotnetTypeName = "Integer" Case "money" col.dotnetTypeName = "Decimal" Case "nchar" col.dotnetTypeName = "String" Case "ntext" col.dotnetTypeName = "String" Case "numeric" col.dotnetTypeName = "Decimal" Case "nvarchar" col.dotnetTypeName = "String" Case "real" col.dotnetTypeName = "Single" Case "smalldatetime" col.dotnetTypeName = "DateTime" Case "smallint" col.dotnetTypeName = "Short" Case "smallmoney" col.dotnetTypeName = "Decimal" Case "text" col.dotnetTypeName = "String" Case "timestamp" col.dotnetTypeName = "Byte()" Case "tinyint" col.dotnetTypeName = "Byte" Case "uniqueidentifier" col.dotnetTypeName = "Guid" Case "varbinary" col.dotnetTypeName = "Byte()" Case "varchar" col.dotnetTypeName = "String" Case "sql_variant" col.dotnetTypeName = "Object" End Select col.parentTable = table table.columns.Add(col) Next Dim constraintDA As SqlClient.SqlDataAdapter = _ New SqlClient.SqlDataAdapter("SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS " & _ "where table_schema = '" & dr("TABLE_SCHEMA") & "' and Table_name = '" & dr("TABLE_NAME") & "' " & _ "and CONSTRAINT_TYPE = 'PRIMARY KEY'", conn) Dim TableConstraintCols As DataTable = New DataTable constraintDA.Fill(TableConstraintCols) If TableConstraintCols.Rows.Count > 0 Then Dim constraintRow As DataRow = TableConstraintCols.Rows(0) Dim cname As String = constraintRow("CONSTRAINT_NAME") Dim primaryKeyDA As SqlClient.SqlDataAdapter = _ New SqlClient.SqlDataAdapter("SELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE " & _ "where table_schema = '" & dr("TABLE_SCHEMA") & "' and Table_name = '" & dr("TABLE_NAME") & "' " & _ "and CONSTRAINT_NAME = '" & cname & "'", conn) Dim constraintCols As DataTable = New DataTable primaryKeyDA.Fill(constraintCols) For Each conColrow As DataRow In constraintCols.Rows col = table.columns(conColrow("COLUMN_NAME")) col.isPrimaryKey = True Next End If Next End Sub End Class Public Class dbTable Public tableName As String Public tableOwner As String <NonSerialized(), Xml.Serialization.XmlIgnore()> Public parentDB As CMappedDatabase Public Expanded As Boolean Public columns As New dbColumnCollection Public tableType As String Public Overrides Function ToString() As String Return tableOwner & "." & tableName End Function End Class Public Class dbColumn Public colName As String Public colType As String Public dotnetTypeName As String Public parentTable As dbTable Public isPrimaryKey As Boolean End Class Public Class CMappedDatabaseCollection Inherits CollectionBase Public Sub Add(ByVal a As CMappedDatabase) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As CMappedDatabase) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As CMappedDatabase Get Return CType(list.Item(index), CMappedDatabase) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As CMappedDatabase Get For Each ma As CMappedDatabase In Me If ma.dbname = _name Then Return ma End If Next End Get End Property End Class Public Class dbTableCollection Inherits CollectionBase Public Sub Add(ByVal a As dbTable) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As dbTable) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As dbTable Get Return CType(list.Item(index), dbTable) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As dbTable Get For Each t As dbTable In Me If t.tableName = _name Then Return t End If Next End Get End Property End Class Public Class dbColumnCollection Inherits CollectionBase Public Sub Add(ByVal a As dbColumn) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As dbColumn) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As dbColumn Get Return CType(list.Item(index), dbColumn) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As dbColumn Get For Each c As dbColumn In Me If c.colName = _name Then Return c End If Next End Get End Property End Class --- NEW FILE: XMLMapper.vb --- Option Strict Off Option Explicit On Imports System.Collections.Specialized Imports System.Xml Public Class CXMLMapper Private m_FileName As String Private p As CProject Public Sub New(ByVal xmlFile As String, ByRef inProj As CProject) MyBase.New() m_FileName = xmlFile p = inProj End Sub Public Sub Load() p.databases = New CMappedDatabaseCollection p.classes = New CMappedClassCollection Dim doc As New XmlDocument Try doc.Load(m_FileName) Catch ex As Exception Exit Sub End Try Dim node As XmlNode Dim elem As XmlElement Dim reldb As CMappedDatabase Dim clm As CMappedClass Dim elementRoot As XmlElement elementRoot = doc.DocumentElement node = elementRoot.FirstChild While Not node Is Nothing If node.NodeType = XmlNodeType.Element Then elem = node If node.Name = "database" Then reldb = getRelationalDatabase(elem) Try p.databases.Add(reldb) Catch ex As Exception Throw New Exception("Could not add database " & reldb.dbname & vbCrLf & ex.Message, ex) End Try ElseIf node.Name = "class" Then clm = getClassMap(elem) Try p.classes.Add(clm) Catch ex As Exception Throw New Exception("Could not add classmap " & clm.ClassName & vbCrLf & ex.Message, ex) End Try ElseIf node.Name = "association" Then processAssociation(elem) End If End If node = node.NextSibling() End While End Sub Private Function getRelationalDatabase(ByRef node As XmlElement) As CMappedDatabase Dim relDb As CMappedDatabase relDb = Nothing Dim attrPMName As String Dim attrClassName As XmlAttribute attrPMName = node.GetAttribute("name") attrClassName = node.GetAttributeNode("class") Dim params As HybridDictionary Dim nodeChild As XmlNode Dim elementChild As XmlElement Dim attrName, attrValue As XmlAttribute If ((Not attrPMName Is Nothing) And (Not attrClassName Is Nothing)) Then relDb = New CMappedDatabase relDb.dbType = attrClassName.Value relDb.dbname = attrPMName nodeChild = node.FirstChild() Do While Not nodeChild Is Nothing If nodeChild.NodeType = XmlNodeType.Element Then elementChild = nodeChild If elementChild.Name = "parameter" Then attrName = elementChild.GetAttributeNode("name") attrValue = elementChild.GetAttributeNode("value") Select Case attrName.Value Case "name" relDb.NameParam = attrValue.Value Case "serverName" relDb.serverName = attrValue.Value Case "user" relDb.user = attrValue.Value Case "password" If attrValue.Value = "N/A" Then relDb.password = Nothing Else relDb.password = attrValue.Value End If Case "OIDTable" relDb.OIDTable = attrValue.Value Case "port" relDb.portNumber = attrValue.Value Case "options" relDb.options = attrValue.Value End Select End If End If nodeChild = nodeChild.NextSibling Loop End If relDb.getDBSchema() Return relDb End Function Private Function getClassMap(ByVal node As XmlElement) As CMappedClass Dim attrClassName As XmlAttribute, attrTable As XmlAttribute, attrTableOwner As XmlAttribute Dim attrDatabase As XmlAttribute, attrSuperClassName As XmlAttribute, attrReadOnly As XmlAttribute, attrModifyOnly As XmlAttribute Dim attrClassNameSpace, attrAssemblyPath, attrFactory As XmlAttribute Dim attrSharedField As XmlAttribute, attrSharedValue As XmlAttribute attrClassName = node.GetAttributeNode("name") attrTable = node.GetAttributeNode("table") attrDatabase = node.GetAttributeNode("database") attrSuperClassName = node.GetAttributeNode("superclass") attrReadOnly = node.GetAttributeNode("readonly") attrModifyOnly = node.GetAttributeNode("modifyonly") attrTableOwner = node.GetAttributeNode("owner") attrSharedField = node.GetAttributeNode("sharedtablefield") attrSharedValue = node.GetAttributeNode("sharedtablevalue") attrClassNameSpace = node.GetAttributeNode("namespace") attrAssemblyPath = node.GetAttributeNode("assemblypath") attrFactory = node.GetAttributeNode("factory") Dim ClassMap As CMappedClass Dim dbMap As CMappedDatabase Dim nodeChild As XmlNode Dim elementChild As XmlElement Dim AttrMap As CMappedAttribute If ((Not attrClassName Is Nothing) And (Not attrDatabase Is Nothing)) Then ClassMap = New CMappedClass ClassMap.Project = p ClassMap.ClassName = attrClassName.Value If Not attrSuperClassName Is Nothing Then ClassMap.SuperClass = p.classes.Item(attrSuperClassName.Value) If Not attrSharedValue Is Nothing Then ClassMap.SharedValue = attrSharedValue.Value End If If Not attrSharedField Is Nothing Then ClassMap.SharedField = attrSharedField.Value End If End If If Not attrAssemblyPath Is Nothing Then ClassMap.AssemblyPath = attrAssemblyPath.Value End If If Not attrFactory Is Nothing Then ClassMap.Factory = attrFactory.Value End If If attrReadOnly Is Nothing Then ClassMap.ReadOnlyFlag = False Else ClassMap.ReadOnlyFlag = attrReadOnly.Value End If If attrModifyOnly Is Nothing Then ClassMap.ModifyOnlyFlag = False Else ClassMap.ModifyOnlyFlag = attrModifyOnly.Value End If If Not attrClassNameSpace Is Nothing Then ClassMap.ClassNameSpace = attrClassNameSpace.Value End If ClassMap.Database = p.databases.Item(attrDatabase.Value) ClassMap.Table = attrTable.Value If attrTableOwner Is Nothing Then ClassMap.TableOwner = "dbo" Else ClassMap.TableOwner = attrTableOwner.Value End If If Not ClassMap.Database Is Nothing Then For Each tbl As dbTable In ClassMap.Database.tables If tbl.tableName = ClassMap.Table AndAlso tbl.tableOwner = ClassMap.TableOwner Then ClassMap.MappedTable = tbl End If Next End If nodeChild = node.FirstChild Do While Not nodeChild Is Nothing If nodeChild.NodeType = XmlNodeType.Element Then elementChild = nodeChild If elementChild.Name = "attribute" Then AttrMap = getAttributeMap(elementChild, ClassMap) If Not AttrMap.Column Is Nothing AndAlso Not ClassMap.MappedTable Is Nothing Then For Each col As dbColumn In ClassMap.MappedTable.columns If col.colName = AttrMap.Column Then AttrMap.MappedColumn = col AttrMap.DataType = col.colType End If Next End If ClassMap.Attributes.Add(AttrMap) End If End If nodeChild = nodeChild.NextSibling Loop End If getClassMap = ClassMap End Function Private Function getAttributeMap(ByVal node As XmlElement, ByVal clMap As CMappedClass) As CMappedAttribute Dim attrColumn, attrName, attrKey, attrFind, attrProxy, attrTimeStamp, attrIdentity As XmlAttribute Dim attrReference As XmlAttribute attrName = node.GetAttributeNode("name") attrColumn = node.GetAttributeNode("column") attrKey = node.GetAttributeNode("key") attrReference = node.GetAttributeNode("reference") attrFind = node.GetAttributeNode("find") attrProxy = node.GetAttributeNode("proxy") attrTimeStamp = node.GetAttributeNode("timestamp") attrIdentity = node.GetAttributeNode("identity") Dim AttrMap As CMappedAttribute Dim refAttr As CMappedAttribute If Not attrName Is Nothing Then AttrMap = New CMappedAttribute AttrMap.Name = attrName.Value AttrMap.isKey = False If Not attrColumn Is Nothing Then AttrMap.Column = attrColumn.Value If Not attrKey Is Nothing Then If UCase(attrKey.Value) = "PRIMARY" Then AttrMap.isKey = True End If End If If Not attrFind Is Nothing Then AttrMap.isFind = CBool(attrFind.Value) End If If Not attrIdentity Is Nothing Then AttrMap.isIdentity = CBool(attrIdentity.Value) End If If Not attrTimeStamp Is Nothing Then AttrMap.isTimeStamp = CBool(attrTimeStamp.Value) Else AttrMap.isTimeStamp = False ' Default is not a timestamp End If End If If Not attrProxy Is Nothing Then AttrMap.isProxy = CBool(attrProxy.Value) Else AttrMap.isProxy = True End If If ((Not attrReference Is Nothing) And (Not clMap.SuperClass Is Nothing)) Then refAttr = clMap.SuperClass.Attributes.Item(attrReference.Value) If Not refAttr Is Nothing Then AttrMap.Reference = refAttr.Name End If End If getAttributeMap = AttrMap End If End Function Private Sub processAssociation(ByVal node As XmlElement) Dim attrToClass, attrFromClass, attrTarget As XmlAttribute Dim attrCardinality, attrFromClassNamespace, attrToClassNamespace As XmlAttribute Dim fromClassMap As CMappedClass Dim toClassMap As CMappedClass Dim udaAm As CMappedAssociation Dim nodeChild As XmlNode Dim elementChild As XmlElement Dim entry As CAssociationEntry Dim amFromAttribute As Object Dim amToAttribute As CMappedAttribute Dim attrFromAttribute As Object Dim attrToAttribute As XmlAttribute Dim attrName As XmlAttribute attrFromClass = node.GetAttributeNode("fromClass") attrToClass = node.GetAttributeNode("toClass") attrFromClassNamespace = node.GetAttributeNode("fromClassNameSpace") attrToClassNamespace = node.GetAttributeNode("toClassNameSpace") attrTarget = node.GetAttributeNode("target") attrCardinality = node.GetAttributeNode("cardinality") attrName = node.GetAttributeNode("name") If ((Not attrFromClass Is Nothing) And (Not attrToClass Is Nothing) And (Not attrTarget Is Nothing)) Then fromClassMap = p.classes.Item(attrFromClass.Value) toClassMap = p.classes.Item(attrToClass.Value) udaAm = New CMappedAssociation udaAm.fromClass = fromClassMap udaAm.ToClass = toClassMap If Not attrFromClassNamespace Is Nothing Then udaAm.FromClassNamespace = attrFromClassNamespace.Value End If If Not attrToClassNamespace Is Nothing Then udaAm.ToClassNamespace = attrToClassNamespace.Value End If udaAm.TargetAttribute = fromClassMap.Attributes.Item(attrTarget.Value) udaAm.DeleteAuto = node.GetAttributeNode("deleteAutomatic").Value udaAm.SaveAuto = node.GetAttributeNode("saveAutomatic").Value udaAm.RetrieveAuto = node.GetAttributeNode("retrieveAutomatic").Value If attrName Is Nothing Then udaAm.Name = udaAm.TargetAttribute.Name Else udaAm.Name = attrName.Value End If If Not attrCardinality Is Nothing Then If UCase(attrCardinality.Value) = "ONETOONE" Then udaAm.Cardinality = Cardinalities.OneToOne ElseIf UCase(attrCardinality.Value) = "ONETOMANY" Then udaAm.Cardinality = Cardinalities.OneToMany End If End If nodeChild = node.FirstChild Do While Not nodeChild Is Nothing If nodeChild.NodeType = XmlNodeType.Element Then elementChild = nodeChild If elementChild.Name = "entry" Then attrFromAttribute = elementChild.GetAttributeNode("fromAttribute") attrToAttribute = elementChild.GetAttributeNode("toAttribute") If ((Not attrFromAttribute Is Nothing) And (Not attrToAttribute Is Nothing)) Then amFromAttribute = fromClassMap.Attributes.Item(attrFromAttribute.Value) amToAttribute = toClassMap.Attributes.Item(attrToAttribute.Value) If amFromAttribute Is Nothing Then Throw New Exception("Error in association definition") End If If amToAttribute Is Nothing Then Throw New Exception("Error in association definition") End If entry = New CAssociationEntry entry.fromAttribute = amFromAttribute entry.toAttribute = amToAttribute udaAm.Entries.Add(entry) End If End If End If nodeChild = nodeChild.NextSibling Loop fromClassMap.Associations.Add(udaAm, udaAm.Name) Else Throw New Exception("Error in association definition: Missing FromClass, ToClass or Target attributes") End If End Sub Public Sub Save() Dim doc As New XmlDocument Dim elem As XmlElement Dim node As XmlNode Dim attr As XmlAttribute node = doc.CreateElement("map") For Each db As CMappedDatabase In p.databases elem = doc.CreateElement("database") saveDatabase(doc, elem, db) node.AppendChild(elem) Next For Each cls As CMappedClass In p.classes elem = doc.CreateElement("class") saveClass(doc, elem, cls) node.AppendChild(elem) Next For Each cls As CMappedClass In p.classes For Each ass As CMappedAssociation In cls.Associations elem = doc.CreateElement("association") saveassociation(doc, elem, ass) node.AppendChild(elem) Next Next doc.AppendChild(node) doc.Save(m_FileName) End Sub Private Sub saveDatabase(ByVal doc As XmlDocument, ByVal elem As XmlElement, ByVal db As CMappedDatabase) Dim attr As XmlAttribute Dim param As XmlElement 'db name CreateAttributeValue(doc, elem, "name", db.dbname) CreateAttributeValue(doc, elem, "class", db.dbType) 'Now add parameters If db.NameParam <> String.Empty Then param = doc.CreateElement("parameter") CreateAttributeValue(doc, param, "name", "name") CreateAttributeValue(doc, param, "value", db.NameParam) elem.AppendChild(param) End If If db.serverName <> String.Empty Then param = doc.CreateElement("parameter") CreateAttributeValue(doc, param, "name", "serverName") CreateAttributeValue(doc, param, "value", db.serverName) elem.AppendChild(param) End If If db.user <> String.Empty Then param = doc.CreateElement("parameter") CreateAttributeValue(doc, param, "name", "user") CreateAttributeValue(doc, param, "value", db.user) elem.AppendChild(param) End If If db.password <> String.Empty Then param = doc.CreateElement("parameter") CreateAttributeValue(doc, param, "name", "password") CreateAttributeValue(doc, param, "value", db.password) elem.AppendChild(param) End If If db.OIDTable <> String.Empty Then param = doc.CreateElement("parameter") CreateAttributeValue(doc, param, "name", "OIDTable") CreateAttributeValue(doc, param, "value", db.OIDTable) elem.AppendChild(param) End If If db.portNumber <> String.Empty Then param = doc.CreateElement("parameter") CreateAttributeValue(doc, param, "name", "port") CreateAttributeValue(doc, param, "value", db.portNumber) elem.AppendChild(param) End If If db.options <> String.Empty Then param = doc.CreateElement("parameter") CreateAttributeValue(doc, param, "name", "options") CreateAttributeValue(doc, param, "value", db.options) elem.AppendChild(param) End If End Sub Private Sub SaveClass(ByVal doc As XmlDocument, ByVal elem As XmlElement, ByVal cls As CMappedClass) Dim mappedAttr As XmlElement CreateAttributeValue(doc, elem, "name", cls.ClassName) CreateAttributeValue(doc, elem, "table", cls.Table) CreateAttributeValue(doc, elem, "database", cls.DatabaseName) If cls.TableOwner <> "dbo" AndAlso cls.TableOwner <> String.Empty Then CreateAttributeValue(doc, elem, "owner", cls.TableOwner) End If If Not cls.SuperClass Is Nothing Then CreateAttributeValue(doc, elem, "superclass", cls.SuperClass.ClassName) If cls.SharedField <> String.Empty Then CreateAttributeValue(doc, elem, "sharedtablefield", cls.SharedField) CreateAttributeValue(doc, elem, "sharedtablevalue", cls.SharedValue) End If End If If cls.ReadOnlyFlag Then CreateAttributeValue(doc, elem, "readonly", "true") End If If cls.ModifyOnlyFlag Then CreateAttributeValue(doc, elem, "modifyonly", "true") End If If cls.ClassNameSpace <> String.Empty Then CreateAttributeValue(doc, elem, "namespace", cls.ClassNameSpace) End If For Each attr As CMappedAttribute In cls.Attributes mappedAttr = doc.CreateElement("attribute") CreateAttributeValue(doc, mappedAttr, "name", attr.Name) If attr.Column <> String.Empty Then CreateAttributeValue(doc, mappedAttr, "column", attr.Column) End If If attr.isKey Then CreateAttributeValue(doc, mappedAttr, "key", "primary") End If If attr.isFind Then CreateAttributeValue(doc, mappedAttr, "find", "true") End If If attr.Reference <> String.Empty Then CreateAttributeValue(doc, mappedAttr, "reference", attr.Reference) End If If attr.isProxy = False Then CreateAttributeValue(doc, mappedAttr, "proxy", "false") End If If attr.isTimeStamp Then CreateAttributeValue(doc, mappedAttr, "timestamp", "true") End If If attr.isIdentity Then CreateAttributeValue(doc, mappedAttr, "identity", "true") End If elem.AppendChild(mappedAttr) Next End Sub Private Sub SaveAssociation(ByVal doc As XmlDocument, ByVal elem As XmlElement, ByVal ass As CMappedAssociation) Dim assEntry As XmlElement CreateAttributeValue(doc, elem, "fromClass", ass.fromClass.ClassName) CreateAttributeValue(doc, elem, "toClass", ass.ToClass.ClassName) If ass.TargetAttribute Is Nothing Then CreateAttributeValue(doc, elem, "target", "No Target") Else CreateAttributeValue(doc, elem, "target", ass.TargetAttribute.Name) End If If ass.Cardinality = Cardinalities.OneToOne Then CreateAttributeValue(doc, elem, "cardinality", "OneToOne") Else CreateAttributeValue(doc, elem, "cardinality", "OneToMany") End If If ass.Name <> ass.TargetAttribute.Name Then CreateAttributeValue(doc, elem, "name", ass.Name) End If If ass.RetrieveAuto Then CreateAttributeValue(doc, elem, "retrieveAutomatic", "true") Else CreateAttributeValue(doc, elem, "retrieveAutomatic", "false") End If If ass.SaveAuto Then CreateAttributeValue(doc, elem, "saveAutomatic", "true") Else CreateAttributeValue(doc, elem, "saveAutomatic", "false") End If If ass.DeleteAuto Then CreateAttributeValue(doc, elem, "deleteAutomatic", "true") Else CreateAttributeValue(doc, elem, "deleteAutomatic", "false") End If For Each e As CAssociationEntry In ass.Entries assEntry = doc.CreateElement("entry") CreateAttributeValue(doc, assEntry, "fromAttribute", e.fromAttribute.Name) CreateAttributeValue(doc, assEntry, "toAttribute", e.toAttribute.Name) elem.AppendChild(assEntry) Next End Sub Private Sub CreateAttributeValue(ByVal doc As XmlDocument, ByVal elem As XmlElement, ByVal name As String, ByVal value As String) Dim attr As XmlAttribute attr = doc.CreateAttribute(name) attr.Value = value elem.Attributes.Append(attr) End Sub End Class --- NEW FILE: MappedDatabaseList.vb --- Imports System.ComponentModel Public Class MappedDatabaseList Inherits StringConverter Public Overloads Overrides Function _ GetStandardValues(ByVal context As _ System.ComponentModel.ITypeDescriptorContext) _ As System.ComponentModel.TypeConverter.StandardValuesCollection Dim p As CProject Dim cls As CMappedClass Dim c As New ArrayList If context.Instance.GetType Is GetType(CMappedClass) Then cls = context.Instance p = cls.Project For Each db As CMappedDatabase In p.databases c.Add(db.dbname) Next End If c.Add("(None)") Return New StandardValuesCollection(c) End Function Public Overloads Overrides Function _ GetStandardValuesExclusive(ByVal context _ As System.ComponentModel.ITypeDescriptorContext) _ As Boolean Return True End Function Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean Return True End Function End Class --- NEW FILE: AFMappingClasses.vbproj --- <VisualStudioProject> <VisualBasic ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{AD59B3EC-022E-4CEB-B625-BB56C75A2255}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "AFMappingClasses" AssemblyOriginatorKeyFile = "" AssemblyOriginatorKeyMode = "None" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" RootNamespace = "AFMappingClasses" StartupObject = "AFMappingClasses.(None)" > <Config Name = "Debug" BaseAddress = "285212672" ConfigurationOverrideFile = "" DefineConstants = "" DefineDebug = "true" DefineTrace = "true" DebugSymbols = "true" IncrementalBuild = "true" Optimize = "false" OutputPath = "bin\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "1" /> <Config Name = "Release" BaseAddress = "285212672" ConfigurationOverrideFile = "" DefineConstants = "" DefineDebug = "false" DefineTrace = "true" DebugSymbols = "false" IncrementalBuild = "false" Optimize = "true" OutputPath = "bin\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "1" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" /> <Reference Name = "System.Data" AssemblyName = "System.Data" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" /> </References> <Imports> <Import Namespace = "Microsoft.VisualBasic" /> <Import Namespace = "System" /> <Import Namespace = "System.Collections" /> <Import Namespace = "System.Data" /> <Import Namespace = "System.Diagnostics" /> </Imports> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CAssociationEntry.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CAssociationEntryCollection.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CAttributeList.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CMappedAssociation.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CMappedAttribute.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CMappedAttributeCollection.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CMappedClass.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CMappedClassCollection.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CMappedDatabase.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "CProject.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "MappedDatabaseList.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "XMLMapper.vb" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </VisualBasic> </VisualStudioProject> --- NEW FILE: CAttributeList.vb --- Imports System.ComponentModel Imports AFMappingClasses Public Class CAttributeList Inherits StringConverter Public Overloads Overrides Function _ GetStandardValues(ByVal context As _ System.ComponentModel.ITypeDescriptorContext) _ As System.ComponentModel.TypeConverter.StandardValuesCollection Dim cls As CMappedClass Dim ass As CMappedAssociation Dim al As New ArrayList If context.Instance.GetType Is GetType(CMappedAssociation) Then ass = context.Instance cls = ass.FromClass For Each attr As CMappedAttribute In cls.Attributes al.Add(attr.Name) Next End If al.Add("(None)") Return New StandardValuesCollection(al) End Function Public Overloads Overrides Function _ GetStandardValuesExclusive(ByVal context _ As System.ComponentModel.ITypeDescriptorContext) _ As Boolean Return True End Function Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean Return True End Function End Class --- NEW FILE: CMappedAssociation.vb --- Imports System.ComponentModel Public Enum Cardinalities OneToOne OneToMany End Enum <DefaultProperty("Target")> _ Public Class CMappedAssociation Private _fromClass As CMappedClass Private _toClass As CMappedClass Private _name As String Private _targetAttribute As CMappedAttribute Private _cardinality As Cardinalities Private _deleteAuto As Boolean = False Private _saveAuto As Boolean = False Private _retrieveAuto As Boolean = False Private _lazyLoad As Boolean = False Private _entries As CAssociationEntryCollection Private _fromNamespace As String Private _toNamespace As String Public Event NameChanged As EventHandler <Browsable(False)> _ Public Property FromClass() As CMappedClass Get Return _fromClass End Get Set(ByVal Value As CMappedClass) _fromClass = Value End Set End Property Public ReadOnly Property FromClassName() As String Get If _fromClass Is Nothing Then Return "N/A" End If Return _fromClass.ClassName End Get End Property <Browsable(False)> _ Public Property ToClass() As CMappedClass Get Return _toClass End Get Set(ByVal Value As CMappedClass) _toClass = Value End Set End Property Public ReadOnly Property ToClassName() As String Get If _toClass Is Nothing Then Return "N/A" End If Return _toClass.ClassName End Get End Property Public Property Name() As String Get Return _name End Get Set(ByVal Value As String) _name = Value RaiseEvent NameChanged(Me, New EventArgs) End Set End Property <Browsable(False)> _ Public Property TargetAttribute() As CMappedAttribute Get Return _targetAttribute End Get Set(ByVal Value As CMappedAttribute) _targetAttribute = Value End Set End Property <TypeConverter(GetType(CAttributeList))> _ Public Property Target() As String Get If _targetAttribute Is Nothing Then Return "(None)" End If Return _targetAttribute.Name End Get Set(ByVal Value As String) If Value = "" Then Exit Property Dim s As String If _targetAttribute Is Nothing Then s = "(None)" Else If _targetAttribute.Name Is Nothing Then s = "(None)" Else s = _targetAttribute.Name End If End If If s <> Value Then If _fromClass Is Nothing Then _targetAttribute = Nothing End If If Value = "(None)" Then _targetAttribute = Nothing Else Try _targetAttribute = FromClass.Attributes(Value) If Left(Name, 9) = "No Target" Then Name = _targetAttribute.Name End If Catch _targetAttribute = Nothing End Try End If End If End Set End Property Public Property Cardinality() As Cardinalities Get Return _cardinality End Get Set(ByVal Value As Cardinalities) _cardinality = Value End Set End Property Public Property DeleteAuto() As Boolean Get Return _deleteAuto End Get Set(ByVal Value As Boolean) _deleteAuto = Value End Set End Property Public Property SaveAuto() As Boolean Get Return _saveAuto End Get Set(ByVal Value As Boolean) _saveAuto = Value End Set End Property Public Property RetrieveAuto() As Boolean Get Return _retrieveAuto End Get Set(ByVal Value As Boolean) _retrieveAuto = Value End Set End Property Public Property LazyLoad() As Boolean Get Return _lazyLoad End Get Set(ByVal Value As Boolean) _lazyLoad = Value End Set End Property <Browsable(False)> _ Public Property Entries() As CAssociationEntryCollection Get Return _entries End Get Set(ByVal Value As CAssociationEntryCollection) _entries = Value End Set End Property Public Sub New() _entries = New CAssociationEntryCollection _entries.parentAssociation = Me End Sub Public Property FromClassNamespace() As String Get Return _fromNamespace End Get Set(ByVal Value As String) _fromNamespace = Value End Set End Property Public Property ToClassNamespace() As String Get Return _toNamespace End Get Set(ByVal Value As String) _toNamespace = Value End Set End Property End Class --- NEW FILE: CProject.vb --- Public Class CProject Public ProjectName As String Public SourceCodeLocation As String Public IsNew As Boolean = True Public FileName As String Public XMLMappingFile As String Public BusinessClassScript As String Public XMLMappingScript As String Public DBSchemaScript As String Public databases As New CMappedDatabaseCollection Public classes As New CMappedClassCollection End Class --- NEW FILE: CMappedAttributeCollection.vb --- Option Explicit On Imports System.ComponentModel Public Class CMappedAttributeCollection Inherits CollectionBase Implements IBindingList Implements IComponent Public Sub Add(ByVal a As CMappedAttribute) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As CMappedAttribute) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As CMappedAttribute Get Return CType(list.Item(index), CMappedAttribute) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As CMappedAttribute Get For Each ma As CMappedAttribute In Me If ma.Name = _name Then Return ma End If Next End Get End Property #Region "IBindlingList" Public Overridable Sub AddIndex(ByVal [property] As System.ComponentModel.PropertyDescriptor) Implements System.ComponentModel.IBindingList.AddIndex End Sub Public Overridable Function AddNew() As Object Implements System.ComponentModel.IBindingList.AddNew Dim cm As New CMappedAttribute list.Add(cm) Return cm End Function Public Overridable ReadOnly Property AllowEdit() As Boolean Implements System.ComponentModel.IBindingList.AllowEdit Get Return True End Get End Property Public Overridable ReadOnly Property AllowNew() As Boolean Implements System.ComponentModel.IBindingList.AllowNew Get Return True End Get End Property Public Overridable ReadOnly Property AllowRemove() As Boolean Implements System.ComponentModel.IBindingList.AllowRemove Get Return True End Get End Property Public Overridable Sub ApplySort(ByVal [property] As System.ComponentModel.PropertyDescriptor, ByVal direction As System.ComponentModel.ListSortDirection) Implements System.ComponentModel.IBindingList.ApplySort End Sub Public Overridable Function Find(ByVal [property] As System.ComponentModel.PropertyDescriptor, ByVal key As Object) As Integer Implements System.ComponentModel.IBindingList.Find End Function Public Overridable ReadOnly Property IsSorted() As Boolean Implements System.ComponentModel.IBindingList.IsSorted Get End Get End Property Public Event ListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Implements System.ComponentModel.IBindingList.ListChanged Public Overridable Sub RemoveIndex(ByVal [property] As System.ComponentModel.PropertyDescriptor) Implements System.ComponentModel.IBindingList.RemoveIndex End Sub Public Overridable Sub RemoveSort() Implements System.ComponentModel.IBindingList.RemoveSort End Sub Public Overridable ReadOnly Property SortDirection() As System.ComponentModel.ListSortDirection Implements System.ComponentModel.IBindingList.SortDirection Get End Get End Property Public Overridable ReadOnly Property SortProperty() As System.ComponentModel.PropertyDescriptor Implements System.ComponentModel.IBindingList.SortProperty Get End Get End Property Public Overridable ReadOnly Property SupportsChangeNotification() As Boolean Implements System.ComponentModel.IBindingList.SupportsChangeNotification Get Return True End Get End Property Public Overridable ReadOnly Property SupportsSearching() As Boolean Implements System.ComponentModel.IBindingList.SupportsSearching Get Return False End Get End Property Public Overridable ReadOnly Property SupportsSorting() As Boolean Implements System.ComponentModel.IBindingList.SupportsSorting Get Return False End Get End Property #End Region #Region "Collection Events" Protected Overrides Sub OnInsertComplete(ByVal index As Integer, ByVal value As Object) AddHandler CType(value, CMappedAttribute).RemoveMe, AddressOf Remove RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.ItemAdded, index)) End Sub Protected Overrides Sub OnClearComplete() RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.Reset, 0)) End Sub Protected Overrides Sub OnRemoveComplete(ByVal index As Integer, ByVal value As Object) RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.ItemDeleted, index)) End Sub Protected Overrides Sub OnSetComplete(ByVal index As Integer, ByVal oldValue As Object, ByVal newValue As Object) RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.ItemChanged, index)) End Sub #End Region #Region "IComponent Interface" Public Event Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Implements IComponent.Disposed Private m_curCPCSite As ISite <Browsable(False)> Public Property Site() As System.ComponentModel.ISite Implements IComponent.Site Get Return m_curCPCSite End Get Set(ByVal Value As System.ComponentModel.ISite) m_curCPCSite = Value End Set End Property Public Sub Dispose() Implements System.IDisposable.Dispose RaiseEvent Disposed(Me, EventArgs.Empty) End Sub #End Region End Class --- NEW FILE: AssemblyInfo.vb --- Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("")> <Assembly: AssemblyCopyright("")> <Assembly: AssemblyTrademark("")> <Assembly: CLSCompliant(True)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("9892C051-0923-47CD-81D8-E1F0C0A65B58")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: <Assembly: AssemblyVersion("1.0.*")> --- NEW FILE: CAssociationEntry.vb --- Imports System.ComponentModel Public Class CAssociationEntry Implements IEditableObject Implements IDataErrorInfo Private _fromAttribute As CMappedAttribute Private _toAttribute As CMappedAttribute Private _parentAssociation As CMappedAssociation Friend Event RemoveMe(ByVal Attribute As CAssociationEntry) Private m_isNew As Boolean Private m_editing As Boolean Private m_preEditCopy As CAssociationEntry <Browsable(False)> _ Public Property ParentAssociation() As CMappedAssociation Get Return _parentAssociation End Get Set(ByVal Value As CMappedAssociation) _parentAssociation = Value End Set End Property <Browsable(False)> _ Public Property fromAttribute() As CMappedAttribute Get Return _fromAttribute End Get Set(ByVal Value As CMappedAttribute) _fromAttribute = Value End Set End Property <Browsable(False)> _ Public Property toAttribute() As CMappedAttribute Get Return _toAttribute End Get Set(ByVal Value As CMappedAttribute) _toAttribute = Value End Set End Property Public Property fromAttributeName() As String Get If _fromAttribute Is Nothing Then Return "" End If Return _fromAttribute.Name End Get Set(ByVal Value As String) If _parentAssociation Is Nothing Then Exit Property _fromAttribute = _parentAssociation.FromClass.Attributes(Value) End Set End Property Public Property toAttributeName() As String Get If _toAttribute Is Nothing Then Return "" End If Return _toAttribute.Name End Get Set(ByVal Value As String) If _parentAssociation Is Nothing Then Exit Property _toAttribute = _parentAssociation.ToClass.Attributes(Value) End Set End Property Public Overridable Sub BeginEdit() Implements System.ComponentModel.IEditableObject.BeginEdit If Not m_editing Then m_preEditCopy = New CAssociationEntry m_preEditCopy.fromAttribute = Me.fromAttribute m_preEditCopy.toAttribute = Me.toAttribute m_preEditCopy.ParentAssociation = Me.ParentAssociation m_editing = True End If End Sub Public Overridable Sub CancelEdit() Implements System.ComponentModel.IEditableObject.CancelEdit m_editing = False If m_isNew Then m_isNew = False RaiseEvent RemoveMe(Me) Else Me.fromAttribute = m_preEditCopy.fromAttribute Me.toAttribute = m_preEditCopy.toAttribute Me.ParentAssociation = m_preEditCopy.ParentAssociation m_preEditCopy = Nothing End If End Sub Public Overridable Sub EndEdit() Implements System.ComponentModel.IEditableObject.EndEdit m_editing = False m_isNew = False End Sub #Region "IDataErrorInfo" <Browsable(False)> Public ReadOnly Property [Error]() As String Implements System.ComponentModel.IDataErrorInfo.Error Get If _fromAttribute Is Nothing Then Return "Missing FromAttribute" End If If _toAttribute Is Nothing Then Return "Missing ToAttribute" End If If _parentAssociation Is Nothing Then Return "Missing Association" End If Dim found As Integer = 0 For Each ae As CAssociationEntry In _parentAssociation.Entries If _fromAttribute.Name = ae.fromAttribute.Name Then found += 1 End If Next If found > 1 Then Return "From Attribute appears more than once" End If found = 0 For Each ae As CAssociationEntry In _parentAssociation.Entries If _toAttribute.Name = ae.toAttribute.Name Then found += 1 End If Next If found > 1 Then Return "To Attribute appears more than once" End If End Get End Property <Browsable(False)> Default Public ReadOnly Property Item(ByVal columnName As String) As String Implements System.ComponentModel.IDataErrorInfo.Item Get Return "" End Get End Property #End Region End Class --- NEW FILE: CAssociationEntryCollection.vb --- Option Explicit On Imports System.ComponentModel Public Class CAssociationEntryCollection Inherits CollectionBase Implements IBindingList Implements IComponent Private _parent As CMappedAssociation Public Property parentAssociation() As CMappedAssociation Get Return _parent End Get Set(ByVal Value As CMappedAssociation) _parent = Value End Set End Property Public Sub Add(ByVal ae As CAssociationEntry) If ae.ParentAssociation Is Nothing Then ae.ParentAssociation = _parent End If list.Add(ae) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As CAssociationEntry) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As CAssociationEntry Get Return CType(list.Item(index), CAssociationEntry) End Get End Property #Region "IBindingList" Public Overridable Sub AddIndex(ByVal [property] As System.ComponentModel.PropertyDescriptor) Implements System.ComponentModel.IBindingList.AddIndex End Sub Public Overridable Function AddNew() As Object Implements System.ComponentModel.IBindingList.AddNew Dim ae As New CAssociationEntry ae.ParentAssociation = _parent list.Add(ae) Return ae End Function Public Overridable ReadOnly Property AllowEdit() As Boolean Implements System.ComponentModel.IBindingList.AllowEdit Get Return True End Get End Property Public Overridable ReadOnly Property AllowNew() As Boolean Implements System.ComponentModel.IBindingList.AllowNew Get Return True End Get End Property Public Overridable ReadOnly Property AllowRemove() As Boolean Implements System.ComponentModel.IBindingList.AllowRemove Get Return True End Get End Property Public Overridable Sub ApplySort(ByVal [property] As System.ComponentModel.PropertyDescriptor, ByVal direction As System.ComponentModel.ListSortDirection) Implements System.ComponentModel.IBindingList.ApplySort End Sub Public Overridable Function Find(ByVal [property] As System.ComponentModel.PropertyDescriptor, ByVal key As Object) As Integer Implements System.ComponentModel.IBindingList.Find End Function Public Overridable ReadOnly Property IsSorted() As Boolean Implements System.ComponentModel.IBindingList.IsSorted Get End Get End Property Public Event ListChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ListChangedEventArgs) Implements System.ComponentModel.IBindingList.ListChanged Public Overridable Sub RemoveIndex(ByVal [property] As System.ComponentModel.PropertyDescriptor) Implements System.ComponentModel.IBindingList.RemoveIndex End Sub Public Overridable Sub RemoveSort() Implements System.ComponentModel.IBindingList.RemoveSort End Sub Public Overridable ReadOnly Property SortDirection() As System.ComponentModel.ListSortDirection Implements System.ComponentModel.IBindingList.SortDirection Get End Get End Property Public Overridable ReadOnly Property SortProperty() As System.ComponentModel.PropertyDescriptor Implements System.ComponentModel.IBindingList.SortProperty Get End Get End Property Public Overridable ReadOnly Property SupportsChangeNotification() As Boolean Implements System.ComponentModel.IBindingList.SupportsChangeNotification Get Return True End Get End Property Public Overridable ReadOnly Property SupportsSearching() As Boolean Implements System.ComponentModel.IBindingList.SupportsSearching Get Return False End Get End Property Public Overridable ReadOnly Property SupportsSorting() As Boolean Implements System.ComponentModel.IBindingList.SupportsSorting Get Return False End Get End Property #End Region #Region "Collection events and Component interface" Protected Overrides Sub OnInsertComplete(ByVal index As Integer, ByVal value As Object) AddHandler CType(value, CAssociationEntry).RemoveMe, AddressOf Remove RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.ItemAdded, index)) End Sub Protected Overrides Sub OnClearComplete() RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.Reset, 0)) End Sub Protected Overrides Sub OnRemoveComplete(ByVal index As Integer, ByVal value As Object) RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.ItemDeleted, index)) End Sub Protected Overrides Sub OnSetComplete(ByVal index As Integer, ByVal oldValue As Object, ByVal newValue As Object) RaiseEvent ListChanged(Me, New ListChangedEventArgs(ListChangedType.ItemChanged, index)) End Sub Public Event Disposed(ByVal sender As Object, ByVal e As System.EventArgs) Implements IComponent.Disposed Private m_curCPCSite As ISite <Browsable(False)> Public Property Site() As System.ComponentModel.ISite Implements IComponent.Site Get Return m_curCPCSite End Get Set(ByVal Value As System.ComponentModel.ISite) m_curCPCSite = Value End Set End Property Public Sub Dispose() Implements System.IDisposable.Dispose RaiseEvent Disposed(Me, EventArgs.Empty) End Sub #End Region End Class --- NEW FILE: CMappedClass.vb --- Imports System.ComponentModel <DefaultProperty("ClassName")> _ Public Class CMappedClass Private _ClassName As String Private _SourcFile As String Private _isNew As Boolean = True Private _attributes As New CMappedAttributeCollection Private _associations As New Collection Private _DefaultExpiry As Integer Private _database As CMappedDatabase Private _superclass As CMappedClass Private _table As String Private _tableOwner As String Private _readOnlyFlag As Boolean = False Private _modifyOnlyFlag As Boolean = False Private _sharedField As String Private _sharedValue As String Private _classNamespace As String Private _expanded As Boolean Private _project As CProject Private _mappedTable As dbTable Private _assemblyPath As String Private _factory As String Public Event ClassNameChanged As EventHandler Public Sub New() _ClassName = "New Class" End Sub Public Property ClassName() As String Get Return _ClassName End Get Set(ByVal Value As String) _ClassName = Value RaiseEvent ClassNameChanged(Me, New EventArgs) End Set End Property Public Property SourceFile() As String Get Return _SourcFile End Get Set(ByVal Value As String) _SourcFile = Value End Set End Property Public Property IsNew() As Boolean Get Return _isNew End Get Set(ByVal Value As Boolean) _isNew = Value End Set End Property <Browsable(False)> _ Public Property Attributes() As CMappedAttributeCollection Get Return _attributes End Get Set(ByVal Value As CMappedAttributeCollection) _attributes = Value End Set End Property <Browsable(False)> _ Public Property Associations() As Collection Get Return _associations End Get Set(ByVal Value As Collection) _associations = Value End Set End Property Public Property DefaultExpiry() As Integer Get Return _DefaultExpiry End Get Set(ByVal Value As Integer) _DefaultExpiry = Value End Set End Property <TypeConverter(GetType(MappedDatabaseList)), [ReadOnly](False)> _ Public Property DatabaseName() As String Get If _database Is Nothing Then Return "(None)" End If Return _database.dbname End Get Set(ByVal Value As String) If Value = "" Then Exit Property Dim s As String If _database Is Nothing Then s = "(None)" Else s = _database.dbname End If If s <> Value Then If _project Is Nothing Then _database = Nothing End If If Value = "(None)" Then _database = Nothing Else _database = _project.databases(Value) End If End If End Set End Property <Browsable(False)> _ Public Property Database() As CMappedDatabase Get Return _database End Get Set(ByVal Value As CMappedDatabase) _database = Value End Set End Property Public Property SuperClass() As CMappedClass Get Return _superclass End Get Set(ByVal Value As CMappedClass) _superclass = Value End Set End Property Public Property Table() As String Get Return _table End Get Set(ByVal Value As String) _table = Value End Set End Property Public Property TableOwner() As String Get Return _tableOwner End Get Set(ByVal Value As String) _tableOwner = Value End Set End Property <Browsable(False)> _ Public Property MappedTable() As dbTable Get Return _mappedTable End Get Set(ByVal Value As dbTable) _mappedTable = Value End Set End Property Public Property ReadOnlyFlag() As Boolean Get Return _readOnlyFlag End Get Set(ByVal Value As Boolean) _readOnlyFlag = Value End Set End Property Public Property ModifyOnlyFlag() As Boolean Get Return _modifyOnlyFlag End Get Set(ByVal Value As Boolean) _modifyOnlyFlag = Value End Set End Property Public Property SharedField() As String Get Return _sharedField End Get Set(ByVal Value As String) _sharedField = Value End Set End Property Public Property SharedValue() As String Get Return _sharedValue End Get Set(ByVal Value As String) _sharedValue = Value End Set End Property Public Property ClassNameSpace() As String Get Return _classNamespace End Get Set(ByVal Value As String) _classNamespace = Value End Set End Property <Browsable(False)> _ Public Property Expanded() As Boolean Get Return _expanded End Get Set(ByVal Value As Boolean) _expanded = Value End Set End Property <Browsable(False)> Public Property Project() As CProject Get Return _project End Get Set(ByVal Value As CProject) _project = Value End Set End Property Public Property AssemblyPath() As String Get Return _assemblyPath End Get Set(ByVal Value As String) _assemblyPath = Value End Set End Property Public Property Factory() As String Get Return _factory End Get Set(ByVal Value As String) _factory = Value End Set End Property End Class --- NEW FILE: CMappedAttribute.vb --- Imports System.ComponentModel Public Class CMappedAttribute Implements IEditableObject Private _Name As String Private _column As String Private _isKey As Boolean = False Private _isProxy As Boolean = True Private _isFind As Boolean = False Private _isIdentity As Boolean = False Private _isTimeStamp As Boolean = False Private _referenceToParentField As String Private _dataType As String Private _mappedColumn As dbColumn Friend Event RemoveMe(ByVal Attribute As CMappedAttribute) Private m_isNew As Boolean Private m_editing As Boolean Private m_preEditCopy As CMappedAttribute Public Property Name() As String Get Return _Name End Get Set(ByVal Value As String) _Name = Value End Set End Property Public Property Column() As String Get Return _column End Get Set(ByVal Value As String) _column = Value End Set End Property Public Property MappedColumn() As dbColumn Get Return _mappedColumn End Get Set(ByVal Value As dbColumn) _mappedColumn = Value End Set End Property Public Property isKey(... [truncated message content] |
Update of /cvsroot/jcframework/FrameworkMapper In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5004 Modified Files: COptions.vb FrmMain.resx FrmMain.vb frmAddDatabase.resx frmAddDatabase.vb frmClassInfo.resx frmClassInfo.vb frmClasses.vb frmDatabases.vb frmOptions.resx frmOptions.vb frmProjectProperties.resx frmProjectProperties.vb frmProperties.vb Added Files: AtomsFrameworkMapper.suo AtomsFrameworkMapper.vbproj WeifenLuo.WinFormsUI.dll WeifenLuo.WinFormsUI.pdb Log Message: Major update to incorporate CodeSmith scripts, and integration with WinMerge for viewing differences. Index: frmProperties.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmProperties.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frmProperties.vb 12 Oct 2004 23:10:17 -0000 1.1 +++ frmProperties.vb 10 Dec 2004 04:31:12 -0000 1.2 @@ -1,36 +1,38 @@ +Imports AFMappingClasses + Public Class frmProperties - Inherits WeifenLuo.WinFormsUI.DockContent + Inherits WeifenLuo.WinFormsUI.DockContent Friend CurrentObject As Object #Region " Windows Form Designer generated code " - Public Sub New() - MyBase.New() + Public Sub New() + MyBase.New() - 'This call is required by the Windows Form Designer. - InitializeComponent() + 'This call is required by the Windows Form Designer. + InitializeComponent() - 'Add any initialization after the InitializeComponent() call + 'Add any initialization after the InitializeComponent() call - End Sub + End Sub - 'Form overrides dispose to clean up the component list. - Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing Then - If Not (components Is Nothing) Then - components.Dispose() - End If - End If - MyBase.Dispose(disposing) - End Sub + 'Form overrides dispose to clean up the component list. + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing Then + If Not (components Is Nothing) Then + components.Dispose() + End If + End If + MyBase.Dispose(disposing) + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents PropertyGrid1 As System.Windows.Forms.PropertyGrid <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() @@ -71,9 +73,9 @@ Me.Controls.Add(Me.PropertyGrid1) Me.Controls.Add(Me.Label1) Me.DockableAreas = CType(((((WeifenLuo.WinFormsUI.DockAreas.Float Or WeifenLuo.WinFormsUI.DockAreas.DockLeft) _ - Or WeifenLuo.WinFormsUI.DockAreas.DockRight) _ - Or WeifenLuo.WinFormsUI.DockAreas.DockTop) _ - Or WeifenLuo.WinFormsUI.DockAreas.DockBottom), WeifenLuo.WinFormsUI.DockAreas) + Or WeifenLuo.WinFormsUI.DockAreas.DockRight) _ + Or WeifenLuo.WinFormsUI.DockAreas.DockTop) _ + Or WeifenLuo.WinFormsUI.DockAreas.DockBottom), WeifenLuo.WinFormsUI.DockAreas) Me.HideOnClose = True Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Name = "frmProperties" Index: FrmMain.resx =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/FrmMain.resx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FrmMain.resx 12 Oct 2004 23:10:17 -0000 1.1 +++ FrmMain.resx 10 Dec 2004 04:31:12 -0000 1.2 @@ -196,6 +196,21 @@ <data name="mnuOptions.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> + <data name="MenuItem4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="MenuItem4.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="DockPanel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="DockPanel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="DockPanel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> <data name="SaveFileDialog1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> @@ -214,15 +229,12 @@ <data name="OpenFileDialog1.Location" type="System.Drawing.Point, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>254, 17</value> </data> - <data name="DockPanel1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <data name="MenuItem7.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> - <data name="DockPanel1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <data name="MenuItem7.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> - <data name="DockPanel1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> --- NEW FILE: AtomsFrameworkMapper.vbproj --- <VisualStudioProject> <VisualBasic ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{F656650C-9484-4E0F-AC0B-0358E133FB96}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "AtomsFrameworkMapper" AssemblyOriginatorKeyFile = "" AssemblyOriginatorKeyMode = "None" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "WinExe" OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" RootNamespace = "AtomsFrameworkMapper" StartupObject = "AtomsFrameworkMapper.FrmMain" > <Config Name = "Debug" BaseAddress = "285212672" ConfigurationOverrideFile = "" DefineConstants = "" DefineDebug = "true" DefineTrace = "true" DebugSymbols = "true" IncrementalBuild = "true" Optimize = "false" OutputPath = "bin\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "1" /> <Config Name = "Release" BaseAddress = "285212672" ConfigurationOverrideFile = "" DefineConstants = "" DefineDebug = "false" DefineTrace = "true" DebugSymbols = "false" IncrementalBuild = "false" Optimize = "true" OutputPath = "bin\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "1" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" /> <Reference Name = "System.Data" AssemblyName = "System.Data" /> <Reference Name = "System.Drawing" AssemblyName = "System.Drawing" /> <Reference Name = "System.Windows.Forms" AssemblyName = "System.Windows.Forms" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" /> <Reference Name = "Microsoft.VisualBasic" AssemblyName = "Microsoft.VisualBasic" HintPath = "..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Microsoft.VisualBasic.dll" /> <Reference Name = "WeifenLuo.WinFormsUI" AssemblyName = "WeifenLuo.WinFormsUI" HintPath = "WinFormsUI\bin\Debug\WeifenLuo.WinFormsUI.dll" /> <Reference Name = "AFMappingClasses" Project = "{AD59B3EC-022E-4CEB-B625-BB56C75A2255}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> <Reference Name = "CodeSmithDataClasses" Project = "{FB3D28DB-55C0-4068-A9F3-23412147768C}" Package = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}" /> </References> <Imports> <Import Namespace = "Microsoft.VisualBasic" /> <Import Namespace = "System" /> <Import Namespace = "System.Collections" /> <Import Namespace = "System.Data" /> <Import Namespace = "System.Drawing" /> <Import Namespace = "System.Diagnostics" /> <Import Namespace = "System.Windows.Forms" /> </Imports> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "COptions.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "frmAddDatabase.vb" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "frmAddDatabase.resx" DependentUpon = "frmAddDatabase.vb" BuildAction = "EmbeddedResource" /> <File RelPath = "frmClasses.vb" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "frmClasses.resx" DependentUpon = "frmClasses.vb" BuildAction = "EmbeddedResource" /> <File RelPath = "frmClassInfo.vb" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "frmClassInfo.resx" DependentUpon = "frmClassInfo.vb" BuildAction = "EmbeddedResource" /> <File RelPath = "frmDatabases.vb" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "frmDatabases.resx" DependentUpon = "frmDatabases.vb" BuildAction = "EmbeddedResource" /> <File RelPath = "FrmMain.vb" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "FrmMain.resx" DependentUpon = "FrmMain.vb" BuildAction = "EmbeddedResource" /> <File RelPath = "frmOptions.vb" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "frmOptions.resx" DependentUpon = "frmOptions.vb" BuildAction = "EmbeddedResource" /> <File RelPath = "frmProjectProperties.vb" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "frmProjectProperties.resx" DependentUpon = "frmProjectProperties.vb" BuildAction = "EmbeddedResource" /> <File RelPath = "frmProperties.vb" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "frmProperties.resx" DependentUpon = "frmProperties.vb" BuildAction = "EmbeddedResource" /> <File RelPath = "Images\Class.ico" BuildAction = "Content" /> <File RelPath = "Images\Database.ico" BuildAction = "Content" /> <File RelPath = "Images\OpenFolder.ICO" BuildAction = "Content" /> <File RelPath = "Images\Property.ico" BuildAction = "Content" /> <File RelPath = "Images\SQLColumn.ico" BuildAction = "Content" /> <File RelPath = "Images\SQLTable.ico" BuildAction = "Content" /> <File RelPath = "Images\SQLView.ico" BuildAction = "Content" /> </Include> </Files> </VisualBasic> </VisualStudioProject> --- NEW FILE: AtomsFrameworkMapper.suo --- (This appears to be a binary file; contents omitted.) Index: frmProjectProperties.resx =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmProjectProperties.resx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frmProjectProperties.resx 12 Oct 2004 23:10:17 -0000 1.1 +++ frmProjectProperties.resx 10 Dec 2004 04:31:12 -0000 1.2 @@ -169,13 +169,13 @@ <data name="TextBox3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> - <data name="cmbTemplateSet.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <data name="cmbClassScript.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> - <data name="cmbTemplateSet.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <data name="cmbClassScript.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> - <data name="cmbTemplateSet.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <data name="cmbClassScript.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> <data name="Label4.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> @@ -187,6 +187,42 @@ <data name="Label4.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> + <data name="Label5.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="Label5.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="Label5.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="cmbXMLScript.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="cmbXMLScript.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="cmbXMLScript.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="Label6.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="Label6.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="Label6.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="cmbDBSchema.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="cmbDBSchema.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="cmbDBSchema.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> @@ -196,9 +232,6 @@ <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> - <data name="$this.Name"> - <value>frmProjectProperties</value> - </data> <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> @@ -211,6 +244,9 @@ <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>80</value> </data> + <data name="$this.Name"> + <value>frmProjectProperties</value> + </data> <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </data> Index: frmClassInfo.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmClassInfo.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frmClassInfo.vb 12 Oct 2004 23:10:17 -0000 1.1 +++ frmClassInfo.vb 10 Dec 2004 04:31:12 -0000 1.2 @@ -1,4 +1,5 @@ Imports System.Data +Imports AFMappingClasses Public Class frmClassInfo Inherits WeifenLuo.WinFormsUI.DockContent @@ -33,7 +34,6 @@ 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. - Friend WithEvents CMappedAttributeCollection1 As FrameworkMapper.CMappedAttributeCollection Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid Friend WithEvents DataGridTableStyle1 As System.Windows.Forms.DataGridTableStyle Friend WithEvents DataGridTextBoxColumn1 As System.Windows.Forms.DataGridTextBoxColumn @@ -45,7 +45,6 @@ Friend WithEvents DataGridBoolColumn4 As System.Windows.Forms.DataGridBoolColumn Friend WithEvents DataGridBoolColumn5 As System.Windows.Forms.DataGridBoolColumn Friend WithEvents DataGridTextBoxColumn4 As System.Windows.Forms.DataGridTextBoxColumn - Friend WithEvents CAssociationEntryCollection1 As FrameworkMapper.CAssociationEntryCollection Friend WithEvents Splitter1 As System.Windows.Forms.Splitter Friend WithEvents Splitter2 As System.Windows.Forms.Splitter Friend WithEvents Panel2 As System.Windows.Forms.Panel @@ -53,10 +52,10 @@ Friend WithEvents ListView1 As System.Windows.Forms.ListView Friend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu Friend WithEvents mnuDeleteAssociation As System.Windows.Forms.MenuItem + Friend WithEvents CMappedAttributeCollection2 As AFMappingClasses.CMappedAttributeCollection + Friend WithEvents CAssociationEntryCollection2 As AFMappingClasses.CAssociationEntryCollection <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmClassInfo)) - Me.CMappedAttributeCollection1 = New FrameworkMapper.CMappedAttributeCollection - Me.CAssociationEntryCollection1 = New FrameworkMapper.CAssociationEntryCollection Me.DataGrid1 = New System.Windows.Forms.DataGrid Me.DataGridTableStyle1 = New System.Windows.Forms.DataGridTableStyle Me.DataGridTextBoxColumn1 = New System.Windows.Forms.DataGridTextBoxColumn @@ -75,21 +74,19 @@ Me.ListView1 = New System.Windows.Forms.ListView Me.ContextMenu1 = New System.Windows.Forms.ContextMenu Me.mnuDeleteAssociation = New System.Windows.Forms.MenuItem + Me.CMappedAttributeCollection2 = New AFMappingClasses.CMappedAttributeCollection + Me.CAssociationEntryCollection2 = New AFMappingClasses.CAssociationEntryCollection CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit() Me.Panel2.SuspendLayout() CType(Me.DataGrid2, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' - 'CAssociationEntryCollection1 - ' - Me.CAssociationEntryCollection1.parentAssociation = Nothing - ' 'DataGrid1 ' Me.DataGrid1.AllowDrop = True Me.DataGrid1.CaptionText = "Attributes" Me.DataGrid1.DataMember = "" - Me.DataGrid1.DataSource = Me.CMappedAttributeCollection1 + Me.DataGrid1.DataSource = Me.CMappedAttributeCollection2 Me.DataGrid1.Dock = System.Windows.Forms.DockStyle.Fill Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.DataGrid1.Location = New System.Drawing.Point(0, 0) @@ -214,7 +211,7 @@ ' Me.DataGrid2.CaptionText = "Association Entries" Me.DataGrid2.DataMember = "" - Me.DataGrid2.DataSource = Me.CAssociationEntryCollection1 + Me.DataGrid2.DataSource = Me.CAssociationEntryCollection2 Me.DataGrid2.Dock = System.Windows.Forms.DockStyle.Fill Me.DataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText Me.DataGrid2.Location = New System.Drawing.Point(181, 0) @@ -242,6 +239,10 @@ Me.mnuDeleteAssociation.Index = 0 Me.mnuDeleteAssociation.Text = "Delete" ' + 'CAssociationEntryCollection2 + ' + Me.CAssociationEntryCollection2.parentAssociation = Nothing + ' 'frmClassInfo ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Index: frmClasses.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmClasses.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frmClasses.vb 12 Oct 2004 23:10:17 -0000 1.1 +++ frmClasses.vb 10 Dec 2004 04:31:12 -0000 1.2 @@ -1,4 +1,5 @@ Imports WeifenLuo.WinFormsUI +Imports AFMappingClasses Public Class frmClasses Inherits WeifenLuo.WinFormsUI.DockContent Index: frmOptions.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmOptions.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frmOptions.vb 12 Oct 2004 23:10:17 -0000 1.1 +++ frmOptions.vb 10 Dec 2004 04:31:12 -0000 1.2 @@ -1,4 +1,5 @@ Imports System.IO +Imports AFMappingClasses Public Class frmOptions Inherits System.Windows.Forms.Form @@ -35,11 +36,19 @@ Friend WithEvents Button2 As System.Windows.Forms.Button Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents txtTemplateDir As System.Windows.Forms.TextBox + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents txtCodeSmith As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents txtDiffUtil As System.Windows.Forms.TextBox <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label Me.txtTemplateDir = New System.Windows.Forms.TextBox Me.Button2 = New System.Windows.Forms.Button Me.Button1 = New System.Windows.Forms.Button + Me.Label2 = New System.Windows.Forms.Label + Me.txtCodeSmith = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.txtDiffUtil = New System.Windows.Forms.TextBox Me.SuspendLayout() ' 'Label1 @@ -48,7 +57,7 @@ Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(108, 23) Me.Label1.TabIndex = 0 - Me.Label1.Text = "Template Directory" + Me.Label1.Text = "Script Directory" ' 'txtTemplateDir ' @@ -72,16 +81,51 @@ Me.Button1.TabIndex = 6 Me.Button1.Text = "OK" ' + 'Label2 + ' + Me.Label2.Location = New System.Drawing.Point(16, 64) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(116, 23) + Me.Label2.TabIndex = 8 + Me.Label2.Text = "CodeSmith Directory" + ' + 'txtCodeSmith + ' + Me.txtCodeSmith.Location = New System.Drawing.Point(148, 62) + Me.txtCodeSmith.Name = "txtCodeSmith" + Me.txtCodeSmith.Size = New System.Drawing.Size(164, 20) + Me.txtCodeSmith.TabIndex = 9 + Me.txtCodeSmith.Text = "" + ' + 'Label3 + ' + Me.Label3.Location = New System.Drawing.Point(16, 98) + Me.Label3.Name = "Label3" + Me.Label3.TabIndex = 10 + Me.Label3.Text = "Diff Utility" + ' + 'txtDiffUtil + ' + Me.txtDiffUtil.Location = New System.Drawing.Point(148, 94) + Me.txtDiffUtil.Name = "txtDiffUtil" + Me.txtDiffUtil.Size = New System.Drawing.Size(166, 20) + Me.txtDiffUtil.TabIndex = 11 + Me.txtDiffUtil.Text = "" + ' 'frmOptions ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(368, 158) + Me.Controls.Add(Me.txtDiffUtil) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.txtCodeSmith) + Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.txtTemplateDir) Me.Controls.Add(Me.Label1) Me.Name = "frmOptions" - Me.Text = "Options" + Me.Text = "frmOptions" Me.ResumeLayout(False) End Sub @@ -93,21 +137,34 @@ Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim d As Directory If d.Exists(txtTemplateDir.Text) Then - o.TemplateDirectory = txtTemplateDir.Text - o.Save() - Me.Close() + o.ScriptDirectory = txtTemplateDir.Text Else If MsgBox("Template directory does not exist. Do you wish to create it?", MsgBoxStyle.YesNo, "Create Template Directory") = MsgBoxResult.Yes Then d.CreateDirectory(txtTemplateDir.Text) - o.TemplateDirectory = txtTemplateDir.Text - o.Save() - Me.Close() + o.ScriptDirectory = txtTemplateDir.Text + Else + o.ScriptDirectory = "" End If End If + If d.Exists(txtCodeSmith.Text) Then + o.CodeSmithDirectory = txtCodeSmith.Text + Else + o.CodeSmithDirectory = "" + End If + Dim f As File + If f.Exists(txtDiffUtil.Text) Then + o.DiffUtil = txtDiffUtil.Text + Else + o.DiffUtil = "" + End If + o.Save() + Me.Close() End Sub Private Sub frmOptions_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load - txtTemplateDir.Text = o.TemplateDirectory + txtTemplateDir.Text = o.ScriptDirectory + txtCodeSmith.Text = o.CodeSmithDirectory + txtDiffUtil.Text = o.DiffUtil End Sub Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click Index: frmOptions.resx =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmOptions.resx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frmOptions.resx 12 Oct 2004 23:10:17 -0000 1.1 +++ frmOptions.resx 10 Dec 2004 04:31:12 -0000 1.2 @@ -133,9 +133,48 @@ <data name="Button1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> + <data name="Label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="Label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="Label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="txtCodeSmith.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="txtCodeSmith.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="txtCodeSmith.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="Label3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="Label3.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="Label3.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="txtDiffUtil.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> + <data name="txtDiffUtil.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="txtDiffUtil.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Assembly</value> + </data> <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> + <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>(Default)</value> + </data> <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> @@ -145,21 +184,18 @@ <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>2, 2</value> </data> - <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>(Default)</value> - </data> <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </data> - <data name="$this.Name"> - <value>frmOptions</value> - </data> <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>80</value> </data> <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </data> + <data name="$this.Name"> + <value>frmOptions</value> + </data> <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> Index: frmAddDatabase.resx =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmAddDatabase.resx,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frmAddDatabase.resx 12 Oct 2004 23:10:17 -0000 1.1 +++ frmAddDatabase.resx 10 Dec 2004 04:31:12 -0000 1.2 @@ -124,12 +124,12 @@ <data name="ComboBox1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> - <data name="Label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>False</value> - </data> <data name="Label2.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> + <data name="Label2.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> <data name="Label2.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> @@ -163,12 +163,12 @@ <data name="GroupBox1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> - <data name="GroupBox1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </data> <data name="GroupBox1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>Assembly</value> </data> + <data name="GroupBox1.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> <data name="lblParam3.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>False</value> </data> Index: FrmMain.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/FrmMain.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FrmMain.vb 12 Oct 2004 23:10:17 -0000 1.1 +++ FrmMain.vb 10 Dec 2004 04:31:12 -0000 1.2 @@ -1,17 +1,13 @@ Imports System.IO Imports WeifenLuo.WinFormsUI Imports System.Xml +Imports AFMappingClasses +Imports System.ComponentModel +Imports CodeSmithDataClasses Public Class FrmMain Inherits System.Windows.Forms.Form - 'TODO: Link db properties (frmAddDatabase) to existing databases - 'TODO: Add db code to get schema for access/odbc/mysql - 'TODO: Flesh out association collections - 'TODO: Add ability to add new classes - 'TODO: Generate XML schema from mappings - 'TODO: Think about code generation templates - Public p As CProject Public opt As COptions Friend fClasses As New frmClasses @@ -67,6 +63,8 @@ Friend WithEvents mnuProperties As System.Windows.Forms.MenuItem Friend WithEvents mnuGenerateXML As System.Windows.Forms.MenuItem Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem + Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem + Friend WithEvents MenuItem7 As System.Windows.Forms.MenuItem <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.MainMenu1 = New System.Windows.Forms.MainMenu Me.MenuItem1 = New System.Windows.Forms.MenuItem @@ -84,9 +82,11 @@ Me.mnuGenerateXML = New System.Windows.Forms.MenuItem Me.MenuItem6 = New System.Windows.Forms.MenuItem Me.mnuOptions = New System.Windows.Forms.MenuItem + Me.MenuItem4 = New System.Windows.Forms.MenuItem + Me.DockPanel1 = New WeifenLuo.WinFormsUI.DockPanel Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog - Me.DockPanel1 = New WeifenLuo.WinFormsUI.DockPanel + Me.MenuItem7 = New System.Windows.Forms.MenuItem Me.SuspendLayout() ' 'MainMenu1 @@ -154,7 +154,7 @@ 'MenuItem2 ' Me.MenuItem2.Index = 3 - Me.MenuItem2.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuGenerateXML, Me.MenuItem6, Me.mnuOptions}) + Me.MenuItem2.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuGenerateXML, Me.MenuItem7, Me.MenuItem4, Me.MenuItem6, Me.mnuOptions}) Me.MenuItem2.Text = "Tools" ' 'mnuGenerateXML @@ -164,21 +164,18 @@ ' 'MenuItem6 ' - Me.MenuItem6.Index = 1 + Me.MenuItem6.Index = 3 Me.MenuItem6.Text = "-" ' 'mnuOptions ' - Me.mnuOptions.Index = 2 + Me.mnuOptions.Index = 4 Me.mnuOptions.Text = "Options..." ' - 'SaveFileDialog1 - ' - Me.SaveFileDialog1.Filter = "AtomsFramework XML Mapping Projects (*.axproj)|*.axproj" - ' - 'OpenFileDialog1 + 'MenuItem4 ' - Me.OpenFileDialog1.Filter = "AtomsFramework XML Mapping Projects (*.axproj)|*.axproj" + Me.MenuItem4.Index = 2 + Me.MenuItem4.Text = "Generate Database Schema" ' 'DockPanel1 ' @@ -188,7 +185,20 @@ Me.DockPanel1.Location = New System.Drawing.Point(0, 0) Me.DockPanel1.Name = "DockPanel1" Me.DockPanel1.Size = New System.Drawing.Size(560, 478) - Me.DockPanel1.TabIndex = 1 + Me.DockPanel1.TabIndex = 0 + ' + 'SaveFileDialog1 + ' + Me.SaveFileDialog1.Filter = "AtomsFramework XML Mapping Projects (*.axproj)|*.axproj" + ' + 'OpenFileDialog1 + ' + Me.OpenFileDialog1.Filter = "AtomsFramework XML Mapping Projects (*.axproj)|*.axproj" + ' + 'MenuItem7 + ' + Me.MenuItem7.Index = 1 + Me.MenuItem7.Text = "Generate Class Code" ' 'FrmMain ' @@ -198,7 +208,7 @@ Me.IsMdiContainer = True Me.Menu = Me.MainMenu1 Me.Name = "FrmMain" - Me.Text = "FrameworkMapper " + Me.Text = "AtomsFramework Code Generator" Me.WindowState = System.Windows.Forms.FormWindowState.Maximized Me.ResumeLayout(False) @@ -309,8 +319,11 @@ elem = xdoc.CreateElement("XMLMappingFile") elem.InnerText = p.XMLMappingFile root.AppendChild(elem) - elem = xdoc.CreateElement("TemplateSet") - elem.InnerText = p.TemplateSet + elem = xdoc.CreateElement("BusinessClassScript") + elem.InnerText = p.BusinessClassScript + root.AppendChild(elem) + elem = xdoc.CreateElement("XMLScript") + elem.InnerText = p.XMLMappingScript root.AppendChild(elem) xdoc.AppendChild(root) xdoc.Save(p.FileName) @@ -345,8 +358,11 @@ If elem.Name = "XMLMappingFile" Then newproj.XMLMappingFile = elem.InnerText End If - If elem.Name = "TemplateSet" Then - newproj.TemplateSet = elem.InnerText + If elem.Name = "BusinessClassScript" Then + newproj.BusinessClassScript = elem.InnerText + End If + If elem.Name = "XMLScript" Then + newproj.XMLMappingScript = elem.InnerText End If elem = elem.NextSibling End While @@ -423,15 +439,427 @@ End Sub Private Sub mnuGenerateXML_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuGenerateXML.Click - SaveFileDialog1.FileName = "AtomsFramework.xml" - SaveFileDialog1.Filter = "XML File(*.xml)|*.xml" - If SaveFileDialog1.ShowDialog(Me) <> DialogResult.OK Then - MsgBox("XML Mapping file was not generated") + If p.XMLMappingScript = String.Empty Then + MsgBox("You need to select an XML Mapping script in the project properties") Exit Sub End If + Dim xn_db As XmlNode + Dim xn_cls As XmlNode + Dim overwrite As Boolean - Dim x As New CXMLMapper(SaveFileDialog1.FileName, p) - x.Save() - MsgBox("XML Mapping file was generated") + Dim tc As DatabaseTypeConverter + tc = New DatabaseTypeConverter + Dim dbcollection As New DatabaseCollection + Dim cs_db As DatabaseMap + For Each d As CMappedDatabase In p.databases + cs_db = New DatabaseMap + cs_db.dbname = d.dbname + cs_db.dbType = d.dbType + cs_db.NameParam = d.NameParam + cs_db.OIDTable = d.OIDTable + cs_db.options = d.options + cs_db.password = d.password + cs_db.portNumber = d.portNumber + cs_db.serverName = d.serverName + cs_db.user = d.user + cs_db.tables = New DatabaseTableCollection + dbcollection.Add(cs_db) + Next d + + Dim clsConv As New ClassMapTypeConverter + Dim clsCollection As New ClassMapCollection + Dim cls As ClassMap + Dim att As AttributeMap + Dim assoc As Association + Dim assocEntry As AssociationEntry + For Each c As CMappedClass In p.classes + cls = New ClassMap + cls.ClassName = c.ClassName + cls.classNamespace = c.ClassNameSpace + cls.databaseName = c.DatabaseName + cls.table = c.Table + cls.tableOwner = c.TableOwner + cls.modifyOnlyFlag = c.ModifyOnlyFlag + cls.readOnlyFlag = c.ReadOnlyFlag + cls.sharedField = c.SharedField + cls.sharedValue = c.SharedValue + cls.SourceFile = c.SourceFile + cls.assemblyPath = c.AssemblyPath + cls.factory = c.Factory + cls.associations = New AssociationCollection + cls.attributes = New CodeSmithDataClasses.AttributeCollection + If Not c.SuperClass Is Nothing Then + cls.superClassName = c.SuperClass.ClassName + cls.superClassNameSpace = c.SuperClass.ClassNameSpace + End If + For Each a As CMappedAttribute In c.Attributes + att = New AttributeMap + att.column = a.Column + att.isFind = a.isFind + att.isIdentity = a.isIdentity + att.isKey = a.isKey + att.isProxy = a.isProxy + att.isTimeStamp = a.isTimeStamp + att.Name = a.Name + att.referenceToParentField = a.Reference + cls.attributes.Add(att) + Next + For Each ass As CMappedAssociation In c.Associations + assoc = New Association + If ass.Name <> "No Target" Then + assoc.name = ass.Name + End If + assoc.cardinality = ass.Cardinality + assoc.deleteAuto = ass.DeleteAuto + assoc.fromClass = ass.FromClassName + assoc.retrieveAuto = ass.RetrieveAuto + assoc.lazyLoad = ass.LazyLoad + assoc.saveAuto = ass.SaveAuto + assoc.target = ass.TargetAttribute.Name + assoc.toClass = ass.ToClassName + If ass.FromClassNamespace <> String.Empty Then + assoc.fromNamespace = ass.FromClassNamespace + Else + assoc.fromNamespace = ass.FromClass.ClassNameSpace + End If + If ass.ToClassNamespace <> String.Empty Then + assoc.toNamespace = ass.ToClassNamespace + Else + assoc.toNamespace = ass.ToClass.ClassNameSpace + End If + assoc.entries = New AssociationEntryCollection + For Each ent As CAssociationEntry In ass.Entries + assocEntry = New AssociationEntry + assocEntry.fromAttribute = ent.fromAttributeName + assocEntry.toAttribute = ent.toAttributeName + assoc.entries.Add(assocEntry) + Next + cls.associations.Add(assoc) + Next + clsCollection.Add(cls) + Next + xn_db = TypeDescriptor.GetConverter(dbcollection).ConvertTo(dbcollection, GetType(XmlNode)) + xn_cls = TypeDescriptor.GetConverter(clsCollection).ConvertTo(clsCollection, GetType(XmlNode)) + Dim xr As New System.Xml.XmlTextWriter(opt.ScriptDirectory & "\properties.xml", Nothing) + xr.WriteStartElement("codeSmith") + xr.WriteStartElement("propertySet") + xr.WriteStartElement("property") + xr.WriteAttributeString("name", "databases") + xr.WriteRaw(xn_db.OuterXml) + xr.WriteEndElement() + xr.WriteStartElement("property") + xr.WriteAttributeString("name", "classes") + xr.WriteRaw(xn_cls.OuterXml) + xr.WriteEndElement() + xr.WriteEndElement() + xr.Close() + Dim cmdString As String + cmdString = """" & opt.CodeSmithDirectory & "\CodeSmithConsole.exe"" " + cmdString &= "/template:""" & opt.ScriptDirectory & "\" & p.XMLMappingScript & """ " + cmdString &= "/properties:""" & opt.ScriptDirectory & "\properties.xml"" " + cmdString &= "/out:""" & opt.ScriptDirectory & "\new.xml""" + Shell(cmdString, AppWinStyle.NormalFocus, True) + overwrite = True + If Not FileCompare(opt.ScriptDirectory & "\new.xml", p.XMLMappingFile) Then + If opt.DiffUtil <> String.Empty Then + 'check tmp.xml vs original + cmdString = """" & opt.DiffUtil & """" + cmdString &= " """ & p.XMLMappingFile & """" + cmdString &= " """ & opt.ScriptDirectory & "\new.xml""" + Shell(cmdString, AppWinStyle.Hide, True) + Else + If Not MsgBox("Overwrite existing XML file?", MsgBoxStyle.YesNo) Then + overwrite = False + End If + End If + Else + overwrite = False + End If + If overwrite Then + File.Copy(p.XMLMappingFile, p.XMLMappingFile & ".bak") + File.Copy(opt.ScriptDirectory & "\new.xml", p.XMLMappingFile, True) + End If + End Sub + + Private Sub MenuItem4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click + If p.DBSchemaScript = String.Empty Then + MsgBox("You need to select a database schema script in the project properties") + Exit Sub + End If + Dim xn As System.Xml.XmlNode + Dim tc As DatabaseTypeConverter + tc = New DatabaseTypeConverter + Dim dbcollection As New DatabaseCollection + Dim cs_db As DatabaseMap + Dim cs_t As DatabaseTable + Dim cs_c As DatabaseColumn + For Each d As CMappedDatabase In p.databases + cs_db = New DatabaseMap + cs_db.dbname = d.dbname + cs_db.dbType = d.dbType + cs_db.NameParam = d.NameParam + cs_db.OIDTable = d.OIDTable + cs_db.options = d.options + cs_db.password = d.password + cs_db.portNumber = d.portNumber + cs_db.serverName = d.serverName + cs_db.user = d.user + cs_db.tables = New DatabaseTableCollection + For Each t As dbTable In d.tables + cs_t = New DatabaseTable + cs_t.parentDBName = cs_db.dbname + cs_t.tableName = t.tableName + cs_t.tableOwner = t.tableOwner + cs_t.tableType = t.tableType + cs_t.columns = New DatabaseColumnCollection + For Each c As dbColumn In t.columns + cs_c = New DatabaseColumn + cs_c.colName = c.colName + cs_c.colType = c.colType + cs_c.dotnetTypeName = c.dotnetTypeName + cs_c.isPrimaryKey = c.isPrimaryKey + cs_c.parentTableName = cs_t.tableName + cs_t.columns.Add(cs_c) + Next c + cs_db.tables.Add(cs_t) + Next t + dbcollection.Add(cs_db) + Next d + xn = TypeDescriptor.GetConverter(dbcollection).ConvertTo(dbcollection, GetType(System.Xml.XmlNode)) + 'Dim dd As New DatabaseCollection + 'dd = TypeDescriptor.GetConverter(dbcollection).ConvertFrom(xn) + Dim xr As New System.Xml.XmlTextWriter(opt.ScriptDirectory & "\properties.xml", Nothing) + xr.WriteStartElement("codeSmith") + xr.WriteStartElement("propertySet") + xr.WriteStartElement("property") + xr.WriteAttributeString("name", "d") + xr.WriteRaw(xn.OuterXml) + xr.WriteEndElement() + xr.WriteStartElement("property") + xr.WriteAttributeString("name", "classmaps") + xr.WriteRaw("somename") + xr.WriteEndElement() + xr.WriteStartElement("property") + xr.WriteAttributeString("name", "associations") + xr.WriteRaw("person") + xr.WriteEndElement() + xr.WriteEndElement() + xr.WriteEndElement() + xr.Close() + Dim cmdString As String + cmdString = """" & opt.CodeSmithDirectory & "\CodeSmithConsole.exe"" " + cmdString &= "/template:""" & opt.ScriptDirectory & "\" & p.DBSchemaScript & """ " + cmdString &= "/properties:""" & opt.ScriptDirectory & "\properties.xml"" " + cmdString &= "/out:default" + Shell(cmdString, AppWinStyle.NormalFocus) + End Sub + + 'this function courtesy of Microsoft - http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B320346 + Private Function FileCompare(ByVal file1 As String, ByVal file2 As String) As Boolean + Dim file1byte As Integer + Dim file2byte As Integer + Dim fs1 As FileStream + Dim fs2 As FileStream + + ' Determine if the same file was referenced two times. + If (file1 = file2) Then + ' Return 0 to indicate that the files are the same. + Return True + End If + + ' Open the two files. + Try + fs1 = New FileStream(file1, FileMode.Open) + fs2 = New FileStream(file2, FileMode.Open) + Catch + Return False + End Try + + ' Check the file sizes. If they are not the same, the files + ' are not equal. + If (fs1.Length <> fs2.Length) Then + ' Close the file + fs1.Close() + fs2.Close() + + ' Return a non-zero value to indicate that the files are different. + Return False + End If + + ' Read and compare a byte from each file until either a + ' non-matching set of bytes is found or until the end of + ' file1 is reached. + Do + ' Read one byte from each file. + file1byte = fs1.ReadByte() + file2byte = fs2.ReadByte() + Loop While ((file1byte = file2byte) And (file1byte <> -1)) + + ' Close the files. + fs1.Close() + fs2.Close() + + ' Return the success of the comparison. "file1byte" is + ' equal to "file2byte" at this point only if the files are + ' the same. + Return ((file1byte - file2byte) = 0) + End Function + + Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click + If p.BusinessClassScript = String.Empty Then + MsgBox("You need to select a Business Class script in the project properties") + Exit Sub + End If + + Dim ci As frmClassInfo + If DockPanel1.ActiveContent Is Nothing Then + MsgBox("There is no class currently being displayed") + Exit Sub + End If + If DockPanel1.ActiveContent.GetType Is GetType(frmClassInfo) Then + ci = DockPanel1.ActiveContent + If ci Is Nothing Then + MsgBox("Please make a business class active first") + Exit Sub + End If + Else + MsgBox("Please make a business class active first") + Exit Sub + End If + + Dim xn_db As XmlNode + Dim xn_cls As XmlNode + Dim overwrite As Boolean + + Dim clsConv As New ClassMapTypeConverter + Dim clsCollection As New ClassMapCollection + Dim cls As ClassMap + Dim att As AttributeMap + Dim assoc As Association + Dim assocEntry As AssociationEntry + Dim c As CMappedClass = ci.MappedClass + If c.SourceFile Is Nothing Then + SaveFileDialog1.FileName = "*.*" + SaveFileDialog1.AddExtension = True + SaveFileDialog1.Filter = "All Files (*.*)|*.*|VB Classes (*.vb)|*.vb|C# Classes (*.cs)|*.cs" + If SaveFileDialog1.ShowDialog(Me) = DialogResult.OK Then + c.SourceFile = SaveFileDialog1.FileName + Else + MsgBox("A file name is required") + Exit Sub + End If + End If + + cls = New ClassMap + cls.ClassName = c.ClassName + cls.SourceFile = c.SourceFile + cls.classNamespace = c.ClassNameSpace + cls.databaseName = c.DatabaseName + cls.table = c.Table + cls.tableOwner = c.TableOwner + cls.modifyOnlyFlag = c.ModifyOnlyFlag + cls.readOnlyFlag = c.ReadOnlyFlag + cls.sharedField = c.SharedField + cls.sharedValue = c.SharedValue + cls.SourceFile = c.SourceFile + cls.assemblyPath = c.AssemblyPath + cls.factory = c.Factory + cls.associations = New AssociationCollection + cls.attributes = New CodeSmithDataClasses.AttributeCollection + If Not c.SuperClass Is Nothing Then + cls.superClassName = c.SuperClass.ClassName + cls.superClassNameSpace = c.SuperClass.ClassNameSpace + End If + For Each a As CMappedAttribute In c.Attributes + att = New AttributeMap + att.column = a.Column + att.isFind = a.isFind + att.isIdentity = a.isIdentity + att.isKey = a.isKey + att.isProxy = a.isProxy + att.isTimeStamp = a.isTimeStamp + att.Name = a.Name + att.referenceToParentField = a.Reference + If Not a.MappedColumn Is Nothing Then + att.dataType = a.MappedColumn.dotnetTypeName + Else + att.dataType = a.DataType + End If + cls.attributes.Add(att) + Next + For Each ass As CMappedAssociation In c.Associations + assoc = New Association + If ass.Name <> "No Target" Then + assoc.name = ass.Name + End If + assoc.cardinality = ass.Cardinality + assoc.deleteAuto = ass.DeleteAuto + assoc.fromClass = ass.FromClassName + assoc.retrieveAuto = ass.RetrieveAuto + assoc.lazyLoad = ass.LazyLoad + assoc.saveAuto = ass.SaveAuto + assoc.target = ass.TargetAttribute.Name + assoc.toClass = ass.ToClassName + If ass.FromClassNamespace <> String.Empty Then + assoc.fromNamespace = ass.FromClassNamespace + Else + assoc.fromNamespace = ass.FromClass.ClassNameSpace + End If + If ass.ToClassNamespace <> String.Empty Then + assoc.toNamespace = ass.ToClassNamespace + Else + assoc.toNamespace = ass.ToClass.ClassNameSpace + End If + assoc.entries = New AssociationEntryCollection + For Each ent As CAssociationEntry In ass.Entries + assocEntry = New AssociationEntry + assocEntry.fromAttribute = ent.fromAttributeName + assocEntry.toAttribute = ent.toAttributeName + assoc.entries.Add(assocEntry) + Next + cls.associations.Add(assoc) + Next + clsCollection.Add(cls) + xn_cls = TypeDescriptor.GetConverter(clsCollection).ConvertTo(clsCollection, GetType(XmlNode)) + Dim xr As New System.Xml.XmlTextWriter(opt.ScriptDirectory & "\properties.xml", Nothing) + xr.WriteStartElement("codeSmith") + xr.WriteStartElement("propertySet") + xr.WriteStartElement("property") + xr.WriteAttributeString("name", "classes") + xr.WriteRaw(xn_cls.OuterXml) + xr.WriteEndElement() + xr.WriteEndElement() + xr.Close() + Dim cmdString As String + cmdString = """" & opt.CodeSmithDirectory & "\CodeSmithConsole.exe"" " + cmdString &= "/template:""" & opt.ScriptDirectory & "\" & p.BusinessClassScript & """ " + cmdString &= "/properties:""" & opt.ScriptDirectory & "\properties.xml"" " + cmdString &= "/out:""" & opt.ScriptDirectory & "\new.code""" + Shell(cmdString, AppWinStyle.NormalFocus, True) + overwrite = True + If File.Exists(c.SourceFile) Then + If Not FileCompare(opt.ScriptDirectory & "\new.code", c.SourceFile) Then + If opt.DiffUtil <> String.Empty Then + 'check new code vs original + cmdString = """" & opt.DiffUtil & """" + cmdString &= " """ & opt.ScriptDirectory & "\new.code""" + cmdString &= " """ & c.SourceFile & """" + Shell(cmdString, AppWinStyle.Hide, True) + overwrite = False + Else + If Not MsgBox("Overwrite existing file?", MsgBoxStyle.YesNo) Then + overwrite = False + End If + End If + Else + overwrite = False + End If + If overwrite Then + File.Copy(c.SourceFile, c.SourceFile & ".bak") + File.Copy(opt.ScriptDirectory & "\new.code", c.SourceFile, True) + End If + Else + File.Copy(opt.ScriptDirectory & "\new.code", c.SourceFile, False) + End If End Sub End Class Index: frmAddDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/frmAddDatabase.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frmAddDatabase.vb 12 Oct 2004 23:10:17 -0000 1.1 +++ frmAddDatabase.vb 10 Dec 2004 04:31:12 -0000 1.2 @@ -1,34 +1,36 @@ +Imports AFMappingClasses + Public Class frmAddDatabase - Inherits System.Windows.Forms.Form + Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " - Public Sub New() - MyBase.New() + Public Sub New() + MyBase.New() - 'This call is required by the Windows Form Designer. - InitializeComponent() + 'This call is required by the Windows Form Designer. + InitializeComponent() - 'Add any initialization after the InitializeComponent() call + 'Add any initialization after the InitializeComponent() call - End Sub + End Sub - 'Form overrides dispose to clean up the component list. - Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) - If disposing Then - If Not (components Is Nothing) Then - components.Dispose() - End If - End If - MyBase.Dispose(disposing) - End Sub + 'Form overrides dispose to clean up the component list. + Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing Then + If Not (components Is Nothing) Then + components.Dispose() + End If + End If + MyBase.Dispose(disposing) + End Sub - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox Friend WithEvents Label2 As System.Windows.Forms.Label @@ -217,7 +219,7 @@ Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Name = "frmAddDatabase" - Me.Text = "Database Connection" + Me.Text = "frmAddDatabase" Me.GroupBox1.ResumeLayout(False) Me.ResumeLayout(False) @@ -282,4 +284,5 @@ lblParam3.Text = "OIDTable" End If End Sub + End Class Index: COptions.vb =================================================================== RCS file: /cvsroot/jcframework/FrameworkMapper/COptions.vb,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- COptions.vb 12 Oct 2004 23:10:17 -0000 1.1 +++ COptions.vb 10 Dec 2004 04:31:12 -0000 1.2 @@ -2,19 +2,29 @@ Imports System.io Public Class COptions - Public TemplateSets As New Collection - Public CurrentTemplateSet As TemplateSet - Public TemplateDirectory As String + Public CSScripts As New Collection + Public CodeSmithDirectory As String + Private _scriptDir As String + Public DiffUtil As String + + Public Property ScriptDirectory() As String + Get + Return _scriptDir + End Get + Set(ByVal Value As String) + If _scriptD... [truncated message content] |
Update of /cvsroot/jcframework/FrameworkMapper/WinFormsUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5004/WinFormsUI Added Files: AssemblyInfo.cs AutoHideWindow.cs AutoHideWindowSplitter.cs DisplayingDockList.cs DockAreasEditor.cs DockContent.cs DockContent.resx DockContentCollection.cs DockHelper.cs DockList.cs DockPane.cs DockPaneCollection.cs DockPaneSplitter.cs DockPaneSplitter.resx DockPanel.cs DockPanelPersist.cs DockWindow.cs DockWindowCollection.cs DockWindowSplitter.cs DragHandler.cs DragHandlerBase.cs DrawHelper.cs DummyControl.cs Enums.cs EventArgs.cs FloatWindow.cs FloatWindow.resx FloatWindowCollection.cs HiddenMdiChild.cs InertButton.cs InertButton.resx Interfaces.cs LocalWindowsHook.cs Localization.cs Measures.cs NestedDockingStatus.cs ResourceHelper.cs SplitterBase.cs Strings.resX WinFormsUI.csproj Log Message: Major update to incorporate CodeSmith scripts, and integration with WinMerge for viewing differences. --- NEW FILE: DockList.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.Collections; using System.Drawing; namespace WeifenLuo.WinFormsUI { public class DockList : ReadOnlyCollectionBase { private IDockListContainer m_container; private DisplayingDockList m_displayingList; internal DockList(IDockListContainer container) { m_container = container; m_displayingList = new DisplayingDockList(this); } public IDockListContainer Container { get { return m_container; } } internal DisplayingDockList DisplayingList { get { return m_displayingList; } } public DockState DockState { get { return Container.DockState; } } public bool IsFloat { get { return DockState == DockState.Float; } } public bool Contains(DockPane pane) { return InnerList.Contains(pane); } public int IndexOf(DockPane pane) { return InnerList.IndexOf(pane); } public DockPane this[int index] { get { return InnerList[index] as DockPane; } } internal void Add(DockPane pane) { InnerList.Add(pane); } internal void Remove(DockPane pane) { if (!Contains(pane)) return; NestedDockingStatus statusPane = pane.GetNestedDockingStatus(IsFloat); DockPane lastNestedPane = null; for (int i=Count - 1; i> IndexOf(pane); i--) { if (this[i].GetNestedDockingStatus(IsFloat).PrevPane == pane) { lastNestedPane = this[i]; break; } } if (lastNestedPane != null) { int indexLastNestedPane = IndexOf(lastNestedPane); InnerList.Remove(lastNestedPane); InnerList[IndexOf(pane)] = lastNestedPane; NestedDockingStatus lastNestedDock = lastNestedPane.GetNestedDockingStatus(IsFloat); lastNestedDock.SetStatus(this, statusPane.PrevPane, statusPane.Alignment, statusPane.Proportion); for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--) { NestedDockingStatus status = this[i].GetNestedDockingStatus(IsFloat); if (status.PrevPane == pane) status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion); } } else InnerList.Remove(pane); statusPane.SetStatus(null, null, DockAlignment.Left, 0.5); statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5); statusPane.SetDisplayingBounds(Rectangle.Empty, Rectangle.Empty, Rectangle.Empty); } } } --- NEW FILE: DockAreasEditor.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; using System.Windows.Forms.Design; namespace WeifenLuo.WinFormsUI { internal class DockAreasEditor : UITypeEditor { /// <summary> /// Summary description for DockAreasEditorControl. /// </summary> private class DockAreasEditorControl : System.Windows.Forms.UserControl { private IWindowsFormsEditorService m_edSvc; private CheckBox checkBoxFloat; private CheckBox checkBoxDockLeft; private CheckBox checkBoxDockRight; private CheckBox checkBoxDockTop; private CheckBox checkBoxDockBottom; private CheckBox checkBoxDockFill; private DockAreas m_oldDockAreas; public DockAreas DockAreas { get { DockAreas dockAreas = 0; if (checkBoxFloat.Checked) dockAreas |= DockAreas.Float; if (checkBoxDockLeft.Checked) dockAreas |= DockAreas.DockLeft; if (checkBoxDockRight.Checked) dockAreas |= DockAreas.DockRight; if (checkBoxDockTop.Checked) dockAreas |= DockAreas.DockTop; if (checkBoxDockBottom.Checked) dockAreas |= DockAreas.DockBottom; if (checkBoxDockFill.Checked) dockAreas |= DockAreas.Document; if (dockAreas == 0) return m_oldDockAreas; else return dockAreas; } } public DockAreasEditorControl() { checkBoxFloat = new CheckBox(); checkBoxDockLeft = new CheckBox(); checkBoxDockRight = new CheckBox(); checkBoxDockTop = new CheckBox(); checkBoxDockBottom = new CheckBox(); checkBoxDockFill = new CheckBox(); SuspendLayout(); checkBoxFloat.Appearance = Appearance.Button; checkBoxFloat.Dock = DockStyle.Top; checkBoxFloat.Height = 24; checkBoxFloat.Text = "(Float)"; checkBoxFloat.TextAlign = ContentAlignment.MiddleCenter; checkBoxFloat.FlatStyle = FlatStyle.System; checkBoxDockLeft.Appearance = System.Windows.Forms.Appearance.Button; checkBoxDockLeft.Dock = System.Windows.Forms.DockStyle.Left; checkBoxDockLeft.Width = 24; checkBoxDockLeft.FlatStyle = FlatStyle.System; checkBoxDockRight.Appearance = System.Windows.Forms.Appearance.Button; checkBoxDockRight.Dock = System.Windows.Forms.DockStyle.Right; checkBoxDockRight.Width = 24; checkBoxDockRight.FlatStyle = FlatStyle.System; checkBoxDockTop.Appearance = System.Windows.Forms.Appearance.Button; checkBoxDockTop.Dock = System.Windows.Forms.DockStyle.Top; checkBoxDockTop.Height = 24; checkBoxDockTop.FlatStyle = FlatStyle.System; checkBoxDockBottom.Appearance = System.Windows.Forms.Appearance.Button; checkBoxDockBottom.Dock = System.Windows.Forms.DockStyle.Bottom; checkBoxDockBottom.Height = 24; checkBoxDockBottom.FlatStyle = FlatStyle.System; checkBoxDockFill.Appearance = System.Windows.Forms.Appearance.Button; checkBoxDockFill.Dock = System.Windows.Forms.DockStyle.Fill; checkBoxDockFill.FlatStyle = FlatStyle.System; this.Controls.AddRange(new Control[] { checkBoxDockFill, checkBoxDockBottom, checkBoxDockTop, checkBoxDockRight, checkBoxDockLeft, checkBoxFloat}); Size = new System.Drawing.Size(160, 144); BackColor = SystemColors.Control; ResumeLayout(false); } public void SetStates(IWindowsFormsEditorService edSvc, DockAreas dockAreas) { m_edSvc = edSvc; m_oldDockAreas = dockAreas; if ((dockAreas & DockAreas.DockLeft) != 0) checkBoxDockLeft.Checked = true; if ((dockAreas & DockAreas.DockRight) != 0) checkBoxDockRight.Checked = true; if ((dockAreas & DockAreas.DockTop) != 0) checkBoxDockTop.Checked = true; if ((dockAreas & DockAreas.DockTop) != 0) checkBoxDockTop.Checked = true; if ((dockAreas & DockAreas.DockBottom) != 0) checkBoxDockBottom.Checked = true; if ((dockAreas & DockAreas.Document) != 0) checkBoxDockFill.Checked = true; if ((dockAreas & DockAreas.Float) != 0) checkBoxFloat.Checked = true; } } private DockAreasEditor.DockAreasEditorControl m_ui = null; public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) { return UITypeEditorEditStyle.DropDown; } public override object EditValue(ITypeDescriptorContext context, IServiceProvider sp, object value) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)sp.GetService(typeof(IWindowsFormsEditorService)); if (m_ui == null) m_ui = new DockAreasEditor.DockAreasEditorControl(); m_ui.SetStates(edSvc, (DockAreas)value); edSvc.DropDownControl(m_ui); return m_ui.DockAreas; } } } --- NEW FILE: DockPane.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WeifenLuo.WinFormsUI { [...1859 lines suppressed...] if (container.DockState == DockState.Float && container.DockList.Count == 0) ((FloatWindow)container).Close(); else ((Control)container).PerformLayout(); } public void SetNestedDockingProportion(double proportion) { SetNestedDockingProportion(proportion, DockState == DockState.Float); } public void SetNestedDockingProportion(double proportion, bool isFloat) { NestedDockingStatus status = this.GetNestedDockingStatus(isFloat); status.SetStatus(status.DockList, status.PrevPane, status.Alignment, proportion); if ((this.DockState == DockState.Float) == isFloat) ((Control)this.DockListContainer).PerformLayout(); } } } --- NEW FILE: DockContent.resx --- <?xml version="1.0" encoding="utf-8" ?> <root> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="ResMimeType"> <value>text/microsoft-resx</value> </resheader> <resheader name="Version"> <value>1.0.0.0</value> </resheader> <resheader name="Reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="Writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root> --- NEW FILE: DockWindowCollection.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.Collections; namespace WeifenLuo.WinFormsUI { public class DockWindowCollection : ReadOnlyCollectionBase { internal DockWindowCollection(DockPanel dockPanel) { InnerList.Add(new DockWindow(dockPanel, DockState.Document)); InnerList.Add(new DockWindow(dockPanel, DockState.DockLeft)); InnerList.Add(new DockWindow(dockPanel, DockState.DockRight)); InnerList.Add(new DockWindow(dockPanel, DockState.DockTop)); InnerList.Add(new DockWindow(dockPanel, DockState.DockBottom)); } public DockWindow this [DockState dockState] { get { if (dockState == DockState.Document) return InnerList[0] as DockWindow; else if (dockState == DockState.DockLeft) return InnerList[1] as DockWindow; else if (dockState == DockState.DockRight) return InnerList[2] as DockWindow; else if (dockState == DockState.DockTop) return InnerList[3] as DockWindow; else if (dockState == DockState.DockBottom) return InnerList[4] as DockWindow; throw (new ArgumentOutOfRangeException()); } } } } --- NEW FILE: DummyControl.cs --- using System; using System.Windows.Forms; namespace WeifenLuo.WinFormsUI { internal class DummyControl : Control { public DummyControl() { SetStyle(ControlStyles.Selectable, false); } } } --- NEW FILE: WinFormsUI.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "WeifenLuo.WinFormsUI" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "WeifenLuo.WinFormsUI" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "true" NoStdLib = "false" NoWarn = "" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.dll" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.XML.dll" /> <Reference Name = "System.Drawing" AssemblyName = "System.Drawing" HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Drawing.dll" /> <Reference Name = "System.Windows.Forms" AssemblyName = "System.Windows.Forms" HintPath = "..\..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3705\System.Windows.Forms.dll" /> <Reference Name = "System.Design" AssemblyName = "System.Design" HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Design.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "AutoHideWindow.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "AutoHideWindowSplitter.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "DisplayingDockList.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DockAreasEditor.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DockContent.cs" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "DockContent.resx" DependentUpon = "DockContent.cs" BuildAction = "EmbeddedResource" /> <File RelPath = "DockContentCollection.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DockHelper.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DockList.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DockPane.cs" SubType = "UserControl" BuildAction = "Compile" /> <File RelPath = "DockPaneCollection.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DockPanel.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "DockPanelPersist.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DockPaneSplitter.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "DockPaneSplitter.resx" DependentUpon = "DockPaneSplitter.cs" BuildAction = "EmbeddedResource" /> <File RelPath = "DockWindow.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "DockWindowCollection.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DockWindowSplitter.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "DragHandler.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DragHandlerBase.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DrawHelper.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DummyControl.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "Enums.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "EventArgs.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "FloatWindow.cs" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "FloatWindow.resx" DependentUpon = "FloatWindow.cs" BuildAction = "EmbeddedResource" /> <File RelPath = "FloatWindowCollection.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "HiddenMdiChild.cs" SubType = "Form" BuildAction = "Compile" /> <File RelPath = "InertButton.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "InertButton.resx" DependentUpon = "InertButton.cs" BuildAction = "EmbeddedResource" /> <File RelPath = "Interfaces.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Localization.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "LocalWindowsHook.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Measures.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "NestedDockingStatus.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ResourceHelper.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "SplitterBase.cs" SubType = "Component" BuildAction = "Compile" /> <File RelPath = "Strings.resX" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.AutoHideNo.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.AutoHideYes.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.DocumentCloseDisabled.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.DocumentCloseEnabled.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.ScrollLeftDisabled.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.ScrollLeftEnabled.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.ScrollRightDisabled.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.ScrollRightEnabled.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.ToolWindowCloseDisabled.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Resources\DockPane.ToolWindowCloseEnabled.bmp" BuildAction = "EmbeddedResource" /> <File RelPath = "Win32\Enums.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Win32\Gdi32.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Win32\Structs.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Win32\User32.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: EventArgs.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; namespace WeifenLuo.WinFormsUI { public class DockContentEventArgs : EventArgs { public DockContent m_content; public DockContentEventArgs(DockContent content) { m_content = content; } public DockContent Content { get { return m_content; } } } } --- NEW FILE: Strings.resX --- <?xml version="1.0" encoding="utf-8" ?> <root> <!-- Microsoft ResX Schema Version 1.3 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">1.3</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1">this is my long string</data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> [base64 mime encoded serialized .NET Framework object] </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> [base64 mime encoded string representing a byte array form of the .NET Framework object] </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used forserialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>1.3</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <data name="DockContent.Show.InvalidDockState"> <value>Invalid DockState: Content can not be showed as "Unknown" or "Hidden".</value> </data> <data name="DockPanel.LoadFromXml.InvalidFormatVersion"> <value>The configuration file's version is invalid.</value> </data> <data name="Category.DockingNotification"> <value>Docking Notification</value> </data> <data name="InertButton.Monochrom.Description"> <value>Determines fore/back colors are used to display black/white image.</value> </data> <data name="DockPanel.LoadFromXml.InvalidXmlFormat"> <value>The XML file format is invalid.</value> </data> <data name="InertButton.ToolTipText.Description"> <value>The tool tip text to display.</value> </data> <data name="InertButton.BorderWidth.Description"> <value>The border width of the control.</value> </data> <data name="FloatWindow.SetPaneIndex.InvalidPane"> <value>Invalid Pane: DockPane not within the collection.</value> </data> <data name="InertButton.ImageIndexDisabled.Description"> <value>The index of the image in the ImageList to display when the control is disabled.</value> </data> <data name="DockPanel.SetPaneIndex.InvalidPane"> <value>Invalid Pane: DockPane not within the collection.</value> </data> <data name="DockContent.ToolTipText.Description"> <value>The text displayed when mouse hovers over the tab.</value> </data> <data name="DockPane.Constructor.NullDockPanel"> <value>Invalid argument: The content's DockPanel can not be "null".</value> </data> <data name="InertButton.IsPopup.Description"> <value>Determines whether the control should be displayed in popup style.</value> </data> <data name="DockPanel.DockLeftPortion.Description"> <value>Portion of the left docking window.</value> </data> <data name="FloatWindow.Constructor.NullPane"> <value>Invalid argument: DockPane can not be "null".</value> </data> <data name="DockPane.ToolTipAutoHide"> <value>Auto Hide</value> </data> <data name="DockPane.ActiveContent.InvalidValue"> <value>Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content.</value> </data> <data name="DockPane.ToolTipScrollLeft"> <value>Scroll Left</value> </data> <data name="DockContent.Show.NullDockPanel"> <value>DockPanel can not be null.</value> </data> <data name="DockContent.HideOnClose.Description"> <value>Indicates the content will be hidden instead of being closed.</value> </data> <data name="DockPanel.ActiveAutoHideContent.InvalidValue"> <value>Invalid Content: The content must be auto-hide state and assiociates with this DockPanel.</value> </data> <data name="Category.Docking"> <value>Docking</value> </data> <data name="InertButton.ImageDisabled.Description"> <value>The image will be displayed when the control is disabled.</value> </data> <data name="DockPanel.DockRightPortion.Description"> <value>Portion of the right docking window.</value> </data> <data name="FloatWindow.SetPaneIndex.InvalidIndex"> <value>Invalid Index: The index is out of range.</value> </data> <data name="DockPanel.DockBottomPortion.Description"> <value>Portion of the bottom docking window.</value> </data> <data name="DockPane.ToolTipDocumentWindowClose"> <value>Close</value> </data> <data name="DockContent.DockableAreas.Description"> <value>Gets or sets a value indicating in which area of the DockPanel the content allowed to show.</value> </data> <data name="DockPane.Constructor.NullContent"> <value>Invalid argument: Content can not be "null".</value> </data> <data name="DockContent.AutoHidePortion.Description"> <value>The portion when the content displayed in auto hide mode.</value> </data> <data name="DockContent.ShowHint.Description"> <value>The desired docking state when first showing.</value> </data> <data name="DockPanel.ContentRemoved.Description"> <value>Occurs when a content removed from the DockPanel.</value> </data> <data name="DockPanel.SetPaneIndex.InvalidIndex"> <value>Invalid Index: The index is out of range.</value> </data> <data name="InertButton.TextAlign.Description"> <value>The alignment of the text that will be displayed in the face of the control.</value> </data> <data name="DockContent.AllowRedocking.Description"> <value>Determines if drag-and-drop re-docking is allowed.</value> </data> <data name="FloatWindow.Constructor.NullDockPanel"> <value>Invalid argument: DockPanel can not be "null".</value> </data> <data name="DockPane.SetContentIndex.InvalidContent"> <value>Invalid Content: Content not within the collection.</value> </data> <data name="InertButton.ImageEnabled.Description"> <value>The image will be displayed when the control is enabled.</value> </data> <data name="DockPane.SetContentIndex.InvalidIndex"> <value>Invalid Index: The index is out of range.</value> </data> <data name="DockPanel.ContentAdded.Description"> <value>Occurs when a content added to the DockPanel.</value> </data> <data name="DockPanel.DockTopPortion.Description"> <value>Portion of the top docking window.</value> </data> <data name="DockPanel.LoadFromXml.AlreadyInitialized"> <value>The DockPanel has already been initialized.</value> </data> <data name="DockContent.DockableAreas.InvalidValue"> <value>Invalid Value: The value of DockableAreas conflicts with current DockState.</value> </data> <data name="DockContent.CloseButton.Description"> <value>Enable/Disable the close button of the content.</value> </data> <data name="DockPane.ToolTipScrollRight"> <value>Scroll Right</value> </data> <data name="DockContent.DockStateChanged.Description"> <value>Occurs when the value of DockState property changed.</value> </data> <data name="Category.PropertyChanged"> <value>Property Changed</value> </data> <data name="DockPane.ToolTipDockWindowClose"> <value>Close</value> </data> <data name="DockPanel.ActiveDocumentChanged.Description"> <value>Occurs when the value of ActiveDocument property changed.</value> </data> <data name="InertButton.ImageIndexEnabled.Description"> <value>The index of the image in the image list to display when the control is enabled.</value> </data> <data name="InertButton.BorderColor.Description"> <value>The color of the left top border.</value> </data> <data name="DockContent.AutoHidePortion.OutOfRange"> <value>The provided value is out of range.</value> </data> <data name="InertButton.ImageList.Description"> <value>The image list to get the image(s) to display in the face of the control.</value> </data> <data name="DockContent.ShowHint.InvalidValue"> <value>Invalid value, check DockableAreas property.</value> </data> <data name="DockPane.FloatWindow.InvalidValue"> <value>FloatWindow property can not be set to "null" when DockState is DockState.Float.</value> </data> <data name="DockPanel.ActiveContentChanged.Description"> <value>Occurs when the value of ActiveContentProperty changed.</value> </data> <data name="DockContent.TabText.Description"> <value>The tab text displayed in the dock pane. If not set, the Text property will be used.</value> </data> <data name="DockPanel.ActivePaneChanged.Description"> <value>Occurs when the value of ActivePane property changed.</value> </data> <data name="DockPane.AddToDockList.NullContainer"> <value>The container can not be null.</value> </data> <data name="DockPane.AddToDockList.NullPrevPane"> <value>The PrevPane can not be null when the dock list is not empty.</value> </data> <data name="DockPane.AddToDockList.NoPrevPane"> <value>The PrevPane does not exist in the dock list.</value> </data> <data name="DockPane.AddToDockList.SelfPrevPane"> <value>The PrevPane can not be itself.</value> </data> <data name="DockContent.TabPageContextMenu.Description"> <value>Context menu displayed for the dock pane tab strip.</value> </data> <data name="DockPane.VisibleState.InvalidState"> <value>The state for visible state is invalid.</value> </data> <data name="DockContent.DockState.InvalidState"> <value>The dock state is invalid.</value> </data> <data name="DockContent.DockState.NullPanel"> <value>The dock panel is null.</value> </data> </root> --- NEW FILE: ResourceHelper.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.Drawing; using System.Reflection; using System.Resources; using System.Windows.Forms; namespace WeifenLuo.WinFormsUI { /// <summary> /// Summary description for ResourceHelper. /// </summary> internal class ResourceHelper { private static ResourceManager m_resourceManager; static ResourceHelper() { m_resourceManager = new ResourceManager("WeifenLuo.WinFormsUI.Strings", typeof(DockPanel).Assembly); } public static Bitmap LoadBitmap(string name) { Assembly assembly = typeof(ResourceHelper).Assembly; string fullNamePrefix = "WeifenLuo.WinFormsUI.Resources."; return new Bitmap(assembly.GetManifestResourceStream(fullNamePrefix + name)); } public static string GetString(string name) { return m_resourceManager.GetString(name); } } } --- NEW FILE: DockPanelPersist.cs --- // ***************************************************************************** // // Copyright 2004, Weifen Luo // All rights reserved. The software and associated documentation // supplied hereunder are the proprietary information of Weifen Luo // and are supplied subject to licence terms. // // WinFormsUI Library Version 1.0 // ***************************************************************************** using System; using System.ComponentModel; using System.Windows.Forms; using System.Drawing; using WeifenLuo.WinFormsUI; using System.IO; using System.Text; using System.Xml; using System.Globalization; namespace WeifenLuo.WinFormsUI { internal class DockPanelPersist { private const string ConfigFileVersion = "0.9.2"; private class DummyContent : DockContent { } private struct DockPanelStruct { private double m_dockLeftPortion; public double DockLeftPortion { get { return m_dockLeftPortion; } set { m_dockLeftPortion = value; } } private double m_dockRightPortion; public double DockRightPortion { get { return m_dockRightPortion; } set { m_dockRightPortion = value; } } private double m_dockTopPortion; public double DockTopPortion { get { return m_dockTopPortion; } set { m_dockTopPortion = value; } } private double m_dockBottomPortion; public double DockBottomPortion { get { return m_dockBottomPortion; } set { m_dockBottomPortion = value; } } private int m_indexActiveDocumentPane; public int IndexActiveDocumentPane { get { return m_indexActiveDocumentPane; } set { m_indexActiveDocumentPane = value; } } private int m_indexActivePane; public int IndexActivePane { get { return m_indexActivePane; } set { m_indexActivePane = value; } } } private struct ContentStruct { private string m_persistString; public string PersistString { get { return m_persistString; } set { m_persistString = value; } } private double m_autoHidePortion; public double AutoHidePortion { get { return m_autoHidePortion; } set { m_autoHidePortion = value; } } private bool m_isHidden; public bool IsHidden { get { return m_isHidden; } set { m_isHidden = value; } } } private struct PaneStruct { private DockState m_visibleState; public DockState VisibleState { get { return m_visibleState; } set { m_visibleState = value; } } private bool m_isHidden; public bool IsHidden { get { return m_isHidden; } set { m_isHidden = value; } } private DockState m_dockState; public DockState DockState { get { return m_dockState; } set { m_dockState = value; } } private int m_indexActiveContent; public int IndexActiveContent { get { return m_indexActiveContent; } set { m_indexActiveContent = value; } } private int[] m_indexContents; public int[] IndexContents { get { return m_indexContents; } set { m_indexContents = value; } } private int m_zOrderIndex; public int ZOrderIndex { get { return m_zOrderIndex; } set { m_zOrderIndex = value; } } } private struct DockListItem { private int m_indexPane; public int IndexPane { get { return m_indexPane; } set { m_indexPane = value; } } private int m_indexPrevPane; public int IndexPrevPane { get { return m_indexPrevPane; } set { m_indexPrevPane = value; } } private DockAlignment m_alignment; public DockAlignment Alignment { get { return m_alignment; } set { m_alignment = value; } } private double m_proportion; public double Proportion { get { return m_proportion; } set { m_proportion = value; } } } private struct DockWindowStruct { private DockState m_dockState; public DockState DockState { get { return m_dockState; } set { m_dockState = value; } } private int m_zOrderIndex; public int ZOrderIndex { get { return m_zOrderIndex; } set { m_zOrderIndex = value; } } private DockListItem[] m_dockList; public DockListItem[] DockList { get { return m_dockList; } set { m_dockList = value; } } } private struct FloatWindowStruct { private Rectangle m_bounds; public Rectangle Bounds { get { return m_bounds; } set { m_bounds = value; } } private bool m_allowRedocking; public bool AllowRedocking { get { return m_allowRedocking; } set { m_allowRedocking = value; } } private int m_zOrderIndex; public int ZOrderIndex { get { return m_zOrderIndex; } set { m_zOrderIndex = value; } } private DockListItem[] m_dockList; public DockListItem[] DockList { get { return m_dockList; } set { m_dockList = value; } } } public DockPanelPersist() { } public static void SaveAsXml(DockPanel dockPanel, string filename) { SaveAsXml(dockPanel, filename, Encoding.Unicode); } public static void SaveAsXml(DockPanel dockPanel, string filename, Encoding encoding) { FileStream fs = new FileStream(filename, FileMode.Create); try { SaveAsXml(dockPanel, fs, encoding); } finally { fs.Close(); } } public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding) { XmlTextWriter xmlOut = new XmlTextWriter(stream, encoding); // Use indenting for readability xmlOut.Formatting = Formatting.Indented; // Always begin file with identification and warning xmlOut.WriteStartDocument(); xmlOut.WriteComment(" DockPanel configuration file. Author: Weifen Luo, all rights reserved. "); xmlOut.WriteComment(" !!! AUTOMATICALLY GENERATED FILE. DO NOT MODIFY !!! "); // Associate a version number with the root element so that future version of the code // will be able to be backwards compatible or at least recognise out of date versions xmlOut.WriteStartElement("DockPanel"); xmlOut.WriteAttributeString("FormatVersion", ConfigFileVersion); xmlOut.WriteAttributeString("DockLeftPortion", dockPanel.DockLeftPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockRightPortion", dockPanel.DockRightPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockTopPortion", dockPanel.DockTopPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("DockBottomPortion", dockPanel.DockBottomPortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString()); xmlOut.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString()); // Contents xmlOut.WriteStartElement("Contents"); xmlOut.WriteAttributeString("Count", dockPanel.Contents.Count.ToString()); foreach (DockContent content in dockPanel.Contents) { xmlOut.WriteStartElement("Content"); xmlOut.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString()); xmlOut.WriteAttributeString("PersistString", content.PersistString); xmlOut.WriteAttributeString("AutoHidePortion", content.AutoHidePortion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteAttributeString("IsHidden", content.IsHidden.ToString()); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // Panes xmlOut.WriteStartElement("Panes"); xmlOut.WriteAttributeString("Count", dockPanel.Panes.Count.ToString()); foreach (DockPane pane in dockPanel.Panes) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", dockPanel.Panes.IndexOf(pane).ToString()); xmlOut.WriteAttributeString("VisibleState", pane.VisibleState.ToString()); xmlOut.WriteAttributeString("IsHidden", pane.IsHidden.ToString()); xmlOut.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString()); xmlOut.WriteStartElement("Contents"); xmlOut.WriteAttributeString("Count", pane.Contents.Count.ToString()); foreach (DockContent content in pane.Contents) { xmlOut.WriteStartElement("Content"); xmlOut.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString()); xmlOut.WriteAttributeString("RefID", dockPanel.Contents.IndexOf(content).ToString()); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // DockWindows xmlOut.WriteStartElement("DockWindows"); int count = 0; foreach (DockWindow dw in dockPanel.DockWindows) if (dw.DockList.Count > 0) count++; xmlOut.WriteAttributeString("Count", count.ToString()); int i = 0; foreach (DockWindow dw in dockPanel.DockWindows) { if (dw.DockList.Count == 0) continue; xmlOut.WriteStartElement("DockWindow"); xmlOut.WriteAttributeString("ID", i.ToString()); xmlOut.WriteAttributeString("DockState", dw.DockState.ToString()); xmlOut.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString()); xmlOut.WriteStartElement("DockList"); xmlOut.WriteAttributeString("Count", dw.DockList.Count.ToString()); foreach (DockPane pane in dw.DockList) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", dw.DockList.IndexOf(pane).ToString()); xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString()); NestedDockingStatus status = pane.GetNestedDockingStatus(false); xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PrevPane).ToString()); xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString()); xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); i++; } xmlOut.WriteEndElement(); // FloatWindows RectangleConverter rectConverter = new RectangleConverter(); xmlOut.WriteStartElement("FloatWindows"); xmlOut.WriteAttributeString("Count", dockPanel.FloatWindows.Count.ToString()); foreach (FloatWindow fw in dockPanel.FloatWindows) { xmlOut.WriteStartElement("FloatWindow"); xmlOut.WriteAttributeString("ID", dockPanel.FloatWindows.IndexOf(fw).ToString()); xmlOut.WriteAttributeString("Bounds", rectConverter.ConvertToInvariantString(fw.Bounds)); xmlOut.WriteAttributeString("AllowRedocking", fw.AllowRedocking.ToString()); xmlOut.WriteAttributeString("ZOrderIndex", fw.DockPanel.FloatWindows.IndexOf(fw).ToString()); xmlOut.WriteStartElement("DockList"); xmlOut.WriteAttributeString("Count", fw.DockList.Count.ToString()); foreach (DockPane pane in fw.DockList) { xmlOut.WriteStartElement("Pane"); xmlOut.WriteAttributeString("ID", fw.DockList.IndexOf(pane).ToString()); xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString()); NestedDockingStatus status = pane.GetNestedDockingStatus(true); xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PrevPane).ToString()); xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString()); xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture)); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); xmlOut.WriteEndElement(); } xmlOut.WriteEndElement(); // </FloatWindows> xmlOut.WriteEndElement(); xmlOut.WriteEndDocument(); // This should flush all actions and close the file xmlOut.Close(); } public static void LoadFromXml(DockPanel dockPanel, string filename, DeserializeDockContent deserializeContent) { FileStream fs = new FileStream(filename, FileMode.Open); try { LoadFromXml(dockPanel, fs, deserializeContent); } finally { fs.Close(); } } public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent) { if (dockPanel.Contents.Count != 0) throw new InvalidOperationException(ResourceHelper.GetString("DockPanel.LoadFromXml.AlreadyInitialized")); EnumConverter dockStateConverter = new EnumConverter(typeof(DockState)); EnumConverter dockAlignmentConverter = new EnumConverter(typeof(DockAlignment)); RectangleConverter rectConverter = new RectangleConverter(); XmlTextReader xmlIn = new XmlTextReader(stream); xmlIn.WhitespaceHandling = WhitespaceHandling.None; xmlIn.MoveToContent(); if (xmlIn.Name != "DockPanel") throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); string formatVersion = xmlIn.GetAttribute("FormatVersion"); if (formatVersion != ConfigFileVersion) throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidFormatVersion")); DockPanelStruct dockPanelStruct = new DockPanelStruct(); dockPanelStruct.DockLeftPortion = Convert.ToDouble(xmlIn.GetAttribute("DockLeftPortion"), CultureInfo.InvariantCulture); dockPanelStruct.DockRightPortion = Convert.ToDouble(xmlIn.GetAttribute("DockRightPortion"), CultureInfo.InvariantCulture); dockPanelStruct.DockTopPortion = Convert.ToDouble(xmlIn.GetAttribute("DockTopPortion"), CultureInfo.InvariantCulture); dockPanelStruct.DockBottomPortion = Convert.ToDouble(xmlIn.GetAttribute("DockBottomPortion"), CultureInfo.InvariantCulture); dockPanelStruct.IndexActiveDocumentPane = Convert.ToInt32(xmlIn.GetAttribute("ActiveDocumentPane")); dockPanelStruct.IndexActivePane = Convert.ToInt32(xmlIn.GetAttribute("ActivePane")); // Load Contents MoveToNextElement(xmlIn); if (xmlIn.Name != "Contents") throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); int countOfContents = Convert.ToInt32(xmlIn.GetAttribute("Count")); ContentStruct[] contents = new ContentStruct[countOfContents]; MoveToNextElement(xmlIn); for (int i=0; i<countOfContents; i++) { int id = Convert.ToInt32(xmlIn.GetAttribute("ID")); if (xmlIn.Name != "Content" || id != i) throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); contents[i].PersistString = xmlIn.GetAttribute("PersistString"); contents[i].AutoHidePortion = Convert.ToDouble(xmlIn.GetAttribute("AutoHidePortion"), CultureInfo.InvariantCulture); contents[i].IsHidden = Convert.ToBoolean(xmlIn.GetAttribute("IsHidden")); MoveToNextElement(xmlIn); } // Load Panes if (xmlIn.Name != "Panes") throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); int countOfPanes = Convert.ToInt32(xmlIn.GetAttribute("Count")); PaneStruct[] panes = new PaneStruct[countOfPanes]; MoveToNextElement(xmlIn); for (int i=0; i<countOfPanes; i++) { int id = Convert.ToInt32(xmlIn.GetAttribute("ID")); if (xmlIn.Name != "Pane" || id != i) throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); panes[i].VisibleState = (DockState)dockStateConverter.ConvertFrom(xmlIn.GetAttribute("VisibleState")); panes[i].IsHidden = Convert.ToBoolean(xmlIn.GetAttribute("IsHidden")); panes[i].DockState = panes[i].IsHidden ? DockState.Hidden : panes[i].VisibleState; panes[i].IndexActiveContent = Convert.ToInt32(xmlIn.GetAttribute("ActiveContent")); panes[i].ZOrderIndex = -1; MoveToNextElement(xmlIn); if (xmlIn.Name != "Contents") throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); int countOfPaneContents = Convert.ToInt32(xmlIn.GetAttribute("Count")); panes[i].IndexContents = new int[countOfPaneContents]; MoveToNextElement(xmlIn); for (int j=0; j<countOfPaneContents; j++) { int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID")); if (xmlIn.Name != "Content" || id2 != j) throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); panes[i].IndexContents[j] = Convert.ToInt32(xmlIn.GetAttribute("RefID")); MoveToNextElement(xmlIn); } } // Load DockWindows if (xmlIn.Name != "DockWindows") throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); int countOfDockWindows = Convert.ToInt32(xmlIn.GetAttribute("Count")); DockWindowStruct[] dockWindows = new DockWindowStruct[countOfDockWindows]; MoveToNextElement(xmlIn); for (int i=0; i<countOfDockWindows; i++) { int id = Convert.ToInt32(xmlIn.GetAttribute("ID")); if (xmlIn.Name != "DockWindow" || id != i) throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); dockWindows[i].DockState = (DockState)dockStateConverter.ConvertFrom(xmlIn.GetAttribute("DockState")); dockWindows[i].ZOrderIndex = Convert.ToInt32(xmlIn.GetAttribute("ZOrderIndex")); MoveToNextElement(xmlIn); if (xmlIn.Name != "DockList") throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); int countOfDockList = Convert.ToInt32(xmlIn.GetAttribute("Count")); dockWindows[i].DockList = new DockListItem[countOfDockList]; MoveToNextElement(xmlIn); for (int j=0; j<countOfDockList; j++) { int id2 = Convert.ToInt32(xmlIn.GetAttribute("ID")); if (xmlIn.Name != "Pane" || id2 != j) throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); dockWindows[i].DockList[j].IndexPane = Convert.ToInt32(xmlIn.GetAttribute("RefID")); dockWindows[i].DockList[j].IndexPrevPane = Convert.ToInt32(xmlIn.GetAttribute("PrevPane")); dockWindows[i].DockList[j].Alignment = (DockAlignment)dockAlignmentConverter.ConvertFrom(xmlIn.GetAttribute("Alignment")); dockWindows[i].DockList[j].Proportion = Convert.ToDouble(xmlIn.GetAttribute("Proportion"), CultureInfo.InvariantCulture); MoveToNextElement(xmlIn); } } // Load FloatWindows if (xmlIn.Name != "FloatWindows") throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); int countOfFloatWindows = Convert.ToInt32(xmlIn.GetAttribute("Count")); FloatWindowStruct[] floatWindows = new FloatWindowStruct[countOfFloatWindows]; MoveToNextElement(xmlIn); for (int i=0; i<countOfFloatWindows; i++) { int id = Convert.ToInt32(xmlIn.GetAttribute("ID")); if (xmlIn.Name != "FloatWindow" || id != i) throw new ArgumentException(ResourceHelper.GetString("DockPanel.LoadFromXml.InvalidXmlFormat")); ... [truncated message content] |
From: Richard B. <rb...@us...> - 2004-12-10 04:31:25
|
Update of /cvsroot/jcframework/FrameworkMapper/CodeSmithDataClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5004/CodeSmithDataClasses Added Files: AssemblyInfo.vb Association.vb AssociationEntry.vb AttributeMap.vb ClassMap.vb ClassMapTypeConverter.vb CodeSmithDataClasses.vbproj DatabaseColumn.vb DatabaseMap.vb DatabaseTable.vb DatabaseTypeConverter.vb InheritedBusinessClass(VB).cst XMLMapping.cst test.vb Log Message: Major update to incorporate CodeSmith scripts, and integration with WinMerge for viewing differences. --- NEW FILE: AssemblyInfo.vb --- Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes <Assembly: AssemblyTitle("")> <Assembly: AssemblyDescription("")> <Assembly: AssemblyCompany("")> <Assembly: AssemblyProduct("")> <Assembly: AssemblyCopyright("")> <Assembly: AssemblyTrademark("")> <Assembly: CLSCompliant(True)> 'The following GUID is for the ID of the typelib if this project is exposed to COM <Assembly: Guid("BADE80C6-587B-435F-AFA1-91555400E247")> ' Version information for an assembly consists of the following four values: ' ' Major Version ' Minor Version ' Build Number ' Revision ' ' You can specify all the values or you can default the Build and Revision Numbers ' by using the '*' as shown below: <Assembly: AssemblyVersion("1.0.*")> --- NEW FILE: Association.vb --- Public Class Association Public fromClass As String Public toClass As String Public name As String Public target As String Public cardinality As Integer Public deleteAuto As Boolean = False Public saveAuto As Boolean = False Public retrieveAuto As Boolean = False Public lazyLoad As Boolean = False Public fromNamespace As String Public toNamespace As String Public entries As AssociationEntryCollection End Class Public Class AssociationCollection Inherits CollectionBase Public Sub Add(ByVal a As Association) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As Association) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As Association Get Return CType(list.Item(index), Association) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As Association Get For Each ma As Association In Me If ma.name = _name Then Return ma End If Next End Get End Property End Class --- NEW FILE: CodeSmithDataClasses.vbproj --- <VisualStudioProject> <VisualBasic ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{FB3D28DB-55C0-4068-A9F3-23412147768C}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "CodeSmithDataClasses" AssemblyOriginatorKeyFile = "" AssemblyOriginatorKeyMode = "None" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" OptionCompare = "Binary" OptionExplicit = "On" OptionStrict = "Off" RootNamespace = "CodeSmithDataClasses" StartupObject = "" > <Config Name = "Debug" BaseAddress = "285212672" ConfigurationOverrideFile = "" DefineConstants = "" DefineDebug = "true" DefineTrace = "true" DebugSymbols = "true" IncrementalBuild = "true" Optimize = "false" OutputPath = "bin\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "1" /> <Config Name = "Release" BaseAddress = "285212672" ConfigurationOverrideFile = "" DefineConstants = "" DefineDebug = "false" DefineTrace = "true" DebugSymbols = "false" IncrementalBuild = "false" Optimize = "true" OutputPath = "bin\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "1" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" /> <Reference Name = "System.Data" AssemblyName = "System.Data" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" /> </References> <Imports> <Import Namespace = "Microsoft.VisualBasic" /> <Import Namespace = "System" /> <Import Namespace = "System.Collections" /> <Import Namespace = "System.Data" /> <Import Namespace = "System.Diagnostics" /> </Imports> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Association.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "AssociationEntry.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "AttributeMap.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ClassMap.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ClassMapTypeConverter.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DatabaseColumn.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DatabaseMap.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DatabaseTable.vb" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "DatabaseTypeConverter.vb" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </VisualBasic> </VisualStudioProject> --- NEW FILE: AttributeMap.vb --- Public Class AttributeMap Public Name As String Public column As String Public isKey As Boolean = False Public isProxy As Boolean = True Public isFind As Boolean = False Public isIdentity As Boolean = False Public isTimeStamp As Boolean = False Public referenceToParentField As String Public dataType As String End Class Public Class AttributeCollection Inherits CollectionBase Public Sub Add(ByVal a As AttributeMap) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As AttributeMap) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As AttributeMap Get Return CType(list.Item(index), AttributeMap) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As AttributeMap Get For Each ma As AttributeMap In Me If ma.Name = _name Then Return ma End If Next End Get End Property End Class --- NEW FILE: AssociationEntry.vb --- Public Class AssociationEntry Public fromAttribute As String Public toAttribute As String Public parentAssociation As String End Class Public Class AssociationEntryCollection Inherits CollectionBase Public Sub Add(ByVal a As AssociationEntry) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As AssociationEntry) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As AssociationEntry Get Return CType(list.Item(index), AssociationEntry) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As AssociationEntry Get For Each ma As AssociationEntry In Me If ma.fromAttribute = _name Then Return ma End If Next End Get End Property End Class --- NEW FILE: XMLMapping.cst --- <%@ CodeTemplate Language="VB" TargetLanguage="XML" Description="Generates an XML Mapping file the AToMSFramework." %> <%@ Import Namespace="System.Collections" %> <%@ Assembly Name="CodeSmithDataClasses" %> <%@ Import Namespace="CodeSmithDataClasses" %> <%@ Import Namespace="System.Text" %> <%@ Property Name="databases" Type="DatabaseCollection" Category="Context"%> <%@ Property Name="classes" Type="ClassMapCollection" Category="Context"%> <% dim cls as ClassMap %> <map> <% for each db as DatabaseMap in databases %> <database name="<%= db.dbname %>" class="<%= db.DbType %>"> <parameter name="name" value="<%= db.nameparam %>" /> <parameter name="serverName" value="<%= db.servername %>" /> <parameter name="user" value="<%= db.user %>" /> <parameter name="password" value="<%= db.password %>" /> </database> <% next %> <% for each cls in classes %> <%= GenerateClassHeader(cls) %> <% for each att as AttributeMap in cls.Attributes %> <%= GenerateAttribute(att) %> <% next att %> </class> <% next cls %> <% for each cls in classes if not cls.associations is nothing then for each ass as Association in cls.associations %> <%= GenerateAssociationHeader(ass) %> <% for each entry as associationentry in ass.entries %> <entry fromAttribute="<%= entry.fromattribute %>" toAttribute="<%= entry.toattribute %>"/> <% next entry %> </association> <% next ass end if next cls %> </map> <script runat="template"> public overrides function GetFileName() as string return "output.xml" end function public function GenerateClassHeader(c as ClassMap) as string dim lineBuilder as StringBuilder = new StringBuilder() linebuilder.append(" <class") linebuilder.append(" name=""" & c.classname & """") linebuilder.append(" table=""" & c.table & """") if c.tableowner <> string.empty then linebuilder.append(" owner=""" & c.tableowner & """") end if linebuilder.append(" database = """ & c.databasename & """") if c.superclassname <> string.empty then linebuilder.append(" superclass=""" & c.superclassname & """") if c.superclassnamespace <> string.empty then linebuilder.append(" superclassnamespace=""" & c.superclassnamespace & """") end if end if if c.readonlyflag then linebuilder.append(" readonly=""true""") end if if c.modifyonlyflag then linebuilder.append(" modifyonly=""true""") end if if c.sharedfield <> string.empty then linebuilder.append(" sharedtablefield= """ & c.sharedfield & """") linebuilder.append(" sharedtablevalued= """ & c.sharedvalue & """") end if if c.classnamespace <> string.empty then linebuilder.append(" namespace=""" & c.classnamespace & """") end if if c.assemblypath <> string.empty then linebuilder.append(" assemblypath=""" & c.assemblypath & """") end if if c.factory <> string.empty then linebuilder.append(" factory=""" & c.factory & """") end if linebuilder.append(">") return lineBuilder.ToString() end function public function GenerateAttribute(a as AttributeMap) as string dim lineBuilder as StringBuilder = new StringBuilder() linebuilder.append(" <attribute") linebuilder.append(" name=""" & a.name & """") if a.column <> string.empty then linebuilder.append(" column=""" & a.column & """") end if if a.isfind then linebuilder.append(" find=""true""") end if if a.iskey then linebuilder.append(" key=""primary""") end if if not a.isproxy then linebuilder.append(" proxy=""false""") end if if a.istimestamp then linebuilder.append(" timestamp=""true""") end if if a.isidentity then linebuilder.append(" identity=""true""") end if if a.referenceToParentField <> string.empty then linebuilder.append(" reference=""" & a.referenceToParentField & """") end if linebuilder.append(" />") return lineBuilder.ToString() end function public function GenerateAssociationHeader(a as Association) as string dim lineBuilder as StringBuilder = new StringBuilder() linebuilder.append(" <association") linebuilder.append(" fromClass=""" & a.fromclass & """") linebuilder.append(" toClass=""" & a.toclass & """") linebuilder.append(" target=""" & a.target & """") if a.cardinality = 0 then linebuilder.append(" cardinality=""OneToOne""") else linebuilder.append(" cardinality=""OneToMany""") end if if a.name <> string.empty then linebuilder.append(" name=""" & a.name & """") end if if a.fromNamespace <> string.empty then linebuilder.append(" fromClassNameSpace=""" & a.fromNamespace & """") end if if a.toNamespace <> string.empty then linebuilder.append(" toClassNameSpace=""" & a.toNamespace & """") end if linebuilder.append(vbcrlf) if a.retrieveAuto then if a.lazyload then linebuilder.append(" retrieveAutomatic=""lazy""") else linebuilder.append(" retrieveAutomatic=""true""") end if else linebuilder.append(" retrieveAutomatic=""false""") end if linebuilder.append(vbcrlf) if a.saveauto then linebuilder.append(" saveAutomatic=""true""") else linebuilder.append(" saveAutomatic=""false""") end if linebuilder.append(vbcrlf) if a.deleteauto then linebuilder.append(" deleteAutomatic=""true""") else linebuilder.append(" deleteAutomatic=""false""") end if linebuilder.append(">") return lineBuilder.ToString() end function </script> --- NEW FILE: ClassMap.vb --- Imports System.ComponentModel Public Class ClassMap Public ClassName As String Public SourceFile As String Public attributes As New AttributeCollection Public associations As New AssociationCollection Public databaseName As String Public superClassName As String Public superClassNameSpace As String Public table As String Public tableOwner As String Public readOnlyFlag As Boolean = False Public modifyOnlyFlag As Boolean = False Public sharedField As String Public sharedValue As String Public classNamespace As String Public assemblyPath As String Public factory As String End Class <TypeConverter(GetType(ClassMapTypeConverter))> _ Public Class ClassMapCollection Inherits CollectionBase Public Sub Add(ByVal a As ClassMap) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As ClassMap) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As ClassMap Get Return CType(list.Item(index), ClassMap) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As ClassMap Get For Each ma As ClassMap In Me If ma.ClassName = _name Then Return ma End If Next End Get End Property End Class --- NEW FILE: DatabaseColumn.vb --- <Serializable()> Public Class DatabaseColumn Public colName As String Public colType As String Public dotnetTypeName As String Public parentTableName As String Public isPrimaryKey As Boolean End Class Public Class DatabaseColumnCollection Inherits CollectionBase Public Sub Add(ByVal a As DatabaseColumn) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As DatabaseColumn) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As DatabaseColumn Get Return CType(list.Item(index), DatabaseColumn) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As DatabaseColumn Get For Each c As DatabaseColumn In Me If c.colName = _name Then Return c End If Next End Get End Property End Class --- NEW FILE: test.vb --- Option Strict Off Option Explicit On Imports System Imports AToMSFramework Public Class Batches Inherits CPersistentObject #region "Generated Code" Private _BatchCode As String Public Overridable Property BatchCode() As String Get Return _BatchCode End Get Set(ByVal Value As String) If _BatchCode <> Value Then _BatchCode = Value SetDirtyFlag() End If End Set End Property Private _Reference As String Public Overridable Property Reference() As String Get Return _Reference End Get Set(ByVal Value As String) If _Reference <> Value Then _Reference = Value SetDirtyFlag() End If End Set End Property Private _StyleCode As String Public Overridable Property StyleCode() As String Get Return _StyleCode End Get Set(ByVal Value As String) If _StyleCode <> Value Then _StyleCode = Value SetDirtyFlag() End If End Set End Property Private _RqdMtrs As Integer Public Overridable Property RqdMtrs() As Integer Get Return _RqdMtrs End Get Set(ByVal Value As Integer) If _RqdMtrs <> Value Then _RqdMtrs = Value SetDirtyFlag() End If End Set End Property Private _RqdKlgs As Integer Public Overridable Property RqdKlgs() As Integer Get Return _RqdKlgs End Get Set(ByVal Value As Integer) If _RqdKlgs <> Value Then _RqdKlgs = Value SetDirtyFlag() End If End Set End Property Private _RqdRolls As Integer Public Overridable Property RqdRolls() As Integer Get Return _RqdRolls End Get Set(ByVal Value As Integer) If _RqdRolls <> Value Then _RqdRolls = Value SetDirtyFlag() End If End Set End Property Private _DoffedMtrs As Integer Public Overridable Property DoffedMtrs() As Integer Get Return _DoffedMtrs End Get Set(ByVal Value As Integer) If _DoffedMtrs <> Value Then _DoffedMtrs = Value SetDirtyFlag() End If End Set End Property Private _DoffedKgs As Integer Public Overridable Property DoffedKgs() As Integer Get Return _DoffedKgs End Get Set(ByVal Value As Integer) If _DoffedKgs <> Value Then _DoffedKgs = Value SetDirtyFlag() End If End Set End Property Private _DoffedRolls As Integer Public Overridable Property DoffedRolls() As Integer Get Return _DoffedRolls End Get Set(ByVal Value As Integer) If _DoffedRolls <> Value Then _DoffedRolls = Value SetDirtyFlag() End If End Set End Property Private _DateStarted As DateTime Public Overridable Property DateStarted() As DateTime Get Return _DateStarted End Get Set(ByVal Value As DateTime) If _DateStarted <> Value Then _DateStarted = Value SetDirtyFlag() End If End Set End Property Private _DateCompleted As DateTime Public Overridable Property DateCompleted() As DateTime Get Return _DateCompleted End Get Set(ByVal Value As DateTime) If _DateCompleted <> Value Then _DateCompleted = Value SetDirtyFlag() End If End Set End Property Private _WorkInProgress As Boolean Public Overridable Property WorkInProgress() As Boolean Get Return _WorkInProgress End Get Set(ByVal Value As Boolean) If _WorkInProgress <> Value Then _WorkInProgress = Value SetDirtyFlag() End If End Set End Property Private _EditedBy As String Public Overridable Property EditedBy() As String Get Return _EditedBy End Get Set(ByVal Value As String) If _EditedBy <> Value Then _EditedBy = Value SetDirtyFlag() End If End Set End Property Private _Created As DateTime Public Overridable Property Created() As DateTime Get Return _Created End Get Set(ByVal Value As DateTime) If _Created <> Value Then _Created = Value SetDirtyFlag() End If End Set End Property Private _Modified As DateTime Public Overridable Property Modified() As DateTime Get Return _Modified End Get Set(ByVal Value As DateTime) If _Modified <> Value Then _Modified = Value SetDirtyFlag() End If End Set End Property Private _Times As BatchTime Public Overridable Property Times() As BatchTime Get Return _Times End Get Set(ByVal Value As BatchTime) If _Times <> Value Then _Times = Value SetDirtyFlag() End If End Set End Property Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject Return New Batches End Function Public Overrides Function IsValid() As Boolean Return True End Function #end region #region "Non-Generated Code" #end region End Class --- NEW FILE: InheritedBusinessClass(VB).cst --- <%@ CodeTemplate Language="VB" TargetLanguage="XML" Description="Generates a business class definition based on the XML Mapping file the AToMSFramework." %> <%@ Assembly Name="CodeSmithDataClasses" %> <%@ Import Namespace="CodeSmithDataClasses" %> <%@ Property Name="classes" Type="ClassMapCollection" Category="Context"%> <% dim intPrefix as string = "_" dim intName as string dim amap as AttributeMap dim cmap as ClassMap cmap = classes.item(0) %> Option Strict Off Option Explicit On Imports System Imports AToMSFramework <% if cmap.classnamespace <> string.empty then %>Namespace <%= cmap.classnamespace %><% end if %> Public Class <%= cmap.ClassName %> Inherits CPersistentObject #region "Generated Private Variables" <% for each amap in cmap.Attributes intName = intPrefix & amap.name if amap.column <> string.empty andalso amap.istimestamp = false then %> Private <%= intname%> As <%= amap.datatype %> <% end if next %> #end region #region "Generated Properties" <% for each amap in cmap.Attributes intName = intPrefix & amap.name if amap.column <> string.empty andalso amap.istimestamp = false then %> Public Overridable Property <%=amap.name %>() As <%= GetVBDataType(amap.datatype) %> Get Return <%= intname %> End Get Set(ByVal Value As <%= amap.datatype %>) If <%= intname %> <> Value Then <%= intname %> = Value SetDirtyFlag() End If End Set End Property <% end if next dim objType as string for each assoc as Association in cmap.associations if assoc.tonamespace <> string.empty then objtype = assoc.tonamespace & "." & assoc.toclass else objtype = assoc.toclass end if intName = intPrefix & assoc.target %> Private <%= intname%> As <%= objType %> Public Overridable Property <%=assoc.target %>() As <%= objtype %> Get Return <%= intname %> End Get Set(ByVal Value As <%= objtype %>) If <%= intname %> <> Value Then <%= intname %> = Value SetDirtyFlag() End If End Set End Property <% next %> Public Overrides Function getNewObject() As AToMSFramework.CPersistentObject Return New <%= cmap.classname %> End Function Public Overrides Function IsValid() As Boolean Return True End Function #end region #region "Non-Generated Code" #end region End Class <% if cmap.classnamespace <> string.empty then %>End Namespace<% end if %> <script runat="template"> ' This function is here as a reference when making other templates that need to change data types public function GetVBDataType(dataType as string) as string Select Case dataType Case "long" return "Long" Case "Object", "Boolean", "String", "DateTime", "Decimal", "Double", "Byte()", "Integer", "Single", "Short", "Byte", "Guid" return dataType end select end function </script> --- NEW FILE: DatabaseMap.vb --- Imports System.ComponentModel <Serializable()> _ Public Class DatabaseMap Public dbname As String Public dbType As String Public serverName As String Public user As String Public password As String Public OIDTable As String Public portNumber As String Public options As String Public NameParam As String Public tables As DatabaseTableCollection End Class <TypeConverter(GetType(DatabaseTypeConverter))> _ Public Class DatabaseCollection Inherits CollectionBase Public Sub Add(ByVal a As DatabaseMap) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As DatabaseMap) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As DatabaseMap Get Return CType(list.Item(index), DatabaseMap) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As DatabaseMap Get For Each ma As DatabaseMap In Me If ma.dbname = _name Then Return ma End If Next End Get End Property End Class --- NEW FILE: DatabaseTable.vb --- <Serializable()> Public Class DatabaseTable Public tableName As String Public tableOwner As String Public parentDBName As String Public columns As New DatabaseColumnCollection Public tableType As String End Class Public Class DatabaseTableCollection Inherits CollectionBase Public Sub Add(ByVal a As DatabaseTable) list.Add(a) End Sub Public Sub Remove(ByVal index As Integer) If index > Count - 1 Or index < 0 Then Throw New Exception("index value is outside of bounds") End If list.RemoveAt(index) End Sub Public Sub Remove(ByVal value As DatabaseTable) list.Remove(value) End Sub Default Public ReadOnly Property Item(ByVal index As Integer) As DatabaseTable Get Return CType(list.Item(index), DatabaseTable) End Get End Property Default Public ReadOnly Property Item(ByVal _name As String) As DatabaseTable Get For Each t As DatabaseTable In Me If t.tableName = _name Then Return t End If Next End Get End Property End Class --- NEW FILE: ClassMapTypeConverter.vb --- Imports System Imports System.Collections Imports System.Data Imports System.ComponentModel Imports System.Globalization Imports System.Xml Imports System.IO Imports System.Reflection Imports System.Xml.Serialization Public Class ClassMapTypeConverter Inherits TypeConverter Public Overloads Overrides Function CanConvertFrom(ByVal context As ITypeDescriptorContext, ByVal sourceType As Type) As Boolean If sourceType Is GetType(XmlNode) Then Return True End If Return MyBase.CanConvertFrom(context, sourceType) End Function Public Overloads Overrides Function CanConvertTo(ByVal context As ITypeDescriptorContext, ByVal destinationType As Type) As Boolean If destinationType Is GetType(XmlNode) Then Return True End If Return MyBase.CanConvertTo(context, destinationType) End Function Public Overloads Overrides Function ConvertFrom(ByVal context As ITypeDescriptorContext, ByVal culture As CultureInfo, ByVal value As Object) As Object Dim i As Integer If value.GetType Is GetType(XmlNode) Or value.GetType.IsSubclassOf(GetType(XmlNode)) Then Dim node As XmlNode = value Dim nodeList As XmlNodeList Dim cm As ClassMapCollection Dim elem As XmlElement elem = node If elem.Name = "property" Then node = elem.FirstChild End If Dim ms As MemoryStream = New MemoryStream Dim objSerializer As XmlSerializer = New XmlSerializer(GetType(XmlNode)) Dim myWriter As StreamWriter = New StreamWriter(ms) objSerializer.Serialize(myWriter, node) ms.Seek(0, SeekOrigin.Begin) Dim objDeSerializer As XmlSerializer = New XmlSerializer(GetType(ClassMapCollection)) Dim obj As Object obj = objDeSerializer.Deserialize(ms) cm = CType(obj, ClassMapCollection) ms.Close() Return cm End If Return MyBase.ConvertFrom(context, culture, value) End Function Public Overloads Overrides Function ConvertTo(ByVal context As ITypeDescriptorContext, ByVal culture As CultureInfo, ByVal value As Object, ByVal destinationType As Type) As Object If destinationType Is GetType(XmlNode) Then Dim cm As ClassMapCollection = value Dim ms As MemoryStream = New MemoryStream Dim objSerializer As XmlSerializer = New XmlSerializer(GetType(ClassMapCollection)) Dim myWriter As StreamWriter = New StreamWriter(ms) objSerializer.Serialize(myWriter, cm) ms.Seek(0, SeekOrigin.Begin) Dim doc As New XmlDocument doc.Load(ms) ms.Close() Return doc.SelectSingleNode("/ArrayOfClassMap") End If Return MyBase.ConvertTo(context, culture, value, destinationType) End Function End Class --- NEW FILE: DatabaseTypeConverter.vb --- Imports System Imports System.Collections Imports System.Data Imports System.ComponentModel Imports System.Globalization Imports System.Xml Imports System.IO Imports System.Reflection Imports System.Xml.Serialization Public Class DatabaseTypeConverter Inherits TypeConverter Public Overloads Overrides Function CanConvertFrom(ByVal context As ITypeDescriptorContext, ByVal sourceType As Type) As Boolean If sourceType Is GetType(XmlNode) Then Return True End If Return MyBase.CanConvertFrom(context, sourceType) End Function Public Overloads Overrides Function CanConvertTo(ByVal context As ITypeDescriptorContext, ByVal destinationType As Type) As Boolean If destinationType Is GetType(XmlNode) Then Return True End If Return MyBase.CanConvertTo(context, destinationType) End Function Public Overloads Overrides Function ConvertFrom(ByVal context As ITypeDescriptorContext, ByVal culture As CultureInfo, ByVal value As Object) As Object Dim i As Integer If value.GetType Is GetType(XmlNode) Or value.GetType.IsSubclassOf(GetType(XmlNode)) Then Dim node As XmlNode = value Dim nodeList As XmlNodeList Dim md As DatabaseCollection Dim elem As XmlElement elem = node If elem.Name = "property" Then node = elem.FirstChild End If Dim ms As MemoryStream = New MemoryStream Dim objSerializer As XmlSerializer = New XmlSerializer(GetType(XmlNode)) Dim myWriter As StreamWriter = New StreamWriter(ms) objSerializer.Serialize(myWriter, node) ms.Seek(0, SeekOrigin.Begin) Dim objDeSerializer As XmlSerializer = New XmlSerializer(GetType(DatabaseCollection)) Dim obj As Object obj = objDeSerializer.Deserialize(ms) md = CType(obj, DatabaseCollection) ms.Close() Return md End If Return MyBase.ConvertFrom(context, culture, value) End Function Public Overloads Overrides Function ConvertTo(ByVal context As ITypeDescriptorContext, ByVal culture As CultureInfo, ByVal value As Object, ByVal destinationType As Type) As Object If destinationType Is GetType(XmlNode) Then Dim md As DatabaseCollection = value Dim ms As MemoryStream = New MemoryStream Dim objSerializer As XmlSerializer = New XmlSerializer(GetType(DatabaseCollection)) Dim myWriter As StreamWriter = New StreamWriter(ms) objSerializer.Serialize(myWriter, md) ms.Seek(0, SeekOrigin.Begin) Dim doc As New XmlDocument doc.Load(ms) ms.Close() Return doc.SelectSingleNode("/ArrayOfDatabaseMap") End If Return MyBase.ConvertTo(context, culture, value, destinationType) End Function End Class |
From: Richard B. <rb...@us...> - 2004-12-10 04:29:39
|
Update of /cvsroot/jcframework/FrameworkMapper/WinFormsUI/Resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4687/Resources Log Message: Directory /cvsroot/jcframework/FrameworkMapper/WinFormsUI/Resources added to the repository |
From: Richard B. <rb...@us...> - 2004-12-10 04:29:35
|
Update of /cvsroot/jcframework/FrameworkMapper/WinFormsUI/Win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4687/Win32 Log Message: Directory /cvsroot/jcframework/FrameworkMapper/WinFormsUI/Win32 added to the repository |
From: Richard B. <rb...@us...> - 2004-12-10 04:29:07
|
Update of /cvsroot/jcframework/FrameworkMapper/CodeSmithDataClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4482/CodeSmithDataClasses Log Message: Directory /cvsroot/jcframework/FrameworkMapper/CodeSmithDataClasses added to the repository |
From: Richard B. <rb...@us...> - 2004-12-10 04:29:06
|
Update of /cvsroot/jcframework/FrameworkMapper/AFMappingClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4482/AFMappingClasses Log Message: Directory /cvsroot/jcframework/FrameworkMapper/AFMappingClasses added to the repository |
From: Richard B. <rb...@us...> - 2004-12-10 04:29:06
|
Update of /cvsroot/jcframework/FrameworkMapper/WinFormsUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4482/WinFormsUI Log Message: Directory /cvsroot/jcframework/FrameworkMapper/WinFormsUI added to the repository |
From: Richard B. <rb...@us...> - 2004-12-06 01:01:28
|
Update of /cvsroot/jcframework/Nunit/InheritedClasses In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28347/InheritedClasses Modified Files: AtomsFrameworkTests.vb Log Message: Extra tests for IValidation interface Index: AtomsFrameworkTests.vb =================================================================== RCS file: /cvsroot/jcframework/Nunit/InheritedClasses/AtomsFrameworkTests.vb,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- AtomsFrameworkTests.vb 1 Nov 2004 21:27:10 -0000 1.6 +++ AtomsFrameworkTests.vb 6 Dec 2004 01:01:11 -0000 1.7 @@ -96,6 +96,24 @@ Assert.IsFalse(emp.Persistent) End Sub + <Test()> Public Sub SetPropertyToNothing() + Dim oidvalue As String + emp.Name = "SomeNewEmp" + emp.Find() + Assert.IsFalse(emp.Persistent) + oidvalue = emp.OIDValue + emp.Save() + emp = New CEmployee + emp.Name = "SomeNewEmp" + emp.Find() + Assert.IsTrue(emp.Persistent) + Assert.AreEqual(emp.OIDValue, oidvalue) + Assert.AreEqual(emp.Name, "SomeNewEmp") + emp.Name = Nothing + emp.Save() + Assert.IsTrue(emp.Persistent) + End Sub + <Test()> Public Sub DeleteMultipleEmployees() emp.Name = "DeleteMe1" emp.Save() @@ -145,7 +163,7 @@ End Sub <Test(), ExpectedException(GetType(AssertionException))> _ - Public Sub CheckCacheCopiesAreDifferent() + Public Sub CheckCacheCopiesAreDifferent() Dim emp2 As CEmployee emp.Name = "ac" emp.Find() |
From: Richard B. <rb...@us...> - 2004-12-06 01:01:28
|
Update of /cvsroot/jcframework/Nunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28347 Modified Files: Nunit_AtomsFramework.vbproj Log Message: Extra tests for IValidation interface Index: Nunit_AtomsFramework.vbproj =================================================================== RCS file: /cvsroot/jcframework/Nunit/Nunit_AtomsFramework.vbproj,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Nunit_AtomsFramework.vbproj 1 Nov 2004 21:27:09 -0000 1.13 +++ Nunit_AtomsFramework.vbproj 6 Dec 2004 01:01:12 -0000 1.14 @@ -205,6 +205,11 @@ BuildAction = "Compile" /> <File + RelPath = "Interfaces\ValidatedEmployee.vb" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "StandardClasses\LazyEmployee.vb" SubType = "Code" BuildAction = "Compile" |
From: Richard B. <rb...@us...> - 2004-12-06 01:01:23
|
Update of /cvsroot/jcframework/Nunit/Interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28347/Interfaces Added Files: ValidatedEmployee.vb Log Message: Extra tests for IValidation interface --- NEW FILE: ValidatedEmployee.vb --- Namespace Interfaces Public Class ValidatedEmployee Inherits EmployeeClass Implements AToMSFramework.IValidation Private _allowValidation As Boolean Public Property AllowValidation() As Boolean Get Return _allowvalidation End Get Set(ByVal Value As Boolean) _allowvalidation = Value End Set End Property Public Function IsValid() As Boolean Implements AToMSFramework.IValidation.IsValid Return _allowValidation End Function End Class End Namespace |
From: Richard B. <rb...@us...> - 2004-12-06 00:57:16
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27533 Modified Files: CPersistenceBroker.vb CPersistentObject.vb IPersistentObject.vb readme.html Log Message: A new interface IValidation has been created to allow validation checks on objects that do not inherit from CPersistentObject. It contains a single method - IsValid(). Index: readme.html =================================================================== RCS file: /cvsroot/jcframework/dotnet/readme.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- readme.html 16 Nov 2004 21:39:34 -0000 1.2 +++ readme.html 6 Dec 2004 00:57:06 -0000 1.3 @@ -186,6 +186,11 @@ <td class="col1">Performance </td> <td>Code has been added to allow various performance values to be measured in PerfMon. This includes cache hits, sql hits, retrieves, saves, deletes per second, etc. If you want more, just place a request on the web site.<td> </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">Validation</td> + <td>A new interface IValidation has been created to allow validation checks on objects that do not inherit from CPersistentObject. It contains a single method - IsValid().<td> + </tr> </table> </div> </td> Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- CPersistenceBroker.vb 16 Nov 2004 21:39:34 -0000 1.80 +++ CPersistenceBroker.vb 6 Dec 2004 00:57:05 -0000 1.81 @@ -2274,8 +2274,11 @@ If Not obj.IsDirty Then Return queue 'Do not save if nothing changed End If If obj.IsProxy Then Return queue 'Do not save if object is proxied - If obj.GetObjectType.IsSubclassOf(GetType(CPersistentObject)) Then - If Not CType(obj, CPersistentObject).IsValid Then Return queue 'Do not save if object is not valid + 'If obj.GetObjectType.IsSubclassOf(GetType(CPersistentObject)) Then + ' If Not CType(obj, CPersistentObject).IsValid Then Return queue 'Do not save if object is not valid + 'End If + If GetType(IValidation).IsInstanceOfType(obj.GetSourceObject) Then + If Not CType(obj.GetSourceObject, IValidation).IsValid Then Return queue 'Do not save if object is not valid End If If obj.IsReadOnly Then Return queue @@ -2292,9 +2295,10 @@ 'But, countinue to determine if the object's associations need saving If includeBaseObject AndAlso _ (obj.IsDirty AndAlso Not obj.IsProxy AndAlso Not obj.IsReadOnly AndAlso Not obj.IsModifyOnly) Then - If obj.GetObjectType.IsSubclassOf(GetType(CPersistentObject)) Then - If CType(obj, CPersistentObject).IsValid Then 'Do not save if object is not valid - obj.IsDirty = False 'Added to queue so clear dirty flag + If GetType(IValidation).IsInstanceOfType(obj.GetSourceObject) Then + 'If obj.GetObjectType.IsSubclassOf(GetType(CPersistentObject)) Then + If CType(obj.GetSourceObject, IValidation).IsValid Then 'Do not save if object is not valid + obj.IsDirty = False 'Added to queue so clear dirty flag queue.Enqueue(obj) End If Else Index: IPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IPersistentObject.vb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- IPersistentObject.vb 5 Nov 2004 01:39:17 -0000 1.7 +++ IPersistentObject.vb 6 Dec 2004 00:57:06 -0000 1.8 @@ -55,7 +55,6 @@ Sub Delete(ByVal obj As CPersistentObject, ByVal deleteSuperClass As Boolean) Sub DeleteAll() - Function IsValid() As Boolean Function IsReferenced() As Boolean Function getNewObject() As CPersistentObject @@ -64,3 +63,7 @@ Event LoadStarted As EventHandler Event LoadFinished As EventHandler End Interface + +Public Interface IValidation + Function IsValid() As Boolean +End Interface \ No newline at end of file Index: CPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentObject.vb,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- CPersistentObject.vb 5 Nov 2004 01:39:17 -0000 1.50 +++ CPersistentObject.vb 6 Dec 2004 00:57:05 -0000 1.51 @@ -27,6 +27,7 @@ Implements IEditableObject Implements IDataErrorInfo Implements IPersistentObject + Implements IValidation Private m_persistent As Boolean Private m_proxy As Boolean @@ -1136,7 +1137,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public MustOverride Function IsValid() As Boolean Implements IPersistentObject.IsValid + Public MustOverride Function IsValid() As Boolean Implements IValidation.IsValid '''----------------------------------------------------------------------------- ''' <summary> |
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9164 Modified Files: CCacheEntry.vb CClassMap.vb CConnection.vb CInjectedObject.vb CPersistenceBroker.vb modPersistenceBrokerSingleton.vb readme.html Log Message: Various bug fixes (infinite loop prevention, type cast error) Addition of performance counters. Update readme.html Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- CPersistenceBroker.vb 9 Nov 2004 11:46:04 -0000 1.79 +++ CPersistenceBroker.vb 16 Nov 2004 21:39:34 -0000 1.80 @@ -42,6 +42,17 @@ Private m_disposed As Boolean Private m_inPersistChangesLoop As Boolean + Friend PCSQLHits As PerformanceCounter + Friend PCCacheHits As PerformanceCounter + Friend PCInserts As PerformanceCounter + Friend PCUpdates As PerformanceCounter + Friend PCReads As PerformanceCounter + Friend PCDeletes As PerformanceCounter + Friend PCCriteria As PerformanceCounter + Friend PCCacheSize As PerformanceCounter + Friend PCAverageTime As PerformanceCounter + Friend PCAverageTimeBase As PerformanceCounter + '''----------------------------------------------------------------------------- ''' <summary> ''' Flag indicating wether the configuration XML file has been loaded. @@ -162,7 +173,11 @@ Dim cm As CClassMap Dim conn As _CConnection Dim x As RetrieveException - cm = obj.getClassMap + + Dim inTicks As Long, outTicks As Long + inTicks = Now.Ticks + + cm = obj.GetClassMap conn = cm.RelationalDatabase.getConnection(Nothing) conn.AutoCommit = False Try @@ -177,6 +192,9 @@ x = New RetrieveException(ex.Message, ex) Finally cm.RelationalDatabase.freeConnection(conn) + outTicks = Now.Ticks + PCAverageTime.RawValue = outTicks - inTicks + PCAverageTimeBase.Increment() If Not x Is Nothing Then Throw x End If @@ -255,6 +273,8 @@ Dim t As Type Dim resetLoadingFlag As Boolean + PCReads.Increment() + 'Storage for maps we will use to retrieve data (for the sql query) 'each entry will store the class map and the sql alias for the map Dim rMaps As New HybridDictionary @@ -286,6 +306,7 @@ If t Is obj.GetObjectType Or t.IsSubclassOf(obj.GetObjectType) Then Debug.WriteLine("retrievePrivateObject: retreived from cache") obj = tmpObj + PCCacheHits.Increment() Return True End If End If @@ -326,6 +347,7 @@ 'Execute it and fill the data Dim rs As CResultset + PCSQLHits.Increment() rs = conn.processSelectStatement(statement) Debug.WriteLine("Select statement returned " & rs.ResultSet.Tables(0).Rows.Count & " row(s)") If rs.ResultSet.Tables(0).Rows.Count > 0 Then @@ -363,6 +385,7 @@ End While obj.IsProxy = False 'Need to set non-proxy in case object is loaded via a retrieve criteria m_cache.Add(obj) 'Add retrieved object to the cache + PCCacheSize.RawValue = m_cache.Count j = classMapCount + 1 Dim rw As DataRow @@ -391,9 +414,11 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj + PCCacheHits.Increment() Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) + PCCacheSize.RawValue = m_cache.Count End If obj.SetAttributeValue(udamap.Target, targetobj.GetSourceObject) If Not targetobj.AssociationsLoaded Then @@ -423,9 +448,11 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj + PCCacheHits.Increment() Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) + PCCacheSize.RawValue = m_cache.Count End If If Not targetobj.AssociationsLoaded Then If udamap.LazyLoad Then @@ -452,9 +479,11 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj + PCCacheHits.Increment() Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) + PCCacheSize.RawValue = m_cache.Count End If If Not targetobj.AssociationsLoaded Then If udamap.LazyLoad Then @@ -486,9 +515,11 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj + PCCacheHits.Increment() Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) + PCCacheSize.RawValue = m_cache.Count End If 'Need to determine if new object is already in the collection @@ -532,9 +563,11 @@ tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then targetobj = tmpObj + PCCacheHits.Increment() Else ' All objects are loaded to the cache regardless of applications cache usage m_cache.Add(targetobj) + PCCacheSize.RawValue = m_cache.Count End If 'Need to determine if new object is already in the collection '(prevents duplicates when multiple one-to-many associations exist) @@ -587,6 +620,7 @@ m_cache.ObjectsAreLoading = False End If m_cache.Add(obj) + PCCacheSize.RawValue = m_cache.Count Return True End Function @@ -631,13 +665,14 @@ If Not Value Is Nothing Then 'Need to know if returned object is persistent and has a legitimate key If Value.HasValidKey Then - anObjPers = m_cache.Item(Value) + anObjPers = m_cache.Item(Value) If Not anObjPers Is Nothing Then - Value = anObjPers - Value.IsDirty = False - Value.OriginalCacheKey = New CCacheKey(Value) - obj.SetAttributeValue(udaMap.Target, Value.GetSourceObject) - gotValue = True + PCCacheHits.Increment() + Value = anObjPers + Value.IsDirty = False + Value.OriginalCacheKey = New CCacheKey(Value) + obj.SetAttributeValue(udaMap.Target, Value.GetSourceObject) + gotValue = True End If End If End If @@ -657,6 +692,7 @@ retrieveObject(Value, False, False) Else Value = anObjPers + PCCacheHits.Increment() End If Value.IsDirty = False 'After populating a new object Value.OriginalCacheKey = New CCacheKey(Value) @@ -688,6 +724,7 @@ anObjPers.OriginalCacheKey = New CCacheKey(anObjPers) col.Add(anObjPers.GetSourceObject) m_cache.Add(anObjPers) 'Add retrieved objects to the cache + PCCacheSize.RawValue = m_cache.Count cursor.nextCursor() End While End If @@ -721,6 +758,9 @@ '''----------------------------------------------------------------------------- Public Sub saveObject(ByRef obj As IPersistableObject) SyncLock GetType(CPersistenceBroker) + Dim inTicks As Long, outTicks As Long + inTicks = Now.Ticks + Dim conn As _CConnection Dim cm As CClassMap cm = obj.GetClassMap @@ -736,6 +776,9 @@ Throw New SaveException(ex.Message, ex) End Try cm.RelationalDatabase.freeConnection(conn) + outTicks = Now.Ticks + PCAverageTime.RawValue = outTicks - inTicks + PCAverageTimeBase.Increment() End SyncLock End Sub @@ -782,9 +825,13 @@ If obj.Persistent Then statement = cm.getUpdateSqlFor(obj) conn.processStatement(statement) + PCSQLHits.Increment() + PCUpdates.Increment() Else statement = cm.getInsertSqlFor(obj) conn.processStatement(statement) + PCSQLHits.Increment() + PCInserts.Increment() If cm.getIdentitySize > 0 Then If CInt(cm.RelationalDatabase.getValueFor(obj.GetValueByAttribute(cm.getIdentityAttributeMap(1).Name))) = 0 Then obj.SetAttributeValue(cm.getIdentityAttributeMap(1).Name, cm.RelationalDatabase.getIdentityValue(conn)) @@ -802,11 +849,13 @@ If Not obj.GetObjectType.IsSubclassOf(GetType(CPersistentObject)) Then If Not obj.OriginalCacheKey Is Nothing Then m_cache.Remove(obj.OriginalCacheKey) + PCCacheSize.RawValue = m_cache.Count End If End If obj.OriginalCacheKey = New CCacheKey(obj) If m_useCache Then m_cache.Add(obj) 'Add to the cache + PCCacheSize.RawValue = m_cache.Count End If End Sub @@ -841,6 +890,8 @@ SyncLock GetType(CPersistenceBroker) Dim cm As CClassMap Dim x As DeleteException + Dim inTicks As Long, outTicks As Long + inTicks = Now.Ticks cm = obj.GetClassMap Dim conn As _CConnection conn = cm.RelationalDatabase.getConnection(Nothing) @@ -853,6 +904,10 @@ conn.rollback() Finally cm.RelationalDatabase.freeConnection(conn) + outTicks = Now.Ticks + PCAverageTime.RawValue = outTicks - inTicks + PCAverageTimeBase.Increment() + PCAverageTime.NextSample() If Not x Is Nothing Then Throw x End If @@ -875,6 +930,7 @@ Public Sub deleteCachedObject(ByVal obj As IPersistableObject) If m_useCache Then m_cache.Remove(obj) + PCCacheSize.RawValue = m_cache.Count End If End Sub @@ -915,6 +971,8 @@ Dim myKeys(cm.AssociationMaps.Count) As String cm.AssociationMaps.Keys.CopyTo(myKeys, 0) + PCDeletes.Increment() + For i = 0 To cm.AssociationMaps.Count - 1 udaMap = cm.AssociationMaps.Item(myKeys(i)) If udaMap.DeleteAutomatic Then @@ -946,6 +1004,7 @@ Dim statement As CSqlStatement statement = clMap.getDeleteSqlFor(obj) + PCSQLHits.Increment() conn.processStatement(statement) If deleteSuperClass Then @@ -963,6 +1022,7 @@ obj.Persistent = False If m_useCache Then m_cache.Remove(obj) 'remove from the cache + PCCacheSize.RawValue = m_cache.Count End If colCriteriaParameters = Nothing End Sub @@ -1245,9 +1305,12 @@ ''' </history> '''----------------------------------------------------------------------------- Private Function processPrivateCriteria(ByVal pCriteria As CRetrieveCriteria, ByVal conn As _CConnection, ByVal fullObjects As Boolean) As CCursor + PCCriteria.Increment() + Dim statement As CSqlStatement statement = pCriteria.getSqlStatementParameters(fullObjects) + PCSQLHits.Increment() Dim rs As CResultset rs = conn.processSelectStatement(statement) @@ -1275,9 +1338,12 @@ ''' </history> '''----------------------------------------------------------------------------- Private Function processCriteria(ByVal pCriteria As CRetrieveCriteria, ByVal colCriteriaParameters As Collection, ByVal conn As _CConnection) As CCursor + PCCriteria.Increment() + Dim statement As CSqlStatement statement = pCriteria.getSqlStatementParameters() + PCSQLHits.Increment() Dim rs As CResultset rs = conn.processSelectStatement(statement) @@ -1320,6 +1386,7 @@ Public Sub addToCache(ByRef obj As CPersistentObject) If m_useCache Then m_cache.Add(obj) + PCCacheSize.RawValue = m_cache.Count End If End Sub @@ -1336,6 +1403,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Function processMultiRetrieveCriteria(ByRef pCriteria As CMultiRetrieveCriteria, ByVal fullObjects As Boolean) As CCursor + PCCriteria.Increment() Dim clMap As CClassMap clMap = pCriteria.getFirstObject.GetClassMap @@ -1347,6 +1415,7 @@ statement = pCriteria.getSqlStatementParameters(fullObjects) conn.AutoCommit = False + PCSQLHits.Increment() Dim cursor As CCursor Dim rs As CResultset @@ -1380,6 +1449,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Function processMultiSummaryCriteria(ByRef pCriteria As CMultiSummaryCriteria) As CCursor + PCCriteria.Increment() Dim clMap As CClassMap clMap = pCriteria.getFirstObject.GetClassMap @@ -1392,6 +1462,7 @@ conn.AutoCommit = False + PCSQLHits.Increment() Dim cursor As CCursor Dim rs As CResultset Try @@ -1444,6 +1515,7 @@ ''' </history> '''----------------------------------------------------------------------------- Public Function processSummaryCriteria(ByRef obj As CPersistentObject, ByRef pCriteria As CSummaryCriteria) As CCursor + PCCriteria.Increment() Dim clMap As CClassMap clMap = obj.getClassMap(obj) @@ -1456,6 +1528,7 @@ conn.AutoCommit = False + PCSQLHits.Increment() Dim cursor As CCursor Dim rs As CResultset Try @@ -1597,6 +1670,7 @@ conn = firstClassMap.RelationalDatabase.getConnection(Nothing) conn.AutoCommit = False + PCSQLHits.Increment() Dim cursor As CCursor Dim rs As CResultset rs = conn.processSelectStatement(statement) @@ -2066,10 +2140,10 @@ ''' [danymayer] 19/05/2004 Created ''' </history> ''' ----------------------------------------------------------------------------- - Private Function createTargetObjectForMultipleInheritance(ByVal classMap As CClassMap, ByVal objectType As Type, ByVal classNameSpace As String, ByVal dataRow As DataRow, ByVal joins As CJoin, ByVal conn As _CConnection) As CPersistentObject + Private Function createTargetObjectForMultipleInheritance(ByVal classMap As CClassMap, ByVal objectType As Type, ByVal classNameSpace As String, ByVal dataRow As DataRow, ByVal joins As CJoin, ByVal conn As _CConnection) As IPersistableObject Dim de As DictionaryEntry Dim cm, cm1, cm2 As CClassMap - Dim obj As CPersistentObject = Nothing + Dim obj As IPersistableObject = Nothing For Each de In classMap.ChildrenMaps cm = de.Value @@ -2185,6 +2259,12 @@ Return queue End If + If includeBaseObject Then + 'Any object that is processed is automatically marked as isQueued (even if not dirty) + 'so that any recursion is prevented when processing non-dirty objects with circular references + obj.IsQueued = True + End If + If Not checkAssociationsRecursivly Then If includeBaseObject Then 'This will be on when we start saving a normal object. Recursive calls @@ -2206,7 +2286,6 @@ If includeBaseObject Then obj.IsDirty = False 'Added to queue so clear dirty flag queue.Enqueue(obj) - obj.IsQueued = True End If Else 'Determine if the object needs saving @@ -2214,15 +2293,13 @@ If includeBaseObject AndAlso _ (obj.IsDirty AndAlso Not obj.IsProxy AndAlso Not obj.IsReadOnly AndAlso Not obj.IsModifyOnly) Then If obj.GetObjectType.IsSubclassOf(GetType(CPersistentObject)) Then - If CType(obj, CPersistentObject).IsValid Then 'Do not save if object is not valid - obj.IsDirty = False 'Added to queue so clear dirty flag + If CType(obj, CPersistentObject).IsValid Then 'Do not save if object is not valid + obj.IsDirty = False 'Added to queue so clear dirty flag queue.Enqueue(obj) - obj.IsQueued = True End If Else obj.IsDirty = False queue.Enqueue(obj) - obj.IsQueued = True End If End If End If @@ -2373,6 +2450,7 @@ cursor.ClassMap = Nothing cursor.HoldsProxies = False st.SqlString = SQLString + 'PCSQLHits.Increment() cursor.ResultSet = database.getConnection(Nothing).processSelectStatement(st) Return cursor End Function @@ -2406,6 +2484,7 @@ m_databases = Nothing m_cache = Nothing m_disposed = True + PCCacheSize.RawValue = 0 End If End If End Sub @@ -2423,6 +2502,7 @@ Public Sub ClearCache() m_cache.Clear() + PCCacheSize.RawValue = m_cache.Count End Sub Public Sub GetObject(ByRef obj As Object) @@ -2587,4 +2667,100 @@ m_injectedObjects = Value End Set End Property + + Friend Sub InitPerformanceCounters() + If Not PerformanceCounterCategory.Exists("AtomsFramework") Then + + Dim CCDC As New CounterCreationDataCollection + + Dim SQLHitsCount64 As New CounterCreationData + SQLHitsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + SQLHitsCount64.CounterHelp = "SQLStatements Executed per Sec." + SQLHitsCount64.CounterName = "PCSQLHits" + CCDC.Add(SQLHitsCount64) + + Dim CacheHitsCount64 As New CounterCreationData + CacheHitsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + CacheHitsCount64.CounterHelp = "Cache Reads per Sec." + CacheHitsCount64.CounterName = "PCCacheHits" + CCDC.Add(CacheHitsCount64) + + Dim InsertsCount64 As New CounterCreationData + InsertsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + InsertsCount64.CounterHelp = "Inserts per Sec." + InsertsCount64.CounterName = "PCInserts" + CCDC.Add(InsertsCount64) + + Dim UpdatesCount64 As New CounterCreationData + UpdatesCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + UpdatesCount64.CounterHelp = "Updates per Sec." + UpdatesCount64.CounterName = "PCUpdates" + CCDC.Add(UpdatesCount64) + + Dim ReadsCount64 As New CounterCreationData + ReadsCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + ReadsCount64.CounterHelp = "Reads per Sec." + ReadsCount64.CounterName = "PCReads" + CCDC.Add(ReadsCount64) + + Dim DeletesCount64 As New CounterCreationData + DeletesCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + DeletesCount64.CounterHelp = "Deletes per Sec." + DeletesCount64.CounterName = "PCDeletes" + CCDC.Add(DeletesCount64) + + Dim CriteriaCount64 As New CounterCreationData + CriteriaCount64.CounterType = PerformanceCounterType.RateOfCountsPerSecond64 + CriteriaCount64.CounterHelp = "xCriteria per Sec." + CriteriaCount64.CounterName = "PCCriteria" + CCDC.Add(CriteriaCount64) + + Dim CacheSizeCount64 As New CounterCreationData + CacheSizeCount64.CounterType = PerformanceCounterType.NumberOfItems64 + CacheSizeCount64.CounterHelp = "Cache Size (No. of entries)" + CacheSizeCount64.CounterName = "PCCacheSize" + CCDC.Add(CacheSizeCount64) + + Dim AvgOpTimeCount64 As New CounterCreationData + AvgOpTimeCount64.CounterType = PerformanceCounterType.AverageTimer32 + AvgOpTimeCount64.CounterHelp = "Average Operation Time" + AvgOpTimeCount64.CounterName = "PCAverageTime" + CCDC.Add(AvgOpTimeCount64) + + Dim BaseAvgOpTimeCount64 As New CounterCreationData + BaseAvgOpTimeCount64.CounterType = PerformanceCounterType.AverageBase + BaseAvgOpTimeCount64.CounterName = "Average Operation Time Count" + BaseAvgOpTimeCount64.CounterHelp = "PCAverageTimeBase" + CCDC.Add(BaseAvgOpTimeCount64) + + ' Create the category. + PerformanceCounterCategory.Create("AtomsFramework", "Performance Counters for the AtomsFramework", CCDC) + End If + + Dim instanceName As String + instanceName = System.Diagnostics.Process.GetCurrentProcess.ProcessName + ' Create the counters. + PCSQLHits = New PerformanceCounter("AtomsFramework", "PCSQLHits", False) + PCCacheHits = New PerformanceCounter("AtomsFramework", "PCCacheHits", False) + PCInserts = New PerformanceCounter("AtomsFramework", "PCInserts", False) + PCUpdates = New PerformanceCounter("AtomsFramework", "PCUpdates", False) + PCReads = New PerformanceCounter("AtomsFramework", "PCReads", False) + PCDeletes = New PerformanceCounter("AtomsFramework", "PCDeletes", False) + PCCriteria = New PerformanceCounter("AtomsFramework", "PCCriteria", False) + PCCacheSize = New PerformanceCounter("AtomsFramework", "PCCacheSize", False) + PCAverageTime = New PerformanceCounter("AtomsFramework", "PCAverageTime", False) + PCAverageTimeBase = New PerformanceCounter("AtomsFramework", "PCAverageTimeBase", False) + + PCSQLHits.RawValue = 0 + PCCacheHits.RawValue = 0 + PCInserts.RawValue = 0 + PCUpdates.RawValue = 0 + PCReads.RawValue = 0 + PCDeletes.RawValue = 0 + PCCriteria.RawValue = 0 + PCCacheSize.RawValue = 0 + PCAverageTime.RawValue = 0 + PCAverageTimeBase.RawValue = 0 + + End Sub End Class \ No newline at end of file Index: CClassMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CClassMap.vb,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- CClassMap.vb 10 Nov 2004 01:21:24 -0000 1.44 +++ CClassMap.vb 16 Nov 2004 21:39:34 -0000 1.45 @@ -2065,6 +2065,7 @@ End Property Public Function CreateObjectInstance() As IPersistableObject + Dim ip As IPersistableObject If m_classFactoryName Is Nothing Then Return CreateObjectInstanceNoFactory() End If @@ -2109,7 +2110,8 @@ End Try m_classFactory = CType(obj, IClassFactory) End If - Return CreateObjectInstanceViaFactory() + ip = CreateObjectInstanceViaFactory() + Return ip End Function Private Function CreateObjectInstanceNoFactory() As IPersistableObject Index: readme.html =================================================================== RCS file: /cvsroot/jcframework/dotnet/readme.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- readme.html 10 Nov 2004 11:05:13 -0000 1.1 +++ readme.html 16 Nov 2004 21:39:34 -0000 1.2 @@ -149,8 +149,51 @@ </div> <tr> <td class="groupHeader" align="left" valign="top"> + <div onclick="return CFAQ.display('faq_a_notesv2.0', false);" style="width:100%;cursor:pointer;cursor:hand;"> + <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesv2.0', true);" onfocus="this.blur();"><b>Changes in v2.0 Final (xx-xx-04)</b></a></span> + </div> + <div id="faq_a_notesv2.0" style="display:none;"> + <table class="details" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> + <tr class="tableCaption"><td colspan=3>Bugs:</td></tr> + <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> + <td class="colHeader">Description</td> + <td class="colHeader">Details</td> + </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">InjectedObjects</td> + <td>hasValidKey was failing in some circumstances<td> + </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">Infinite loop during object saving</td> + <td>It was possible for object saving to cause a stack overflow in some rare situations. This is now fixed.<td> + </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">Invalid Type Cast error during retrieval</td> + <td>Retrieval of objects that do not inherit from CPersistentObject and that have child objects would fail due to a bug in the code. This is now fixed.<td> + </tr> + <tr class="tableCaption" valign="bottom"> + <td colspan=3><br/>Modifications</td> + </tr> + <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> + <td class="colHeader">Description</td> + <td class="colHeader">Details</td> + </tr> + <tr valign="top"> + <td>N/A</td> + <td class="col1">Performance </td> + <td>Code has been added to allow various performance values to be measured in PerfMon. This includes cache hits, sql hits, retrieves, saves, deletes per second, etc. If you want more, just place a request on the web site.<td> + </tr> + </table> + </div> + </td> + </tr> + <tr> + <td class="groupHeader" align="left" valign="top"> <div onclick="return CFAQ.display('faq_a_changesrc2', false);" style="width:100%;cursor:pointer;cursor:hand;"> - <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesrc2', true);" onfocus="this.blur();"><b>Changes in v2.0 RC2 (10-Nov-04)</b></a></span> + <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_changesrc2', true);" onfocus="this.blur();"><b>Changes in v2.0 RC2 (10-Nov-04)</b></a></span> </div> <div id="faq_a_changesrc2" style="display:none;"> <table class="details" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> @@ -213,6 +256,8 @@ </tr> </table> </div> + </td> + </tr> <tr> <td class="{faq_block.faq_row.ROW_CLASS}" align="left" valign="top"> <div onclick="return CFAQ.display('faq_a_notesrc1', false);" style="width:100%;cursor:pointer;cursor:hand;"> Index: CConnection.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CConnection.vb,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- CConnection.vb 1 Nov 2004 00:10:50 -0000 1.28 +++ CConnection.vb 16 Nov 2004 21:39:34 -0000 1.29 @@ -469,6 +469,7 @@ Try Dim m_adapter As New OleDbDataAdapter(m_command) If m_transactioncalls > 0 Then m_adapter.SelectCommand.Transaction = m_transaction + rs.ResultSet.Tables.Add("ole") m_adapter.Fill(rs.ResultSet, "ole") m_adapter.Dispose() Catch err As OleDbException Index: CCacheEntry.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CCacheEntry.vb,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- CCacheEntry.vb 3 Nov 2004 22:26:48 -0000 1.22 +++ CCacheEntry.vb 16 Nov 2004 21:39:34 -0000 1.23 @@ -907,7 +907,7 @@ pObj = ce.PersistentObject ck = x.Key outString &= i.ToString & ">" & ce.ToString & vbCrLf & _ - i.ToString & " (Cache Key)>" & ck.ToString & vbCrLf + i.ToString & " (Cache Key)>" & ck.ToString & vbCrLf i += 1 Next x outString &= ">>>> END CACHE DUMP <<<<" Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CInjectedObject.vb 5 Nov 2004 01:39:17 -0000 1.7 +++ CInjectedObject.vb 16 Nov 2004 21:39:34 -0000 1.8 @@ -634,7 +634,7 @@ Dim cm As CClassMap cm = Me.getClassMap For Each am In cm.KeyAttributeMaps - If Not IsNullAlias(Me.GetSourceObject.getValueByAttribute(am.Name)) Then + If Not IsNullAlias(Me.getValueByAttribute(am.Name)) Then Return True End If Next Index: modPersistenceBrokerSingleton.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modPersistenceBrokerSingleton.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- modPersistenceBrokerSingleton.vb 14 Oct 2004 05:25:02 -0000 1.9 +++ modPersistenceBrokerSingleton.vb 16 Nov 2004 21:39:34 -0000 1.10 @@ -70,6 +70,8 @@ staticInstance = New CPersistenceBroker staticInstance.Instance = staticInstance End If + 'Initialize performance counters + staticInstance.InitPerformanceCounters() End If Return staticInstance End Function |
From: Richard B. <rb...@us...> - 2004-11-10 11:05:40
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16269 Added Files: readme.html Removed Files: README.txt Log Message: update readme for RC2 --- NEW FILE: readme.html --- <html> <head> <title>Release Notes</title> <style> body { margin: 0px; } tr, p, div { font-family : Verdana, Arial, Helvetica, sans-serif; font-size : 11px; color : #333333; } .thHead { text-align: center; font-family: sans-serif; font-size: 20px; font-weight: bold; color : #ff6600; } .tableCaption { font-family : Verdana, Arial, Helvetica, sans-serif; font-size : 13px; color : #333333; background-color : white; } .tableHeader { font-family : Verdana, Arial, Helvetica, sans-serif; font-size : 13px; color : #333333; background-color : #DDDDDD; } .col1{ font-family : Verdana, Arial, Helvetica, sans-serif; font-size : 11px; color : #333333; background-color : #F0F0FF; } </style> </head> <body> <script language="javascript" type="text/javascript"> function _CFAQ() { this.lastOpened = ''; return this; } _CFAQ.prototype.IsDisplaySupported = function() { if( window.opera && !document.childNodes ) return false; if( document.getElementById || document.all ) return true; return false; } _CFAQ.prototype.getQueryVar = function(varName) { var q = window.location.search.substring(1); var v = q.split('&'); for( var i=0; i < v.length; i++ ) { var p = v[i].split('='); if( p[0] == varName ) return p[1]; } return null; } _CFAQ.prototype.getObj = function(obj) { return ( document.getElementById ? document.getElementById(obj) : ( document.all ? document.all[obj] : null ) ); } _CFAQ.prototype.displayObj = function(obj, status) { var x = this.getObj(obj); if( x && x.style ) x.style.display = status; } _CFAQ.prototype.display = function(faq_id, isLink) { if( this.IsDisplaySupported() ) { if( !isLink ) { if( this.lastOpened != '' ) { this.displayObj(this.lastOpened, 'none'); } if( this.lastOpened != faq_id ) { this.displayObj(faq_id, ''); this.lastOpened = faq_id; } else { this.lastOpened = ''; } } return false; } return true; } var CFAQ = new _CFAQ(); if( !CFAQ.IsDisplaySupported() ) { var u_faq = window.location.href; u_faq += ( u_faq.indexOf('?') > 0 ? '&' : '?' ) + 'dhtml=no'; window.location.replace(u_faq); } </script> <table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center"> <tr> <th class="thHead">Atoms Framework Release Notes</th> </tr> </table> <br clear="all" /> <!-- BEGIN faq_block --> <table class="forumline" width="100%" cellspacing="1" cellpadding="2" border="0" align="center"> <tr> <td class="catHead" height="28" align="center"><span class="cattitle">Atoms Framework 2.0 Release Candidate 2<br />Released: 10-Nov-2004</span></td> </tr> <tr> <td align="center"> <span>Thank you for choosing to use the AtomsFramework. We trust that you enjoy using it and that you find it useful. If you have any questions please visit the project home page and leave a message in the forums.<br/> <br/> - Richard.<br /> <br/> <a href="http://jcframework.sourceforge.net">http://jcframework.sourceforge.net</a><br/> </span> </td> </tr> <tr> <td class="groupHeader" align="left" valign="top"> <div onclick="return CFAQ.display('faq_a_installation', false);" style="width:100%;cursor:pointer;cursor:hand;"> <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_installation', true);" onfocus="this.blur();"><b>INSTALLATION</b></a></span> </div> <div id="faq_a_installation" style="display:none;"> <table class="bodyline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center"> <tr><td align="left" valign="top"><span class="postbody"> This is a source code release so installation is fairly trivial. To get this project working you must have installed the ADO.NET provider for MySQL (even if you don't use MySQL). This is included in the archive (ByteFX and SharpZipLib) or you can get the latest from <a href="http://sourceforge.net/projects/mysqlnet/">http://sourceforge.net/projects/mysqlnet/</a><br/> <br/> The archive also includes sample projects and <a href="http://www.nunit.org/">NUnit</a> tests (Nunit 2.2) to get you started.<br/> <br/> <i>VBSample</i> is written in VB.NET<br/> <i>CSSample</i> is the same project written in C#<br/> <i>DataBoundSample</i> is a VB.NET project showing data bound collections<br/> </span></td></tr> </table> </div> <tr> <td class="groupHeader" align="left" valign="top"> <div onclick="return CFAQ.display('faq_a_changesrc2', false);" style="width:100%;cursor:pointer;cursor:hand;"> <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesrc2', true);" onfocus="this.blur();"><b>Changes in v2.0 RC2 (10-Nov-04)</b></a></span> </div> <div id="faq_a_changesrc2" style="display:none;"> <table class="details" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> <tr class="tableCaption"><td colspan=3>Bugs:</td></tr> <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> <td class="colHeader">Description</td> <td class="colHeader">Details</td> </tr> <tr valign="top"> <td>#1056847</td> <td class="col1">Error in getTableSchema.</td> <td>Errors in reading table schema (locked tables, etc) were not being propogated correctly<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">Cache referencing errors</td> <td>It was possible for object retrieval to be incorrectly returned a reference to a cached object instead of a copy of the object. This could result in cache corruption.<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">Ansi Nulls</td> <td>The logic for Ansi Null behaviour was reversed in some parts of the code.<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">Improved handling of "non-standard" shared table mapping</td> <td>Handle shared tables that incorrectly repeat attribute mappings from the parent class<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">Namespaces in ProcessDirectSQL</td> <td>SQL statements based on class names can be passed to ProcessDirectSQL. If the class names are prefixed with a namespace the method would fail. Namespaces are now correctly handled.<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">SSPI Connections</td> <td>RC1 didn't actually connect to the database when using SSPI. Oops.<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">Overrides in XML Mapping</td> <td>Child classes that remap superclass attributes were being populated with parent values instead of child values.<td> </tr> <tr class="tableCaption" valign="bottom"> <td colspan=3><br/>Modifications</td> </tr> <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> <td class="colHeader">Description</td> <td class="colHeader">Details</td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">Improved Lazy Loading</td> <td>It is now possible to lazy load associations. By marking an association as retrieveAutomatic="lazy" the association will be populated with proxy objects instead of full objects. For attribute based mappings use LazyLoad:=True in the <AFAssociation()> attribute.<td> </tr> <tr valign="top"> <td>N/A</td> <td class="col1">DumpCacheDetails</td> <td>Improved output from DumpCacheDetails to help with debugging<td> </tr> </table> </div> <tr> <td class="{faq_block.faq_row.ROW_CLASS}" align="left" valign="top"> <div onclick="return CFAQ.display('faq_a_notesrc1', false);" style="width:100%;cursor:pointer;cursor:hand;"> <span class="gen"><a class="postlink" href="javascript:void(0)" onclick="return CFAQ.display('faq_a_notesrc1', true);" onfocus="this.blur();"><b>Changes in v2.0 RC1 (29-Oct-2004)</b></span></a> </div> <div id="faq_a_notesrc1" style="display:none;"> <table class="bodyline" width="100%" cellspacing="0" cellpadding="3" border="0" align="left"> <tr class="tableCaption"><td colspan=3>Bugs:</td></tr> <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> <td class="colHeader">Description</td> <td class="colHeader">Details</td> </tr> <tr valign="top"> <td>#1035044</td> <td class="col1">Fixes for MultipleInheritence</td> <td>Improved behaviour<td> </tr> <tr> <td>#1035044</td> <td class="col1">Loading classes from Multiple Assemblies</td> <td>Late binding of objects was not working is some situations<td> </tr> <tr> <td>#1035273</td> <td class="col1">Can't change key field values</td> <td>When a key field of an object was changed, the object could not be saved.<td> </tr> <tr> <td>#1038623</td> <td class="col1">Incomplete Parameters</td> <td>Where clauses for single object SQL statements now use parameters instead of string literals. This can improve SQL server performance in some cases.<td> </tr> <tr> <td>#1038521</td> <td class="col1">Error in CCursor.LoadProxy</td> <td>Multiple problems in the LoadProxy method were fixed<td> </tr> <tr> <td>#1046809</td> <td class="col1">Correct handling of ANSI Nulls</td> <td>Databases handle Nulls in where clauses differently depending on their ANSI Null behaviour. A new "ansinulls" parameter has been added to the XML database configuration to control this behaviour.<td> </tr> <tr> <td>#1046405</td> <td class="col1">Wrong alias used in join</td> <td>MultiRetrieveCriteria joins were always joining against the left most table.<td> </tr> <tr> <td>#1055503</td> <td class="col1">Incomplete SQL when using summary with group by</td> <td>Grouped fields were not included in the result. Fixed by Exelrud.<td> </tr> <tr> <td>N/A</td> <td class="col1">Saving objects in shared tables</td> <td>Various issues with shared tables existed and are now fixed.<td> </tr> <tr> <td>N/A</td> <td class="col1">Problems with code based attribute mappings using OID/Guid</td> <td>Classes mapped using <AFxxx()> custom attributes had problems when using OID or GUID values for primary keys<td> </tr> <tr> <td>N/A</td> <td class="col1">String.Empty and columns marked as NOT NULL</td> <td>NOT NULL String columns could not be saved if the value was String.Empty<td> </tr> <tr> <td>N/A</td> <td class="col1">Duplicate objects when retrieving multiple collections</td> <td>Objects with more than one one-to-many association were incorrectly retrieving duplicate objects<td> </tr> <tr> <td>N/A</td> <td class="col1">Problems with Many-to-Many associations</td> <td>The pivot objects in a many-to-many association were being saved multiple times resulting in duplicate index errors.<td> </tr> <tr> <td>N/A</td> <td class="col1">Could not update value types mapped using <attribute>.<property> syntax in XML.</td> <td>Value types needed to be handled differently to objects in SetAttribute... methods.<td> </tr> <tr> <td>N/A</td> <td class="col1">Using offsets on Microsoft SQL generated invalid SQL</td> <td>Microsoft SQL (and Access) do not natively support offsets. Changes made to mimic offset behaviour for these databases.<td> </tr> <tr class="tableCaption"><td colspan=3><br/>Modifications</td></tr> <tr class="tableHeader" valign="bottom"><td valign="top" class="colHeader">Job Id</td> <td class="colHeader">Description</td> <td class="colHeader">Details</td> </tr> <tr> <td>#1035044</td> <td class="col1">Enhanced method for saving objects</td> <td>Dirty objects in an object tree can still be saved even if the root object is not dirty<td> </tr> <tr> <td>#1035044</td> <td class="col1">Deletion</td> <td>Option added to optionally delete an objects parent when an object is deleted<td> </tr> <tr> <td>#1035044</td> <td class="col1">Attributes for CPersistentObject and CPersistentCollection</td> <td>Properties in these classes have been marked as Browsable(False), NonSerialized and as advanced editor properties where appropriate<td> </tr> <tr> <td>#1013994</td> <td class="col1">Ordering criteria based on associated objects</td> <td>CMultiRetrieveCriteria can now order by properties of associated objects. (exelrud)<td> </tr> <tr> <td>1041860</td> <td class="col1">Add SSPI Support to Microsoft SQL databases</td> <td>To use SSPI set the user name to SSPI in the XML database configuration. No password is required<td> </tr> <tr> <td>N/A</td> <td class="col1">Added NOT BETWEEN selection criteria</td> <td><td> </tr> <tr> <td>N/A</td> <td class="col1">Implemented Dispose on various objects</td> <td>Improved garbage collection and resource management<td> </tr> <tr> <td>N/A</td> <td class="col1">DeleteAll()</td> <td>New method added for DeleteAll(). Thanks mfo<td> </tr> <tr> <td>N/A</td> <td class="col1">Added ability to persist objects without inheriting from CPersistentObject</td> <td>See posts in the forums for more information<td> </tr> <tr> <td>N/A</td> <td class="col1">Added ability to persist objects based on interfaces</td> <td>See posts in the forums for more information<td> </tr> </table> </div> </td> </tr> </table> <br clear="all" /> </body> </html> --- README.txt DELETED --- |
From: Richard B. <rb...@us...> - 2004-11-10 01:21:37
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31898 Modified Files: CClassMap.vb CMsSqlDatabase.vb Log Message: Stupid Mistake Fixes for: Handling overriden fields in mappings SSPI connections to MSSQL DBs Index: CMsSqlDatabase.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CMsSqlDatabase.vb,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- CMsSqlDatabase.vb 18 Oct 2004 03:31:51 -0000 1.19 +++ CMsSqlDatabase.vb 10 Nov 2004 01:21:24 -0000 1.20 @@ -64,8 +64,8 @@ "Persist Security Info=False;" & _ "User Id=" & m_user & ";" & _ "Password=" & m_password - conn.Connection.Open() End If + conn.Connection.Open() Catch ex As SqlClient.SqlException Throw New DatabaseConnectionException(ex.Message, ex) Catch ex As Exception Index: CClassMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CClassMap.vb,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- CClassMap.vb 9 Nov 2004 11:46:04 -0000 1.43 +++ CClassMap.vb 10 Nov 2004 01:21:24 -0000 1.44 @@ -1438,20 +1438,22 @@ End If 'Attempt to load column via alias first, then table qualified name then column name 'find the correct variation of the column name in the row and the retrieve the value - val = Nothing - Try - If rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasName(pAlias)) Then - val = rw.Item(AttrMap.ColumnMap.getAliasName(pAlias)) - ElseIf rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasQualifiedName(pAlias)) Then - val = rw.Item(AttrMap.ColumnMap.getAliasQualifiedName(pAlias)) - ElseIf rw.Table.Columns.Contains(AttrMap.ColumnMap.Name) Then - val = rw.Item(AttrMap.ColumnMap.Name) + If Not skipAttribute Then + val = Nothing + Try + If rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasName(pAlias)) Then + val = rw.Item(AttrMap.ColumnMap.getAliasName(pAlias)) + ElseIf rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasQualifiedName(pAlias)) Then + val = rw.Item(AttrMap.ColumnMap.getAliasQualifiedName(pAlias)) + ElseIf rw.Table.Columns.Contains(AttrMap.ColumnMap.Name) Then + val = rw.Item(AttrMap.ColumnMap.Name) + End If + Catch ex As Exception + End Try + obj.SetAttributeValue(AttrMap.Name, val) + If Not IsDBNull(val) And Not val Is Nothing Then + obj.Persistent = True End If - Catch ex As Exception - End Try - obj.SetAttributeValue(AttrMap.Name, val) - If Not IsDBNull(val) And Not val Is Nothing Then - obj.Persistent = True End If Next i End Sub @@ -1528,21 +1530,23 @@ Catch End Try End If - tmpObj = Nothing - Try - If rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasName(pAlias)) Then - tmpObj = rw.Item(AttrMap.ColumnMap.getAliasName(pAlias)) - ElseIf rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasQualifiedName(pAlias)) Then - tmpObj = rw.Item(AttrMap.ColumnMap.getAliasQualifiedName(pAlias)) - ElseIf rw.Table.Columns.Contains(AttrMap.ColumnMap.Name) Then - tmpObj = rw.Item(AttrMap.ColumnMap.Name) - End If - Catch ex As Exception - End Try + If Not skipAttribute Then + tmpObj = Nothing + Try + If rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasName(pAlias)) Then + tmpObj = rw.Item(AttrMap.ColumnMap.getAliasName(pAlias)) + ElseIf rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasQualifiedName(pAlias)) Then + tmpObj = rw.Item(AttrMap.ColumnMap.getAliasQualifiedName(pAlias)) + ElseIf rw.Table.Columns.Contains(AttrMap.ColumnMap.Name) Then + tmpObj = rw.Item(AttrMap.ColumnMap.Name) + End If + Catch ex As Exception + End Try - obj.SetAttributeValue(AttrMap.Name, tmpObj) - If Not IsDBNull(tmpObj) And Not tmpObj Is Nothing Then - obj.Persistent = True + obj.SetAttributeValue(AttrMap.Name, tmpObj) + If Not IsDBNull(tmpObj) And Not tmpObj Is Nothing Then + obj.Persistent = True + End If End If Next i End Sub |
From: Richard B. <rb...@us...> - 2004-11-09 11:46:13
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13726 Modified Files: CClassMap.vb CCursor.vb CPersistenceBroker.vb CXMLConfigLoader.vb modAliasNull.vb Log Message: Extra case check in modAliasNull Changes CClassmap to use populateObject instead of retrieveObject to reduce confusion Fix for mappings where child classes override mappings in the parent. Index: modAliasNull.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modAliasNull.vb,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- modAliasNull.vb 1 Nov 2004 04:08:23 -0000 1.5 +++ modAliasNull.vb 9 Nov 2004 11:46:04 -0000 1.6 @@ -75,9 +75,10 @@ If InValue Is Nothing Then blnValue = True End If - ' If Trim(InValue) = NULL_STRING Then blnValue = True Case VariantType.Byte If InValue = NULL_BYTE Then blnValue = True + Case VariantType.DataObject.Null + blnValue = True Case Else If InValue Is Nothing Then blnValue = True @@ -86,8 +87,6 @@ blnValue = True End If End If - ' bytes and boleans - 'Debug.Assert False End Select Return blnValue End Function Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- CPersistenceBroker.vb 5 Nov 2004 01:39:17 -0000 1.78 +++ CPersistenceBroker.vb 9 Nov 2004 11:46:04 -0000 1.79 @@ -329,7 +329,7 @@ rs = conn.processSelectStatement(statement) Debug.WriteLine("Select statement returned " & rs.ResultSet.Tables(0).Rows.Count & " row(s)") If rs.ResultSet.Tables(0).Rows.Count > 0 Then - cm.retrieveObject(cm, obj, rs, "t1") + cm.populateObject(cm, obj, rs, "t1") 'Mark associations as retrieved (even though they aren't yet) to stop circular references in processing obj.AssociationsLoaded = True Else @@ -356,7 +356,7 @@ End If If rs.ResultSet.Tables(0).Rows.Count > 0 Then mapName = "t" & classMapCount.ToString - cm.retrieveObject(cm2, obj, rs, mapName) + cm.populateObject(cm2, obj, rs, mapName, True, cm) End If cm3 = cm2 cm2 = cm2.SuperClass @@ -383,9 +383,9 @@ 'if the class as child classes then check if the targetobj is of type child If cm2.ChildrenMaps.Count > 0 Then cm3 = targetobj.GetClassMap() - cm2.retrieveObject(cm3, targetobj, rs, joins.GetTableAlias(cm3)) + cm2.populateObject(cm3, targetobj, rs, joins.GetTableAlias(cm3)) Else - cm2.retrieveObject(cm2, targetobj, rs, mapName) + cm2.populateObject(cm2, targetobj, rs, mapName) End If If targetobj.Persistent Then tmpObj = m_cache.Item(targetobj) @@ -447,7 +447,7 @@ targetobj = udamap.ForClass.CreateObjectInstance If Not targetobj Is Nothing Then - cm2.retrieveObject(cm2, targetobj, rs, mapName) + cm2.populateObject(cm2, targetobj, rs, mapName) If targetobj.Persistent Then tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then @@ -527,7 +527,7 @@ targetobj = udamap.ForClass.CreateObjectInstance rw = rs.ResultSet.Tables(0).Rows(i) - cm2.retrieveObject(cm2, targetobj, rw, mapName) + cm2.populateObject(cm2, targetobj, rw, mapName) If targetobj.Persistent Then tmpObj = m_cache.Item(targetobj) If Not (tmpObj Is Nothing) Then @@ -2089,7 +2089,7 @@ cm1 = classMap.SuperClass cm2 = classMap While Not cm1 Is Nothing - classMap.retrieveObject(cm1, obj, dataRow, joins.GetTableAlias(cm1)) + classMap.populateObject(cm1, obj, dataRow, joins.GetTableAlias(cm1), True, classMap) cm2 = cm1 cm1 = cm1.SuperClass End While @@ -2097,7 +2097,7 @@ 'set persistent to false because the parent will allways be persistent obj.Persistent = False 'Now retrieve the class details - classMap.retrieveObject(classMap, obj, dataRow, joins.GetTableAlias(classMap)) + classMap.populateObject(classMap, obj, dataRow, joins.GetTableAlias(classMap)) 'Dim tmpobj As CPersistentObject 'tmpobj = m_cache.Item(obj) Index: CCursor.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CCursor.vb,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- CCursor.vb 1 Nov 2004 00:10:50 -0000 1.13 +++ CCursor.vb 9 Nov 2004 11:46:04 -0000 1.14 @@ -261,7 +261,7 @@ _alias = mr.getObjectAlias(injObj, offset) clMap = pbroker.getClassMap(obj.GetType) If Not m_holdsProxies Then - clMap.retrieveObject(clMap, injObj, m_row, _alias) + clMap.populateObject(clMap, injObj, m_row, _alias) If clMap.AssociationMapCount > 0 Then injObj.AssociationsLoaded = False Else @@ -270,7 +270,7 @@ pbroker.InjectedObjects.Add(injObj) Else 'need to retrieve the proxy and then load the object - clMap.retrieveProxy(injObj, m_row, _alias) + clMap.populateProxy(injObj, m_row, _alias) pbroker.retrieveObject(injObj, False, True) pbroker.InjectedObjects.Add(injObj) End If @@ -280,7 +280,7 @@ clMap = pbroker.getClassMap(obj.GetType) If Not m_holdsProxies Then - clMap.retrieveObject(injObj, m_row) + clMap.populateObject(injObj, m_row) If clMap.AssociationMapCount > 0 Then injObj.AssociationsLoaded = False Else @@ -289,7 +289,7 @@ pbroker.InjectedObjects.Add(injObj) Else 'need to retrieve the proxy and then load the object - clMap.retrieveProxy(injObj, m_row) + clMap.populateProxy(injObj, m_row) pbroker.retrieveObject(injObj, False, True) pbroker.InjectedObjects.Add(injObj) End If @@ -334,7 +334,7 @@ _alias = cm.getObjectAlias(obj, offset) clMap = obj.getClassMap If Not m_holdsProxies Then - clMap.retrieveObject(clMap, obj, m_row, _alias) + clMap.populateObject(clMap, obj, m_row, _alias) If obj.getClassMap().AssociationMapCount > 0 Then obj.AssociationsLoaded = False Else @@ -342,7 +342,7 @@ End If Else 'need to retrieve the proxy and then load the object - clMap.retrieveProxy(obj, m_row, _alias) + clMap.populateProxy(obj, m_row, _alias) obj.Retrieve() End If Exit Sub @@ -350,7 +350,7 @@ End If If Not m_holdsProxies Then - obj.getClassMap().retrieveObject(obj, m_row) + obj.getClassMap().populateObject(obj, m_row) If obj.getClassMap().AssociationMapCount > 0 Then obj.AssociationsLoaded = False Else @@ -358,7 +358,7 @@ End If Else 'need to retrieve the proxy and then load the object - obj.getClassMap(obj).retrieveProxy(obj, m_row) + obj.getClassMap(obj).populateProxy(obj, m_row) obj.Retrieve() End If End Sub @@ -400,14 +400,14 @@ _alias = cm.getObjectAlias(obj, offset) clMap = obj.getClassMap If Not m_holdsProxies Then - clMap.retrieveObject(clMap, obj, m_row, _alias) + clMap.populateObject(clMap, obj, m_row, _alias) obj.IsDirty = False broker.addToCache(obj) broker.retrieveAssociations(obj, obj.getClassMap(obj).RelationalDatabase.getConnection(Nothing), m_classMap, True) obj.IsProxy = False broker.addToCache(obj) Else - clMap.retrieveProxy(obj, m_row, _alias) + clMap.populateProxy(obj, m_row, _alias) obj.Retrieve() End If Exit Sub @@ -416,7 +416,7 @@ 'TO DO: Handle errors If Not m_holdsProxies Then - obj.getClassMap(obj).retrieveObject(obj, m_row) + obj.getClassMap(obj).populateObject(obj, m_row) obj.IsDirty = False 'Clear the dirty flag after initial loading of the object 'Add object to cache broker.addToCache(obj) @@ -426,7 +426,7 @@ broker.addToCache(obj) Else 'need to retrieve the proxy and then load the object - obj.getClassMap(obj).retrieveProxy(obj, m_row) + obj.getClassMap(obj).populateProxy(obj, m_row) obj.Retrieve() End If End Sub @@ -467,13 +467,13 @@ cm = m_parentCriteria _alias = cm.getObjectAlias(injObj, offset) clMap = pbroker.getClassMap(obj.GetType) - clMap.retrieveProxy(injObj, m_row, _alias) + clMap.populateProxy(injObj, m_row, _alias) Exit Sub End If End If clMap = pbroker.getClassMap(obj.GetType) - clMap.retrieveProxy(injObj, m_row) + clMap.populateProxy(injObj, m_row) End Sub @@ -488,12 +488,12 @@ cm = m_parentCriteria _alias = cm.getObjectAlias(obj, offset) clMap = obj.getClassMap - clMap.retrieveProxy(obj, m_row, _alias) + clMap.populateProxy(obj, m_row, _alias) Exit Sub End If End If - obj.getClassMap(obj).retrieveProxy(obj, m_row) + obj.getClassMap(obj).populateProxy(obj, m_row) End Sub Index: CClassMap.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CClassMap.vb,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- CClassMap.vb 2 Nov 2004 05:36:13 -0000 1.42 +++ CClassMap.vb 9 Nov 2004 11:46:04 -0000 1.43 @@ -1382,13 +1382,13 @@ ''' [rbanks] 27/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub retrieveObject(ByRef obj As IPersistableObject, ByVal rs As CResultset) + Public Sub populateObject(ByRef obj As IPersistableObject, ByVal rs As CResultset) Dim tm As CTableMap Dim ClassMap As CClassMap ClassMap = Me Do tm = ClassMap.Tables.Item(1) - Call retrieveObject(ClassMap, obj, rs, tm.Name) + Call populateObject(ClassMap, obj, rs, tm.Name) ClassMap = ClassMap.SuperClass Loop While Not ClassMap Is Nothing obj.IsDirty = False @@ -1414,17 +1414,29 @@ ''' </history> '''----------------------------------------------------------------------------- - Public Sub retrieveObject(ByRef cm As CClassMap, ByRef obj As IPersistableObject, ByVal rs As CResultset, ByVal pAlias As String) + Public Sub populateObject(ByRef cm As CClassMap, ByRef obj As IPersistableObject, ByVal rs As CResultset, ByVal pAlias As String) + Call populateObject(cm, obj, rs, pAlias, False, Nothing) + End Sub + Public Sub populateObject(ByRef cm As CClassMap, ByRef obj As IPersistableObject, ByVal rs As CResultset, ByVal pAlias As String, ByVal checkForDuplicateAttributes As Boolean, ByVal classMapToCheck As CClassMap) Dim i As Short Dim AttrMap As CAttributeMap Dim val As Object Dim rw As DataRow + Dim skipAttribute As Boolean rw = rs.ResultSet.Tables(0).Rows(0) For i = 1 To cm.getSize AttrMap = cm.getAttributeMap(i) + skipAttribute = False + If checkForDuplicateAttributes Then + Try + If Not classMapToCheck.getAttributeMapByString(AttrMap.Name, False) Is Nothing Then + skipAttribute = True + End If + Catch + End Try + End If 'Attempt to load column via alias first, then table qualified name then column name - 'find the correct variation of the column name in the row and the retrieve the value val = Nothing Try @@ -1462,13 +1474,13 @@ ''' [rbanks] 27/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub retrieveObject(ByRef obj As IPersistableObject, ByVal rw As DataRow) + Public Sub populateObject(ByRef obj As IPersistableObject, ByVal rw As DataRow) Dim tm As CTableMap Dim ClassMap As CClassMap ClassMap = Me Do tm = ClassMap.Tables.Item(1) - Call retrieveObject(ClassMap, obj, rw, tm.Name) + Call populateObject(ClassMap, obj, rw, tm.Name) ClassMap = ClassMap.SuperClass Loop While Not ClassMap Is Nothing obj.IsDirty = False @@ -1493,8 +1505,12 @@ ''' [rbanks] 27/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub retrieveObject(ByRef ClassMap As CClassMap, ByRef obj As IPersistableObject, ByVal rw As DataRow, ByVal pAlias As String) + Public Sub populateObject(ByRef ClassMap As CClassMap, ByRef obj As IPersistableObject, ByVal rw As DataRow, ByVal pAlias As String) + Call populateObject(ClassMap, obj, rw, pAlias, False, Nothing) + End Sub + Public Sub populateObject(ByRef ClassMap As CClassMap, ByRef obj As IPersistableObject, ByVal rw As DataRow, ByVal pAlias As String, ByVal checkForDuplicateAttributes As Boolean, ByVal classMapToCheck As CClassMap) Dim tmpObj As Object + Dim skipAttribute As Boolean If obj Is Nothing Then Throw New RetrieveException("Source object not instantiated yet") End If @@ -1503,7 +1519,15 @@ For i = 1 To ClassMap.getSize AttrMap = ClassMap.getAttributeMap(i) 'Attempt to load column via alias first, then table qualified name then column name - + skipAttribute = False + If checkForDuplicateAttributes Then + Try + If Not classMapToCheck.getAttributeMapByString(AttrMap.Name, False) Is Nothing Then + skipAttribute = True + End If + Catch + End Try + End If tmpObj = Nothing Try If rw.Table.Columns.Contains(AttrMap.ColumnMap.getAliasName(pAlias)) Then @@ -1535,10 +1559,10 @@ ''' [rbanks] 27/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub retrieveProxy(ByRef obj As IPersistableObject, ByVal rw As DataRow) + Public Sub populateProxy(ByRef obj As IPersistableObject, ByVal rw As DataRow) Dim tm As CTableMap tm = obj.GetClassMap.Tables.Item(1) - Call retrieveProxy(obj, rw, tm.Name) + Call populateProxy(obj, rw, tm.Name) End Sub '''----------------------------------------------------------------------------- @@ -1554,7 +1578,7 @@ ''' [rbanks] 27/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Sub retrieveProxy(ByRef obj As IPersistableObject, ByVal rw As DataRow, ByVal pAlias As String) + Public Sub populateProxy(ByRef obj As IPersistableObject, ByVal rw As DataRow, ByVal pAlias As String) Dim ClassMap As CClassMap Dim tmpObj As Object If obj Is Nothing Then Index: CXMLConfigLoader.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CXMLConfigLoader.vb,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- CXMLConfigLoader.vb 2 Nov 2004 05:36:13 -0000 1.28 +++ CXMLConfigLoader.vb 9 Nov 2004 11:46:04 -0000 1.29 @@ -294,11 +294,22 @@ Else If Not attrClassNameSpace Is Nothing Then ClassMap.SuperClass = m_classMap.Item(ClassMap.ClassNameSpace & "." & attrSuperClassName.Value) - ClassMap.SuperClassNameSpace = attrClassNameSpace.Value + If ClassMap.SuperClass Is Nothing Then + ClassMap.SuperClass = m_classMap.Item(attrSuperClassName.Value) + Else + ClassMap.SuperClassNameSpace = attrClassNameSpace.Value + End If Else ClassMap.SuperClass = m_classMap.Item(attrSuperClassName.Value) End If End If + If ClassMap.SuperClass Is Nothing Then + If attrSuperClassNameSpace Is Nothing Then + Throw New XMLMappingException([String].Format("Could not find superclass with name {0}", attrSuperClassName.Value)) + Else + Throw New XMLMappingException([String].Format("Could not find superclass with name {0} and namespace {1}", attrSuperClassName.Value, attrSuperClassNameSpace.Value)) + End If + End If ClassMap.SuperClass.addChildrenMap(ClassMap) If Not attrSharedValue Is Nothing Then ClassMap.SharedTableValue = attrSharedValue.Value |
From: Richard B. <rb...@us...> - 2004-11-05 01:39:35
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7037 Modified Files: CInjectedObject.vb CPersistenceBroker.vb CPersistentObject.vb IPersistentObject.vb Log Message: Fix for retrieveAssociations. Preexisting objects were not being correctly retrieved Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- CPersistenceBroker.vb 2 Nov 2004 05:36:13 -0000 1.77 +++ CPersistenceBroker.vb 5 Nov 2004 01:39:17 -0000 1.78 @@ -630,18 +630,16 @@ gotValue = False If Not Value Is Nothing Then 'Need to know if returned object is persistent and has a legitimate key - 'If Value.hasValidKey Then + If Value.HasValidKey Then anObjPers = m_cache.Item(Value) - If anObjPers Is Nothing Then - retrieveObject(Value, False, False) - Else + If Not anObjPers Is Nothing Then Value = anObjPers - End If Value.IsDirty = False Value.OriginalCacheKey = New CCacheKey(Value) obj.SetAttributeValue(udaMap.Target, Value.GetSourceObject) gotValue = True - 'End If + End If + End If End If If Not gotValue Then 'Object doesn't exist - let's create it Index: IPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IPersistentObject.vb,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- IPersistentObject.vb 1 Nov 2004 21:28:03 -0000 1.6 +++ IPersistentObject.vb 5 Nov 2004 01:39:17 -0000 1.7 @@ -31,6 +31,7 @@ Sub ResetOriginalDates() Function GetObjectByClassMap(ByVal classMap As CClassMap) As IPersistableObject Function GetSourceObject() As Object + Function HasValidKey() As Boolean End Interface Public Interface IPersistentObject Index: CInjectedObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CInjectedObject.vb,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CInjectedObject.vb 27 Oct 2004 07:38:48 -0000 1.6 +++ CInjectedObject.vb 5 Nov 2004 01:39:17 -0000 1.7 @@ -627,5 +627,18 @@ Public Function GetSourceObject() As Object Implements IPersistableObject.GetSourceObject Return m_object End Function + + Public Overridable Function hasValidKey() As Boolean Implements IPersistableObject.HasValidKey + 'Check for any non-null key attributes + Dim am As CAttributeMap + Dim cm As CClassMap + cm = Me.getClassMap + For Each am In cm.KeyAttributeMaps + If Not IsNullAlias(Me.GetSourceObject.getValueByAttribute(am.Name)) Then + Return True + End If + Next + Return False + End Function End Class Index: CPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentObject.vb,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- CPersistentObject.vb 1 Nov 2004 21:28:03 -0000 1.49 +++ CPersistentObject.vb 5 Nov 2004 01:39:17 -0000 1.50 @@ -632,11 +632,17 @@ ''' </history> '''----------------------------------------------------------------------------- <EditorBrowsable(EditorBrowsableState.Advanced)> _ - Public Overridable Function hasValidKey() As Boolean - If m_oid Is Nothing Then + Public Overridable Function hasValidKey() As Boolean Implements IPersistableObject.HasValidKey + 'Check for any non-null key attributes + Dim am As CAttributeMap + Dim cm As CClassMap + cm = Me.getClassMap + For Each am In cm.KeyAttributeMaps + If Not IsNullAlias(Me.getValueByAttribute(am.Name)) Then + Return True + End If + Next Return False - End If - Return OIDValue.Length > 0 End Function '''----------------------------------------------------------------------------- |
From: Richard B. <rb...@us...> - 2004-11-03 22:26:58
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25827 Modified Files: CCacheEntry.vb README.txt Log Message: Fix for cache - I broke 3-level recursive association retrieval. Fixed now. Index: CCacheEntry.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CCacheEntry.vb,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- CCacheEntry.vb 3 Nov 2004 01:30:58 -0000 1.21 +++ CCacheEntry.vb 3 Nov 2004 22:26:48 -0000 1.22 @@ -878,7 +878,7 @@ Private Function GetCachedObject(ByVal ce As CCacheEntry) As IPersistableObject If m_objectsLoading Then 'If the object is already fully loaded and is persistent then I can return a copy instead of the original - If ce.PersistentObject.AssociationsLoaded And ce.PersistentObject.Persistent Then + If ce.PersistentObject.AssociationsLoaded And ce.PersistentObject.Persistent And Not ce.PersistentObject.IsLoading Then Debug.WriteLine(" - returning copy of object " & ce.PersistentObject.GetObjectType.Name) Return ce.PersistentObject.Copy Else Index: README.txt =================================================================== RCS file: /cvsroot/jcframework/dotnet/README.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- README.txt 28 Oct 2004 22:48:43 -0000 1.15 +++ README.txt 3 Nov 2004 22:26:48 -0000 1.16 @@ -1,5 +1,5 @@ -AtomsFramework v2.0 Release Candidate 1 -Released: 29-Oct-2004 +AtomsFramework v2.0 Release Candidate 2 +Released: 04-Nov-2004 ----------- Thank you for choosing to use the AtomsFramework. We trust that you enjoy using it and that you find it useful. @@ -23,6 +23,40 @@ DataBoundSample is a VB.NET project showing data bound collections -------------CHANGE LOG--------------- +Changes in v2.0 RC2 (04-Nov-2004) + +Bugs: +----- +(#1056847) Error in getTableSchema. + Errors in reading table schema (locked tables, etc) were not being propogated correctly + +(N/A) Cache referencing errors + It was possible for object retrieval to be incorrectly returned a reference to a + cached object instead of a copy of the object. This could result in cache corruption. + +(N/A) Ansi Nulls + The logic for Ansi Null behaviour was reversed in some parts of the code. + +(N/A) Improved handling of "non-standard" shared table mapping + Handle shared tables that incorrectly repeat attribute mappings from the parent class. + +(N/A) Namespaces in ProcessDirectSQL + SQL statements based on class names can be passed to ProcessDirectSQL. If the + class names are prefixed with a namespace the method would fail. Namespaces are + now correctly handled. + +Modifications: +-------------- +(N/A) Improved Lazy Loading + It is now possible to lazy load associations. By marking an association as + retrieveAutomatic="lazy" the association will be populated with proxy objects + instead of full objects. For attribute based mappings use LazyLoad:=True in + the <AFAssociation()> attribute. + +(N/A) Improved formatting for DumpCacheDetails + + +--------------------------------- Changes in v2.0 RC1 (29-Oct-2004) Bugs: |