コード例 #1
0
ファイル: LayoutEditorDialog.cs プロジェクト: Jiiks/LiveSplit
        private void ShowLayoutSettings(LiveSplit.UI.Components.IComponent tabControl = null)
        {
            var oldSettings = (LiveSplit.UI.LayoutSettings)Layout.Settings.Clone();
            var settingsDialog = new LayoutSettingsDialog(Layout.Settings, Layout, tabControl);
            var result = settingsDialog.ShowDialog(this);
            if (result == DialogResult.OK)
            {
                if (oldSettings.BackgroundImage != null && oldSettings.BackgroundImage != Layout.Settings.BackgroundImage)
                    ImagesToDispose.Add(oldSettings.BackgroundImage);

                Layout.HasChanged = true;
            }
            else if (result == DialogResult.Cancel)
            {
                if (Layout.Settings.BackgroundImage != null && oldSettings.BackgroundImage != Layout.Settings.BackgroundImage)
                    Layout.Settings.BackgroundImage.Dispose();

                Layout.Settings.Assign(oldSettings);
                LayoutSettingsAssigned(null, null);
            }
            BindingList.ResetBindings();
        }
コード例 #2
0
 private void ShowLayoutSettings(LiveSplit.UI.Components.IComponent tabControl = null)
 {
     var oldSettings = (Options.LayoutSettings)Layout.Settings.Clone();
     var settingsDialog = new LayoutSettingsDialog(Layout.Settings, Layout, tabControl);
     var result = settingsDialog.ShowDialog(this);
     if (result == DialogResult.OK)
     {
         Layout.HasChanged = true;
     }
     else if (result == DialogResult.Cancel)
     {
         Layout.Settings.Assign(oldSettings);
         LayoutSettingsAssigned(null, null);
     }
     BindingList.ResetBindings();
 }