Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Common / AuthoringOM / Utility.cs / 1305376 / Utility.cs
namespace System.Workflow { using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; static class Utility { [SuppressMessage("Reliability", "Reliability113", Justification = "These are the core methods that should be used for all other Guid(string) calls.")] internal static Guid CreateGuid(string guidString) { bool success = false; Guid result = Guid.Empty; try { result = new Guid(guidString); success = true; } finally { if (!success) { Debug.Assert(false, "Creation of the Guid failed."); } } return result; } [SuppressMessage("Reliability", "Reliability113", Justification = "These are the core methods that should be used for all other Guid(string) calls.")] internal static bool TryCreateGuid(string guidString, out Guid result) { bool success = false; result = Guid.Empty; try { result = new Guid(guidString); success = true; } catch (ArgumentException) { // ---- this } catch (FormatException) { // ---- this } catch (OverflowException) { // ---- this } return success; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Workflow { using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; static class Utility { [SuppressMessage("Reliability", "Reliability113", Justification = "These are the core methods that should be used for all other Guid(string) calls.")] internal static Guid CreateGuid(string guidString) { bool success = false; Guid result = Guid.Empty; try { result = new Guid(guidString); success = true; } finally { if (!success) { Debug.Assert(false, "Creation of the Guid failed."); } } return result; } [SuppressMessage("Reliability", "Reliability113", Justification = "These are the core methods that should be used for all other Guid(string) calls.")] internal static bool TryCreateGuid(string guidString, out Guid result) { bool success = false; result = Guid.Empty; try { result = new Guid(guidString); success = true; } catch (ArgumentException) { // ---- this } catch (FormatException) { // ---- this } catch (OverflowException) { // ---- this } return success; } } } // 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
- TextDecorationCollection.cs
- PersonalizationStateInfo.cs
- Style.cs
- ProtectedConfigurationSection.cs
- QualifiedCellIdBoolean.cs
- RequestTimeoutManager.cs
- _RequestCacheProtocol.cs
- BamlVersionHeader.cs
- RawStylusInputCustomDataList.cs
- SharedStream.cs
- EntitySetDataBindingList.cs
- CounterSampleCalculator.cs
- PropertyInformation.cs
- PassportAuthenticationModule.cs
- Receive.cs
- XmlAnyAttributeAttribute.cs
- ProtectedProviderSettings.cs
- TrackingLocation.cs
- TriggerBase.cs
- AdPostCacheSubstitution.cs
- TimeSpanValidatorAttribute.cs
- DocumentPage.cs
- SchemaImporterExtensionsSection.cs
- UndirectedGraph.cs
- State.cs
- TimeSpan.cs
- TdsParserStaticMethods.cs
- ProxyRpc.cs
- BindableAttribute.cs
- CapabilitiesUse.cs
- CubicEase.cs
- IdnElement.cs
- LoginView.cs
- Region.cs
- InternalException.cs
- QueryRelOp.cs
- NamespaceCollection.cs
- ImageListUtils.cs
- UriTemplateLiteralQueryValue.cs
- BufferedStream.cs
- BitmapDownload.cs
- NamespaceQuery.cs
- ExtractedStateEntry.cs
- ProfileGroupSettings.cs
- CreateUserErrorEventArgs.cs
- TextWriterTraceListener.cs
- ListBoxItem.cs
- WindowVisualStateTracker.cs
- BamlBinaryReader.cs
- XmlWrappingReader.cs
- XPathMultyIterator.cs
- TextChange.cs
- WindowsButton.cs
- XmlWrappingReader.cs
- DataSourceXmlElementAttribute.cs
- CollectionsUtil.cs
- TransformPattern.cs
- SQLGuid.cs
- GridViewPageEventArgs.cs
- UrlRoutingHandler.cs
- DESCryptoServiceProvider.cs
- NativeCppClassAttribute.cs
- RuntimeResourceSet.cs
- SplashScreen.cs
- TransactedBatchContext.cs
- BooleanKeyFrameCollection.cs
- RotateTransform.cs
- RpcAsyncResult.cs
- EditorBrowsableAttribute.cs
- Canvas.cs
- CodeExpressionStatement.cs
- WindowsFont.cs
- Helpers.cs
- ToolboxDataAttribute.cs
- ResourceDictionary.cs
- Emitter.cs
- FrameworkElement.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- TableItemProviderWrapper.cs
- FixedNode.cs
- RecognitionEventArgs.cs
- KeyFrames.cs
- SafeRightsManagementSessionHandle.cs
- PrincipalPermission.cs
- ChannelEndpointElement.cs
- ErrorProvider.cs
- XpsS0ValidatingLoader.cs
- JavaScriptSerializer.cs
- RectAnimationBase.cs
- ObjectSet.cs
- TransformDescriptor.cs
- SHA512Cng.cs
- ObjectDataSource.cs
- GroupItemAutomationPeer.cs
- RuleSettings.cs
- DataGridViewRowStateChangedEventArgs.cs
- OverrideMode.cs
- HashMembershipCondition.cs
- WebBrowser.cs
- SwitchDesigner.xaml.cs