本文整理汇总了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;
}