Exemplo n.º 1
0
        public static Hash128[] GetArtifactHashes(string[] guids, ImportSyncMode mode = ImportSyncMode.Block)
        {
            var _guids = guids.Select(a => new GUID(a)).ToArray();

            switch (mode)
            {
            case ImportSyncMode.Block:
                List <Hash128> resultA = new List <Hash128>();
                foreach (var g in _guids)
                {
                    resultA.Add(ProduceArtifact(new ArtifactKey(g)).value);
                }
                return(resultA.ToArray());

            case ImportSyncMode.Poll:
                List <Hash128> resultB = new List <Hash128>();
                foreach (var g in _guids)
                {
                    resultB.Add(LookupArtifact(new ArtifactKey(g)).value);
                }
                return(resultB.ToArray());

            case ImportSyncMode.Queue:
                return(ProduceArtifactsAsync(_guids, null).Select(a => a.value).ToArray());
            }

            throw new Exception("Invalid ImportSyncMode " + mode);
        }
Exemplo n.º 2
0
        public static Hash128 GetArtifactHash(string guid, ImportSyncMode mode = ImportSyncMode.Block)
        {
            switch (mode)
            {
            case ImportSyncMode.Block:
                return(ProduceArtifact(new ArtifactKey(new GUID(guid))).value);

            case ImportSyncMode.Poll:
                return(LookupArtifact(new ArtifactKey(new GUID(guid))).value);

            case ImportSyncMode.Queue:
                return(ProduceArtifactAsync(new ArtifactKey(new GUID(guid))).value);
            }

            throw new Exception("Invalid ImportSyncMode " + mode);
        }
Exemplo n.º 3
0
 public static Hash128[] GetArtifactHashes(string[] guids, ImportSyncMode mode = ImportSyncMode.Block)
 {
     return(GetArtifactHashes_Internal_Guids_SelectImporter(guids, mode));
 }
Exemplo n.º 4
0
 public static Hash128 GetArtifactHash(string guid, [uei.DefaultValue("null")] Type importerType, ImportSyncMode mode = ImportSyncMode.Block)
 {
     if (importerType == null)
     {
         return(GetArtifactHash_Internal_Guid_SelectImporter(guid, mode));
     }
     else
     {
         return(GetArtifactHash_Internal_Guid(guid, importerType, mode));
     }
 }
Exemplo n.º 5
0
 [uei.ExcludeFromDocs] public static Hash128 GetArtifactHash(string guid, ImportSyncMode mode = ImportSyncMode.Block)
 {
     return(GetArtifactHash(guid, null, mode));
 }
Exemplo n.º 6
0
 private extern static Hash128[] GetArtifactHashes_Internal_Guids_SelectImporter(string[] guid, ImportSyncMode mode);
Exemplo n.º 7
0
 private extern static Hash128 GetArtifactHash_Internal_Guid(string guid, Type importerType, ImportSyncMode mode);
Exemplo n.º 8
0
 private extern static Hash128 GetArtifactHash_Internal_Guid_SelectImporter(string guid, ImportSyncMode mode);