DialogBox.zip
DialogBox
bin
Debug
Infrastructure.Interface.dll
Infrastructure.Layout.dll
Infrastructure.Library.dll
Infrastructure.Module.dll
Microsoft.Practices.CompositeUI.dll
Microsoft.Practices.CompositeUI.WinForms.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
Microsoft.Practices.EnterpriseLibrary.Logging.dll
Microsoft.Practices.ObjectBuilder.dll
Module1.dll
Module1.Interface.dll
Shell.exe
Shell.vshost.exe
DialogBox.gpState
Lib
Microsoft.Practices.CompositeUI.dll
Microsoft.Practices.CompositeUI.WinForms.dll
Microsoft.Practices.CompositeUI.WPF.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
Microsoft.Practices.EnterpriseLibrary.Logging.dll
Microsoft.Practices.ObjectBuilder.dll
Microsoft.Practices.SmartClient.ConnectionMonitor.dll
Microsoft.Practices.SmartClient.DisconnectedAgent.dll
Microsoft.Practices.SmartClient.EndpointCatalog.dll
Microsoft.Practices.SmartClient.EnterpriseLibrary.dll
Module1
Module1.Interface
Constants
obj
Debug
Refactor
TempPE
Properties
Services
Module1
Constants
obj
Debug
Refactor
TempPE
Properties
Services
Views
DialogView
View1
Source
Infrastructure
Infrastructure.Interface
bin
Debug
Infrastructure.Interface.dll
Microsoft.Practices.CompositeUI.dll
Microsoft.Practices.CompositeUI.WinForms.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
Microsoft.Practices.ObjectBuilder.dll
BusinessEntities
Constants
obj
Debug
Refactor
TempPE
Properties
Services
Infrastructure.Layout
obj
Debug
Refactor
TempPE
Properties
Infrastructure.Library
bin
Debug
Infrastructure.Interface.dll
Infrastructure.Library.dll
Microsoft.Practices.CompositeUI.dll
Microsoft.Practices.CompositeUI.WinForms.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
Microsoft.Practices.ObjectBuilder.dll
BuilderStrategies
EntityTranslators
EntLib
obj
Debug
Refactor
TempPE
Properties
Services
UI
Web References
Infrastructure.Module
obj
Debug
Refactor
TempPE
Properties
Shell
obj
Debug
Refactor
TempPE
Properties
SculptureExample.zip
NHibernate+ASMX
SculptureExample
DataAccess
bin
Debug
GeneratedCode
Repositories
Implementation
Interface
obj
Debug
TempPE
Properties
SQL
Entities
bin
Debug
GeneratedCode
Entities
Mappings
obj
Debug
TempPE
Properties
Lib
Castle.DynamicProxy.dll
Iesi.Collections.dll
log4net.dll
NHibernate.dll
Model
bin
Debug
MyFirstModel.Sculpture
MyFirstModel.Sculpture.diagram
obj
Debug
TempPE
Properties
SculptureExample.gpState
Service
bin
Debug
CustomCode
Services
Translators
GeneratedCode
DataContracts
Services
Contracts
Implementations
obj
Debug
TempPE
Properties
WCFHost
App_Data
bin
obj
Debug
build.force
TempPE
Properties
Services
CategoriesService.svc
ProductsService.svc
WCFHost.csproj.user
WCFService
bin
Debug
CustomCode
Services
Translators
GeneratedCode
DataContracts
Services
Contracts
Implementations
obj
Debug
TempPE
Properties
WebService
App_Data
bin
obj
Debug
TempPE
Properties
Services
WebService.csproj.user
WCF+LINQ
SculptureExample
DataAccess
bin
Debug
GeneratedCode
Repositories
Implementation
Interface
obj
Debug
TempPE
Properties
Settings.settings
SQL
Entities
bin
Debug
GeneratedCode
Entities
obj
Debug
TempPE
Properties
Model
bin
Debug
MyFirstModel.Sculpture
MyFirstModel.Sculpture.diagram
obj
Debug
TempPE
Properties
SculptureExample.gpState
WCFHost
App_Data
bin
obj
Debug
TempPE
Properties
Services
CategoriesService.svc
ProductsService.svc
WCFHost.csproj.user
WCFService
bin
Debug
CustomCode
Services
Translators
GeneratedCode
DataContracts
Services
Contracts
Implementations
obj
Debug
TempPE
Properties
SculptureExample_WPFMold.zip
SculptureExample
DataAccess
bin
Debug
GeneratedCode
Repositories
Implementation
Interface
obj
Debug
TempPE
Properties
SQL
Entities
bin
Debug
GeneratedCode
Entities
Mappings
obj
Debug
TempPE
Properties
Lib
Castle.DynamicProxy.dll
Iesi.Collections.dll
log4net.dll
NHibernate.dll
Model
bin
Debug
MyFirstModel.Sculpture
MyFirstModel.Sculpture.diagram
obj
Debug
TempPE
Properties
SculptureExample.gpState
SculptureExample.suo
Service
bin
Debug
CustomCode
Services
Translators
GeneratedCode
DataContracts
Services
Contracts
Implementations
obj
Debug
TempPE
Properties
WPFApplication
bin
Debug
WPFApplication.vshost.exe
WPFApplication.vshost.exe.manifest
Controls
obj
Debug
Controls
TempPE
Properties
Settings.settings
WPFMold
WPFMold.gpState
WPFMold.suo
WPFMold
Helpers
Lib
Dawliasoft.Sculpture.Common.dll
Dawliasoft.Sculpture.Dsl.dll
obj
Debug
TempPE
Resource1.Designer.cs.dll
SampleUserControl_cs.cs.dll
SampleUserControl_xaml.cs.dll
SampleUserControl_xaml_cs.cs.dll
Window1_xaml.cs.dll
Window1_xaml_cs.cs.dll
Windows1_cs.cs.dll
Windows1_xaml.cs.dll
Output
bin
Microsoft.Data.ConnectionUI.Dialog.dll
Microsoft.Data.ConnectionUI.dll
Microsoft.Practices.RecipeFramework.Extensions.dll
Microsoft.Practices.RepositoryFactory.SchemaDiscovery.dll
Mold3.pdb
MoldBase.dll
MoldBase.pdb
Output
Template
Templates
WPFMold.Mold
Properties
Resources
ThemeBitmap.bmp
|
//----------------------------------------------------------------------------------------
// patterns & practices - Smart Client Software Factory - Guidance Package
//
// The BaseTranslator class is a base helper implementation of an IEntityTranslator
//
// For more information see:
// ms-help://MS.VSCC.v80/MS.VSIPCC.v80/ms.practices.scsf.2007may/SCSF/html/03-01-090-How_to_Translate_Between_Business_Entities_and_Service_Entities.htm
//
// Latest version of this Guidance Package: http://go.microsoft.com/fwlink/?LinkId=62182
//----------------------------------------------------------------------------------------
using System;
using DialogBox.Infrastructure.Interface.Services;
namespace DialogBox.Infrastructure.Library.EntityTranslators
{
public abstract class BaseTranslator : IEntityTranslator
{
public abstract bool CanTranslate(Type targetType, Type sourceType);
public bool CanTranslate<TTarget, TSource>()
{
return CanTranslate(typeof(TTarget), typeof(TSource));
}
public TTarget Translate<TTarget>(IEntityTranslatorService service, object source)
{
return (TTarget)Translate(service, typeof(TTarget), source);
}
public abstract object Translate(IEntityTranslatorService service, Type targetType, object source);
}
}
|
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.