本文整理汇总了C#中System.Windows.Freezable.Freeze方法的典型用法代码示例。如果您正苦于以下问题:C# Freezable.Freeze方法的具体用法?C# Freezable.Freeze怎么用?C# Freezable.Freeze使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Freezable
的用法示例。
在下文中一共展示了Freezable.Freeze方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryFreeze
/// <summary>
/// Try to freeze object
/// </summary>
/// <param name="freezable">Freezable object</param>
/// <returns></returns>
public static Boolean TryFreeze(Freezable freezable)
{
Debug.Assert(freezable != null);
if (freezable.CanFreeze)
{
freezable.Freeze();
return true;
}else return false;
}
示例2: return
FreezeIfFreezable
(
Freezable freezable
)
{
Debug.Assert(freezable != null);
if (freezable.CanFreeze)
{
freezable.Freeze();
return (true);
}
return (false);
}
示例3: Freeze
/// <summary>
/// Helper method that just invokes Freeze on provided
/// Freezable if it's not null. Otherwise it doesn't do anything.
/// </summary>
/// <param name="freezable">Freezable to freeze.</param>
/// <param name="isChecking">If this is true, the method will just check
/// to see that the object can be frozen, but won't actually freeze it.
/// </param>
/// <returns>True if the Freezable was or can be frozen.
/// False if isChecking was true and the Freezable can't be frozen.
/// </returns>
/// <exception cref="System.InvalidOperationException">This exception
/// will be thrown if isChecking is passed in as false and this
/// Freezable can't be frozen.</exception>
//
static protected internal bool Freeze(Freezable freezable, bool isChecking)
{
if (freezable != null)
{
return freezable.Freeze(isChecking);
}
// <mcalkins> I guess something that's null is always frozen.
return true;
}
示例4: SetupNewFreezable
/// <summary>
/// Freezes the given freezable if the fFreeze flag is true. Used by
/// the various drawing methods to freeze resources if there is no
/// chance the user might attempt to mutate it.
/// (i.e., there are no animations and the dependant properties are
/// null or themselves frozen.)
/// </summary>
private Freezable SetupNewFreezable(Freezable newFreezable, bool fFreeze)
{
if (fFreeze)
{
newFreezable.Freeze();
}
return newFreezable;
}