Beispiel #1
0
        public IICCodeTable <K, V> GetCodeTable <K, V>(string tableName, Action <IICCodeTable <K, V> > onUpdate) where V : IICCodeTableItem
        {
            if (IICConfigurationManager.Loader == null)
            {
                throw new InvalidOperationException("No loader yet, You *MUST* call ServiceSettings.InitService() at First");
            }

            try {
                IICConfigTableBuffer buffer = IICConfigurationManager.Loader.LoadConfigTable(tableName);
                if (buffer == null)
                {
                    throw new ConfigurationNotFoundException(IICConfigType.Table, tableName);
                }

                IICCodeTable <K, V> table = new IICCodeTable <K, V>(buffer);
                table.RunAfterLoad();

                if (onUpdate != null)
                {
                    onUpdate(table);
                }
                return(table);
            } catch (Exception ex) {
                throw new ConfigurationFailedException(IICConfigType.Table, tableName, ex);
            }
        }
Beispiel #2
0
        public override void OnUpdate()
        {
            if (_onUpdate == null)
            {
                throw new NotSupportedException("Not Support Update");
            }

            IICCodeTable <K, V> table = IICConfigurationManager.Imp.GetCodeTable <K, V>(p_path, _onUpdate);

            p_Version = table.Version;
        }