Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Markup / Baml2006 / WpfKnownTypeInvoker.cs / 1305600 / WpfKnownTypeInvoker.cs
using System; using System.Collections.Generic; using System.Xaml; using System.Xaml.Schema; namespace System.Windows.Baml2006 { class WpfKnownTypeInvoker : XamlTypeInvoker { WpfKnownType _type; public WpfKnownTypeInvoker(WpfKnownType type) : base(type) { _type = type; } public override object CreateInstance(object[] arguments) { if ((arguments == null || arguments.Length == 0) && _type.DefaultConstructor != null) { return _type.DefaultConstructor.Invoke(); } else if (_type.IsMarkupExtension) { Baml6ConstructorInfo ctorInfo; if(!_type.Constructors.TryGetValue(arguments.Length, out ctorInfo)) { throw new InvalidOperationException(SR.Get(SRID.PositionalArgumentsWrongLength)); } return ctorInfo.Constructor(arguments); } else { return base.CreateInstance(arguments); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UnsafePeerToPeerMethods.cs
- DateTimeValueSerializerContext.cs
- TextServicesCompartmentEventSink.cs
- IItemProperties.cs
- DesigntimeLicenseContextSerializer.cs
- SemanticAnalyzer.cs
- CompositeFontInfo.cs
- ISO2022Encoding.cs
- PeerCollaborationPermission.cs
- InternalControlCollection.cs
- WebEventCodes.cs
- KnownBoxes.cs
- Style.cs
- TypeElementCollection.cs
- SchemaAttDef.cs
- MultiByteCodec.cs
- InternalBufferManager.cs
- HitTestWithGeometryDrawingContextWalker.cs
- GatewayDefinition.cs
- ModuleConfigurationInfo.cs
- TemplateAction.cs
- AudioSignalProblemOccurredEventArgs.cs
- FormViewPagerRow.cs
- EncodingInfo.cs
- Polygon.cs
- DomainUpDown.cs
- Types.cs
- GeneralTransform.cs
- DataGrid.cs
- HMACMD5.cs
- SmiEventSink_Default.cs
- ImplicitInputBrush.cs
- FolderBrowserDialog.cs
- SchemaHelper.cs
- InstanceStoreQueryResult.cs
- AutomationPeer.cs
- AppSettingsExpressionEditor.cs
- SecurityTokenAuthenticator.cs
- ActionItem.cs
- TypeToken.cs
- SQLBoolean.cs
- DataGridViewRowHeaderCell.cs
- DataGridTextBox.cs
- SafeFileHandle.cs
- NamedPipeAppDomainProtocolHandler.cs
- InputLanguageCollection.cs
- ExternalCalls.cs
- SwitchDesigner.xaml.cs
- EntityDataSourceMemberPath.cs
- CursorConverter.cs
- ClonableStack.cs
- contentDescriptor.cs
- ToolStripContainerDesigner.cs
- DBDataPermission.cs
- ToolStripCollectionEditor.cs
- Stackframe.cs
- ConfigurationStrings.cs
- ListSortDescription.cs
- ToolStripDesigner.cs
- FlowLayoutPanel.cs
- TextSelectionHelper.cs
- DynamicMetaObjectBinder.cs
- DataGridTablesFactory.cs
- Light.cs
- FormParameter.cs
- StickyNoteAnnotations.cs
- InstanceKey.cs
- ListBoxItemWrapperAutomationPeer.cs
- ValueProviderWrapper.cs
- DictionaryBase.cs
- ProxySimple.cs
- WebPartUserCapability.cs
- NullPackagingPolicy.cs
- HttpVersion.cs
- MULTI_QI.cs
- TemplateComponentConnector.cs
- TreeIterator.cs
- ExpandedWrapper.cs
- NotifyInputEventArgs.cs
- ISAPIRuntime.cs
- ExitEventArgs.cs
- __Error.cs
- NameNode.cs
- TagNameToTypeMapper.cs
- System.Data.OracleClient_BID.cs
- Transform3DGroup.cs
- HtmlTableCellCollection.cs
- PixelFormatConverter.cs
- ReadOnlyKeyedCollection.cs
- MembershipUser.cs
- ControlType.cs
- SQLDateTimeStorage.cs
- Graphics.cs
- EnvelopedPkcs7.cs
- SystemIcons.cs
- DataSourceCacheDurationConverter.cs
- PageSetupDialog.cs
- DocumentApplication.cs
- fixedPageContentExtractor.cs
- Parser.cs