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


C# Basket.Open方法代码示例

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


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

示例1: createTemplateXML

        private string createTemplateXML(IExportDocument docRef, IExportTools exportTools, string tempfolder, string tempName)
        {
            string templateFolder = tempfolder;
            string templateName = tempName.ToString() + ".xml";
            string temp = templateFolder + "\\" + templateName;

            NTAccount ntAccount = new NTAccount("Everyone");
            SecurityIdentifier sid = (SecurityIdentifier)ntAccount.Translate(typeof(SecurityIdentifier));
            byte[] sidArray = new byte[sid.BinaryLength];
            sid.GetBinaryForm(sidArray, 0);

            if (!File.Exists(temp))
            {
                fileCabinetForm = new DocuwareFileCabinet(docRef, exportTools, temp);
                fileCabinetForm.ShowDialog();
            }
            if (File.Exists(temp))
            {
                // create the XmlReader object
                XmlReaderSettings settings = new XmlReaderSettings();
                XmlReader reader = XmlReader.Create(temp.ToString(), settings);

                int depth = -1; // tree depth is -1, no indentation

                while (reader.Read()) // display each node's content
                {
                    switch (reader.NodeType)
                    {
                        case XmlNodeType.Element: // XML Element, display its name
                            depth++; // increase tab depth
                            TabOutput(depth); // insert tabs

                            if (reader.Name == "FileCabinetName")
                            {
                                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();
//.........这里部分代码省略.........
开发者ID:bantran,项目名称:DocuwareExport,代码行数:101,代码来源:DocuwareExport.cs


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