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
- FtpRequestCacheValidator.cs
- ServiceOperationWrapper.cs
- AssemblyHelper.cs
- CultureInfoConverter.cs
- ReadOnlyDataSource.cs
- HandleScope.cs
- MatcherBuilder.cs
- SendKeys.cs
- PrePostDescendentsWalker.cs
- WebCategoryAttribute.cs
- BaseInfoTable.cs
- DateTimeValueSerializerContext.cs
- Size3D.cs
- InfoCardArgumentException.cs
- CqlParser.cs
- StringFunctions.cs
- Message.cs
- CharacterString.cs
- TemplatePropertyEntry.cs
- SRDisplayNameAttribute.cs
- MsmqTransportSecurity.cs
- TreeNodeBindingCollection.cs
- DispatcherExceptionFilterEventArgs.cs
- WebServiceClientProxyGenerator.cs
- VirtualPathUtility.cs
- PreDigestedSignedInfo.cs
- ScrollChangedEventArgs.cs
- ExtensionSimplifierMarkupObject.cs
- SqlUserDefinedAggregateAttribute.cs
- ExpressionBuilderContext.cs
- SR.cs
- UInt64Storage.cs
- BuildManagerHost.cs
- NamespaceList.cs
- AuthenticatingEventArgs.cs
- CompositeKey.cs
- BatchParser.cs
- PassportAuthenticationEventArgs.cs
- SQLInt32.cs
- GetPageNumberCompletedEventArgs.cs
- ProcessModule.cs
- XmlObjectSerializerReadContext.cs
- StaticResourceExtension.cs
- StorageTypeMapping.cs
- SizeAnimationUsingKeyFrames.cs
- HierarchicalDataBoundControl.cs
- SQLGuid.cs
- ComponentResourceKeyConverter.cs
- DynamicRendererThreadManager.cs
- Pair.cs
- BaseTemplateParser.cs
- PriorityBinding.cs
- SafePEFileHandle.cs
- CriticalHandle.cs
- CachedBitmap.cs
- _BasicClient.cs
- DataServiceResponse.cs
- SizeF.cs
- SerializationStore.cs
- DataColumnChangeEvent.cs
- listitem.cs
- MemberNameValidator.cs
- ipaddressinformationcollection.cs
- Maps.cs
- WebCategoryAttribute.cs
- UnSafeCharBuffer.cs
- ArgumentDesigner.xaml.cs
- DateTimeEditor.cs
- ECDsa.cs
- ThreadStateException.cs
- Section.cs
- ETagAttribute.cs
- PowerStatus.cs
- TextEditorMouse.cs
- BulletedListEventArgs.cs
- QilList.cs
- SemanticValue.cs
- SimpleMailWebEventProvider.cs
- HandlerMappingMemo.cs
- AccessibilityHelperForXpWin2k3.cs
- HealthMonitoringSectionHelper.cs
- MediaEntryAttribute.cs
- _DisconnectOverlappedAsyncResult.cs
- DisplayToken.cs
- DetailsViewUpdatedEventArgs.cs
- XmlRootAttribute.cs
- ReferencedAssembly.cs
- NetworkStream.cs
- DataGridViewRowsAddedEventArgs.cs
- RenderDataDrawingContext.cs
- VerificationAttribute.cs
- SoapHeaderException.cs
- AutomationFocusChangedEventArgs.cs
- ConfigUtil.cs
- GACIdentityPermission.cs
- MSAAWinEventWrap.cs
- MTConfigUtil.cs
- RegexWriter.cs
- StringToken.cs
- ToolStripSettings.cs