Example #1
0
        private ITestData createData()
        {
            var dataStore  = new ObjectStorage(s => values[s], (s, v) => values[s] = v);
            var observable = DataStorageInterceptor <ITestData> .ImplementInterface(dataStore, new ProxyGenerator());

            return(observable);
        }
        private IVoxelDataExtension createExtension <T>() where T : IVoxelDataExtension
        {
            if (!IsValidExtension <T>())
            {
                throw new InvalidOperationException("Unsupported extension");
            }
            T   ext     = default(T);
            var storage = new ObjectStorage(s => getData(ext, s), (s, v) => setData(ext, s, v));

            ext = DataStorageInterceptor <T> .ImplementInterface(storage, proxyGenerator);

            return(ext);
        }