コード例 #1
0
ファイル: UIElement.cs プロジェクト: samuelGrahame/Granular
        public UIElement()
        {
            logicalChildren          = new List <object>();
            LogicalChildren          = new ReadOnlyCollection <object>(logicalChildren);
            routedEventHandlers      = new ListDictionary <RoutedEvent, RoutedEventHandlerItem>();
            routedEventHandlersCache = CacheDictionary <RoutedEvent, IEnumerable <RoutedEventHandlerItem> > .CreateUsingStringKeys(ResolveRoutedEventHandlers, routedEvent => routedEvent.StringKey);

            DesiredSize           = Size.Zero;
            PreviousFinalRect     = Rect.Empty;
            PreviousAvailableSize = Size.Infinity;
            previousDesiredSize   = Size.Empty;

            VisualClipToBounds     = ClipToBounds;
            VisualIsHitTestVisible = IsHitTestVisible;
            VisualIsVisible        = IsVisible;
            VisualOpacity          = Opacity;

            disableMeasureInvalidationToken = new Disposable(() => disableMeasureInvalidationRequests--);
        }
コード例 #2
0
ファイル: DependencyProperty.cs プロジェクト: Ref12/Grazor
        private DependencyProperty(DependencyPropertyHashKey hashKey, Type propertyType, PropertyMetadata metadata, ValidateValueCallback validateValueCallback, bool isAttached, bool isReadOnly)
        {
            this.hashKey               = hashKey;
            this.Name                  = hashKey.Name;
            this.OwnerType             = hashKey.Owner;
            this.PropertyType          = propertyType;
            this.ValidateValueCallback = validateValueCallback;
            this.IsReadOnly            = isReadOnly;
            this.Inherits              = metadata.Inherits;
            this.StringKey             = hashKey.StringKey;
            this.hashCode              = hashKey.GetHashCode();

            this.ownerMetadata = metadata;
            this.IsAttached    = isAttached;

            typeMetadata = new ConvertedStringDictionary <Type, PropertyMetadata>(type => type.FullName);
            typeMetadata.Add(OwnerType, ownerMetadata);

            typeMetadataCache = CacheDictionary <Type, PropertyMetadata> .CreateUsingStringKeys(ResolveTypeMetadata, type => type.FullName);

            typeContainsCache = CacheDictionary <Type, bool> .CreateUsingStringKeys(ResolveTypeContains, type => type.FullName);
        }
コード例 #3
0
 public EmbeddedResourceObjectFactory(HtmlValueConverter converter)
 {
     this.converter = converter;
     objectUrlCache = CacheDictionary <Uri, string> .CreateUsingStringKeys(ResolveObjectUrl, uri => uri.GetAbsoluteUri());
 }
コード例 #4
0
ファイル: SystemResources.cs プロジェクト: will8886/Granular
 public SystemResources()
 {
     themeResourcesCache = CacheDictionary <Assembly, ResourceDictionary> .CreateUsingStringKeys(ResolveAssemblyThemeResources, assembly => assembly.FullName);
 }
コード例 #5
0
 private RenderImageSourceFactory(IHtmlValueConverter converter)
 {
     this.converter = converter;
     objectUrlCache = CacheDictionary <string, string> .CreateUsingStringKeys(ResolveObjectUrl);
 }