Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / Microsoft / VisualBasic / Activities / VisualBasicSettings.cs / 1407647 / VisualBasicSettings.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.VisualBasic.Activities { using Microsoft.VisualBasic.Activities.XamlIntegration; using System; using System.Activities; using System.Collections.Generic; using System.Runtime; using System.Windows.Markup; using System.Xaml; using System.ComponentModel; using System.Reflection; [ValueSerializer(typeof(VisualBasicSettingsValueSerializer))] [TypeConverter(typeof(VisualBasicSettingsConverter))] public class VisualBasicSettings { static readonly HashSetdefaultImportReferences = new HashSet () { //"mscorlib" new VisualBasicImportReference { Import = "System", Assembly = "mscorlib" }, new VisualBasicImportReference { Import = "System.Collections", Assembly = "mscorlib" }, new VisualBasicImportReference { Import = "System.Collections.Generic", Assembly = "mscorlib" }, //"system" new VisualBasicImportReference { Import = "System", Assembly = "system" }, new VisualBasicImportReference { Import = "System.Collections.Generic", Assembly = "system" }, //"System.Activities" new VisualBasicImportReference { Import = "System.Activities", Assembly = "System.Activities" }, new VisualBasicImportReference { Import = "System.Activities.Statements", Assembly = "System.Activities" }, new VisualBasicImportReference { Import = "System.Activities.Expressions", Assembly = "System.Activities" }, }; static VisualBasicSettings defaultSettings = new VisualBasicSettings(defaultImportReferences); public VisualBasicSettings() { this.ImportReferences = new HashSet (); } VisualBasicSettings(HashSet importReferences) { Fx.Assert(importReferences != null, "caller must verify"); this.ImportReferences = new HashSet (importReferences); } public static VisualBasicSettings Default { get { return defaultSettings; } } // hide from XAML since the value serializer can't suppress yet [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public ISet ImportReferences { get; private set; } internal bool SuppressXamlSerialization { get; set; } internal void GenerateXamlReferences(IValueSerializerContext context) { // promote settings to xmlns declarations INamespacePrefixLookup namespaceLookup = GetService (context); foreach (VisualBasicImportReference importReference in this.ImportReferences) { importReference.GenerateXamlNamespace(namespaceLookup); } } internal static T GetService (ITypeDescriptorContext context) where T : class { T service = (T)context.GetService(typeof(T)); if (service == null) { throw FxTrace.Exception.AsError(new InvalidOperationException(SR.InvalidTypeConverterUsage)); } return service; } } } // 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
- StylusPointProperties.cs
- RefType.cs
- PointF.cs
- FloatUtil.cs
- NGCSerializerAsync.cs
- SQLSingleStorage.cs
- GCHandleCookieTable.cs
- AttachedPropertiesService.cs
- LoadRetryAsyncResult.cs
- FolderLevelBuildProvider.cs
- FormsIdentity.cs
- ZipFileInfoCollection.cs
- SessionSwitchEventArgs.cs
- FlowLayoutPanel.cs
- ToolStripItemClickedEventArgs.cs
- ConcatQueryOperator.cs
- HitTestParameters.cs
- HttpCachePolicyElement.cs
- TemplateNameScope.cs
- OracleConnection.cs
- CommentEmitter.cs
- DocumentApplicationJournalEntry.cs
- ComponentDispatcher.cs
- ExpressionNormalizer.cs
- DesigntimeLicenseContextSerializer.cs
- typedescriptorpermissionattribute.cs
- SpeechDetectedEventArgs.cs
- XMLSchema.cs
- EndpointAddressProcessor.cs
- DynamicArgumentDialog.cs
- ConnectionManagementSection.cs
- OracleParameter.cs
- AnnotationAuthorChangedEventArgs.cs
- XmlSchemaComplexContent.cs
- SoapAttributeOverrides.cs
- HwndHostAutomationPeer.cs
- TypeConverterHelper.cs
- Baml6Assembly.cs
- ObjectSelectorEditor.cs
- WorkflowMarkupSerializerMapping.cs
- PlatformNotSupportedException.cs
- XMLUtil.cs
- WmlValidationSummaryAdapter.cs
- ellipse.cs
- MasterPageBuildProvider.cs
- DataServiceEntityAttribute.cs
- HttpCapabilitiesEvaluator.cs
- WorkflowMarkupElementEventArgs.cs
- PolyLineSegmentFigureLogic.cs
- CodeComment.cs
- RequestCacheManager.cs
- DocumentNUp.cs
- TypeLoadException.cs
- TextPointerBase.cs
- RequestSecurityTokenResponse.cs
- SafeSecurityHelper.cs
- HttpCookiesSection.cs
- Configuration.cs
- DrawingContext.cs
- TransformPattern.cs
- SqlDataSourceCommandEventArgs.cs
- AppDomainProtocolHandler.cs
- HttpRequestContext.cs
- FormViewCommandEventArgs.cs
- AutomationEventArgs.cs
- SoapReflector.cs
- Base64Decoder.cs
- DataGridViewCellPaintingEventArgs.cs
- OrderingExpression.cs
- WinEventWrap.cs
- Pen.cs
- EnumerableRowCollection.cs
- EastAsianLunisolarCalendar.cs
- QueryTaskGroupState.cs
- DBConnection.cs
- IndentedTextWriter.cs
- DataObjectMethodAttribute.cs
- DataTableTypeConverter.cs
- ContentElementAutomationPeer.cs
- CharEntityEncoderFallback.cs
- DocobjHost.cs
- assemblycache.cs
- Byte.cs
- MenuCommand.cs
- ExitEventArgs.cs
- NavigationProperty.cs
- CapabilitiesState.cs
- _emptywebproxy.cs
- FlowLayoutPanel.cs
- StorageModelBuildProvider.cs
- SqlConnectionManager.cs
- DataTrigger.cs
- PropertyItemInternal.cs
- ThreadStartException.cs
- TdsParameterSetter.cs
- StretchValidation.cs
- WorkflowMarkupSerializer.cs
- TrackingStringDictionary.cs
- AtomServiceDocumentSerializer.cs
- NonVisualControlAttribute.cs