示例#1
0
        public void Close()
        {
            if (_profile == null)
            {
                return;
            }

            if (_needsFlushing)
            {
                Flush();
            }

            _doc = null;

            if (_file != null)
            {
                _file.Close();
                _file = null;
            }

            if (_profile != null)
            {
                _profile._buffer = null;
            }
            _profile = null;
        }
示例#2
0
        internal XmlBuffer(XmlBase profile, bool lockFile)
        {
            _profile = profile;

            if (lockFile)
            {
                _profile.VerifyName();
                if (File.Exists(_profile.Name))
                {
                    _file = new FileStream(_profile.Name, FileMode.Open, _profile.ReadOnly ? FileAccess.Read : FileAccess.ReadWrite, FileShare.Read);
                }
            }
        }
示例#3
0
 protected XmlBase(XmlBase profile) :
     base(profile)
 {
     _encoding = profile.Encoding;
 }