コード例 #1
0
ファイル: TargetFactory.cs プロジェクト: Zebra/iFactr-Android
        private static void LoadLanguageResource()
        {
            if (TheApp == null)
            {
                throw new NullReferenceException("An instance of iApp is required to load language resources.");
            }

            Device.Resources.RemoveAllResources();
            Device.Resources.AddResources("iFactr.UI.Resources.Strings", Device.Reflector.GetAssembly(typeof(TargetFactory)));
            Device.Resources.AddResources(Device.Reflector.GetAssembly(TheApp.GetType()));
        }
コード例 #2
0
ファイル: TargetFactory.cs プロジェクト: Zebra/iFactr-Android
        /// <summary>
        /// Gets the abstracted object from an <see cref="IPairable"/>.
        /// </summary>
        /// <param name="pair">The object for which to return the abstract counterpart.</param>
        protected internal static object GetPair(object pair)
        {
            var pairable = pair as IPairable;

            if (pairable == null)
            {
                return(pair);
            }

            return((TheApp != null && Device.Reflector.GetAssembly(pair.GetType()) == Device.Reflector.GetAssembly(TheApp.GetType())) ? pair : pairable.Pair ?? pair);
        }