コード例 #1
0
ファイル: DirectControl.cs プロジェクト: goutkannan/ironlab
 public DirectControl()
 {
     rectangle = new System.Windows.Shapes.Rectangle();
     try
     {
         CreateDirectImage();
         //throw new Exception("Artificial exception");
     }
     catch (Exception e)
     {
         // In case of error, just display message on Control
         messageBlock = new TextBlock() { Margin = new Thickness(5), Foreground = Brushes.Red };
         messageBlock.Text = "Error initializing DirectX control: " +  e.Message;
         messageBlock.Text += "\rTry installing latest DirectX End-User Runtime";
         this.Children.Add(messageBlock);
         directImage = null;
         initializationFailed = true;
         return;
     }
     directImage.RenderRequested += new EventHandler(directImage_RenderRequested);
     this.Children.Add(rectangle);
     RecreateImage();
     this.IsVisibleChanged += new DependencyPropertyChangedEventHandler(DirectControl_IsVisibleChanged);
     frontBufferCheckTimer.Tick += new EventHandler(frontBufferCheckTimer_Tick);
     frontBufferCheckTimer.Interval = TimeSpan.FromSeconds(0.5);
     frontBufferCheckTimer.Start();
 }
コード例 #2
0
 public DirectControl()
 {
     rectangle = new System.Windows.Shapes.Rectangle();
     try
     {
         CreateDirectImage();
         //throw new Exception("Artificial exception");
     }
     catch (Exception e)
     {
         // In case of error, just display message on Control
         messageBlock = new TextBlock()
         {
             Margin = new Thickness(5), Foreground = Brushes.Red
         };
         messageBlock.Text  = "Error initializing DirectX control: " + e.Message;
         messageBlock.Text += "\rTry installing latest DirectX End-User Runtime";
         this.Children.Add(messageBlock);
         directImage          = null;
         initializationFailed = true;
         return;
     }
     directImage.RenderRequested += new EventHandler(directImage_RenderRequested);
     this.Children.Add(rectangle);
     RecreateImage();
     this.IsVisibleChanged         += new DependencyPropertyChangedEventHandler(DirectControl_IsVisibleChanged);
     frontBufferCheckTimer.Tick    += new EventHandler(frontBufferCheckTimer_Tick);
     frontBufferCheckTimer.Interval = TimeSpan.FromSeconds(0.5);
     frontBufferCheckTimer.Start();
 }
コード例 #3
0
 public void Register(DirectImage image)
 {
     if (imageList.Contains(image))
     {
         throw new Exception("Multiple registration attempted.");
     }
     imageList.Add(image);
 }
コード例 #4
0
 public void Unregister(DirectImage image)
 {
     imageList.Remove(image);
 }
コード例 #5
0
 public void Unregister(DirectImage image)
 {
     imageList.Remove(image);
 }
コード例 #6
0
 public void Register(DirectImage image)
 {
     if (imageList.Contains(image)) throw new Exception("Multiple registration attempted."); 
     imageList.Add(image);
 }
コード例 #7
0
 public DirectPath()
 {
     this.geometry    = null;
     this.directImage = null;
 }
コード例 #8
0
ファイル: DirectPath.cs プロジェクト: goutkannan/ironlab
 public DirectPath()
 {
     this.geometry = null;
     this.directImage = null;
 }