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
- ObjectItemAssemblyLoader.cs
- RTLAwareMessageBox.cs
- EdmError.cs
- CalendarDataBindingHandler.cs
- coordinator.cs
- DetailsViewUpdateEventArgs.cs
- LinearGradientBrush.cs
- InputScopeConverter.cs
- TraceLog.cs
- OdbcConnectionOpen.cs
- Cell.cs
- DataSourceXmlAttributeAttribute.cs
- RadioButton.cs
- CodeDirectiveCollection.cs
- StringAnimationUsingKeyFrames.cs
- Material.cs
- ZipIOLocalFileDataDescriptor.cs
- NavigationPropertyEmitter.cs
- TypeForwardedToAttribute.cs
- WinEventWrap.cs
- LateBoundBitmapDecoder.cs
- DbParameterHelper.cs
- PlainXmlDeserializer.cs
- ImageAutomationPeer.cs
- CellNormalizer.cs
- OracleCommand.cs
- TextHidden.cs
- TextControl.cs
- PagerSettings.cs
- OleStrCAMarshaler.cs
- TTSEngineTypes.cs
- odbcmetadatafactory.cs
- XmlSchemaValidationException.cs
- XmlExceptionHelper.cs
- SystemDropShadowChrome.cs
- WhitespaceRule.cs
- NumberFormatInfo.cs
- ChtmlPhoneCallAdapter.cs
- RenderingEventArgs.cs
- Touch.cs
- CheckableControlBaseAdapter.cs
- StretchValidation.cs
- TdsParserSafeHandles.cs
- DoubleAnimation.cs
- ModuleBuilderData.cs
- WebPartConnectionsCancelEventArgs.cs
- DefaultAssemblyResolver.cs
- ObjectToken.cs
- ImageAnimator.cs
- PrintEvent.cs
- ObjectListCommandsPage.cs
- TextBoxLine.cs
- BamlRecordHelper.cs
- ListViewItem.cs
- Internal.cs
- PostBackTrigger.cs
- BitConverter.cs
- MediaContextNotificationWindow.cs
- UnsafeNativeMethods.cs
- TypographyProperties.cs
- Int32EqualityComparer.cs
- SqlUdtInfo.cs
- ConstructorNeedsTagAttribute.cs
- LicenseManager.cs
- TakeOrSkipQueryOperator.cs
- ExpressionEvaluator.cs
- LoadedOrUnloadedOperation.cs
- CultureInfoConverter.cs
- ConnectionConsumerAttribute.cs
- PropertyChange.cs
- DummyDataSource.cs
- WizardPanel.cs
- MinimizableAttributeTypeConverter.cs
- KnownColorTable.cs
- DelegatedStream.cs
- QilDataSource.cs
- CodePageUtils.cs
- LayoutEditorPart.cs
- DataExchangeServiceBinder.cs
- LZCodec.cs
- ReferenceEqualityComparer.cs
- Model3DGroup.cs
- DisableDpiAwarenessAttribute.cs
- SafeNativeMethods.cs
- EventsTab.cs
- NamedPipeConnectionPoolSettingsElement.cs
- DashStyle.cs
- StretchValidation.cs
- RegexCompilationInfo.cs
- TraceHwndHost.cs
- UrlPropertyAttribute.cs
- InkCanvasInnerCanvas.cs
- Solver.cs
- BaseDataList.cs
- DbConvert.cs
- DataContractAttribute.cs
- MailBnfHelper.cs
- TreeViewAutomationPeer.cs
- TypeResolver.cs
- Visual3D.cs