Beispiel #1
0
    protected virtual void Initialize(RootDomain domain)
    {
        BasicDomainConfiguration configuration;
        Stream stream;

        configuration = new BasicDomainConfiguration();
        stream = this.GetResourceAsStream(
            "BaseSettings/RootDomain.xml",
            true);
        try
        {
            configuration.Load(stream);
        }
        finally
        {
            stream.Close();
        }
        stream = this.GetResourceAsStream(
            "LocalSettings/RootDomain.xml",
            false);
        if (stream != null)
        {
            try
            {
                configuration.Load(stream);
            }
            finally
            {
                stream.Close();
            }
        }
        domain.Initialize(configuration);
    }
Beispiel #2
0
        public static void Main(string[] arguments)
        {
            TestDomain domain;
            BasicDomainConfiguration configuration;
            Stream stream;

            domain = new TestDomain();
            configuration = new BasicDomainConfiguration();
            stream = File.OpenRead("DomainTests.xml");
            try
            {
                configuration.Load(stream);
            }
            finally
            {
                stream.Close();
            }
            domain.Initialize(configuration);
            Console.WriteLine(String.Format(
                "* I have got: {0}",
                domain.EveryNew.Get().GetType().Name));
            Console.WriteLine(String.Format(
                "* I have got: {0}",
                domain.Singleton.Get().GetType().Name));
            Console.WriteLine(String.Format(
                "* I have got: {0}",
                domain.Ordered0.Get().GetType().Name));
            Console.WriteLine(String.Format(
                "* I have got: {0}",
                domain.Ordered1.Get().GetType().Name));
            Console.WriteLine(String.Format(
                "* I have got: {0}",
                domain.EveryNew.Get().GetType().Name));
            Console.WriteLine(String.Format(
                "* I have got: {0}",
                domain.Singleton.Get().GetType().Name));
            Console.WriteLine(String.Format(
                "* I have got: {0}",
                domain.Ordered0.Get().GetType().Name));
            Console.WriteLine(String.Format(
                "* I have got: {0}",
                domain.Ordered1.Get().GetType().Name));
            Console.WriteLine("press ENTER to exit");
            Console.ReadLine();
        }