本文整理汇总了C#中IDocument.LoadProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IDocument.LoadProperty方法的具体用法?C# IDocument.LoadProperty怎么用?C# IDocument.LoadProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDocument
的用法示例。
在下文中一共展示了IDocument.LoadProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddDocument
private static void AddDocument(IDocument doc, string[] attributes)
{
IList<KeyValuePair<string, object>> attrList = new List<KeyValuePair<string, object>>();
foreach (var attribute in attributes)
{
string[] keyValue = attribute.Split('=');
attrList.Add(new KeyValuePair<string, object>(keyValue[0], keyValue[1]));
}
var name = (from pair in attrList
where pair.Key == "name"
select pair).FirstOrDefault();
if (name.Value == null)
{
Console.WriteLine("Document has no name");
}
else
{
Console.WriteLine("Document added: {0}", name.Value);
foreach (var item in attrList)
{
doc.LoadProperty(item.Key.ToString(), item.Value.ToString());
}
listOfDocuments.Add(doc);
}
}
示例2: AddSomeDocument
private static void AddSomeDocument(IDocument file, string[] attributes)
{
foreach (var properties in attributes)
{
string[] property = properties.Split('=');
file.LoadProperty(property[0], property[1]);
}
if (file.Name != null)
{
files.Add(file);
Console.WriteLine("Document added: " + file.Name);
}
else Console.WriteLine("Document has no name");
}
示例3: AddDocument
private static void AddDocument(IDocument document, string[] attributes)
{
foreach (var abtr in attributes)
{
string[] separateAtr = abtr.Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
document.LoadProperty(separateAtr[0], separateAtr[1]);
}
if (document.Name == null)
{
Console.WriteLine("Document has no name");
}
else
{
allDocs.Add(document);
Console.WriteLine("Document added: {0}",document.Name);
}
}
示例4: AddDocument
public static void AddDocument(IDocument newDocument, string[] attributes)
{
foreach (var attribute in attributes)
{
string[] parts = attribute.Split('=');
newDocument.LoadProperty(parts[0], parts[1]);
}
if (newDocument.Name == null)
{
Console.WriteLine("Document has no name");
}
else
{
Console.WriteLine("Document added: " + newDocument.Name);
documents.Add(newDocument);
}
}
示例5: AddDocument
private static void AddDocument(string[] attributes, IDocument document)
{
foreach (string pair in attributes)
{
string[] dataPair = pair.Split('=');
document.LoadProperty(dataPair[0], dataPair[1]);
}
if (document.Name != null)
{
documents.Add(document);
Console.WriteLine("Document added: {0}", document.Name);
}
else
{
Console.WriteLine("Document has no name");
}
}
示例6: AddDocument
private static void AddDocument(IDocument document, string[] attributes)
{
foreach (var prop in attributes)
{
var properties = prop.Split('=');
document.LoadProperty(properties[0], properties[1]);
}
if (document.Name == null)
{
Console.WriteLine("Document has no name");
}
else
{
Console.WriteLine("Document added: " + document.Name);
AllDocuments.Add(document);
}
}
示例7: AddDocument
private string AddDocument(IDocument document, string[] attributes)
{
foreach (var attribute in attributes)
{
var keyValue = this.ParseAttribute(attribute);
document.LoadProperty(keyValue.Key, keyValue.Value);
}
if (document.Name == null)
{
return "Document has no name";
}
else
{
this.documents.Add(document);
return string.Format("Document added: {0}", document.Name);
}
}
示例8: AddDocument
//
private static void AddDocument(IDocument doc, string[] attributes)
{
foreach (var item in attributes)
{
string[] tokens = item.Split('=');
string propertyName = tokens[0];
string propertyValue = tokens[1];
doc.LoadProperty(propertyName, propertyValue);
}
if (doc.Name != null)
{
documents.Add(doc);
Console.WriteLine("Document added: " + doc.Name);
}
else
{
Console.WriteLine("Document has no name");
}
}
示例9: AddDocument
private static void AddDocument(IDocument doc, string[] attributes)
{
foreach (var attrib in attributes)
{
string[] keyAndValue = attrib.Split('=');
string key = keyAndValue[0];
string value = keyAndValue[1];
doc.LoadProperty(key, value);
}
if (doc.Name != null)
{
documents.Add(doc);
Console.WriteLine("Document added: " + doc.Name);
}
else
{
Console.WriteLine("Document has no name");
}
}
示例10: AddDocument
private static void AddDocument(IDocument doc, string[] properties)
{
foreach (var prop in properties)
{
string[] keyValue = prop.Split('=');
string key = keyValue[0];
string value = keyValue[1];
doc.LoadProperty(key, value);
}
if (doc.Name != null)
{
documents.Add(doc);
Console.WriteLine("Document added: {0}", doc.Name);
}
else
{
Console.WriteLine("Document has no name");
}
}
示例11: AddDocument
private static void AddDocument(IDocument document, string[] attributes)
{
foreach (var attr in attributes)
{
string[] property = attr.Split('=');
string key = property[0];
string value = property[1];
document.LoadProperty(key, value);
}
if (document.Name == null || document.Name == "")
{
Console.WriteLine("Document has no name");
}
else
{
documents.Add(document);
Console.WriteLine("Document added: {0}", document.Name);
}
//Console.WriteLine("Test");
}
示例12: ApplyAttributes
// applies a list of properties and returns the name property
private static string ApplyAttributes(string[] attributes, IDocument document)
{
string name = "";
foreach (var attribute in attributes)
{
string[] keyValuePair = attribute.Split(new char[] { '=' });
if (keyValuePair.Length > 0)
{
string key = keyValuePair[0];
string value = keyValuePair[1];
if (key == "name" && !string.IsNullOrEmpty(value)
&& !string.IsNullOrWhiteSpace(value))
{
name = value;
}
document.LoadProperty(key, value);
}
}
return name;
}
示例13: AddDocument
private static void AddDocument(string[] attributes, IDocument doc)
{
foreach (string attr in attributes)
{
string[] keyValue = attr.Split('=');
doc.LoadProperty(keyValue[0], keyValue[1]);
}
if (!string.IsNullOrEmpty(doc.Name))
{
documents.Add(doc);
Console.WriteLine("Document added: {0}", doc.Name);
}
else
{
Console.WriteLine("Document has no name");
}
}
示例14: AddDocument
public static void AddDocument(IDocument doc, string[] attributes)
{
foreach (var attrib in attributes)
{
string[] keyVal = attrib.Split('=');
doc.LoadProperty(keyVal[0], keyVal[1]);
}
if (doc.Name != null)
{
documents.Add(doc);
Console.WriteLine("Document added: " + doc.Name);
}
else
{
Console.WriteLine("Document has no name");
}
}
示例15: AddDocument
private static void AddDocument(string[] attributes, IDocument doc)
{
bool isDocument = false;
var properties = new List<KeyValuePair<string, object>>();
foreach (var item in attributes)
{
string[] attribs = item.Split('=');
doc.LoadProperty(attribs[0], attribs[1]);
if (attribs[0] == "name")
{
isDocument = true;
}
}
if (isDocument)
{
documents.Add(doc);
Console.WriteLine("Document added: " + doc.Name);
}
else
{
Console.WriteLine("Document has no name");
}
}