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
- SafePEFileHandle.cs
- Logging.cs
- LongValidatorAttribute.cs
- IPGlobalProperties.cs
- DataControlPagerLinkButton.cs
- ProtocolState.cs
- MergablePropertyAttribute.cs
- MailDefinition.cs
- DetailsViewRow.cs
- GatewayDefinition.cs
- DbDataSourceEnumerator.cs
- TagPrefixInfo.cs
- DataGridViewCellFormattingEventArgs.cs
- CodeComment.cs
- StorageComplexPropertyMapping.cs
- UIElement3D.cs
- SelectionList.cs
- OperandQuery.cs
- GorillaCodec.cs
- XmlSchemaObject.cs
- SmtpLoginAuthenticationModule.cs
- CodeMemberField.cs
- ConfigurationSchemaErrors.cs
- TabItemAutomationPeer.cs
- DrawingAttributes.cs
- AnnotationStore.cs
- SignatureResourceHelper.cs
- FrameworkTemplate.cs
- SecurityPolicySection.cs
- ServiceDescriptions.cs
- CatalogPartCollection.cs
- NTAccount.cs
- DesignDataSource.cs
- EndPoint.cs
- ExecutedRoutedEventArgs.cs
- XPathDocument.cs
- ResourcesChangeInfo.cs
- _ListenerAsyncResult.cs
- DataGridViewSelectedCellCollection.cs
- UIElementHelper.cs
- TypeListConverter.cs
- StylusEventArgs.cs
- XmlSerializerAssemblyAttribute.cs
- BaseValidator.cs
- FirstMatchCodeGroup.cs
- TextComposition.cs
- ContractUtils.cs
- XmlArrayAttribute.cs
- ComboBox.cs
- StringSource.cs
- HttpRequestTraceRecord.cs
- GridViewRowPresenter.cs
- TableCell.cs
- PrintController.cs
- ByteStack.cs
- ListViewItemSelectionChangedEvent.cs
- QilChoice.cs
- XMLDiffLoader.cs
- SHA384Managed.cs
- WindowsListView.cs
- Point3DAnimation.cs
- StorageMappingFragment.cs
- FileLogRecordStream.cs
- Monitor.cs
- NativeMethods.cs
- DataSourceSelectArguments.cs
- ArrayItemValue.cs
- pingexception.cs
- ItemCheckEvent.cs
- AccessText.cs
- TypeResolver.cs
- MapPathBasedVirtualPathProvider.cs
- ValueChangedEventManager.cs
- WebPartConnectionsCancelEventArgs.cs
- SecurityListenerSettingsLifetimeManager.cs
- ListQueryResults.cs
- DependencyObjectProvider.cs
- StatusBarDrawItemEvent.cs
- StrongName.cs
- DataGridViewDataErrorEventArgs.cs
- FontDifferentiator.cs
- PermissionListSet.cs
- XmlSignificantWhitespace.cs
- OrderedHashRepartitionEnumerator.cs
- ComponentConverter.cs
- FileNameEditor.cs
- RegisteredDisposeScript.cs
- ButtonField.cs
- GacUtil.cs
- TextProviderWrapper.cs
- AnimationTimeline.cs
- RowSpanVector.cs
- Terminate.cs
- FlowPosition.cs
- AutoCompleteStringCollection.cs
- XmlAttributeOverrides.cs
- TraceLevelStore.cs
- PriorityQueue.cs
- Trace.cs
- DebugTracing.cs