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
- FormatterServicesNoSerializableCheck.cs
- AudioBase.cs
- HitTestParameters3D.cs
- DataGridColumnDropSeparator.cs
- StringToken.cs
- XmlValidatingReaderImpl.cs
- PenThreadPool.cs
- PropertyMapper.cs
- RawStylusInput.cs
- SqlParameterizer.cs
- InstanceHandleConflictException.cs
- SmtpFailedRecipientException.cs
- DeviceFiltersSection.cs
- Tool.cs
- Annotation.cs
- SystemIPv4InterfaceProperties.cs
- TransformPatternIdentifiers.cs
- ProcessThread.cs
- EventHandlerList.cs
- StreamInfo.cs
- ImportCatalogPart.cs
- Matrix3D.cs
- BufferModeSettings.cs
- PrePrepareMethodAttribute.cs
- VersionedStream.cs
- DateTimePicker.cs
- WorkflowElementDialog.cs
- LayoutTable.cs
- _DomainName.cs
- GenericTypeParameterConverter.cs
- RootBuilder.cs
- _TLSstream.cs
- FormsAuthenticationEventArgs.cs
- EditorZoneDesigner.cs
- CompressedStack.cs
- ConfigXmlWhitespace.cs
- Slider.cs
- DbXmlEnabledProviderManifest.cs
- CuspData.cs
- FontUnitConverter.cs
- Paragraph.cs
- DataServicePagingProviderWrapper.cs
- RepeaterItemEventArgs.cs
- MissingFieldException.cs
- ZoneMembershipCondition.cs
- Control.cs
- PresentationAppDomainManager.cs
- TimeSpanFormat.cs
- WebEvents.cs
- MetabaseServerConfig.cs
- OdbcConnection.cs
- FixedSOMLineRanges.cs
- PlaceHolder.cs
- CngAlgorithmGroup.cs
- DispatcherOperation.cs
- ClientFormsIdentity.cs
- HttpValueCollection.cs
- PeerNameRecord.cs
- TiffBitmapEncoder.cs
- SqlBulkCopyColumnMappingCollection.cs
- ObjectAssociationEndMapping.cs
- SqlDataSourceQueryConverter.cs
- InstancePersistence.cs
- NameObjectCollectionBase.cs
- SqlUnionizer.cs
- FilterRepeater.cs
- QilInvokeLateBound.cs
- RecognizerStateChangedEventArgs.cs
- Paragraph.cs
- RegexParser.cs
- DetailsViewInsertEventArgs.cs
- IntPtr.cs
- HtmlWindowCollection.cs
- ImageSource.cs
- HybridDictionary.cs
- RightNameExpirationInfoPair.cs
- SamlAuthorizationDecisionClaimResource.cs
- activationcontext.cs
- HttpHeaderCollection.cs
- DoubleAnimationUsingPath.cs
- ViewBox.cs
- StorageInfo.cs
- HashHelper.cs
- PromptBuilder.cs
- ChildrenQuery.cs
- QueryableDataSourceEditData.cs
- TypeTypeConverter.cs
- BamlBinaryWriter.cs
- XmlNamespaceDeclarationsAttribute.cs
- DataPointer.cs
- Publisher.cs
- ToolBarTray.cs
- GPStream.cs
- FamilyCollection.cs
- DataSet.cs
- OdbcErrorCollection.cs
- Parser.cs
- HtmlInputCheckBox.cs
- DefaultPropertyAttribute.cs
- TextTreeRootNode.cs