예제 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initialize this as an IxCoreColleague
        /// </summary>
        /// <param name="mediator"></param>
        /// <param name="configurationParameters"></param>
        /// ------------------------------------------------------------------------------------
        public override void Init(Mediator mediator, XmlNode configurationParameters)
        {
            CheckDisposed();

            InitBase(mediator, configurationParameters);

            m_showDescendantInRoot = XmlUtils.GetOptionalBooleanAttributeValue(configurationParameters, "showDescendantInRoot", false);

            // retrieve persisted clerk index and set it.
            int idx = m_mediator.PropertyTable.GetIntProperty(Clerk.PersistedIndexProperty, -1, PropertyTable.SettingsGroup.LocalSettings);
            int lim = Clerk.ListSize;

            if (idx >= 0 && idx < lim)
            {
                int idxOld = Clerk.CurrentIndex;
                try
                {
                    Clerk.JumpToIndex(idx);
                }
                catch
                {
                    if (lim > idxOld && lim > 0)
                    {
                        Clerk.JumpToIndex(idxOld >= 0 ? idxOld : 0);
                    }
                }
            }

            // If possible make it use the style sheet appropriate for its main window.
            m_dataEntryForm.StyleSheet = FontHeightAdjuster.StyleSheetFromMediator(m_mediator);
            m_fullyInitialized         = true;
        }
예제 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initialize this as an IxCoreColleague
        /// </summary>
        /// <param name="mediator"></param>
        /// <param name="configurationParameters"></param>
        /// ------------------------------------------------------------------------------------
        public override void Init(Mediator mediator, XmlNode configurationParameters)
        {
            CheckDisposed();

            InitBase(mediator, configurationParameters);

            // retrieve persisted clerk index and set it.
            int idx = m_mediator.PropertyTable.GetIntProperty(Clerk.PersistedIndexProperty, -1, PropertyTable.SettingsGroup.LocalSettings);
            int lim = Clerk.ListSize;

            if (idx >= 0 && idx < lim)
            {
                int idxOld = Clerk.CurrentIndex;
                try
                {
                    Clerk.JumpToIndex(idx);
                }
                catch
                {
                    if (lim > idxOld && lim > 0)
                    {
                        Clerk.JumpToIndex(idxOld >= 0 ? idxOld : 0);
                    }
                }
            }

            // If possible make it use the style sheet appropriate for its main window.
            IMainWindowDelegatedFunctions containingForm = this.FindForm() as IMainWindowDelegatedFunctions;

            if (containingForm != null)
            {
                m_dataEntryForm.StyleSheet = containingForm.StyleSheet;
            }
            m_fullyInitialized = true;
        }