当前位置: 首页>>代码示例>>C#>>正文


C# IDocument.GetIndexDataValue方法代码示例

本文整理汇总了C#中IDocument.GetIndexDataValue方法的典型用法代码示例。如果您正苦于以下问题:C# IDocument.GetIndexDataValue方法的具体用法?C# IDocument.GetIndexDataValue怎么用?C# IDocument.GetIndexDataValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDocument的用法示例。


在下文中一共展示了IDocument.GetIndexDataValue方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AppendIndex

        public void AppendIndex(IDocument document, string outputFileName)
        {
            using (FileStream fs = new FileStream(outputFileName, FileMode.Append, FileAccess.Write, FileShare.None))
            using (StreamWriter writer = new StreamWriter(fs, Encoding.Unicode))
            {
               for (int indexNumber = 0; indexNumber < document.IndexDataCount; indexNumber++)
                   writer.WriteLine("{0}:{1}", document.GetIndexDataLabel(indexNumber), document.GetIndexDataValue(indexNumber));

                writer.Flush();
                writer.Close();
            }
        }
开发者ID:ebruning,项目名称:DAT-File-Index-Generator,代码行数:12,代码来源:DatIndexGenerator.cs

示例2: CreateIndex

        public void CreateIndex(IDocument document, IDictionary<string, string> releaseData, string outputFileName)
        {
            if (_exportSettings.OverRideDefault)
                outputFileName = GetIndexFileName(releaseData[string.Format("DocumentOutputFileName[{0}]", document.Number)], outputFileName);

            using (FileStream fs = new FileStream(outputFileName, FileMode.Append, FileAccess.Write, FileShare.None))
            using (StreamWriter writer = new StreamWriter(fs, Encoding.ASCII))
            {
                for (int i = 0; i < document.IndexDataCount; i++)
                    writer.WriteLine(string.Format("{0}={1}", document.GetIndexDataLabel(i), document.GetIndexDataValue(i)));

                writer.Flush();
                writer.Close();
            }
        }
开发者ID:ebruning,项目名称:CustomTxtExporter,代码行数:15,代码来源:CustomTxtExporter.cs

示例3: CreateIndex

        public void CreateIndex(IDocument document, IDictionary<string, string> exportData, string outputFileName)
        {
            using (FileStream fs = new FileStream(outputFileName, FileMode.CreateNew, FileAccess.Write, FileShare.None))
            using (StreamWriter writer = new StreamWriter(fs, Encoding.ASCII))
            {
                if (exportData != null)
                {
                    for (int indexNumber = 0; indexNumber < document.IndexDataCount; indexNumber++)
                        writer.WriteLine("{0}:{1}", document.GetIndexDataLabel(indexNumber), document.GetIndexDataValue(indexNumber));
                }

                //20100111 - Changed the index to pass the current document number so the correct file is written out
                writer.WriteLine("{0}", exportData[string.Format("DocumentOutputFileName[{0}]", _documentNumner)]);

                _documentNumner++;

                writer.Flush();
                writer.Close();
            }
        }
开发者ID:ebruning,项目名称:DAT-File-Index-Generator,代码行数:20,代码来源:DatIndexGenerator.cs

示例4: AppendIndex

        public void AppendIndex(IDocument document, string outputFileName)
        {
            using (FileStream fs = new FileStream(outputFileName, FileMode.Append, FileAccess.Write, FileShare.None))
            using (StreamWriter writer = new StreamWriter(fs, Encoding.ASCII))
            {
                string indexData = string.Empty;

                for (int count = 0; count < document.IndexDataCount; count++)
                {
                    indexData += string.Format("{0},", document.GetIndexDataValue(count));
                }
                indexData = indexData.TrimEnd(',');

                for (int count = 1; count < document.PageCount; count++ )
                    writer.WriteLine(string.Format("{0},{1}", indexData, _releaseData[string.Format("PageOutputFileName[{0}][{1}]", document.Number, count)]));

                writer.Flush();
                writer.Close();
            }
        }
开发者ID:ebruning,项目名称:CustomCsvExporter,代码行数:20,代码来源:CustomCsvExporter.cs

示例5: CreateIndex

        public void CreateIndex(IDocument document, IDictionary<string, string> releaseData, string outputFileName)
        {
            string index = string.Empty;

            using (FileStream stream = new FileStream(outputFileName, FileMode.Append,
                                                      FileAccess.Write, FileShare.None))
            using (StreamWriter writer = new StreamWriter(stream, Encoding.ASCII))
            {
                for (int i = 0; i < document.IndexDataCount; i++)
                    index += string.Format("{0}|", document.GetIndexDataValue(i));

                writer.WriteLine(index.TrimEnd('|'));

                foreach (KeyValuePair<string, string> file in releaseData)
                    if (WorkingMode == ReleaseMode.SinglePage)
                        writer.WriteLine("@{0}", file.Value);
                    else
                        writer.WriteLine(file.Value);

                writer.Flush();
                writer.Close();
            }
        }
开发者ID:ebruning,项目名称:Application-Xtender-Export,代码行数:23,代码来源:AxIndexGenerator.cs

示例6: GetIndexValue

 private string GetIndexValue(IDocument doc)
 {
     for (int indexCount = 0; indexCount < doc.IndexDataCount; indexCount++)
     {
         if (m_IndexField.Equals(doc.GetIndexDataLabel(indexCount)))
             return doc.GetIndexDataValue(indexCount);
     }
         return string.Empty;
 }
