Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / FunctionParameter.cs / 1305376 / FunctionParameter.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- 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 [....] // @backupOwner [....] //--------------------------------------------------------------------- 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
- CriticalHandle.cs
- Viewport2DVisual3D.cs
- SelectingProviderEventArgs.cs
- ReaderWriterLockWrapper.cs
- DbConnectionPoolIdentity.cs
- OneOfTypeConst.cs
- LicenseManager.cs
- XmlBoundElement.cs
- AbsoluteQuery.cs
- AnnotationAuthorChangedEventArgs.cs
- FileInfo.cs
- StyleBamlTreeBuilder.cs
- BuildProviderUtils.cs
- ObjectDataSourceWizardForm.cs
- SpeechDetectedEventArgs.cs
- NetCodeGroup.cs
- ColumnHeaderConverter.cs
- PermissionRequestEvidence.cs
- MouseActionValueSerializer.cs
- ScriptResourceAttribute.cs
- DataStreams.cs
- EllipseGeometry.cs
- TrailingSpaceComparer.cs
- WindowsIPAddress.cs
- ReadOnlyNameValueCollection.cs
- AsynchronousChannel.cs
- FileSystemWatcher.cs
- ProcessHostFactoryHelper.cs
- WebPartConnectionsDisconnectVerb.cs
- LocationReferenceValue.cs
- DesignTimeDataBinding.cs
- TypeForwardedToAttribute.cs
- SyntaxCheck.cs
- TextSelectionHelper.cs
- DataAdapter.cs
- CompoundFileDeflateTransform.cs
- Context.cs
- RelAssertionDirectKeyIdentifierClause.cs
- FileSystemInfo.cs
- ScrollableControl.cs
- SharedPersonalizationStateInfo.cs
- FamilyMap.cs
- DaylightTime.cs
- WindowsGraphicsCacheManager.cs
- ComponentCache.cs
- RtfControlWordInfo.cs
- ConvertEvent.cs
- FunctionGenerator.cs
- MediaCommands.cs
- SerializationEventsCache.cs
- WebPartManagerInternals.cs
- MetadataPropertyCollection.cs
- ButtonField.cs
- sqlstateclientmanager.cs
- ContentIterators.cs
- FilterElement.cs
- OdbcErrorCollection.cs
- SizeConverter.cs
- ByteViewer.cs
- RecipientInfo.cs
- ErrorTableItemStyle.cs
- HMACSHA1.cs
- CreateUserErrorEventArgs.cs
- XmlParserContext.cs
- AbsoluteQuery.cs
- MenuItem.cs
- ProcessModuleDesigner.cs
- DataGridViewCellStyleChangedEventArgs.cs
- OdbcException.cs
- validationstate.cs
- ImageSourceTypeConverter.cs
- EnvironmentPermission.cs
- RuntimeConfigLKG.cs
- XmlCompatibilityReader.cs
- PrintController.cs
- SoapTypeAttribute.cs
- FlowLayout.cs
- cookiecollection.cs
- ArcSegment.cs
- DispatcherExceptionEventArgs.cs
- ReadingWritingEntityEventArgs.cs
- MappingSource.cs
- PriorityRange.cs
- ProviderCommandInfoUtils.cs
- PropertyGridEditorPart.cs
- HttpBufferlessInputStream.cs
- SoapObjectWriter.cs
- XmlIncludeAttribute.cs
- DayRenderEvent.cs
- AxHost.cs
- MethodAccessException.cs
- WeakReferenceEnumerator.cs
- RecipientInfo.cs
- RootBrowserWindow.cs
- NumericUpDownAccelerationCollection.cs
- WebConfigurationHostFileChange.cs
- Ref.cs
- SQLChars.cs
- ConfigurationValidatorBase.cs
- RowsCopiedEventArgs.cs