当前位置: 首页>>代码示例>>C#>>正文


C# Freezable.Freeze方法代码示例

本文整理汇总了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;
        }
开发者ID:KevinCathcart,项目名称:GraphX,代码行数:15,代码来源:GeometryHelper.cs

示例2: return

    FreezeIfFreezable
    (
        Freezable freezable
    )
    {
        Debug.Assert(freezable != null);

        if (freezable.CanFreeze)
        {
            freezable.Freeze();

            return (true);
        }

        return (false);
    }
开发者ID:2014-sed-team3,项目名称:term-project,代码行数:16,代码来源:WpfGraphicsUtil.cs

示例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;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:26,代码来源:Freezable.cs

示例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; 
        }
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:16,代码来源:DrawingDrawingContext.cs


注:本文中的System.Windows.Freezable.Freeze方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。