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


C# DependencyObject.GetValueOrRegisterParentNotifier方法代码示例

本文整理汇总了C#中System.Windows.DependencyObject.GetValueOrRegisterParentNotifier方法的典型用法代码示例。如果您正苦于以下问题:C# DependencyObject.GetValueOrRegisterParentNotifier方法的具体用法?C# DependencyObject.GetValueOrRegisterParentNotifier怎么用?C# DependencyObject.GetValueOrRegisterParentNotifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.DependencyObject的用法示例。


在下文中一共展示了DependencyObject.GetValueOrRegisterParentNotifier方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetDictionary

        /// <summary>
        /// Get the dictionary from the context, if possible.
        /// </summary>
        /// <param name="target">The target object.</param>
        /// <returns>The dictionary name, if available.</returns>
        protected override string GetDictionary(DependencyObject target)
        {
            if (target == null)
                return FallbackDictionary;

            var dictionary = target.GetValueOrRegisterParentNotifier<string>(DefaultDictionaryProperty, ParentChangedAction, _parentNotifiers);
            return String.IsNullOrEmpty(dictionary) ? FallbackDictionary : dictionary;
        }
开发者ID:doublekill,项目名称:WPFLocalizationExtension,代码行数:13,代码来源:ResxLocalizationProvider.cs

示例2: GetDictionary

        /// <summary>
        /// Get the dictionary from the context, if possible.
        /// </summary>
        /// <param name="target">The target object.</param>
        /// <returns>The dictionary name, if available.</returns>
        protected override string GetDictionary(DependencyObject target)
        {
            if (target == null)
                return null;

            return target.GetValueOrRegisterParentNotifier<string>(CSVEmbeddedLocalizationProvider.DefaultDictionaryProperty, ParentChangedAction, parentNotifiers);
        }
开发者ID:jogibear9988,项目名称:WPFLocalizationExtension,代码行数:12,代码来源:CSVEmbeddedLocalizationProvider.cs

示例3: GetAssembly

        /// <summary>
        /// Get the assembly from the context, if possible.
        /// </summary>
        /// <param name="target">The target object.</param>
        /// <returns>The assembly name, if available.</returns>
        protected override string GetAssembly(DependencyObject target)
        {
            if (target == null)
                return FallbackAssembly;

            var assembly = target.GetValueOrRegisterParentNotifier<string>(DefaultAssemblyProperty, ParentChangedAction, _parentNotifiers);
            return String.IsNullOrEmpty(assembly) ? FallbackAssembly : assembly;
        }
开发者ID:doublekill,项目名称:WPFLocalizationExtension,代码行数:13,代码来源:ResxLocalizationProvider.cs

示例4: GetLocalizedObject

        /// <summary>
        /// Get the localized object using the given target for context information.
        /// </summary>
        /// <param name="key">The key to the value.</param>
        /// <param name="target">The target <see cref="DependencyObject"/>.</param>
        /// <param name="culture">The culture to use.</param>
        /// <returns>The value corresponding to the source/dictionary/key path for the given culture (otherwise NULL).</returns>
        public object GetLocalizedObject(string key, DependencyObject target, CultureInfo culture)
        {
#if WINDOWS_PHONE
            var provider = this.DefaultProvider;
#else
#if !SILVERLIGHT
            if (this.DefaultProvider is InheritingResxLocalizationProvider)
                return GetLocalizedObject(key, target, culture, this.DefaultProvider);
#endif
                
            var provider = target != null ? target.GetValueOrRegisterParentNotifier(GetProvider, (obj) => { LocalizeDictionary.DictionaryEvent.Invoke(obj, new DictionaryEventArgs(DictionaryEventType.ProviderChanged, null)); }, parentNotifiers) : null;

            if (provider == null)
                provider = this.DefaultProvider;
#endif

            return GetLocalizedObject(key, target, culture, provider);
        }
开发者ID:magnushaggren,项目名称:WPFLocalizationExtension,代码行数:25,代码来源:LocalizeDictionary.cs


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