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
- HttpModulesSection.cs
- AnnouncementEventArgs.cs
- MatrixStack.cs
- GridLengthConverter.cs
- ActivityBindForm.cs
- TreeView.cs
- AdapterDictionary.cs
- SecUtil.cs
- DateTimeFormatInfoScanner.cs
- XmlIncludeAttribute.cs
- ColumnWidthChangingEvent.cs
- SystemIPv6InterfaceProperties.cs
- OracleParameter.cs
- ClientSettingsSection.cs
- ComponentCollection.cs
- RequestCachingSection.cs
- XmlSchemaObject.cs
- AppDomainUnloadedException.cs
- DynamicDocumentPaginator.cs
- AttachmentCollection.cs
- SQLInt16.cs
- ExpressionNode.cs
- TextParagraphProperties.cs
- Gdiplus.cs
- TimeZone.cs
- BrowsableAttribute.cs
- ManagementScope.cs
- ControlIdConverter.cs
- OutputCacheProfileCollection.cs
- ImageUrlEditor.cs
- StreamAsIStream.cs
- Model3D.cs
- ShutDownListener.cs
- ExpressionsCollectionEditor.cs
- XamlTypeMapper.cs
- GifBitmapEncoder.cs
- DataServiceQueryException.cs
- AnimationTimeline.cs
- RadioButtonStandardAdapter.cs
- HitTestWithGeometryDrawingContextWalker.cs
- NavigationPropertyEmitter.cs
- VSWCFServiceContractGenerator.cs
- CheckPair.cs
- DeflateStream.cs
- RouteValueDictionary.cs
- DataGridViewCellLinkedList.cs
- SecurityStandardsManager.cs
- ChannelOptions.cs
- JournalNavigationScope.cs
- RegexGroupCollection.cs
- ColorConvertedBitmapExtension.cs
- GridViewCancelEditEventArgs.cs
- StringUtil.cs
- ReferentialConstraint.cs
- Image.cs
- WSMessageEncoding.cs
- WaitHandleCannotBeOpenedException.cs
- Transform3DGroup.cs
- XmlTextEncoder.cs
- DependencyPropertyAttribute.cs
- MulticastDelegate.cs
- HttpVersion.cs
- FileLoadException.cs
- ContainsRowNumberChecker.cs
- WpfWebRequestHelper.cs
- DataGridViewAccessibleObject.cs
- CodeNamespace.cs
- Vector3DKeyFrameCollection.cs
- Literal.cs
- SamlConditions.cs
- StringAttributeCollection.cs
- BuildDependencySet.cs
- StorageFunctionMapping.cs
- PenThreadPool.cs
- AssemblyResourceLoader.cs
- GraphicsPathIterator.cs
- EdmComplexTypeAttribute.cs
- WindowsListViewItemCheckBox.cs
- UnmanagedHandle.cs
- ToolStripDropDownClosedEventArgs.cs
- WindowsAuthenticationModule.cs
- _NetRes.cs
- DataGridViewAdvancedBorderStyle.cs
- DependencyObject.cs
- WsatConfiguration.cs
- ActivityWithResultValueSerializer.cs
- FrameworkRichTextComposition.cs
- OdbcException.cs
- XmlWrappingReader.cs
- ServiceProviders.cs
- JapaneseLunisolarCalendar.cs
- ResourcePermissionBaseEntry.cs
- ListViewHitTestInfo.cs
- BitmapFrame.cs
- RouteData.cs
- DbProviderFactory.cs
- MILUtilities.cs
- ObjectCache.cs
- FunctionNode.cs
- FuncCompletionCallbackWrapper.cs