コード例 #1
0
 private void ChangeHostControlAccordingToNewLight(IDiscreteLight newLightValue)
 {
     if (null == newLightValue)
     {
         ChangeHostControl(null);
     }
     else if (newLightValue is DirectionalLight)
     {
         var ctrl = new DirectionalLightControl
         {
             SelectedValue = newLightValue as DirectionalLight
         };
         ChangeHostControl(ctrl);
     }
     else if (newLightValue is PointLight)
     {
         var ctrl = new PointLightControl
         {
             SelectedValue = newLightValue as PointLight
         };
         ChangeHostControl(ctrl);
     }
     else if (newLightValue is SpotLight)
     {
         var ctrl = new SpotLightControl
         {
             SelectedValue = newLightValue as SpotLight
         };
         ChangeHostControl(ctrl);
     }
     else
     {
         throw new NotImplementedException();
     }
 }
コード例 #2
0
		private void ChangeHostControlAccordingToNewLight(IDiscreteLight newLightValue)
		{
			if (null == newLightValue)
			{
				ChangeHostControl(null);
			}
			else if (newLightValue is DirectionalLight)
			{
				var ctrl = new DirectionalLightControl();
				ctrl.SelectedValue = newLightValue as DirectionalLight;
				ChangeHostControl(ctrl);
			}
			else if (newLightValue is PointLight)
			{
				var ctrl = new PointLightControl();
				ctrl.SelectedValue = newLightValue as PointLight;
				ChangeHostControl(ctrl);
			}
			else if (newLightValue is SpotLight)
			{
				var ctrl = new SpotLightControl();
				ctrl.SelectedValue = newLightValue as SpotLight;
				ChangeHostControl(ctrl);
			}
			else
			{
				throw new NotImplementedException();
			}
		}