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


C# Basket.ImportFile方法代码示例

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


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

示例1: createTemplateXML


//.........这里部分代码省略.........
                            {
                                depth++;
                                reader.Read();
                                xmlfilecabinetpath = reader.Value;
                                depth--;
                                reader.Read();
                            }
                            if (reader.Name == "FieldName")
                            {
                                depth++;
                                reader.Read();
                                xmlfieldname = reader.Value;
                                fieldnamelist.Add(reader.Value);
                                getFields(docRef.Children, docRef, xmlfieldname);
                                depth--;
                                reader.Read();
                            }
                            if (reader.Name == "FieldIndex")
                            {
                                depth++;
                                reader.Read();
                                xmlfieldindex = reader.Value;
                                fieldindexlist.Add(Convert.ToUInt32(reader.Value));
                                depth--;
                                reader.Read();
                                openWith.Add(Convert.ToInt32(xmlfieldindex), fieldValue);
                            }

                            // if empty element, decrease depth
                            if (reader.IsEmptyElement)
                                depth--;
                            break;
                        case XmlNodeType.Comment: // XML Comment, display it
                            TabOutput(depth); // insert tabs
                            break;
                        case XmlNodeType.Text: // XML Text, display it
                            TabOutput(depth); // insert tabs
                            break;

                        // XML XMLDeclaration, display it
                        case XmlNodeType.XmlDeclaration:
                            TabOutput(depth); // insert tabs
                            break;
                        case XmlNodeType.EndElement: // XML EndElement, display it
                            TabOutput(depth); // insert tabs
                            depth--; // decrement depth
                            break;
                    } // end switch
                } // end while

                //------------------- DocuWare -------------------
                string fullimportimagepath = exportImages(docRef, exportTools, templateFolder);
                UpdateLogFile("Full path of current working image: "+fullimportimagepath);

                //select filecabinet
                filecabinet = new FileCabinet(session, xmlfilecabinetpath);
                UpdateLogFile(filecabinet.FileCabinetPath);
                filecabinet.Open();
                abasket = new ActiveBasket(session);

                // open basket
                basket = session.GetActiveBasket();
                basket = new Basket(session, abasket.BasketPath);
                UpdateLogFile("Active Basket Path: " + abasket.BasketPath);
                basket = new ActiveBasket(session);
                basket.Open();
                basket.SetAsActive();
                UpdateLogFile("Basket: "+basket.BasketPath);

                //sending bantran.tif to current basket.
                docum = basket.ImportFile(fullimportimagepath);

                UpdateLogFile("FileName: "+docum.FileName);
                if (File.Exists(fullimportimagepath))
                {
                    File.Delete(fullimportimagepath);
                }

                int numberofdocuments = basket.GetNumberOfDocuments();

                docum = new Document(basket, docum.FileName);
                UpdateLogFile("Name: " + docum.Name);
                UpdateLogFile("FileName: " + docum.FileName);

                if (!File.Exists(docum.FileName))
                {
                    UpdateLogFile(docum.FileName + " path does not exist after import into basket.");
                }

                try
                {
                    filecabinet.Store(docum, false, true, openWith);
                }
                catch (Exception e)
                {
                    UpdateLogFile(filecabinet.LastException.Message+ " | " + e.Message);
                }
            }
            return templateName;
        }
开发者ID:bantran,项目名称:DocuwareExport,代码行数:101,代码来源:DocuwareExport.cs


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