Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / SyntaxCheck.cs / 1305376 / SyntaxCheck.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel { using System; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using System.Security.Permissions; ////// /// SyntaxCheck /// Helper class to check for path and machine name syntax. /// [HostProtection(SharedState = true)] public static class SyntaxCheck { ////// Checks the syntax of the machine name (no "\" anywhere in it). /// ///public static bool CheckMachineName(string value) { if (value == null) return false; value = value.Trim(); if (value.Equals(String.Empty)) return false; // Machine names shouldn't contain any "\" return (value.IndexOf('\\') == -1); } /// /// Checks the syntax of the path (must start with "\\"). /// ///public static bool CheckPath(string value) { if (value == null) return false; value = value.Trim(); if (value.Equals(String.Empty)) return false; // Path names should start with "\\" return value.StartsWith("\\\\"); } /// /// Checks the syntax of the path (must start with "\" or drive letter "C:"). /// NOTE: These denote a file or directory path!! /// /// ///public static bool CheckRootedPath(string value) { if (value == null) return false; value = value.Trim(); if (value.Equals(String.Empty)) return false; // Is it rooted? return Path.IsPathRooted(value); } } } // 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
- EditCommandColumn.cs
- ExpressionVisitorHelpers.cs
- SpeechRecognizer.cs
- VersionUtil.cs
- WebResourceAttribute.cs
- LogLogRecordHeader.cs
- TriggerBase.cs
- ControlParser.cs
- DrawingContextDrawingContextWalker.cs
- ComplexLine.cs
- SmiXetterAccessMap.cs
- ISO2022Encoding.cs
- StrongNamePublicKeyBlob.cs
- MouseBinding.cs
- ZipPackagePart.cs
- ConfigXmlAttribute.cs
- FontFamily.cs
- GlyphRunDrawing.cs
- RequestCache.cs
- GeometryHitTestResult.cs
- ServiceContractListItemList.cs
- SocketAddress.cs
- AmbiguousMatchException.cs
- CopyAction.cs
- TransformerTypeCollection.cs
- ExtensionSurface.cs
- PathSegmentCollection.cs
- ClosableStream.cs
- PropertyItem.cs
- PropertyTab.cs
- AsymmetricKeyExchangeDeformatter.cs
- XmlBinaryReaderSession.cs
- ConfigurationManager.cs
- CryptoApi.cs
- ControlsConfig.cs
- MatrixTransform3D.cs
- DeviceSpecificDesigner.cs
- TableLayoutStyle.cs
- ComponentRenameEvent.cs
- TemplateBamlTreeBuilder.cs
- ComAdminInterfaces.cs
- StartUpEventArgs.cs
- EntityDataSourceState.cs
- BamlResourceDeserializer.cs
- DoubleAnimation.cs
- FixedMaxHeap.cs
- PlaceHolder.cs
- DesignerDataView.cs
- MDIClient.cs
- DataGridBeginningEditEventArgs.cs
- StylusEventArgs.cs
- XmlSchemaDocumentation.cs
- OneOf.cs
- MsmqIntegrationInputChannel.cs
- ValueUnavailableException.cs
- JavaScriptSerializer.cs
- UriSection.cs
- RegisteredDisposeScript.cs
- KeyGestureValueSerializer.cs
- RadioButtonDesigner.cs
- GeneralTransform3DTo2DTo3D.cs
- X509Extension.cs
- DbgUtil.cs
- FormViewUpdateEventArgs.cs
- Span.cs
- QuaternionRotation3D.cs
- StylusPointPropertyUnit.cs
- Matrix.cs
- DeriveBytes.cs
- XmlWrappingReader.cs
- HiddenFieldDesigner.cs
- IIS7WorkerRequest.cs
- ServiceContractViewControl.Designer.cs
- TypefaceMap.cs
- KeyToListMap.cs
- AutomationPropertyInfo.cs
- TextEmbeddedObject.cs
- DoubleUtil.cs
- SortExpressionBuilder.cs
- ChooseAction.cs
- ClientEndpointLoader.cs
- PointConverter.cs
- GenericsInstances.cs
- MetadataArtifactLoaderFile.cs
- CreateUserWizard.cs
- TCPClient.cs
- RectAnimationBase.cs
- Themes.cs
- ObjectDataSourceMethodEventArgs.cs
- ParameterCollectionEditor.cs
- PhysicalFontFamily.cs
- ListView.cs
- ThemeableAttribute.cs
- DataServiceRequestException.cs
- BCLDebug.cs
- XmlProcessingInstruction.cs
- SettingsPropertyIsReadOnlyException.cs
- APCustomTypeDescriptor.cs
- TabControl.cs
- SmtpSection.cs