Autodesk.Workspaces.IdReferenceResolver.GetGuidPropertyValue C# (CSharp) Method

GetGuidPropertyValue() private static method

private static GetGuidPropertyValue ( object value ) : System.Guid
value object
return System.Guid
        private static Guid GetGuidPropertyValue(object value)
        {
            // Use reflection to find the Guid or the GUID
            // property on the object.

            var pi = value.GetType().GetProperty("Guid");
            if (pi == null)
            {
                pi = value.GetType().GetProperty("GUID");
            }

            var id = pi == null ? Guid.NewGuid() : (Guid)pi.GetValue(value);
            return id;
        }