public override void Initialize()
        {
            if (BasedOnRow == null)
            {
                return;
            }

            var attr = BasedOnRow.GetType().GetCustomAttribute <LocalizationRowAttribute>(false);

            if (attr != null)
            {
                localizationRowHandler = Activator.CreateInstance(typeof(LocalizationRowHandler <>)
                                                                  .MakeGenericType(BasedOnRow.GetType())) as ILocalizationRowHandler;
            }
        }
Example #2
0
        public override void Initialize()
        {
            localAttr = null;

            if (BasedOnRow == null)
            {
                return;
            }

            localAttr = BasedOnRow.GetType().GetCustomAttribute <LocalizationRowAttribute>(false);
            if (localAttr == null)
            {
                return;
            }

            if (!typeof(ILocalizationRow).IsAssignableFrom(localAttr.LocalizationRow))
            {
                throw new InvalidOperationException(string.Format("Localization table {0} doesn't implement ILocalizationRow interface!",
                                                                  localAttr.LocalizationRow.FullName));
            }
        }