コード例 #1
0
        public virtual void FillFrom(IMvxValueConverterRegistry registry, Assembly assembly)
        {
            var pairs = from type in assembly.ExceptionSafeGetTypes()
                        where type.IsPublic
                        where !type.IsAbstract
                        where typeof (IMvxValueConverter).IsAssignableFrom(type)
                        let name = FindValueConverterName(type)
                        where !string.IsNullOrEmpty(name)
                        where type.IsConventional()
                        select new {Name = name, Type = type};

            foreach (var pair in pairs)
            {
                try
                {
                    var converter = Activator.CreateInstance(pair.Type) as IMvxValueConverter;
                    MvxBindingTrace.Trace("Registering value converter {0}:{1}", pair.Name, pair.Type.Name);
                    registry.AddOrOverwrite(pair.Name, converter);
                }
                catch (Exception)
                {
                    // ignore this
                }
            }
        }
コード例 #2
0
        protected override void FillValueConverters(IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters(registry);

            var filler = new MvxInstanceBasedValueConverterRegistryFiller(registry);
            filler.AddFieldConverters(typeof(Converters));
        }
コード例 #3
0
        protected override void FillValueConverters(IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters(registry);

            if (_fillValueConvertersAction != null)
                _fillValueConvertersAction(registry);
        }
コード例 #4
0
 public virtual void FillFrom(IMvxValueConverterRegistry registry, Type type)
 {
     if (type.IsAbstract)
     {
         FillFromStatic(registry, type);
     }
     else
     {
         FillFromInstance(registry, type);
     }
 }
コード例 #5
0
        protected virtual void FillValueConverters(IMvxValueConverterRegistry registry)
        {
            var holders = ValueConverterHolders;
            if (holders == null)
                return;

            var filler = new MvxInstanceBasedValueConverterRegistryFiller(registry);
            var staticFiller = new MvxStaticBasedValueConverterRegistryFiller(registry);
            foreach (var converterHolder in holders)
            {
                filler.AddFieldConverters(converterHolder);
                staticFiller.AddStaticFieldConverters(converterHolder);
            }
        }
コード例 #6
0
        protected virtual void FillFromInstance(IMvxValueConverterRegistry registry, Type type)
        {
            var instance = Activator.CreateInstance(type);

            var pairs = from field in type.GetFields()
                        where !field.IsStatic
                        where field.IsPublic
                        where typeof (IMvxValueConverter).IsAssignableFrom(field.FieldType)
                        let converter = field.GetValue(instance) as IMvxValueConverter
                        where converter != null
                        select new
                            {
                                field.Name,
                                Converter = converter
                            };

            foreach (var pair in pairs)
            {
                registry.AddOrOverwrite(pair.Name, pair.Converter);
            }
        }
コード例 #7
0
ファイル: Setup.cs プロジェクト: NPadrutt/MoneyFox.Windows
 protected override void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     base.FillValueConverters(registry);
     registry.AddOrOverwrite("Language", new MvxLanguageConverter());
 }
コード例 #8
0
 protected virtual void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     registry.AddOrOverwrite("CommandParameter", new MvxCommandParameterValueConverter());
     registry.AddOrOverwrite("Language", new MvxLanguageConverter());
 }
コード例 #9
0
ファイル: Setup.cs プロジェクト: Wolfteam/MiraiNotes
 //this is required, if you want to use app:MvxLang="Text WelcomeText"
 protected override void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     base.FillValueConverters(registry);
     registry.AddOrOverwrite("Language", new MvxLanguageConverter());
 }
コード例 #10
0
        protected override void FillValueConverters(IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters(registry);

            this._fillValueConvertersAction?.Invoke(registry);
        }
コード例 #11
0
        protected override void FillValueConverters(IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters(registry);

            if (MvxSingleton<IMvxWindowsAssemblyCache>.Instance != null)
            {
                foreach (var assembly in MvxSingleton<IMvxWindowsAssemblyCache>.Instance.Assemblies)
                {
                    registry.Fill(assembly);
                }
            }
        }
コード例 #12
0
 protected virtual void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     // nothing to do here            
 }
コード例 #13
0
 public MvxInstanceBasedValueConverterRegistryFiller(IMvxValueConverterRegistry registry)
 {
     _registry = registry;
 }
コード例 #14
0
 public MvxStaticBasedValueConverterRegistryFiller(IMvxValueConverterRegistry registry)
 {
     _registry = registry;
 }
コード例 #15
0
 private void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     registry.Fill(GetType().Assembly);
 }
コード例 #16
0
 protected void FillValueConverters(IMvxValueConverterRegistry registry)
 {
 }
コード例 #17
0
        protected override void FillValueConverters(IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters(registry);

            registry.AddOrOverwrite("IconConverter", new IconConverter());
        }
コード例 #18
0
 protected override void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     base.FillValueConverters(registry);
     registry.AddOrOverwrite("CommandParameter", new MvxCommandParameterValueConverter());
 }
コード例 #19
0
 protected virtual void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     // nothing to do here
 }
コード例 #20
0
        protected override void FillValueConverters(IMvxValueConverterRegistry registry)
        {
            base.FillValueConverters(registry);

            this._fillValueConvertersAction?.Invoke(registry);
        }
コード例 #21
0
 protected virtual void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     registry.Fill(ValueConverterAssemblies);
     registry.Fill(ValueConverterHolders);
 }
コード例 #22
0
ファイル: Setup.cs プロジェクト: blueskybcl/Tracking
 protected override void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     base.FillValueConverters(registry);
     //TODO: Do your code here
     //registry.AddOrOverwrite("BooleanToVisibility", new BooleanToVisibilityConverter());
 }
コード例 #23
0
 public MvxInstanceBasedValueConverterRegistryFiller(IMvxValueConverterRegistry registry)
 {
     _registry = registry;
 }
コード例 #24
0
ファイル: Setup.cs プロジェクト: dkataskin/bstrkr
 protected override void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     base.FillValueConverters(registry);
 }
コード例 #25
0
 protected virtual void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     registry.AddOrOverwriteFrom(GetType().Assembly);
     registry.AddOrOverwriteFrom(typeof(MvxLanguageConverter).Assembly);
 }
コード例 #26
0
 protected override void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     base.FillValueConverters(registry);
     registry.AddOrOverwrite(nameof(ImageConverter), new ImageConverter());
 }
コード例 #27
0
 protected virtual void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     registry.Fill(ValueConverterAssemblies);
     registry.Fill(ValueConverterHolders);
 }
コード例 #28
0
 protected virtual void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     registry.AddOrOverwrite("CommandParameter", new MvxCommandParameterValueConverter());
     registry.AddOrOverwrite("Language", new MvxLanguageConverter());
 }
コード例 #29
0
 public MvxStaticBasedValueConverterRegistryFiller(IMvxValueConverterRegistry registry)
 {
     _registry = registry;
 }
コード例 #30
0
ファイル: Setup.cs プロジェクト: SlavaS/BalanceGym.Schedule
 protected override void FillValueConverters(IMvxValueConverterRegistry registry)
 {
     base.FillValueConverters(registry);
 }