Example #1
0
        protected void ReplaceMatchingItemsControl()
        {
            if (m_mediator == null)
            {
                return;
            }
            XmlNode xnWindow = (XmlNode)m_mediator.PropertyTable.GetValue("WindowConfiguration");

            if (xnWindow == null)
            {
                return;
            }
            XmlNode xnControl = xnWindow.SelectSingleNode("controls/parameters/guicontrol[@id=\"matchingReversalEntries\"]");

            if (xnControl == null)
            {
                return;
            }
            // Replace the current matchingEntries object with the one specified in the XML.
            MatchingEntries newME = DynamicLoader.CreateObject(xnControl) as MatchingEntries;

            if (newME != null)
            {
                CopyBasicControlInfo(matchingEntries, newME);
                this.Controls.Remove(matchingEntries);
                matchingEntries.Dispose();
                matchingEntries = newME;
                this.Controls.Add(matchingEntries);
                (matchingEntries as MatchingEntries).SelectionChanged += new SIL.FieldWorks.Common.Utils.FwSelectionChangedEventHandler(this.matchingEntries_SelectionChanged);
                (matchingEntries as MatchingEntries).RestoreFocus     += new EventHandler(matchingEntries_RestoreFocus);
                // Reset Tab indices of direct child controls of the form.
                ResetTabOrder();
                (newME as MatchingReversalEntriesBrowser).Initialize(m_cache,
                                                                     FontHeightAdjuster.StyleSheetFromMediator(m_mediator), m_mediator, m_owningIndex);
            }
        }
Example #2
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ReversalEntryGoDlg));
     this.m_tbForm        = new SIL.FieldWorks.Common.Widgets.FwTextBox();
     this.label1          = new System.Windows.Forms.Label();
     this.btnHelp         = new System.Windows.Forms.Button();
     this.btnInsert       = new System.Windows.Forms.Button();
     this.btnOK           = new System.Windows.Forms.Button();
     this.btnClose        = new System.Windows.Forms.Button();
     this.label2          = new System.Windows.Forms.Label();
     this.matchingEntries = new SIL.FieldWorks.LexText.Controls.MatchingEntries();
     ((System.ComponentModel.ISupportInitialize)(this.m_tbForm)).BeginInit();
     this.SuspendLayout();
     //
     // m_tbForm
     //
     this.m_tbForm.AdjustStringHeight = true;
     this.m_tbForm.AllowMultipleLines = false;
     this.m_tbForm.BackColor          = System.Drawing.SystemColors.Window;
     this.m_tbForm.controlID          = null;
     resources.ApplyResources(this.m_tbForm, "m_tbForm");
     this.m_tbForm.Name            = "m_tbForm";
     this.m_tbForm.SelectionLength = 0;
     this.m_tbForm.SelectionStart  = 0;
     //
     // label1
     //
     resources.ApplyResources(this.label1, "label1");
     this.label1.Name = "label1";
     //
     // btnHelp
     //
     resources.ApplyResources(this.btnHelp, "btnHelp");
     this.btnHelp.Name   = "btnHelp";
     this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
     //
     // btnInsert
     //
     resources.ApplyResources(this.btnInsert, "btnInsert");
     this.btnInsert.Name = "btnInsert";
     //
     // btnOK
     //
     resources.ApplyResources(this.btnOK, "btnOK");
     this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
     this.btnOK.Name         = "btnOK";
     //
     // btnClose
     //
     resources.ApplyResources(this.btnClose, "btnClose");
     this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.btnClose.Name         = "btnClose";
     //
     // label2
     //
     resources.ApplyResources(this.label2, "label2");
     this.label2.Name = "label2";
     //
     // matchingEntries
     //
     resources.ApplyResources(this.matchingEntries, "matchingEntries");
     this.matchingEntries.Name    = "matchingEntries";
     this.matchingEntries.TabStop = false;
     //
     // ReversalEntryGoDlgNew
     //
     this.AcceptButton = this.btnOK;
     resources.ApplyResources(this, "$this");
     this.CancelButton = this.btnClose;
     this.Controls.Add(this.matchingEntries);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.btnHelp);
     this.Controls.Add(this.btnInsert);
     this.Controls.Add(this.btnOK);
     this.Controls.Add(this.btnClose);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.m_tbForm);
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.Name        = "ReversalEntryGoDlgNew";
     ((System.ComponentModel.ISupportInitialize)(this.m_tbForm)).EndInit();
     this.ResumeLayout(false);
 }