コード例 #1
0
 public void InitializeRenderFactory()
 {
     try
     {
         resini = File.ReadAllText("res.ini");
         if (resini == "High")
         {
             Console.WriteLine("Got resolution from res.ini");
             Console.WriteLine("Resolution set to high");
             renderFactory = new HighResRenderFactory();
         }
         else if (resini == "Low")
         {
             Console.WriteLine("Got resolution from res.ini");
             Console.WriteLine("Resolution set to low");
             renderFactory = new LowResRenderFactory();
         }
         else
         {
             Console.WriteLine("res.ini file should read either High or Low. Setting resolution to low by default");
             renderFactory = new LowResRenderFactory();
         }
     }
     catch (System.IO.FileNotFoundException)
     {
         Console.WriteLine("res.ini file not found. Setting resolution to low by default");
         renderFactory = new LowResRenderFactory();
     }
 }
コード例 #2
0
 public RendererFactory(IRenderFactory renderFactory)
 {
     this.renderFactory = renderFactory;
 }
コード例 #3
0
 public RendererFactory(IRenderFactory renderFactory)
 {
     this.renderFactory = renderFactory;
 }