Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Compilation / WCFModel / MetadataSource.cs / 1305376 / MetadataSource.cs
//------------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
//-----------------------------------------------------------------------------
//
// This code is shared between ndp\fx\src\xsp\System\Web\Extensions\Compilation\WCFModel
// and wizard\vsdesigner\designer\microsoft\vsdesigner\WCFModel.
// Please make sure the code files between those two directories are alway in [....] when you make any changes to this code.
// And always test these code in both places before check in.
// The code under ndp\fx\src\xsp\System\Web\Extensions\Compilation\XmlSerializer might have to be regerenated when
// the format of the svcmap file is changed, or class structure has been changed in this directory. Please follow the HowTo file
// under Compilation directory to see how to regerenate that code.
//
using System;
using System.Diagnostics;
using System.Globalization;
#if WEB_EXTENSIONS_CODE
using System.Web.Resources;
#else
using Microsoft.VSDesigner.Resources.Microsoft.VSDesigner;
#endif
using XmlSerialization = System.Xml.Serialization;
#if WEB_EXTENSIONS_CODE
namespace System.Web.Compilation.WCFModel
#else
namespace Microsoft.VSDesigner.WCFModel
#endif
{
///
/// This class implements a MetadataSource item in the svcmap file
///
///
#if WEB_EXTENSIONS_CODE
internal class MetadataSource
#else
[CLSCompliant(true)]
public class MetadataSource
#endif
{
// URL of metadata source
private string m_Address;
// protocol to download it
private string m_Protocol;
// ID of this source
private int m_SourceId;
///
/// Constructor
///
/// Must support a default construct for XmlSerializer
public MetadataSource() {
m_Address = String.Empty;
m_Protocol = String.Empty;
}
///
/// Constructor
///
///
///
///
public MetadataSource(string protocol, string address, int sourceId) {
if (protocol == null) {
throw new ArgumentNullException("protocol");
}
if (address == null) {
throw new ArgumentNullException("address");
}
if (protocol.Length == 0) {
throw new ArgumentException(WCFModelStrings.ReferenceGroup_EmptyProtocol);
}
if (address == null) {
throw new ArgumentException(WCFModelStrings.ReferenceGroup_EmptyAddress);
}
m_Protocol = protocol;
m_Address = address;
if (sourceId < 0) {
Debug.Fail("Source ID shouldn't be a nagtive number");
throw new ArgumentException(WCFModelStrings.ReferenceGroup_InvalidSourceId);
}
m_SourceId = sourceId;
}
///
/// URL address to download metadata
///
///
///
[XmlSerialization.XmlAttribute()]
public string Address {
get {
return m_Address;
}
set {
if (value == null) {
throw new ArgumentNullException("value");
}
m_Address = value;
}
}
///
/// protocol used to download metadata
///
///
///
[XmlSerialization.XmlAttribute()]
public string Protocol {
get {
return m_Protocol;
}
set {
if (value == null) {
throw new ArgumentNullException("value");
}
m_Protocol = value;
}
}
///
/// generated ID for this metadata source
///
///
///
[XmlSerialization.XmlAttribute()]
public int SourceId
{
get
{
return m_SourceId;
}
set
{
if (value < 0) {
Debug.Fail("Source ID shouldn't be a nagtive number");
throw new ArgumentException(WCFModelStrings.ReferenceGroup_InvalidSourceId);
}
m_SourceId = value;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All Rights Reserved.
//
//-----------------------------------------------------------------------------
//
// This code is shared between ndp\fx\src\xsp\System\Web\Extensions\Compilation\WCFModel
// and wizard\vsdesigner\designer\microsoft\vsdesigner\WCFModel.
// Please make sure the code files between those two directories are alway in [....] when you make any changes to this code.
// And always test these code in both places before check in.
// The code under ndp\fx\src\xsp\System\Web\Extensions\Compilation\XmlSerializer might have to be regerenated when
// the format of the svcmap file is changed, or class structure has been changed in this directory. Please follow the HowTo file
// under Compilation directory to see how to regerenate that code.
//
using System;
using System.Diagnostics;
using System.Globalization;
#if WEB_EXTENSIONS_CODE
using System.Web.Resources;
#else
using Microsoft.VSDesigner.Resources.Microsoft.VSDesigner;
#endif
using XmlSerialization = System.Xml.Serialization;
#if WEB_EXTENSIONS_CODE
namespace System.Web.Compilation.WCFModel
#else
namespace Microsoft.VSDesigner.WCFModel
#endif
{
///
/// This class implements a MetadataSource item in the svcmap file
///
///
#if WEB_EXTENSIONS_CODE
internal class MetadataSource
#else
[CLSCompliant(true)]
public class MetadataSource
#endif
{
// URL of metadata source
private string m_Address;
// protocol to download it
private string m_Protocol;
// ID of this source
private int m_SourceId;
///
/// Constructor
///
/// Must support a default construct for XmlSerializer
public MetadataSource() {
m_Address = String.Empty;
m_Protocol = String.Empty;
}
///
/// Constructor
///
///
///
///
public MetadataSource(string protocol, string address, int sourceId) {
if (protocol == null) {
throw new ArgumentNullException("protocol");
}
if (address == null) {
throw new ArgumentNullException("address");
}
if (protocol.Length == 0) {
throw new ArgumentException(WCFModelStrings.ReferenceGroup_EmptyProtocol);
}
if (address == null) {
throw new ArgumentException(WCFModelStrings.ReferenceGroup_EmptyAddress);
}
m_Protocol = protocol;
m_Address = address;
if (sourceId < 0) {
Debug.Fail("Source ID shouldn't be a nagtive number");
throw new ArgumentException(WCFModelStrings.ReferenceGroup_InvalidSourceId);
}
m_SourceId = sourceId;
}
///
/// URL address to download metadata
///
///
///
[XmlSerialization.XmlAttribute()]
public string Address {
get {
return m_Address;
}
set {
if (value == null) {
throw new ArgumentNullException("value");
}
m_Address = value;
}
}
///
/// protocol used to download metadata
///
///
///
[XmlSerialization.XmlAttribute()]
public string Protocol {
get {
return m_Protocol;
}
set {
if (value == null) {
throw new ArgumentNullException("value");
}
m_Protocol = value;
}
}
///
/// generated ID for this metadata source
///
///
///
[XmlSerialization.XmlAttribute()]
public int SourceId
{
get
{
return m_SourceId;
}
set
{
if (value < 0) {
Debug.Fail("Source ID shouldn't be a nagtive number");
throw new ArgumentException(WCFModelStrings.ReferenceGroup_InvalidSourceId);
}
m_SourceId = value;
}
}
}
}
// 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
- RtType.cs
- Int32CAMarshaler.cs
- ModifierKeysConverter.cs
- ObjectDataSourceMethodEditor.cs
- TreeNodeStyleCollection.cs
- ReversePositionQuery.cs
- Quaternion.cs
- TrackingRecord.cs
- CodeDomConfigurationHandler.cs
- HwndProxyElementProvider.cs
- PointCollection.cs
- SafeNativeMemoryHandle.cs
- Span.cs
- GacUtil.cs
- HashCodeCombiner.cs
- SpeechSeg.cs
- XmlSchemaSimpleType.cs
- CodeConditionStatement.cs
- DbCommandTree.cs
- EntityObject.cs
- DrawingAttributeSerializer.cs
- SHA256Cng.cs
- WinCategoryAttribute.cs
- AtlasWeb.Designer.cs
- PeerNameRecordCollection.cs
- OrderedHashRepartitionEnumerator.cs
- XmlSerializationGeneratedCode.cs
- CellTreeNodeVisitors.cs
- UrlParameterReader.cs
- XmlAttributes.cs
- XmlDocumentSerializer.cs
- RadioButtonAutomationPeer.cs
- CollectionBase.cs
- DataGridViewBindingCompleteEventArgs.cs
- TransactedBatchingElement.cs
- CodeMemberEvent.cs
- URLMembershipCondition.cs
- XmlTextEncoder.cs
- ProfilePropertySettingsCollection.cs
- ToolStripGripRenderEventArgs.cs
- ToolboxComponentsCreatedEventArgs.cs
- HideDisabledControlAdapter.cs
- AutomationPatternInfo.cs
- UnknownBitmapDecoder.cs
- OracleMonthSpan.cs
- CapabilitiesUse.cs
- DBDataPermission.cs
- DataGridViewColumnEventArgs.cs
- XmlNodeChangedEventArgs.cs
- ApplicationId.cs
- StatusBarDrawItemEvent.cs
- Knowncolors.cs
- InputReport.cs
- RSAOAEPKeyExchangeDeformatter.cs
- RadioButtonFlatAdapter.cs
- RadioButton.cs
- ArraySubsetEnumerator.cs
- DataList.cs
- ObjectStorage.cs
- InkCanvas.cs
- MSAAEventDispatcher.cs
- RelatedCurrencyManager.cs
- log.cs
- OpenFileDialog.cs
- Polygon.cs
- WindowsToolbarItemAsMenuItem.cs
- Timer.cs
- GreenMethods.cs
- ListViewInsertionMark.cs
- rsa.cs
- BrowserTree.cs
- FilteredReadOnlyMetadataCollection.cs
- DataTableMappingCollection.cs
- XmlSchemaDatatype.cs
- MemberPathMap.cs
- PriorityItem.cs
- RuntimeConfigLKG.cs
- TextPointer.cs
- PropertyCondition.cs
- IIS7WorkerRequest.cs
- MenuItem.cs
- X509ChainElement.cs
- StylusButtonCollection.cs
- WebConfigurationHostFileChange.cs
- RequestCacheManager.cs
- basevalidator.cs
- KeyboardNavigation.cs
- TemplateControl.cs
- StrongNameIdentityPermission.cs
- CheckedPointers.cs
- SystemIcons.cs
- BindingNavigator.cs
- NamedPipeActivation.cs
- GrammarBuilderPhrase.cs
- XmlBinaryReader.cs
- _HeaderInfoTable.cs
- PropertyGeneratedEventArgs.cs
- BrowserCapabilitiesCodeGenerator.cs
- WeakReferenceEnumerator.cs
- DbSourceCommand.cs