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


C# IDocument.LoadProperty方法代码示例

本文整理汇总了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);
        }
    }
开发者ID:huoxudong125,项目名称:TelerikAcademy,代码行数:27,代码来源:DocumentSystem.cs

示例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");
 }
开发者ID:Termininja,项目名称:BGCoder,代码行数:14,代码来源:Program.cs

示例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);
     }
 }
开发者ID:naturalna,项目名称:OOPPrinciples,代码行数:17,代码来源:Program.cs

示例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);
     }
 }
开发者ID:androidejl,项目名称:Telerik,代码行数:17,代码来源:DocumentSystem.cs

示例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");
     }
 }
开发者ID:KirilToshev,项目名称:Projects,代码行数:17,代码来源:DocumentSystem.cs

示例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);
            }
        }
开发者ID:MihailGochev,项目名称:Telerik,代码行数:18,代码来源:DocumentSystemTest.cs

示例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);
            }
        }
开发者ID:NikolayKostadinov,项目名称:Homeworks,代码行数:18,代码来源:DocumentSystem.cs

示例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");
     }
 }
开发者ID:smihaylovit,项目名称:TelerikHomework,代码行数:20,代码来源:DocumentSystem.cs

示例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");
     }
 }
开发者ID:veselaparvanova,项目名称:TelerikAcademy-1,代码行数:19,代码来源:DocumentSystem.cs

示例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");
            }
        }
开发者ID:unbelt,项目名称:Telerik,代码行数:20,代码来源:DocumentSystem.cs

示例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");
    }
开发者ID:Jarolim,项目名称:HomeWork,代码行数:22,代码来源:DocumentSystem.cs

示例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;
        }
开发者ID:BlueForeverI,项目名称:OOPHomework,代码行数:26,代码来源:DocumentSystemTest.cs

示例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");
        }
    }
开发者ID:deyantodorov,项目名称:TelerikAcademy,代码行数:18,代码来源:Program.cs

示例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");
        }
    }
开发者ID:Dyno1990,项目名称:TelerikAcademy-1,代码行数:18,代码来源:DocumentSystem.cs

示例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");
     }
 }
开发者ID:hristo11111,项目名称:TelerikAcademy-HristoBratanov,代码行数:23,代码来源:Program.cs


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