Exemplo n.º 1
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    SaveFile();

                    CloseFile();

                    CachedTags.Clear();
                    KnownNodes.Clear();

                    CachedTags  = null;
                    KnownNodes  = null;
                    TrackedFile = null;
                    FileParser  = null;
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }
Exemplo n.º 2
0
        public virtual void CheckTag(String tag)
        {
            if (!CachedTags.Contains(tag))
            {
                if (!KnownNodes.Values.Any(tagArr => tagArr.Contains(tag)))
                {
                    throw new UnsupportedTagException();
                }
            }

            CachedTags.Add(tag);
        }