Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / View / ImportedNamespaceContextItem.cs / 1305376 / ImportedNamespaceContextItem.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Hosting { using System; using System.Runtime; using System.Collections.ObjectModel; using System.Activities.Presentation.Services; using System.Activities.Presentation.Model; [Fx.Tag.XamlVisible(false)] public sealed class ImportedNamespaceContextItem : ContextItem { bool initialized = false; CollectionimportedNamespaces; public Collection ImportedNamespaces { get { if (this.importedNamespaces == null) { initialized = true; this.importedNamespaces = new Collection (); } return this.importedNamespaces; } } public override Type ItemType { get { return typeof(ImportedNamespaceContextItem); } } public void EnsureInitialized(EditingContext context) { if (!initialized) { ModelService modelService = context.Services.GetService (); Fx.Assert(modelService != null, "ModelService shouldn't be null in EditingContext."); Fx.Assert(modelService.Root != null, "model must have a root"); ModelItemCollection importsModelItem = modelService.Root.Properties[NamespaceListPropertyDescriptor.ImportCollectionPropertyName].Collection; Fx.Assert(importsModelItem != null, "root must have imports"); foreach (ModelItem import in importsModelItem) { this.ImportedNamespaces.Add(import.Properties[NamespaceListPropertyDescriptor.NamespacePropertyName].ComputedValue as string); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.Hosting { using System; using System.Runtime; using System.Collections.ObjectModel; using System.Activities.Presentation.Services; using System.Activities.Presentation.Model; [Fx.Tag.XamlVisible(false)] public sealed class ImportedNamespaceContextItem : ContextItem { bool initialized = false; Collection importedNamespaces; public Collection ImportedNamespaces { get { if (this.importedNamespaces == null) { initialized = true; this.importedNamespaces = new Collection (); } return this.importedNamespaces; } } public override Type ItemType { get { return typeof(ImportedNamespaceContextItem); } } public void EnsureInitialized(EditingContext context) { if (!initialized) { ModelService modelService = context.Services.GetService (); Fx.Assert(modelService != null, "ModelService shouldn't be null in EditingContext."); Fx.Assert(modelService.Root != null, "model must have a root"); ModelItemCollection importsModelItem = modelService.Root.Properties[NamespaceListPropertyDescriptor.ImportCollectionPropertyName].Collection; Fx.Assert(importsModelItem != null, "root must have imports"); foreach (ModelItem import in importsModelItem) { this.ImportedNamespaces.Add(import.Properties[NamespaceListPropertyDescriptor.NamespacePropertyName].ComputedValue as string); } } } } } // 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
- SqlNotificationEventArgs.cs
- SectionXmlInfo.cs
- TokenDescriptor.cs
- GuidelineCollection.cs
- BStrWrapper.cs
- SafeNativeMethodsMilCoreApi.cs
- MenuBase.cs
- XmlCDATASection.cs
- DataSourceView.cs
- PerformanceCountersElement.cs
- NetStream.cs
- MimeFormatter.cs
- RegexCaptureCollection.cs
- WhitespaceRule.cs
- tabpagecollectioneditor.cs
- CompilerCollection.cs
- NavigationCommands.cs
- TagElement.cs
- TreeIterators.cs
- ProfileEventArgs.cs
- DecoratedNameAttribute.cs
- XmlBufferedByteStreamReader.cs
- SByteStorage.cs
- CompiledIdentityConstraint.cs
- OracleNumber.cs
- FirstMatchCodeGroup.cs
- SafeTimerHandle.cs
- PageParser.cs
- HttpModuleAction.cs
- ExtensionDataReader.cs
- SimpleTextLine.cs
- ProxyHwnd.cs
- SafeBuffer.cs
- NodeInfo.cs
- ProcessHostServerConfig.cs
- XmlAttributeOverrides.cs
- SqlLiftIndependentRowExpressions.cs
- DropShadowBitmapEffect.cs
- XmlNullResolver.cs
- EntityStoreSchemaGenerator.cs
- HwndHostAutomationPeer.cs
- WebReferencesBuildProvider.cs
- OrderedDictionary.cs
- ButtonChrome.cs
- EditorPartChrome.cs
- SpellerStatusTable.cs
- XamlTemplateSerializer.cs
- SolidColorBrush.cs
- MethodExpr.cs
- CodeTypeDeclarationCollection.cs
- ClientFormsAuthenticationMembershipProvider.cs
- MemberPath.cs
- DynamicValidatorEventArgs.cs
- WebHttpDispatchOperationSelector.cs
- invalidudtexception.cs
- FixedLineResult.cs
- InvalidProgramException.cs
- TablePattern.cs
- CodeNamespaceImport.cs
- RowToParametersTransformer.cs
- MulticastIPAddressInformationCollection.cs
- ThumbButtonInfo.cs
- ProcessHost.cs
- SByteStorage.cs
- SHA384Cng.cs
- WebBrowser.cs
- Graph.cs
- TearOffProxy.cs
- SynchronizationLockException.cs
- EraserBehavior.cs
- DeclarativeCatalogPart.cs
- TemplatedWizardStep.cs
- LassoSelectionBehavior.cs
- ProfileSection.cs
- ExtendedPropertiesHandler.cs
- DesignSurface.cs
- StringUtil.cs
- TimeZoneInfo.cs
- DictionaryKeyPropertyAttribute.cs
- RequestQueryProcessor.cs
- DoubleAnimationClockResource.cs
- CodeChecksumPragma.cs
- HttpPostProtocolImporter.cs
- StatusStrip.cs
- ClockController.cs
- DependentList.cs
- FlowDocumentPage.cs
- ManifestBasedResourceGroveler.cs
- IsolatedStoragePermission.cs
- LineVisual.cs
- StoreContentChangedEventArgs.cs
- RectAnimationBase.cs
- SqlClientFactory.cs
- ImageBrush.cs
- XslCompiledTransform.cs
- DefaultParameterValueAttribute.cs
- PublishLicense.cs
- CustomErrorCollection.cs
- Number.cs
- ITextView.cs