/// ------------------------------------------------------------------------------------
        /// <summary>
        /// Load the reference cache
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected virtual void LoadReferences()
        {
            XmlSerializer serializer = new XmlSerializer(typeof(ReferenceCache));

            try
            {
                TextReader reader = new StreamReader(ReferenceCacheName);
                try
                {
                    m_Cache = (ReferenceCache)serializer.Deserialize(reader);
                }
                catch (Exception e)
                {
                    System.Diagnostics.Debug.WriteLine("Exception: " + e.Message);
                }
                finally
                {
                    reader.Close();
                }
            }
            catch
            {
                // file doesn't exist
            }
        }
Пример #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Load the reference cache
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void LoadReferences()
        {
            var serializer = new XmlSerializer(typeof(ReferenceCache));

            try
            {
                using (TextReader reader = new StreamReader(ReferenceCacheName))
                {
                    m_cache = (ReferenceCache)serializer.Deserialize(reader);
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("Exception: " + e.Message);
            }
        }
Пример #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Load the reference cache
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected virtual void LoadReferences()
		{
			XmlSerializer serializer = new XmlSerializer(typeof(ReferenceCache));
			try
			{
				TextReader reader = new StreamReader(ReferenceCacheName);
				try
				{
					m_Cache = (ReferenceCache)serializer.Deserialize(reader);
				}
				catch(Exception e)
				{
					System.Diagnostics.Debug.WriteLine("Exception: " + e.Message);
				}
				finally
				{
					reader.Close();
				}
			}
			catch
			{
				// file doesn't exist
			}
		}