/// <summary>
        ///     Returns whether or not an enumeration instance a valid value.
        ///     This method is designed to be used with ValidateValueCallback, and thus
        ///     matches it's prototype.
        /// </summary>
        /// <param name="valueObject">
        ///     Enumeration value to validate.
        /// </param>
        /// <returns> 'true' if the enumeration contains a valid value, 'false' otherwise. </returns>
        public static bool IsCachingHintValid(object valueObject)
        {
            CachingHint value = (CachingHint)valueObject;

            return((value == CachingHint.Unspecified) ||
                   (value == CachingHint.Cache));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Writes the attached property CachingHint to the given object.
 /// </summary>
 public static void SetCachingHint(DependencyObject target, CachingHint cachingHint)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     target.SetValue(CachingHintProperty, cachingHint);
 }
Ejemplo n.º 3
0
        public void Stub04()
        {
            DrawingBrush drawingBrush = new DrawingBrush();

            RenderOptions.SetCacheInvalidationThresholdMinimum(drawingBrush, 0.5);
            RenderOptions.SetCacheInvalidationThresholdMaximum(drawingBrush, 2.0);
            RenderOptions.SetCachingHint(drawingBrush, CachingHint.Cache);

            // <SnippetRenderOptionsSnippet4>
            // Get the caching hint option for the brush.
            CachingHint cachingHint = RenderOptions.GetCachingHint(drawingBrush);

            if (cachingHint == CachingHint.Cache)
            {
                // Get the minimum and maximum relative sizes for regenerating the tiled brush.
                double minimum = RenderOptions.GetCacheInvalidationThresholdMinimum(drawingBrush);
                double maximum = RenderOptions.GetCacheInvalidationThresholdMaximum(drawingBrush);

                // Perform action based on cache values...
            }
            // </SnippetRenderOptionsSnippet4>
        }
 public static void SetCachingHint(System.Windows.DependencyObject target, CachingHint cachingHint)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Writes the attached property CachingHint to the given object.
 /// </summary>
 public static void SetCachingHint(DependencyObject target, CachingHint cachingHint)
 {
     if (target == null) { throw new ArgumentNullException("target"); }
     target.SetValue(CachingHintProperty, cachingHint);
 }
 public static void SetCachingHint(System.Windows.DependencyObject target, CachingHint cachingHint)
 {
 }