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
- MarkupCompilePass1.cs
- DocumentPage.cs
- DataGridPreparingCellForEditEventArgs.cs
- DeferredSelectedIndexReference.cs
- QuaternionAnimation.cs
- ClientRoleProvider.cs
- BuildProviderAppliesToAttribute.cs
- CanExecuteRoutedEventArgs.cs
- KeyedPriorityQueue.cs
- ContentFilePart.cs
- RenderDataDrawingContext.cs
- DataGridViewRowsRemovedEventArgs.cs
- SmtpFailedRecipientsException.cs
- XmlNodeReader.cs
- SiteMapNode.cs
- WebPartHelpVerb.cs
- AttachInfo.cs
- TraceContext.cs
- ToolboxControl.cs
- DbConnectionPool.cs
- TextEditorCopyPaste.cs
- InputManager.cs
- TypeListConverter.cs
- ADMembershipUser.cs
- TextEditor.cs
- SessionEndedEventArgs.cs
- DefaultAssemblyResolver.cs
- InstallerTypeAttribute.cs
- FrameworkContextData.cs
- OperatingSystem.cs
- DbException.cs
- Compiler.cs
- X509Extension.cs
- HTMLTextWriter.cs
- FormView.cs
- IgnoreSectionHandler.cs
- TextEditorMouse.cs
- SafeNativeMethods.cs
- LocalizationParserHooks.cs
- DataGridViewCellEventArgs.cs
- Bidi.cs
- SignerInfo.cs
- SqlCacheDependency.cs
- RequestSecurityTokenForRemoteTokenFactory.cs
- TemplateControlCodeDomTreeGenerator.cs
- Bitmap.cs
- ArrayConverter.cs
- NetworkInterface.cs
- ConstrainedDataObject.cs
- HostedElements.cs
- NameTable.cs
- ClientApiGenerator.cs
- MobileRedirect.cs
- ProvidersHelper.cs
- MergablePropertyAttribute.cs
- CounterSample.cs
- ListViewSortEventArgs.cs
- ObjectDataProvider.cs
- LoginView.cs
- XPathChildIterator.cs
- WsatServiceAddress.cs
- DataGridViewColumnHeaderCell.cs
- RewritingProcessor.cs
- UnsafeNetInfoNativeMethods.cs
- BookmarkScope.cs
- ClientTargetSection.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- InputLangChangeEvent.cs
- ConfigUtil.cs
- DispatchOperation.cs
- ViewManager.cs
- FastPropertyAccessor.cs
- TextRangeAdaptor.cs
- CompositionDesigner.cs
- Enum.cs
- XmlRootAttribute.cs
- BuildProvidersCompiler.cs
- EnvelopedPkcs7.cs
- DataTrigger.cs
- XmlSchemaIdentityConstraint.cs
- CommandEventArgs.cs
- DodSequenceMerge.cs
- VideoDrawing.cs
- AsymmetricSecurityBindingElement.cs
- RoleManagerSection.cs
- Color.cs
- PostBackOptions.cs
- ChangeNode.cs
- DesignerSelectionListAdapter.cs
- PeerNodeAddress.cs
- Stack.cs
- ConfigXmlWhitespace.cs
- FilterElement.cs
- DefaultObjectSerializer.cs
- WCFServiceClientProxyGenerator.cs
- DefaultTextStore.cs
- DnsPermission.cs
- GCHandleCookieTable.cs
- LinkArea.cs
- ConfigurationValidatorBase.cs