コード例 #1
0
ファイル: TrafficLight.cs プロジェクト: BdGL3/CXPortal
 override public void applyBehavior(UserControl control, string name, int value)
 {
     if (value == 0)
     {
         _objectGeometry.Material = (MaterialGroup)control.FindResource(TRAFFIC_GREEN_LIGHT_XML_TAG);
     }
     else if (value == 1)
     {
         _objectGeometry.Material = (MaterialGroup)control.FindResource(TRAFFIC_RED_LIGHT_XML_TAG);
     }
     else
     {
         setObjectHidden();
     }
 }
コード例 #2
0
ファイル: VehicleSensor.cs プロジェクト: BdGL3/CXPortal
 override public void applyBehavior(UserControl control, string name, int value)
 {
     if ((value != 1 && value != 2))
     {
         _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Good");
     }
     else if (value == 1)
     {
         _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Warning");
     }
     else if (value == 2)
     {
         _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Vehicle_Sensor_Bad");
     }
 }
コード例 #3
0
ファイル: MotionDetector.cs プロジェクト: BdGL3/CXPortal
 override public void applyBehavior(UserControl control, string name, int value)
 {
     if (value == 1)
     {
         _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Error");
     }
     else if (value == 2)
     {
         _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Warning");
     }
     else
     {
         _objectGeometry.Material = (Material)control.FindResource("M_Interlock");
     }
 }
コード例 #4
0
        override public void applyBehavior(UserControl control, string name, int value)
        {
            System.Console.WriteLine("Applying behavior to " + name + " value " + value);

            if (value == 1)
            {
                _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Error");
            }
            else if (value == 2)
            {
                _objectGeometry.Material = (MaterialGroup)control.FindResource("M_Warning");
            }
            else
            {
                _objectGeometry.Material = (Material)control.FindResource("M_Interlock");
            }
        }
コード例 #5
0
        /// <summary>
        /// Ga terug naar idle
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        public void playAnimation(String animation_name, UserControl uc) // Mogelijke animaties: idle, attack, winner
        {
            Storyboard sb = uc.FindResource(animation_name) as Storyboard;
            sb.Completed += (sender, eventArgs) =>
            {
                Storyboard sb2 = uc.FindResource("idle") as Storyboard;
                sb2.Begin();
                RefreshData();
            };
            sb.Begin();
        }