本文整理汇总了C#中TextBlock.FindChild方法的典型用法代码示例。如果您正苦于以下问题:C# TextBlock.FindChild方法的具体用法?C# TextBlock.FindChild怎么用?C# TextBlock.FindChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextBlock
的用法示例。
在下文中一共展示了TextBlock.FindChild方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAnimationState
void LoadAnimationState( TextBlock block )
{
TextBlock itemBlock = block.FindChild( "currentAnimationItem" );
if( itemBlock != null )
{
string animationBaseName =
itemBlock.GetAttribute( "animationBaseName" );
bool allowRandomAnimationNumber = bool.Parse(
itemBlock.GetAttribute( "allowRandomAnimationNumber", "true" ) );
bool loop = bool.Parse( itemBlock.GetAttribute( "loop", "true" ) );
currentAnimationItem = animationController.Add( animationBaseName,
allowRandomAnimationNumber, loop );
if( currentAnimationItem != null )
{
MeshObjectAnimationController.AnimationItem item = currentAnimationItem;
if( itemBlock.IsAttributeExist( "velocity" ) )
item.Velocity = float.Parse( itemBlock.GetAttribute( "velocity" ) );
if( itemBlock.IsAttributeExist( "weight" ) )
item.Weight = float.Parse( itemBlock.GetAttribute( "weight" ) );
if( itemBlock.IsAttributeExist( "timePosition" ) )
item.TimePosition = float.Parse( itemBlock.GetAttribute( "timePosition" ) );
}
}
if( block.IsAttributeExist( "forceAnimationRemainingTime" ) )
{
forceAnimationRemainingTime = float.Parse(
block.GetAttribute( "forceAnimationRemainingTime" ) );
}
}
示例2: OnSave
protected override bool OnSave( TextBlock block )
{
TextBlock normalModeBlock = block.FindChild( "normalMode" );
if( normalModeBlock == null )
Log.Fatal( "{0} : normalMode Block not exists", Name );
if( !normalMode.Save( normalModeBlock ) )
return false;
TextBlock alternativeModeBlock = block.FindChild( "alternativeMode" );
if( alternativeModeBlock == null )
Log.Fatal( "{0} : alternativeMode Block not exists", Name );
if( !alternativeMode.Save( alternativeModeBlock ) )
return false;
return base.OnSave( block );
}
示例3: Load
public bool Load( TextBlock block )
{
//fireObjects
TextBlock fireObjectsBlock = block.FindChild( "fireObjects" );
if( fireObjectsBlock != null )
{
if( !fireObjects.Load( fireObjectsBlock ) )
return false;
}
return true;
}
示例4: Load
public void Load( TextBlock block )
{
if( block.IsAttributeExist( "scroll" ) )
scroll = Vec2.Parse( block.GetAttribute( "scroll" ) );
if( block.IsAttributeExist( "scale" ) )
scale = Vec2.Parse( block.GetAttribute( "scale" ) );
if( block.IsAttributeExist( "rotate" ) )
rotate = float.Parse( block.GetAttribute( "rotate" ) );
if( block.IsAttributeExist( "dynamicParameters" ) )
dynamicParameters = bool.Parse( block.GetAttribute( "dynamicParameters" ) );
TextBlock animationBlock = block.FindChild( "animation" );
if( animationBlock != null )
animation.Load( animationBlock );
}
示例5: OnLoad
protected override bool OnLoad( TextBlock block )
{
TextBlock normalModeBlock = block.FindChild( "normalMode" );
if( normalModeBlock != null )
if( !normalMode.Load( normalModeBlock ) )
return false;
TextBlock alternativeModeBlock = block.FindChild( "alternativeMode" );
if( alternativeModeBlock != null )
if( !alternativeMode.Load( alternativeModeBlock ) )
return false;
return base.OnLoad( block );
}
示例6: OnLoad
protected override bool OnLoad( TextBlock block )
{
if( !base.OnLoad( block ) )
return false;
//General
{
if( block.IsAttributeExist( "blending" ) )
blending = (MaterialBlendingTypes)Enum.Parse(
typeof( MaterialBlendingTypes ), block.GetAttribute( "blending" ) );
if( block.IsAttributeExist( "lighting" ) )
lighting = bool.Parse( block.GetAttribute( "lighting" ) );
if( block.IsAttributeExist( "ambientLighting" ) )
ambientLighting = bool.Parse( block.GetAttribute( "ambientLighting" ) );
if( block.IsAttributeExist( "doubleSided" ) )
doubleSided = bool.Parse( block.GetAttribute( "doubleSided" ) );
//old version compatibility
if( block.IsAttributeExist( "culling" ) )
doubleSided = !bool.Parse( block.GetAttribute( "culling" ) );
if( block.IsAttributeExist( "useNormals" ) )
useNormals = bool.Parse( block.GetAttribute( "useNormals" ) );
if( block.IsAttributeExist( "receiveShadows" ) )
receiveShadows = bool.Parse( block.GetAttribute( "receiveShadows" ) );
if( block.IsAttributeExist( "receiveSimpleShadows" ) )
receiveSimpleShadows = bool.Parse( block.GetAttribute( "receiveSimpleShadows" ) );
if( block.IsAttributeExist( "alphaRejectFunction" ) )
alphaRejectFunction = (CompareFunction)Enum.Parse( typeof( CompareFunction ),
block.GetAttribute( "alphaRejectFunction" ) );
if( block.IsAttributeExist( "alphaRejectValue" ) )
alphaRejectValue = byte.Parse( block.GetAttribute( "alphaRejectValue" ) );
if( block.IsAttributeExist( "alphaToCoverage" ) )
alphaToCoverage = bool.Parse( block.GetAttribute( "alphaToCoverage" ) );
if( block.IsAttributeExist( "fadingByDistanceRange" ) )
fadingByDistanceRange = Range.Parse( block.GetAttribute( "fadingByDistanceRange" ) );
if( block.IsAttributeExist( "allowFog" ) )
allowFog = bool.Parse( block.GetAttribute( "allowFog" ) );
if( block.IsAttributeExist( "depthWrite" ) )
depthWrite = bool.Parse( block.GetAttribute( "depthWrite" ) );
if( block.IsAttributeExist( "depthTest" ) )
depthTest = bool.Parse( block.GetAttribute( "depthTest" ) );
if( block.IsAttributeExist( "softParticles" ) )
softParticles = bool.Parse( block.GetAttribute( "softParticles" ) );
if( block.IsAttributeExist( "softParticlesFadingLength" ) )
softParticlesFadingLength = float.Parse( block.GetAttribute( "softParticlesFadingLength" ) );
if( block.IsAttributeExist( "depthOffset" ) )
depthOffset = float.Parse( block.GetAttribute( "depthOffset" ) );
if( block.IsAttributeExist( "halfLambert" ) )
halfLambert = bool.Parse( block.GetAttribute( "halfLambert" ) );
}
//Diffuse
{
//old version compatibility
if( block.IsAttributeExist( "diffuseScale" ) )
{
diffuseColor = ColorValue.Parse( block.GetAttribute( "diffuseScale" ) );
float power = Math.Max( Math.Max( diffuseColor.Red, diffuseColor.Green ),
diffuseColor.Blue );
if( power > 1 )
{
diffuseColor.Red /= power;
diffuseColor.Green /= power;
diffuseColor.Blue /= power;
diffusePower = power;
}
}
if( block.IsAttributeExist( "diffuseColor" ) )
diffuseColor = ColorValue.Parse( block.GetAttribute( "diffuseColor" ) );
if( block.IsAttributeExist( "diffusePower" ) )
diffusePower = float.Parse( block.GetAttribute( "diffusePower" ) );
if( block.IsAttributeExist( "diffuseScaleDynamic" ) )
diffuseScaleDynamic = bool.Parse( block.GetAttribute( "diffuseScaleDynamic" ) );
if( block.IsAttributeExist( "diffuseVertexColor" ) )
diffuseVertexColor = bool.Parse( block.GetAttribute( "diffuseVertexColor" ) );
TextBlock diffuse1MapBlock = block.FindChild( "diffuse1Map" );
if( diffuse1MapBlock != null )
diffuse1Map.Load( diffuse1MapBlock );
TextBlock diffuse2MapBlock = block.FindChild( "diffuse2Map" );
//.........这里部分代码省略.........
示例7: OnLoad
protected override bool OnLoad(TextBlock block)
{
if (!base.OnLoad(block))
return false;
//hitObjects
TextBlock hitObjectsBlock = block.FindChild("hitObjects");
if (hitObjectsBlock != null)
{
if (!hitObjects.Load(hitObjectsBlock))
return false;
}
return true;
}
示例8: OnLoad
protected override bool OnLoad(TextBlock block)
{
if (!base.OnLoad(block))
return false;
//currentTask
{
TextBlock taskBlock = block.FindChild("currentTask");
if (taskBlock != null)
{
Task task = CreateTaskByClassName(taskBlock.GetAttribute("class"));
if (task._Load(taskBlock))
currentTask = task;
}
}
//tasks
TextBlock tasksBlock = block.FindChild("tasks");
if (tasksBlock != null)
{
foreach (TextBlock taskBlock in tasksBlock.Children)
{
if (taskBlock.Name == "item")
{
Task task = CreateTaskByClassName(taskBlock.GetAttribute("class"));
if (task._Load(taskBlock))
tasks.Enqueue(task);
}
}
}
return true;
}
示例9: OnLoad
protected override bool OnLoad( TextBlock block )
{
if( !base.OnLoad( block ) )
return false;
//dieObjects
TextBlock dieObjectsBlock = block.FindChild( "dieObjects" );
if( dieObjectsBlock != null )
{
if( !dieObjects.Load( dieObjectsBlock ) )
return false;
}
//old version compatibility
if( block.IsAttributeExist( "lifeMax" ) )
healthMax = float.Parse( block.GetAttribute( "lifeMax" ) );
if( block.IsAttributeExist( "lifeMin" ) )
healthMin = float.Parse( block.GetAttribute( "lifeMin" ) );
return true;
}