Exemplo n.º 1
0
        /// <summary>
        /// 签名搜索;
        /// </summary>
        /// <param name="blDevice"></param>
        /// <param name="setting"></param>
        public static void SignSearch(IStreamFile streamFile)
        {
            var setting = CustomSignSearchService.GetSetting();

            if (setting == null)
            {
                return;
            }

            var loadingDialog = DialogService.Current.CreateLoadingDialog();

            loadingDialog.WindowTitle = LanguageService.FindResourceString(Constants.WindowTitle_CustomSignSearch);

            var part = FileFactory.CreatePartition(Constants.PartitionKey_CustomSignSearch);

            var partStoken = part.GetStoken(Constants.PartitionKey_CustomSignSearch);

            partStoken.BaseStream = streamFile.BaseStream;
            if (streamFile is IPartition streamPart)
            {
                partStoken.Name = $"{FileExtensions.GetPartFixAndName(streamPart)}-{LanguageService.FindResourceString(Constants.DocumentTitle_CustomSignSearch)}" +
                                  $"({CDFCCultures.Helpers.ByteConverterHelper.ConvertToHexFormat(setting.KeyWord)})";
            }
            else
            {
                partStoken.Name = $"{streamFile.Name}-{LanguageService.FindResourceString(Constants.DocumentTitle_CustomSignSearch)}" +
                                  $"({CDFCCultures.Helpers.ByteConverterHelper.ConvertToHexFormat(setting.KeyWord)})";
            }


            (long position, long size)[] fileBlocks = null;
 public object GetMetaData(IPartition part)
 {
     return(FileExtensions.GetPartFixAndName(part));
 }