Esempio n. 1
0
        /// ------------------------------------------------------------------------------------
        private void LoadToolbarAndContextMenus()
        {
            if (App.DesignMode)
            {
                return;
            }

            if (_tmAdapter != null)
            {
                _tmAdapter.Dispose();
            }

            _tmAdapter = AdapterHelper.CreateTMAdapter();

            if (_tmAdapter != null)
            {
                var defs = new[] { FileLocator.GetFileDistributedWithApplication(App.ConfigFolderName,
                                                                                 "CVChartsTMDefinition.xml") };

                _tmAdapter.Initialize(this, App.MsgMediator, App.ApplicationRegKeyPath, defs);
                _tmAdapter.AllowUpdates = true;
            }

            // Give the chart Phone search toolbar button a default image.
            var childItemProps  = _tmAdapter.GetItemProperties("tbbChartPhoneSearchAnywhere");
            var parentItemProps = _tmAdapter.GetItemProperties("tbbChartPhoneSearch");

            if (parentItemProps != null && childItemProps != null)
            {
                parentItemProps.Image   = childItemProps.Image;
                parentItemProps.Visible = true;
                parentItemProps.Update  = true;
                _tmAdapter.SetItemProperties("tbbChartPhoneSearch", parentItemProps);
            }
        }
Esempio n. 2
0
        /// ------------------------------------------------------------------------------------
        private void LoadToolbar()
        {
            if (m_tmAdapter != null)
            {
                m_tmAdapter.Dispose();
            }

            m_tmAdapter = AdapterHelper.CreateTMAdapter();

            if (WordListGrid != null)
            {
                WordListGrid.TMAdapter = m_tmAdapter;
            }

            if (m_tmAdapter != null)
            {
                m_tmAdapter.LoadControlContainerItem += m_tmAdapter_LoadControlContainerItem;
                var defs = new[] { FileLocator.GetFileDistributedWithApplication(App.ConfigFolderName,
                                                                                 "DataCorpusTMDefinition.xml") };

                m_tmAdapter.Initialize(this, App.MsgMediator, App.ApplicationRegKeyPath, defs);
                m_tmAdapter.AllowUpdates = true;
            }
        }
Esempio n. 3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Construct the toolbars
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void CreateMenuAndToolbars()
		{
			Debug.Assert(m_tmAdapter == null);
			m_tmAdapter = AdapterHelper.CreateTMAdapter();

			// This will always be null when running tests. Otherwise, it will only be null if
			// The UIAdapter.dll couldn't be found... or null for some other reason. :o)
			if (m_tmAdapter == null)
				return;

			// Use this to initialize combo box items.
			m_tmAdapter.InitializeComboItem +=
				new InitializeComboItemHandler(InitializeToolBarCombos);

			string[] def = new string[] {Common.Utils.DirectoryFinder.FWCodeDirectory +
											   @"\Translation Editor\Configuration\DiffViewTMDefinition.xml"};
			m_tmAdapter.AllowUpdates = true;
			m_tmAdapter.Initialize(this, m_msgMediator, def);
		}
Esempio n. 4
0
		protected virtual void CreateMenusAndToolBars()
		{
			m_tmAdapter = AdapterHelper.CreateTMAdapter();

			// This will always be null when running tests. Otherwise, it will only be null if
			// The UIAdapter.dll couldn't be found... or null for some other reason. :o)
			if (m_tmAdapter == null)
			{
				// Do this for the sake of the tests.
				InitializeToolBarCombos("tbbParaStylesCombo", new ComboBox());
				InitializeToolBarCombos("tbbCharStylesCombo", new ComboBox());
				InitializeToolBarCombos("tbbZoom", new ComboBox());
				return;
			}

			// Use this to deliver controls to control container toolbar items.
			m_tmAdapter.LoadControlContainerItem +=	LoadCustomToolBarControls;

			// Use this to initialize combo box items.
			m_tmAdapter.InitializeComboItem += InitializeToolBarCombos;

			string sMenuToolBarDefinition = Path.Combine(FwDirectoryFinder.CodeDirectory, "FwTMDefinition.xml");

			m_tmAdapter.Initialize(this, AdapterContentControl, m_mediator, m_app.ProjectSpecificSettingsKey.ToString(),
				new string[] { sMenuToolBarDefinition, GetAppSpecificMenuToolBarDefinition() });

			InitializeContextMenus(sMenuToolBarDefinition, GetAppSpecificMenuToolBarDefinition());

			m_tmAdapter.AllowUpdates = true;
			m_mediator.AddColleague(this);
		}