开发者ID:ebruning,项目名称:Colormax-Custom-Export,代码行数:9,代码来源:ColormaxCustomExport.cs

示例7: Release

        public void Release(IDocument doc)
        {
            if (_settings.BatchCreation == 0)
            {
                PdfDef _pdf = new PdfDef();

                String[] inputFileNames = new String[doc.PageCount];

                for (int i = 1; i <= doc.PageCount; i++)
                    inputFileNames[i - 1] = doc.GetPage(i).OutputFileName;

                _pdf.ChapterNumber = doc.Number;
                _pdf.TiffImages    = inputFileNames;
                _pdf.ChapterTitle  = doc.GetIndexDataValue(_settings.ChapterIndex);

                _documentList.Add(_pdf);
            }
            else
            {
                _docConverter.Convert(doc, Path.Combine(_batchFolder, Path.ChangeExtension(doc.Number.ToString(), "pdf")));
            }
        }
开发者ID:ebruning,项目名称:Enhanced-PDF-Export,代码行数:22,代码来源:EnhancedPdfExport.cs

示例8: Release

        public void Release(IDocument doc)
        {
            string[] indexValues = new string[doc.IndexDataCount];
            for (int i = 0; i < doc.IndexDataCount; i++)
                indexValues[i] = doc.GetIndexDataValue(i);

            string strName = DefaultName.CalculateDefaultName(_releaseSettings.DocumentName, _batchName, doc.Number, null, indexValues) + "." + _docConverter.DefaultExtension;
            string fileName = Utilities.UniqueFileName(Path.Combine(_batchFolder, strName));

            _docConverter.Convert(doc, fileName);

            SetDocumentDataMultiPage(doc, fileName);

            _xmlData.WriteDocumentFileDataMultiPage(Path.GetFileName(fileName));
        }
开发者ID:ebruning,项目名称:DocumentMall-Export-Connector,代码行数:15,代码来源:DmEc.cs

示例9: GetCustomType

        /// <summary>
        /// Get the value for the Document Type or Security Type
        /// </summary>
        /// <param name="doc">Current IDocument</param>
        /// <param name="value">The index name used to get the value</param>
        /// <param name="isSecKey">Is the value the security key</param>
        /// <returns>Return the index value or the custom value</returns>
        private string GetCustomType(IDocument doc, string value, bool isSecKey)
        {
            if (isSecKey)
                return doc.GetIndexDataValue(value) ?? _releaseSettings.SecurityKey;

            return doc.GetIndexDataValue(value) ?? _releaseSettings.DocumentType;
        }
开发者ID:ebruning,项目名称:DocumentMall-Export-Connector,代码行数:14,代码来源:DmEc.cs

示例10: ConvertRepositoryPath

        private string ConvertRepositoryPath(IDocument doc)
        {
            string[] indexValues = new string[doc.IndexDataCount];
            for (int i = 0; i < doc.IndexDataCount; i++)
                indexValues[i] = doc.GetIndexDataValue(i);

            return DefaultName.CalculateDefaultName(_releaseSettings.RepositoryPath, _batchName, doc.Number, null, indexValues);
        }
开发者ID:ebruning,项目名称:DocumentMall-Export-Connector,代码行数:8,代码来源:DmEc.cs

示例11: StartDocument

        public object StartDocument(IDocument doc)
        {
            string[] indexValues = new string[doc.IndexDataCount];
            for (int i = 0; i < doc.IndexDataCount; i++)
                indexValues[i] = doc.GetIndexDataValue(i);

            if (!Directory.Exists(_batchFolder))
                Directory.CreateDirectory(_batchFolder);

            _strName = DefaultName.CalculateDefaultName(_releaseSettings.DocumentName, _batchName, doc.Number, null, indexValues);
            _docNumber = doc.Number.ToString();
            _docRepositoryPath = ConvertRepositoryPath(doc);
            _docType = GetCustomType(doc, _releaseSettings.DocumentType, false);

            _indexArray.Clear();

            for (int i = 0; i < doc.IndexDataCount; i++)
                _indexArray.Add(string.Format("{0},{1}", doc.GetIndexDataLabel(i), doc.GetIndexDataValue(i)));

            return null;
        }
开发者ID:ebruning,项目名称:DocumentMall-Export-Connector,代码行数:21,代码来源:DmEc.cs

示例12: SetDocumentDataMultiPage

        public void SetDocumentDataMultiPage(IDocument doc, string fullyQulifiedFileName)
        {
            _xmlData.WriteDocumentData(Path.GetFileName(fullyQulifiedFileName),
                                       GetCustomType(doc, _releaseSettings.SecurityKey, true),
                                       ConvertRepositoryPath(doc),
                                       GetCustomType(doc, _releaseSettings.DocumentType, false));

            for (int indexCount = 0; indexCount < doc.IndexDataCount; indexCount++)
            {
                if (doc.GetIndexDataValue(indexCount) != GetCustomType(doc, _releaseSettings.DocumentType, false))
                    _xmlData.WriteDocumentIndexData(doc.GetIndexDataLabel(indexCount), doc.GetIndexDataValue(indexCount), fullyQulifiedFileName);
            }
        }
开发者ID:ebruning,项目名称:DocumentMall-Export-Connector,代码行数:13,代码来源:DmEc.cs


注:本文中的IDocument.GetIndexDataValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。