Code:
/ 4.0 / 4.0 / 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. 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
- FtpCachePolicyElement.cs
- UnauthorizedWebPart.cs
- CodeAttachEventStatement.cs
- QilFactory.cs
- FrameworkTemplate.cs
- SafeCryptoHandles.cs
- sqlcontext.cs
- WarningException.cs
- SamlSerializer.cs
- TransactionState.cs
- FacetValues.cs
- ProcessInputEventArgs.cs
- ActivityPropertyReference.cs
- WindowsSlider.cs
- XhtmlConformanceSection.cs
- AutoScrollHelper.cs
- documentation.cs
- DriveNotFoundException.cs
- LocalizableAttribute.cs
- StoragePropertyMapping.cs
- CachedCompositeFamily.cs
- Qualifier.cs
- TemplateNodeContextMenu.cs
- FilteredXmlReader.cs
- CachingHintValidation.cs
- validationstate.cs
- Light.cs
- HitTestFilterBehavior.cs
- __Filters.cs
- PassportPrincipal.cs
- SubqueryTrackingVisitor.cs
- MailBnfHelper.cs
- Rotation3DAnimationUsingKeyFrames.cs
- Image.cs
- documentsequencetextcontainer.cs
- CompositeCollection.cs
- ZipIOBlockManager.cs
- PageParser.cs
- HashHelper.cs
- RuleAttributes.cs
- HttpValueCollection.cs
- TemplatePagerField.cs
- GeneralTransformGroup.cs
- InboundActivityHelper.cs
- RequestCacheManager.cs
- exports.cs
- LoginAutoFormat.cs
- MachineKeySection.cs
- RadioButtonFlatAdapter.cs
- FormView.cs
- BamlRecordReader.cs
- EnumerableRowCollection.cs
- EventToken.cs
- TextViewSelectionProcessor.cs
- QueryFunctions.cs
- FtpWebRequest.cs
- MapPathBasedVirtualPathProvider.cs
- MessageBox.cs
- FuncCompletionCallbackWrapper.cs
- AffineTransform3D.cs
- BridgeDataRecord.cs
- XPathItem.cs
- DataTableExtensions.cs
- AdornedElementPlaceholder.cs
- InstanceContextManager.cs
- EncoderFallback.cs
- SqlXmlStorage.cs
- ObjectQueryExecutionPlan.cs
- LocatorBase.cs
- SeparatorAutomationPeer.cs
- CanonicalXml.cs
- ControlPaint.cs
- ExtensionDataReader.cs
- FileNotFoundException.cs
- VectorCollection.cs
- ClrPerspective.cs
- GlyphInfoList.cs
- LineBreak.cs
- DataColumnMapping.cs
- ChameleonKey.cs
- RawAppCommandInputReport.cs
- WorkflowPersistenceService.cs
- InvokeSchedule.cs
- Matrix3DConverter.cs
- XmlSchemaSimpleContentRestriction.cs
- exports.cs
- WebPartActionVerb.cs
- PathTooLongException.cs
- LookupNode.cs
- NullableFloatSumAggregationOperator.cs
- ProfileSettings.cs
- LinqDataSourceDeleteEventArgs.cs
- ObjectCloneHelper.cs
- SelectionPattern.cs
- XmlTextReader.cs
- UIAgentMonitorHandle.cs
- ConfigurationStrings.cs
- SingleAnimation.cs
- ServiceOperationHelpers.cs
- RuntimeHandles.cs