using System;
using System.Collections.Generic;
using System.Text;
using smo = Microsoft.SqlServer.Management.Smo;
using System.IO;
namespace DynamicStaticValues
{
    class Program
    {
        static void PropertyOut(smo.Property property, TextWriter textWriter)
        {
            textWriter.WriteLine(property.Name);
            textWriter.WriteLine("  Expensive   = " + property.Expensive);
            textWriter.WriteLine("  Retrieved = " + property.Retrieved);
            textWriter.WriteLine("  Dirty = " + property.Dirty);
            textWriter.WriteLine("  Readable = " + property.Readable);
            textWriter.WriteLine("  Value =  " + property.Value);
        }
        static void Main(string[] args)
        {
            smo.Server localhost = new smo.Server();
            smo.Property inst = localhost.Properties["InstanceName"];
            PropertyOut(inst, Console.Out);
            smo.Database database0 = localhost.Databases[1];
            smo.Property p1 = null;
            smo.Property p2 = null;
            foreach (smo.Property p in database0.Properties)
            {
                if (p.Name == "PrimaryFilePath")
                {
                    p1 = p;
                }
                if (p.Name == "IsFullTextEnabled")
                {
                    p2 = p;
                }
            }
            PropertyOut(p1, Console.Out);
            PropertyOut(p2, Console.Out);
            smo.Property createDataProperty = database0.Properties["PrimaryFilePath"];
            PropertyOut(createDataProperty, Console.Out);
            

        }
    }
}
