BsonBinaryWriterContext.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright 2010-2014 MongoDB Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License.
  14. */
  15. namespace MongoDB.Bson.IO
  16. {
  17. internal class BsonBinaryWriterContext
  18. {
  19. // private fields
  20. private BsonBinaryWriterContext _parentContext;
  21. private ContextType _contextType;
  22. private int _startPosition;
  23. private int _index; // used when contextType is Array
  24. // constructors
  25. internal BsonBinaryWriterContext(
  26. BsonBinaryWriterContext parentContext,
  27. ContextType contextType,
  28. int startPosition)
  29. {
  30. _parentContext = parentContext;
  31. _contextType = contextType;
  32. _startPosition = startPosition;
  33. }
  34. // internal properties
  35. internal BsonBinaryWriterContext ParentContext
  36. {
  37. get { return _parentContext; }
  38. }
  39. internal ContextType ContextType
  40. {
  41. get { return _contextType; }
  42. }
  43. internal int StartPosition
  44. {
  45. get { return _startPosition; }
  46. }
  47. internal int Index
  48. {
  49. get { return _index; }
  50. set { _index = value; }
  51. }
  52. }
  53. }