コード例 #1
0
		public override void Apply(ComputedStyle style,Value value){
			
			// Is it lit?
			bool lit=(value!=null && value.Boolean);
			
			if(!lit && style.Shading==null){
				// Essentially ignore it anyway.
				return;
			}
			
			if(style.Shading==null){
				// It's lit:
				style.RequireShading().Lit=true;
			}else{
				// It's not lit:
				style.Shading.Lit=false;
				
				// Optimise - might no longer need the shading info:
				style.Shading.Optimise();
			}
			
			// Request a layout now:
			style.RequestLayout();
			
		}
コード例 #2
0
		public override void Apply(ComputedStyle style,Value value){
			
			ShaderSet family=null;
			
			// Apply:
			if(value!=null){
				
				// Lowercase so we can have the best chance at spotting the standard set (which is optimised for).
				string familyLC=value.Text.ToLower();
				
				if(familyLC!="standardui" && familyLC!="standard" && familyLC!="" && familyLC!="none"){
					
					// Get the family:
					family=ShaderSet.Get(value.Text);
					
				}
				
			}
			
			// Apply it here:
			if(style.Shading!=null){
				
				// Update it:
				style.Shading.Shaders=family;
				
				if(family==null){
					// Check if the shading data is no longer in use:
					style.Shading.Optimise();
				}
				
			}else if(family!=null){
				
				style.RequireShading().Shaders=family;
				
			}
			
			// Request a layout now:
			style.RequestLayout();
			
		}