示例#1
0
        public static Guid GetFingerprintGUID(this Document doc)
        {
            if (doc?.IsValidObject != true)
            {
                return(Guid.Empty);
            }

            return(ExportUtils.GetGBXMLDocumentId(doc));
        }
示例#2
0
        public static System.Guid DocumentGuid(this Document document)
        {
            if (document?.IsValidObject != true)
            {
                return(System.Guid.Empty);
            }

            return(ExportUtils.GetGBXMLDocumentId(document));
        }
示例#3
0
        private static bool TryGetDocument(this IEnumerable <Document> set, Guid guid, out Document document, Document activeDBDocument = default)
        {
            if (guid != Guid.Empty)
            {
                // For performance reasons and also in case of conflict the ActiveDBDocument will have priority
                if (ExportUtils.GetGBXMLDocumentId(activeDBDocument) == guid)
                {
                    document = activeDBDocument;
                    return(true);
                }

                foreach (var doc in set.Where(x => ExportUtils.GetGBXMLDocumentId(x) == guid))
                {
                    document = doc;
                    return(true);
                }
            }

            document = default;
            return(false);
        }