DocumentSystem.Document.LoadProperty C# (CSharp) Method

LoadProperty() public method

public LoadProperty ( string key, string value ) : void
key string
value string
return void
        public virtual void LoadProperty(string key, string value)
        {
            if (key == "name")
            {
                this.Name = value;
            }
            else if (key == "content")
            {
                this.Content = value;
            }
        }

Usage Example

        private static void AddDocument(Document doc, string[] attributes)
        {
            foreach (var attribute in attributes)
            {
                var tokens    = attribute.Split('=');
                var propName  = tokens[0];
                var propValue = tokens[1];
                doc.LoadProperty(propName, propValue);
            }

            if (doc.Name != null)
            {
                documents.Add(doc);
                Console.WriteLine("Document added: {0}", doc.Name);
            }
            else
            {
                Console.WriteLine("Document has no name");
            }
        }
All Usage Examples Of DocumentSystem.Document::LoadProperty