예제 #1
0
        /// Apply the preferences to the Scenario
        /// </summary>
        /// <param name="prefs"></param>
        private void SetPreferences(Logics.Preferences.FormPrefs prefs)
        {
            if (prefs == null || Scenario == null)
            {
                return;
            }

            Scenario.SetPositionInfo(prefs.PosX, prefs.PosY, prefs.Width, prefs.Height, prefs.Properties);
        }
예제 #2
0
        /// <summary>
        /// Get and Apply the existing preferences for the scenario after the Shown event.
        /// </summary>
        private void ApplyPreferencesAfterShown()
        {
            if ((Context as IUClassContext) == null)
            {
                return;
            }

            // Get the scenario name for Preferences.
            ScenarioPrefsName = (Context as IUClassContext).ClassName + ":F:" + Name;
            Logics.Preferences.FormPrefs prefs = Logics.Logic.UserPreferences.GetScenarioPrefs(ScenarioPrefsName) as Logics.Preferences.FormPrefs;

            // If the Preferences contains properties, apply the splitters positions.
            if ((prefs != null) && (prefs.Properties != null))
            {
                Scenario.SetSplittersInfo(prefs.Properties);
            }
        }
예제 #3
0
        /// <summary>
        /// Get and Apply the existing preferences for this scenario
        /// </summary>
        private void ApplyPreferences()
        {
            if (Scenario == null || Scenario.Form == null)
            {
                return;
            }

            if ((Context as IUClassContext) == null)
            {
                return;
            }

            // Set the scenario name for Preferences
            ScenarioPrefsName = (Context as IUClassContext).ClassName + ":F:" + Name;

            Logics.Preferences.FormPrefs prefs = Logics.Logic.UserPreferences.GetScenarioPrefs(ScenarioPrefsName) as Logics.Preferences.FormPrefs;

            if (prefs != null)
            {
                SetPreferences(prefs);
            }
        }