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
- DriveNotFoundException.cs
- PointAnimationUsingPath.cs
- ConfigXmlElement.cs
- SyndicationFeedFormatter.cs
- ScriptMethodAttribute.cs
- QilVisitor.cs
- RemotingAttributes.cs
- XmlExceptionHelper.cs
- DecimalAnimation.cs
- SafeProcessHandle.cs
- ArgumentException.cs
- ButtonAutomationPeer.cs
- DataGridViewRowPostPaintEventArgs.cs
- TraceUtility.cs
- CompareInfo.cs
- ContainerUtilities.cs
- Light.cs
- KnownBoxes.cs
- StaticDataManager.cs
- InvalidPropValue.cs
- DeliveryRequirementsAttribute.cs
- WebServiceReceiveDesigner.cs
- CngAlgorithm.cs
- ErrorHandler.cs
- LayoutUtils.cs
- UndoEngine.cs
- ApplicationInfo.cs
- Material.cs
- AsyncPostBackTrigger.cs
- AttachedAnnotation.cs
- RadioButtonRenderer.cs
- TextEditorThreadLocalStore.cs
- GridViewRowPresenterBase.cs
- GroupBox.cs
- FormViewDeleteEventArgs.cs
- ActivityDesignerHelper.cs
- WindowsIdentity.cs
- LineSegment.cs
- Timer.cs
- WorkflowOperationInvoker.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- ApplicationContext.cs
- ProfileServiceManager.cs
- XamlSerializer.cs
- TextBreakpoint.cs
- DbBuffer.cs
- Version.cs
- OdbcDataReader.cs
- PropertyManager.cs
- BulletDecorator.cs
- MarkerProperties.cs
- PackagingUtilities.cs
- ProviderBase.cs
- ToolStripLabel.cs
- StreamSecurityUpgradeProvider.cs
- XmlObjectSerializerWriteContext.cs
- HtmlTitle.cs
- DataPager.cs
- ServiceActivationException.cs
- TextBreakpoint.cs
- GetPageCompletedEventArgs.cs
- MessageSecurityProtocolFactory.cs
- CheckBoxList.cs
- StringResourceManager.cs
- EntityEntry.cs
- PageBreakRecord.cs
- DataRelationPropertyDescriptor.cs
- WindowsTab.cs
- DynamicResourceExtensionConverter.cs
- InkCanvasInnerCanvas.cs
- Dynamic.cs
- AssemblyInfo.cs
- cookiecontainer.cs
- SqlMetaData.cs
- SystemWebCachingSectionGroup.cs
- X509Chain.cs
- ObjectDataSourceDisposingEventArgs.cs
- BypassElement.cs
- WebPartTracker.cs
- ConsoleCancelEventArgs.cs
- SingleObjectCollection.cs
- PrintDialogException.cs
- Configuration.cs
- LinkedList.cs
- SchemaReference.cs
- filewebresponse.cs
- IODescriptionAttribute.cs
- FlowDocumentPage.cs
- SQLByteStorage.cs
- PageThemeBuildProvider.cs
- __ComObject.cs
- ActivitySurrogate.cs
- MemberPath.cs
- SafeNativeMethods.cs
- DesignerWithHeader.cs
- EntityFunctions.cs
- XmlSchemas.cs
- Events.cs
- _LocalDataStore.cs
- FontEmbeddingManager.cs