Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Compiler / CodeGeneration / CodeGenerationManager.cs / 1305376 / CodeGenerationManager.cs
namespace System.Workflow.ComponentModel.Compiler
{
using System;
using System.ComponentModel.Design.Serialization;
using System.Collections;
using System.Collections.Generic;
#region CodeGenerationManager
public sealed class CodeGenerationManager : IServiceProvider
{
private Hashtable hashOfGenerators = new Hashtable();
private IServiceProvider serviceProvider = null;
private ContextStack context = null;
public CodeGenerationManager(IServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
}
public ContextStack Context
{
get
{
if (this.context == null)
this.context = new ContextStack();
return this.context;
}
}
#region IServiceProvider Members
public object GetService(Type serviceType)
{
if (this.serviceProvider == null)
return null;
return this.serviceProvider.GetService(serviceType);
}
#endregion
public ActivityCodeGenerator[] GetCodeGenerators(Type type)
{
if (type == null)
throw new ArgumentNullException("type");
if (this.hashOfGenerators.Contains(type))
return ((List)this.hashOfGenerators[type]).ToArray();
List generators = new List();
// Return validators for other types such as Bind, XmolDocument, etc.
foreach (ActivityCodeGenerator generator in ComponentDispenser.CreateComponents(type, typeof(ActivityCodeGeneratorAttribute)))
{
generators.Add(generator);
}
this.hashOfGenerators[type] = generators;
return generators.ToArray();
}
}
#endregion
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
namespace System.Workflow.ComponentModel.Compiler
{
using System;
using System.ComponentModel.Design.Serialization;
using System.Collections;
using System.Collections.Generic;
#region CodeGenerationManager
public sealed class CodeGenerationManager : IServiceProvider
{
private Hashtable hashOfGenerators = new Hashtable();
private IServiceProvider serviceProvider = null;
private ContextStack context = null;
public CodeGenerationManager(IServiceProvider serviceProvider)
{
this.serviceProvider = serviceProvider;
}
public ContextStack Context
{
get
{
if (this.context == null)
this.context = new ContextStack();
return this.context;
}
}
#region IServiceProvider Members
public object GetService(Type serviceType)
{
if (this.serviceProvider == null)
return null;
return this.serviceProvider.GetService(serviceType);
}
#endregion
public ActivityCodeGenerator[] GetCodeGenerators(Type type)
{
if (type == null)
throw new ArgumentNullException("type");
if (this.hashOfGenerators.Contains(type))
return ((List)this.hashOfGenerators[type]).ToArray();
List generators = new List();
// Return validators for other types such as Bind, XmolDocument, etc.
foreach (ActivityCodeGenerator generator in ComponentDispenser.CreateComponents(type, typeof(ActivityCodeGeneratorAttribute)))
{
generators.Add(generator);
}
this.hashOfGenerators[type] = generators;
return generators.ToArray();
}
}
#endregion
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InertiaExpansionBehavior.cs
- MULTI_QI.cs
- X509ClientCertificateCredentialsElement.cs
- SqlClientFactory.cs
- XmlSchemaAttributeGroup.cs
- SaveLedgerEntryRequest.cs
- ProfileModule.cs
- TextProperties.cs
- LayoutEngine.cs
- HttpModuleCollection.cs
- SqlConnectionFactory.cs
- FlowDocumentReaderAutomationPeer.cs
- FillBehavior.cs
- GenericsNotImplementedException.cs
- SafeTimerHandle.cs
- Perspective.cs
- ToolboxBitmapAttribute.cs
- OpenFileDialog.cs
- DocumentPageTextView.cs
- InvalidCastException.cs
- WSFederationHttpBindingElement.cs
- KeyValueConfigurationElement.cs
- EdgeProfileValidation.cs
- LoginName.cs
- LayoutSettings.cs
- Enum.cs
- Utils.cs
- WebPartManager.cs
- QilTargetType.cs
- Brushes.cs
- SmtpReplyReaderFactory.cs
- SchemaNamespaceManager.cs
- AlgoModule.cs
- PageStatePersister.cs
- ListChangedEventArgs.cs
- ResXResourceReader.cs
- DefinitionUpdate.cs
- RoutedCommand.cs
- WbmpConverter.cs
- SEHException.cs
- TileBrush.cs
- PerformanceCounterTraceRecord.cs
- DataGridPagerStyle.cs
- SEHException.cs
- BaseValidator.cs
- GridViewCellAutomationPeer.cs
- ActionItem.cs
- CachedRequestParams.cs
- ProcessDesigner.cs
- HostingEnvironmentException.cs
- UnsafeNativeMethods.cs
- ParagraphVisual.cs
- BamlVersionHeader.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- OdbcConnectionFactory.cs
- OrthographicCamera.cs
- LockRecursionException.cs
- TileModeValidation.cs
- ObjectContextServiceProvider.cs
- CallInfo.cs
- VoiceInfo.cs
- MappedMetaModel.cs
- AnimationTimeline.cs
- StateMachine.cs
- Item.cs
- AvTraceDetails.cs
- TcpTransportElement.cs
- Command.cs
- HandlerFactoryCache.cs
- RequestDescription.cs
- ButtonChrome.cs
- TemplateParser.cs
- BindingExpressionBase.cs
- ReservationNotFoundException.cs
- RedirectionProxy.cs
- RowToFieldTransformer.cs
- ECDiffieHellmanCngPublicKey.cs
- NotFiniteNumberException.cs
- CanonicalizationDriver.cs
- Attributes.cs
- CallbackDebugElement.cs
- DetailsViewModeEventArgs.cs
- PageContentAsyncResult.cs
- LicenseManager.cs
- XmlSchemaObject.cs
- DataGridViewColumnDesigner.cs
- NameValueConfigurationElement.cs
- EventBuilder.cs
- RootBuilder.cs
- PackageProperties.cs
- AnimationException.cs
- SpeechSeg.cs
- DataGridViewBindingCompleteEventArgs.cs
- NamedPipeActivation.cs
- PasswordBox.cs
- ThicknessAnimationUsingKeyFrames.cs
- LineProperties.cs
- Oci.cs
- X509CertificateClaimSet.cs
- DrawingGroup.cs