Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Debugger / State.cs / 1305376 / State.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Activities.Debugger { using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime; using System.Diagnostics.CodeAnalysis; // Describes a "state" in the interpretter. A state is any source location that // a breakpoint could be set on or that could be stepped to. [DebuggerNonUserCode] [Fx.Tag.XamlVisible(false)] public class State { SourceLocation location; string name; IEnumerableearlyLocals; int numberOfEarlyLocals; // Calling Type.GetMethod() is slow (10,000 calls can take ~1 minute). // So we stash extra fields to be able to make the call lazily (as we Enter the state). // this.type.GetMethod Type type; string methodName; internal State(SourceLocation location, string name, IEnumerable earlyLocals, int numberOfEarlyLocals) { this.location = location; this.name = name; this.earlyLocals = earlyLocals; Fx.Assert(earlyLocals != null || numberOfEarlyLocals == 0, "If earlyLocals is null then numberOfEarlyLocals should be 0"); // Ignore the passed numberOfEarlyLocals if earlyLocal is null. this.numberOfEarlyLocals = (earlyLocals == null) ? 0 : numberOfEarlyLocals; } // Location in source file associated with this state. internal SourceLocation Location { get { return this.location; } } // Friendly name of the state. May be null if state is not named. // States need unique names. internal string Name { get { return this.name; } } // Type definitions for early bound locals. This list is ordered. // Names should be unique. internal IEnumerable EarlyLocals { get { return this.earlyLocals; } } internal int NumberOfEarlyLocals { get { return this.numberOfEarlyLocals; } } internal void CacheMethodInfo(Type type, string methodName) { this.type = type; this.methodName = methodName; } // Helper to lazily get the MethodInfo. This is expensive, so caller should cache it. internal MethodInfo GetMethodInfo(bool withPriming) { MethodInfo methodInfo = this.type.GetMethod(withPriming ? StateManager.MethodWithPrimingPrefix + this.methodName : this.methodName); return methodInfo; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OpCodes.cs
- RootBuilder.cs
- ComponentConverter.cs
- ComplexPropertyEntry.cs
- SiteOfOriginPart.cs
- BoundPropertyEntry.cs
- BidOverLoads.cs
- WindowInteractionStateTracker.cs
- XmlDataProvider.cs
- HMACSHA1.cs
- TemplatedWizardStep.cs
- StylusPlugin.cs
- BamlResourceContent.cs
- SecurityDescriptor.cs
- ListViewEditEventArgs.cs
- DataSourceHelper.cs
- serverconfig.cs
- WeakRefEnumerator.cs
- QilGeneratorEnv.cs
- CompareValidator.cs
- DiagnosticsConfigurationHandler.cs
- UserPreferenceChangedEventArgs.cs
- TemplateFactory.cs
- NameSpaceEvent.cs
- TimeStampChecker.cs
- DesigntimeLicenseContextSerializer.cs
- HelpEvent.cs
- TaiwanCalendar.cs
- HttpsHostedTransportConfiguration.cs
- userdatakeys.cs
- UrlPropertyAttribute.cs
- TabControlEvent.cs
- CatalogPartChrome.cs
- QueryCreatedEventArgs.cs
- BasicSecurityProfileVersion.cs
- DebugController.cs
- BehaviorEditorPart.cs
- SoapSchemaMember.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- TrackBar.cs
- PriorityRange.cs
- CompositeDataBoundControl.cs
- ColorConverter.cs
- BinaryKeyIdentifierClause.cs
- DesignerTransactionCloseEvent.cs
- SafeFileHandle.cs
- EntityDataSourceSelectedEventArgs.cs
- PropertyPathWorker.cs
- RegexTypeEditor.cs
- EventProviderClassic.cs
- AdornerPresentationContext.cs
- SqlConnectionHelper.cs
- InheritanceUI.cs
- _DigestClient.cs
- TcpClientCredentialType.cs
- StorageAssociationTypeMapping.cs
- TreeViewImageIndexConverter.cs
- PersonalizationStateInfoCollection.cs
- DataSourceExpressionCollection.cs
- BindingNavigator.cs
- OperationContractAttribute.cs
- SQLSingleStorage.cs
- MetadataItemEmitter.cs
- BrowserDefinition.cs
- MSG.cs
- AssemblyAssociatedContentFileAttribute.cs
- XmlCDATASection.cs
- WebPartCancelEventArgs.cs
- PresentationAppDomainManager.cs
- DesignSurfaceEvent.cs
- TdsParameterSetter.cs
- Directory.cs
- XomlCompiler.cs
- OverlappedAsyncResult.cs
- Exceptions.cs
- SpecularMaterial.cs
- OptimalTextSource.cs
- SubstitutionList.cs
- RegexNode.cs
- ComponentConverter.cs
- SubqueryRules.cs
- RemotingSurrogateSelector.cs
- AuthorizationSection.cs
- XmlEnumAttribute.cs
- XmlSchemaSimpleContentRestriction.cs
- EditorAttributeInfo.cs
- ResourceDictionary.cs
- TableRowGroup.cs
- _BufferOffsetSize.cs
- DataPager.cs
- ChangeProcessor.cs
- DocumentOrderComparer.cs
- PerformanceCounterManager.cs
- EraserBehavior.cs
- EntityConnectionStringBuilderItem.cs
- OutputCacheModule.cs
- SerializationInfoEnumerator.cs
- XmlReflectionImporter.cs
- ListItemsPage.cs
- LiteralText.cs