Пример #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		/// ------------------------------------------------------------------------------------
		protected override void Dispose(bool disposing)
		{
			Debug.WriteLineIf(!disposing, "********** Missing Dispose() call for " + GetType().Name + ". **********");
			if (disposing)
			{
				if (m_openFileDialog != null)
					m_openFileDialog.Dispose();

				if (m_fDisposeWsManager)
				{
					var disposable = m_wsManager as IDisposable;
					if (disposable != null)
						disposable.Dispose();
					m_wsManager = null;
				}
				if (m_fntForSpecialChar != null)
				{
					m_fntForSpecialChar.Dispose();
					m_fntForSpecialChar = null;
				}
				if (m_validCharsGridMngr != null)
					m_validCharsGridMngr.Dispose();
				if (m_chkBoxColHdrHandler != null)
					m_chkBoxColHdrHandler.Dispose();
				if (m_chrPropEng != null && Marshal.IsComObject(m_chrPropEng))
				{
					Marshal.ReleaseComObject(m_chrPropEng);
					m_chrPropEng = null;
				}
				if (m_openFileDialog != null)
					m_openFileDialog.Dispose();
				if (components != null)
					components.Dispose();
			}

			m_openFileDialog = null;
			m_validCharsGridMngr = null;
			m_chkBoxColHdrHandler = null;
			m_inventoryCharComparer = null;
			m_openFileDialog = null;

			base.Dispose(disposing);

		}
Пример #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="ValidCharactersDlg"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public ValidCharactersDlg()
		{
			m_validCharsGridMngr = CreateValidCharGridsManager();

			InitializeComponent();
			AccessibleName = GetType().Name;

			m_openFileDialog = new OpenFileDialogAdapter();
			m_openFileDialog.DefaultExt = "lds";
			m_openFileDialog.InitialDirectory = ParatextHelper.ProjectsDirectory;
			m_openFileDialog.Title = FwCoreDlgs.kstidLanguageFileBrowser;

			splitContainerOuter.Panel2MinSize = splitValidCharsOuter.Left +
				(btnTreatAsWrdForming.Right - btnTreatAsPunct.Left);

			// Save the format string for these labels in their tags.
			lblFirstCharCode.Tag = lblFirstCharCode.Text;
			lblFirstCharCode.Text = string.Empty;
			lblLastCharCode.Tag = lblLastCharCode.Text;
			lblLastCharCode.Text = string.Empty;

			gridCharInventory.DefaultCellStyle.SelectionBackColor =
				ColorHelper.CalculateColor(SystemColors.Window, SystemColors.Highlight, 150);

			gridCharInventory.DefaultCellStyle.SelectionForeColor = SystemColors.WindowText;
		}