Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / FunctionParameter.cs / 1 / FunctionParameter.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; namespace System.Data.Metadata.Edm { ////// Class representing a function parameter /// public sealed class FunctionParameter : MetadataItem { internal static Func> DeclaringFunctionLinker = fp => fp._declaringFunction; #region Constructors /// /// The constructor for FunctionParameter taking in a name and a TypeUsage object /// /// The name of this FunctionParameter /// The TypeUsage describing the type of this FunctionParameter /// Mode of the parameter ///Thrown if name or typeUsage arguments are null ///Thrown if name argument is empty string internal FunctionParameter(string name, TypeUsage typeUsage, ParameterMode parameterMode) { EntityUtil.CheckStringArgument(name, "name"); EntityUtil.GenericCheckArgumentNull(typeUsage, "typeUsage"); _name = name; _typeUsage = typeUsage; SetParameterMode(parameterMode); } #endregion #region Fields private readonly TypeUsage _typeUsage; private readonly string _name; private readonly SafeLink_declaringFunction = new SafeLink (); #endregion #region Properties /// /// Returns the kind of the type /// public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.FunctionParameter; } } ////// Gets/Sets the mode of this parameter /// ///Thrown if value passed into setter is null ///Thrown if the FunctionParameter instance is in ReadOnly state [MetadataProperty(BuiltInTypeKind.ParameterMode, false)] public ParameterMode Mode { get { return GetParameterMode(); } } ////// Returns the identity of the member /// internal override string Identity { get { return _name; } } ////// Returns the name of the member /// [MetadataProperty(PrimitiveTypeKind.String, false)] public String Name { get { return _name; } } ////// Returns the TypeUsage object containing the type information and facets /// about the type /// [MetadataProperty(BuiltInTypeKind.TypeUsage, false)] public TypeUsage TypeUsage { get { return _typeUsage; } } ////// Returns the declaring function of this parameter /// public EdmFunction DeclaringFunction { get { return _declaringFunction.Value; } } #endregion #region Methods ////// Overriding System.Object.ToString to provide better String representation /// for this type. /// public override string ToString() { return Name; } ////// Sets the member to read only mode. Once this is done, there are no changes /// that can be done to this class /// internal override void SetReadOnly() { if (!IsReadOnly) { base.SetReadOnly(); // TypeUsage is always readonly, no reason to set it } } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; namespace System.Data.Metadata.Edm { ////// Class representing a function parameter /// public sealed class FunctionParameter : MetadataItem { internal static Func> DeclaringFunctionLinker = fp => fp._declaringFunction; #region Constructors /// /// The constructor for FunctionParameter taking in a name and a TypeUsage object /// /// The name of this FunctionParameter /// The TypeUsage describing the type of this FunctionParameter /// Mode of the parameter ///Thrown if name or typeUsage arguments are null ///Thrown if name argument is empty string internal FunctionParameter(string name, TypeUsage typeUsage, ParameterMode parameterMode) { EntityUtil.CheckStringArgument(name, "name"); EntityUtil.GenericCheckArgumentNull(typeUsage, "typeUsage"); _name = name; _typeUsage = typeUsage; SetParameterMode(parameterMode); } #endregion #region Fields private readonly TypeUsage _typeUsage; private readonly string _name; private readonly SafeLink_declaringFunction = new SafeLink (); #endregion #region Properties /// /// Returns the kind of the type /// public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.FunctionParameter; } } ////// Gets/Sets the mode of this parameter /// ///Thrown if value passed into setter is null ///Thrown if the FunctionParameter instance is in ReadOnly state [MetadataProperty(BuiltInTypeKind.ParameterMode, false)] public ParameterMode Mode { get { return GetParameterMode(); } } ////// Returns the identity of the member /// internal override string Identity { get { return _name; } } ////// Returns the name of the member /// [MetadataProperty(PrimitiveTypeKind.String, false)] public String Name { get { return _name; } } ////// Returns the TypeUsage object containing the type information and facets /// about the type /// [MetadataProperty(BuiltInTypeKind.TypeUsage, false)] public TypeUsage TypeUsage { get { return _typeUsage; } } ////// Returns the declaring function of this parameter /// public EdmFunction DeclaringFunction { get { return _declaringFunction.Value; } } #endregion #region Methods ////// Overriding System.Object.ToString to provide better String representation /// for this type. /// public override string ToString() { return Name; } ////// Sets the member to read only mode. Once this is done, there are no changes /// that can be done to this class /// internal override void SetReadOnly() { if (!IsReadOnly) { base.SetReadOnly(); // TypeUsage is always readonly, no reason to set it } } #endregion } } // 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
- RubberbandSelector.cs
- FixedSOMPage.cs
- WindowsFormsSynchronizationContext.cs
- ComponentEvent.cs
- DiscoveryInnerClientAdhoc11.cs
- WpfXamlMember.cs
- Debugger.cs
- SpecialNameAttribute.cs
- Speller.cs
- CompiledRegexRunnerFactory.cs
- ScalarType.cs
- StyleCollection.cs
- Point4D.cs
- ChangeConflicts.cs
- DropShadowEffect.cs
- ByteAnimation.cs
- AdRotator.cs
- RtType.cs
- PageSettings.cs
- indexingfiltermarshaler.cs
- Size3D.cs
- TextBreakpoint.cs
- ModelUtilities.cs
- WebPart.cs
- CodeMemberEvent.cs
- ScriptingWebServicesSectionGroup.cs
- NativeStructs.cs
- FontFamilyValueSerializer.cs
- DefinitionUpdate.cs
- FormsAuthenticationTicket.cs
- ScriptingWebServicesSectionGroup.cs
- Native.cs
- ComplexBindingPropertiesAttribute.cs
- ByteStorage.cs
- HtmlInputFile.cs
- MimeReturn.cs
- GraphicsPath.cs
- FixedSOMElement.cs
- PhonemeConverter.cs
- BackgroundWorker.cs
- SmiMetaDataProperty.cs
- StorageMappingItemLoader.cs
- Utils.cs
- CodeObjectCreateExpression.cs
- HtmlLink.cs
- MDIClient.cs
- SimpleWorkerRequest.cs
- _ServiceNameStore.cs
- ListSortDescriptionCollection.cs
- SoapTypeAttribute.cs
- ToolTip.cs
- SqlConnectionHelper.cs
- SessionPageStateSection.cs
- SamlDoNotCacheCondition.cs
- DataServiceClientException.cs
- InheritanceRules.cs
- ToolStripProgressBar.cs
- Preprocessor.cs
- TextDecorationLocationValidation.cs
- WaitHandle.cs
- EditModeSwitchButton.cs
- UdpRetransmissionSettings.cs
- HandlerFactoryCache.cs
- TextDecorations.cs
- UiaCoreApi.cs
- BaseComponentEditor.cs
- BindingsCollection.cs
- UpdateCompiler.cs
- PageFunction.cs
- AmbientLight.cs
- AdornerLayer.cs
- SerializeAbsoluteContext.cs
- HtmlDocument.cs
- DataGridViewCellCancelEventArgs.cs
- CodeGeneratorOptions.cs
- XappLauncher.cs
- InternalBufferOverflowException.cs
- ExtensionFile.cs
- CookieHandler.cs
- WindowsAuthenticationEventArgs.cs
- DoubleAnimation.cs
- ExpressionBindingCollection.cs
- DesignerCategoryAttribute.cs
- StructuredTypeEmitter.cs
- FlowLayoutSettings.cs
- RawStylusInputReport.cs
- MetadataItemEmitter.cs
- PointLightBase.cs
- ImageInfo.cs
- TrustLevelCollection.cs
- TargetControlTypeAttribute.cs
- ByValueEqualityComparer.cs
- EntityRecordInfo.cs
- UnsafeNativeMethods.cs
- EnumUnknown.cs
- Assert.cs
- DBBindings.cs
- NamedPermissionSet.cs
- ListItemCollection.cs
- EdmToObjectNamespaceMap.cs