1 /* Copyright (C) 2004 - 2009 Versant Inc. http://www.db4o.com */ 2 3 using System.IO; 4 using Db4objects.Db4o.Config; 5 using Db4objects.Db4o.Config.Encoding; 6 using Db4objects.Db4o.Diagnostic; 7 using Db4objects.Db4o.Internal; 8 using Db4objects.Db4o.Reflect; 9 using Db4objects.Db4o.Typehandlers; 10 11 namespace Db4objects.Db4o.Internal.Config 12 { 13 public class CommonConfigurationImpl : ICommonConfiguration 14 { 15 private readonly Config4Impl _config; 16 CommonConfigurationImpl(Config4Impl config)17 public CommonConfigurationImpl(Config4Impl config) 18 { 19 _config = config; 20 } 21 22 public virtual int ActivationDepth 23 { 24 get 25 { 26 return _config.ActivationDepth(); 27 } 28 set 29 { 30 int depth = value; 31 _config.ActivationDepth(depth); 32 } 33 } 34 Add(IConfigurationItem configurationItem)35 public virtual void Add(IConfigurationItem configurationItem) 36 { 37 _config.Add(configurationItem); 38 } 39 AddAlias(IAlias alias)40 public virtual void AddAlias(IAlias alias) 41 { 42 _config.AddAlias(alias); 43 } 44 RemoveAlias(IAlias alias)45 public virtual void RemoveAlias(IAlias alias) 46 { 47 _config.RemoveAlias(alias); 48 } 49 50 public virtual bool AllowVersionUpdates 51 { 52 set 53 { 54 bool flag = value; 55 _config.AllowVersionUpdates(flag); 56 } 57 } 58 59 public virtual bool AutomaticShutDown 60 { 61 set 62 { 63 bool flag = value; 64 _config.AutomaticShutDown(flag); 65 } 66 } 67 68 public virtual int BTreeNodeSize 69 { 70 set 71 { 72 int size = value; 73 _config.BTreeNodeSize(size); 74 } 75 } 76 77 public virtual bool Callbacks 78 { 79 set 80 { 81 bool flag = value; 82 _config.Callbacks(flag); 83 } 84 } 85 CallbackMode(CallBackMode mode)86 public virtual void CallbackMode(CallBackMode mode) 87 { 88 _config.CallbackMode(mode); 89 } 90 91 public virtual bool CallConstructors 92 { 93 set 94 { 95 bool flag = value; 96 _config.CallConstructors(flag); 97 } 98 } 99 100 public virtual bool DetectSchemaChanges 101 { 102 set 103 { 104 bool flag = value; 105 _config.DetectSchemaChanges(flag); 106 } 107 } 108 109 public virtual IDiagnosticConfiguration Diagnostic 110 { 111 get 112 { 113 return _config.Diagnostic(); 114 } 115 } 116 117 public virtual bool ExceptionsOnNotStorable 118 { 119 set 120 { 121 bool flag = value; 122 _config.ExceptionsOnNotStorable(flag); 123 } 124 } 125 126 public virtual bool InternStrings 127 { 128 set 129 { 130 bool flag = value; 131 _config.InternStrings(flag); 132 } 133 } 134 MarkTransient(string attributeName)135 public virtual void MarkTransient(string attributeName) 136 { 137 _config.MarkTransient(attributeName); 138 } 139 140 public virtual int MessageLevel 141 { 142 set 143 { 144 int level = value; 145 _config.MessageLevel(level); 146 } 147 } 148 ObjectClass(object clazz)149 public virtual IObjectClass ObjectClass(object clazz) 150 { 151 return _config.ObjectClass(clazz); 152 } 153 154 public virtual bool OptimizeNativeQueries 155 { 156 get 157 { 158 return _config.OptimizeNativeQueries(); 159 } 160 set 161 { 162 bool optimizeNQ = value; 163 _config.OptimizeNativeQueries(optimizeNQ); 164 } 165 } 166 167 public virtual IQueryConfiguration Queries 168 { 169 get 170 { 171 return _config.Queries(); 172 } 173 } 174 ReflectWith(IReflector reflector)175 public virtual void ReflectWith(IReflector reflector) 176 { 177 _config.ReflectWith(reflector); 178 } 179 180 public virtual TextWriter OutStream 181 { 182 set 183 { 184 TextWriter outStream = value; 185 _config.SetOut(outStream); 186 } 187 } 188 189 public virtual IStringEncoding StringEncoding 190 { 191 set 192 { 193 IStringEncoding encoding = value; 194 _config.StringEncoding(encoding); 195 } 196 } 197 198 public virtual bool TestConstructors 199 { 200 set 201 { 202 bool flag = value; 203 _config.TestConstructors(flag); 204 } 205 } 206 207 public virtual int UpdateDepth 208 { 209 set 210 { 211 int depth = value; 212 _config.UpdateDepth(depth); 213 } 214 } 215 216 public virtual bool WeakReferences 217 { 218 set 219 { 220 bool flag = value; 221 _config.WeakReferences(flag); 222 } 223 } 224 225 public virtual int WeakReferenceCollectionInterval 226 { 227 set 228 { 229 int milliseconds = value; 230 _config.WeakReferenceCollectionInterval(milliseconds); 231 } 232 } 233 RegisterTypeHandler(ITypeHandlerPredicate predicate, ITypeHandler4 typeHandler)234 public virtual void RegisterTypeHandler(ITypeHandlerPredicate predicate, ITypeHandler4 235 typeHandler) 236 { 237 _config.RegisterTypeHandler(predicate, typeHandler); 238 } 239 240 public virtual IEnvironmentConfiguration Environment 241 { 242 get 243 { 244 return new _IEnvironmentConfiguration_139(this); 245 } 246 } 247 248 private sealed class _IEnvironmentConfiguration_139 : IEnvironmentConfiguration 249 { _IEnvironmentConfiguration_139(CommonConfigurationImpl _enclosing)250 public _IEnvironmentConfiguration_139(CommonConfigurationImpl _enclosing) 251 { 252 this._enclosing = _enclosing; 253 } 254 Add(object service)255 public void Add(object service) 256 { 257 this._enclosing._config.EnvironmentContributions().Add(service); 258 } 259 260 private readonly CommonConfigurationImpl _enclosing; 261 } 262 NameProvider(INameProvider provider)263 public virtual void NameProvider(INameProvider provider) 264 { 265 _config.NameProvider(provider); 266 } 267 268 public virtual int MaxStackDepth 269 { 270 get 271 { 272 return _config.MaxStackDepth(); 273 } 274 set 275 { 276 int maxStackDepth = value; 277 _config.MaxStackDepth(maxStackDepth); 278 } 279 } 280 } 281 } 282