private void PopulateLoadProfileSection(bool firstTime) { XMLProfileSettings profile = new XMLProfileSettings(); radioButtonAskMe.Checked = (profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "LoadAction", "LoadSelected") == "Ask"); radioButtonLoadThisProfile.Checked = (!radioButtonAskMe.Checked); ProfileItem selectedItem = comboBoxLoadThisProfile.SelectedItem as ProfileItem; comboBoxLoadThisProfile.Items.Clear(); if (comboBoxProfiles.Items.Count == 0) return; foreach (ProfileItem item in comboBoxProfiles.Items) { comboBoxLoadThisProfile.Items.Add(item); } if (firstTime) { if (radioButtonLoadThisProfile.Checked) { int loadItemNum = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileToLoad", 0); if (loadItemNum < comboBoxLoadThisProfile.Items.Count) comboBoxLoadThisProfile.SelectedIndex = loadItemNum; } } else // If the combo box was already populated, we want to select the same item. if (selectedItem != null && comboBoxLoadThisProfile.Items.Contains(selectedItem)) { comboBoxLoadThisProfile.SelectedItem = selectedItem; } }
private void Form_Marks_Load(object sender, EventArgs e) { var xml = new XMLProfileSettings(); numericUpDownStandardNudge.Value = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/StandardNudge", Name), 10); numericUpDownSuperNudge.Value = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SuperNudge", Name), 20); //xml = null; }
private void SelectProfile_Load(object sender, EventArgs e) { XMLProfileSettings profile = new XMLProfileSettings(); int profileCount = profile.GetSetting("Profiles/ProfileCount", 0); for (int i = 0; i < profileCount; i++) { ProfileItem item = new ProfileItem(); item.Name = profile.GetSetting("Profiles/" + "Profile" + i.ToString() + "/Name", "New Profile"); item.DataFolder = profile.GetSetting("Profiles/" + "Profile" + i.ToString() + "/DataFolder", string.Empty); listBoxProfiles.Items.Add(item); } }
private void PopulateProfileList() { XMLProfileSettings profile = new XMLProfileSettings(); //Make sure we start with an empty listbox since we may repopulate after editing profiles listBoxProfiles.Items.Clear(); int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0); for (int i = 0; i < profileCount; i++) { ProfileItem item = new ProfileItem(); item.Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name", "New Profile"); item.DataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", string.Empty); listBoxProfiles.Items.Add(item); } }
private void TimedSequenceEditorForm_Load(object sender, EventArgs e) { _settingsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen", "TimedSequenceEditorForm.xml"); _colorCollectionsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen", "ColorCollections.xml"); if (File.Exists(_settingsPath)) { try { //Try to load the dock settings fro ma file. Somehow users manage to corrupt this file, so if it can be used //Then just reconfigure to the defaults. dockPanel.LoadFromXml(_settingsPath, DockingPanels_GetContentFromPersistString); } catch (Exception ex) { DestroyAndRecreateDockPanel(ex); } } else { SetDockDefaults(); } if (GridForm.IsHidden) { GridForm.DockState = DockState.Document; } if (EffectEditorForm.DockState == DockState.Unknown) { EffectEditorForm.Show(dockPanel, DockState.DockRight); } if (LayerEditor.DockState == DockState.Unknown) { LayerEditor.Show(dockPanel, DockState.DockRight); } XMLProfileSettings xml = new XMLProfileSettings(); //Get preferences _autoSaveTimer.Interval = xml.GetSetting(XMLProfileSettings.SettingType.Preferences, string.Format("{0}/AutoSaveInterval", Name), 300000); //Restore App Settings dockPanel.DockLeftPortion = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockLeftPortion", Name), 150); dockPanel.DockRightPortion = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockRightPortion", Name), 150); autoSaveToolStripMenuItem.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AutoSaveEnabled", Name), true); toolStripButton_SnapTo.Checked = toolStripMenuItem_SnapTo.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapToSelected", Name), true); PopulateSnapStrength(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapStrength", Name), 2)); TimelineControl.grid.CloseGap_Threshold = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CloseGapThreshold", Name), ".100"); AlignTo_Threshold = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AlignToThreshold", Name), ".800"); toolStripMenuItem_ResizeIndicator.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorEnabled", Name), false); toolStripButton_DrawMode.Checked = TimelineControl.grid.EnableDrawMode = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DrawModeSelected", Name), false); toolStripButton_SelectionMode.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SelectionModeSelected", Name), true); ToolsForm.LinkCurves = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkCurves", Name), false); ToolsForm.LinkGradients = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkGradients", Name), false); cADStyleSelectionBoxToolStripMenuItem.Checked = TimelineControl.grid.aCadStyleSelectionBox = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CadStyleSelectionBox", Name), false); CheckRiColorMenuItem(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorColor", Name), "Red")); zoomUnderMousePositionToolStripMenuItem.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ZoomUnderMousePosition", Name), false); TimelineControl.waveform.Height = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WaveFormHeight", Name), 50); TimelineControl.ruler.Height = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/RulerHeight", Name), 50); foreach (ToolStripItem toolStripItem in toolStripDropDownButton_SnapToStrength.DropDownItems) { var toolStripMenuItem = toolStripItem as ToolStripMenuItem; if (toolStripMenuItem != null) { if (TimelineControl.grid.SnapStrength.Equals(Convert.ToInt32(toolStripMenuItem.Tag))) { toolStripMenuItem.PerformClick(); break; } } } foreach (ToolStripItem toolStripItem in toolStripSplitButton_CloseGaps.DropDownItems) { var toolStripMenuItem = toolStripItem as ToolStripMenuItem; if (toolStripMenuItem != null) { if (TimelineControl.grid.CloseGap_Threshold.Equals(toolStripMenuItem.Tag)) { toolStripMenuItem.PerformClick(); break; } } } foreach (ToolStripItem toolStripItem in toolStripDropDownButton_AlignTo.DropDownItems) { var toolStripMenuItem = toolStripItem as ToolStripMenuItem; if (toolStripMenuItem != null) { if (AlignTo_Threshold.Equals(toolStripMenuItem.ToString())) { toolStripMenuItem.PerformClick(); break; } } } WindowState = FormWindowState.Normal; var desktopBounds = new Rectangle( new Point( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y)), new Size( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height))); var windowState = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name), "Normal"); if (IsVisibleOnAnyScreen(desktopBounds)) { StartPosition = FormStartPosition.Manual; DesktopBounds = desktopBounds; if (windowState.Equals("Maximized")) { WindowState = FormWindowState.Maximized; } } else { // this resets the upper left corner of the window to windows standards StartPosition = FormStartPosition.WindowsDefaultLocation; if (windowState.Equals("Minimized")) { //Somehow we were closed in a minimized state. All bets are off, so put use back in some sensible default. WindowState = FormWindowState.Normal; // this resets the upper left corner of the window to windows standards StartPosition = FormStartPosition.WindowsDefaultLocation; Size = new Size(800, 600); } else { // we can still apply the saved size Size = new Size(desktopBounds.Width, desktopBounds.Height); } } _effectNodeToElement = new Dictionary<EffectNode, Element>(); _elementNodeToRows = new Dictionary<ElementNode, List<Row>>(); TimelineControl.grid.RenderProgressChanged += OnRenderProgressChanged; TimelineControl.ElementChangedRows += ElementChangedRowsHandler; TimelineControl.ElementsMovedNew += timelineControl_ElementsMovedNew; TimelineControl.ElementDoubleClicked += ElementDoubleClickedHandler; //TimelineControl.DataDropped += timelineControl_DataDropped; TimelineControl.PlaybackCurrentTimeChanged += timelineControl_PlaybackCurrentTimeChanged; TimelineControl.RulerClicked += timelineControl_RulerClicked; TimelineControl.RulerBeginDragTimeRange += timelineControl_RulerBeginDragTimeRange; TimelineControl.RulerTimeRangeDragged += timelineControl_TimeRangeDragged; TimelineControl.MarkMoved += timelineControl_MarkMoved; TimelineControl.DeleteMark += timelineControl_DeleteMark; TimelineControl.SelectionChanged += TimelineControlOnSelectionChanged; TimelineControl.grid.MouseDown += TimelineControl_MouseDown; TimeLineSequenceClipboardContentsChanged += TimelineSequenceTimeLineSequenceClipboardContentsChanged; TimelineControl.CursorMoved += CursorMovedHandler; TimelineControl.ElementsSelected += timelineControl_ElementsSelected; TimelineControl.ContextSelected += timelineControl_ContextSelected; TimelineControl.SequenceLoading = false; TimelineControl.TimePerPixelChanged += TimelineControl_TimePerPixelChanged; TimelineControl.VisibleTimeStartChanged += TimelineControl_VisibleTimeStartChanged; TimelineControl.grid.SelectedElementsCloneDelegate = CloneElements; TimelineControl.grid.StartDrawMode += DrawElement; TimelineControl.grid.DragOver += TimelineControlGrid_DragOver; TimelineControl.grid.DragEnter += TimelineControlGrid_DragEnter; TimelineControl.grid.DragDrop += TimelineControlGrid_DragDrop; Row.RowHeightChanged += TimeLineControl_Row_RowHeightChanged; _curveLibrary = ApplicationServices.Get<IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary; if (_curveLibrary != null) { _curveLibrary.CurveChanged += CurveLibrary_CurveChanged; } _colorGradientLibrary = ApplicationServices.Get<IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary; if (_colorGradientLibrary != null) { _colorGradientLibrary.GradientChanged += ColorGradientLibrary_CurveChanged; } LoadAvailableEffects(); PopulateDragBoxFilterDropDown(); InitUndo(); UpdateButtonStates(); UpdatePasteMenuStates(); LoadColorCollections(); _library = ApplicationServices.Get<IAppModuleInstance>(LipSyncMapDescriptor.ModuleID) as LipSyncMapLibrary; Cursor.Current = Cursors.Default; if (_sequence.DefaultSplitterDistance != 0) { TimelineControl.splitContainer.SplitterDistance = _sequence.DefaultSplitterDistance; } else { TimelineControl.splitContainer.SplitterDistance = (int) (TimelineControl.DefaultSplitterDistance*_scaleFactor); } if (_sequence.DefaultPlaybackEndTime != TimeSpan.Zero) { _mPrevPlaybackStart = TimelineControl.PlaybackStartTime = _sequence.DefaultPlaybackStartTime; _mPrevPlaybackEnd = TimelineControl.PlaybackEndTime = _sequence.DefaultPlaybackEndTime; } #if DEBUG ToolStripButton b = new ToolStripButton("[Debug Break]"); b.Click += b_Click; toolStripOperations.Items.Add(b); #endif }
private void RestoreWindowState() { WindowState = FormWindowState.Normal; StartPosition = FormStartPosition.WindowsDefaultBounds; XMLProfileSettings xml = new XMLProfileSettings(); var desktopBounds = new Rectangle( new Point( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y)), new Size( xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height))); if (desktopBounds.Width < 300) { if (gdiControl.Background != null && gdiControl.Background.Width > 300) desktopBounds.Width = gdiControl.Background.Width; else desktopBounds.Width = 400; } if (desktopBounds.Height < 200) { if (gdiControl.Background != null && gdiControl.Background.Height > 200) desktopBounds.Height = gdiControl.Background.Height; else desktopBounds.Height = 300; } if (IsVisibleOnAnyScreen(desktopBounds)) { StartPosition = FormStartPosition.Manual; DesktopBounds = desktopBounds; if (xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name), "Normal").Equals("Maximized")) { WindowState = FormWindowState.Maximized; } } else { // this resets the upper left corner of the window to windows standards StartPosition = FormStartPosition.WindowsDefaultLocation; // we can still apply the saved size Size = new Size(desktopBounds.Width,desktopBounds.Height); } }
private void PopulateProfileList() { XMLProfileSettings profile = new XMLProfileSettings(); int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0); if (profileCount == 0) { ProfileItem item = new ProfileItem {Name = "Default", DataFolder = _defaultFolder}; comboBoxProfiles.Items.Add(item); } else { for (int i = 0; i < profileCount; i++) { ProfileItem item = new ProfileItem { Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i + "/Name", "New Profile"), DataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i + "/DataFolder", _defaultFolder) }; comboBoxProfiles.Items.Add(item); } } comboBoxProfiles.SelectedIndex = 0; }
private void ProcessProfiles() { XMLProfileSettings profile = new XMLProfileSettings(); // if we don't have any profiles yet, fall through so the "Default" profile will be created int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0); if (profileCount == 0) { return; } // now that we know we have profiles, get the rest of the settings string loadAction = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "LoadAction", "LoadSelected"); int profileToLoad = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileToLoad", -1); // try to load the selected profile if (loadAction != "Ask" && profileToLoad > -1 && profileToLoad < profileCount) { string directory = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + profileToLoad + "/DataFolder", string.Empty); if (!string.IsNullOrEmpty(directory) && Directory.Exists(directory)) { _rootDataDirectory = directory; } else { string name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + profileToLoad + "/Name", string.Empty); //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("Selected profile '" + name + "' data directory does not exist!" + Environment.NewLine + Environment.NewLine + directory + Environment.NewLine + Environment.NewLine + "Select a different profile to load or use the Profile Editor to create a new profile.", "Error", false, false); messageBox.ShowDialog(); } } // if _rootDataDirectory is still empty at this point either we're configured to always ask or loading the selected profile failed // keep asking until we get a good profile directory while (string.IsNullOrEmpty(_rootDataDirectory)) { SelectProfile selectProfile = new SelectProfile(); DialogResult result = selectProfile.ShowDialog(); if (result == DialogResult.OK) { string directory = selectProfile.DataFolder; if (!string.IsNullOrEmpty(directory) && Directory.Exists(directory)) { _rootDataDirectory = directory; break; } //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("The data directory for the selected profile does not exist!" + Environment.NewLine + Environment.NewLine + directory + Environment.NewLine + Environment.NewLine + "Select a different profile to load or use the Profile Editor to create a new profile.", "Error", false, false); messageBox.ShowDialog(); } else if (result == DialogResult.Cancel) { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) var messageBox = new MessageBoxForm(Application.ProductName + " cannot continue without a vaild profile." + Environment.NewLine + Environment.NewLine + "Are you sure you want to exit " + Application.ProductName + "?", Application.ProductName, true, false); messageBox.ShowDialog(); if (messageBox.DialogResult == DialogResult.OK) { Environment.Exit(0); } } else { // SelectProfile.ShowDialog() should only return DialogResult.OK or Cancel, how did we get here? throw new NotImplementedException("SelectProfile.ShowDialog() returned " + result.ToString()); } } SetLogFilePaths(); }
private void ProcessProfiles() { XMLProfileSettings profile = new XMLProfileSettings(); string loadAction = profile.GetSetting("Profiles/LoadAction", "LoadSelected"); int profileCount = profile.GetSetting("Profiles/ProfileCount", 0); int profileToLoad = profile.GetSetting("Profiles/ProfileToLoad", -1); // why ask if there is 0 or 1 profile? if (loadAction == "Ask" && profileCount > 1) { SelectProfile f = new SelectProfile(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _rootDataDirectory = f.DataFolder; } } else // So we're to use the "selected" one... { // If we don't have any profiles, get outta here if (profileCount == 0 || profileToLoad < 0) { return; } else { if (profileToLoad < profileCount) { _rootDataDirectory = profile.GetSetting("Profiles/Profile" + profileToLoad.ToString() + "/DataFolder", string.Empty); if (_rootDataDirectory != string.Empty) { if (!System.IO.Directory.Exists(_rootDataDirectory)) System.IO.Directory.CreateDirectory(_rootDataDirectory); } else { _rootDataDirectory = null; } } } } SetLogFilePaths(); }
private void PopulateProfileList() { XMLProfileSettings profile = new XMLProfileSettings(); int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0); if (profileCount == 0) { MessageBox.Show("Unable to locate any profiles."); return; } else { for (int i = 0; i < profileCount; i++) { ProfileItem item = new ProfileItem(); item.Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name", ""); item.DataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", ""); comboBoxProfiles.Items.Add(item); } } comboBoxProfiles.SelectedIndex = 0; }
private void ProcessProfiles() { XMLProfileSettings profile = new XMLProfileSettings(); // if we don't have any profiles yet, fall through so the "Default" profile will be created int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0); if (profileCount == 0) { return; } // now that we know we have profiles, get the rest of the settings string loadAction = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "LoadAction", "LoadSelected"); int profileToLoad = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileToLoad", -1); // try to load the selected profile if (loadAction != "Ask" && profileToLoad > -1 && profileToLoad < profileCount) { string directory = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + profileToLoad + "/DataFolder", string.Empty); var isLocked = IsProfileLocked(directory); if (!string.IsNullOrEmpty(directory) && Directory.Exists(directory) && !isLocked) { _rootDataDirectory = directory; string profileName = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + profileToLoad + "/Name", string.Empty); UpdateTitleWithProfileName(profileName); } else { string name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + profileToLoad + "/Name", string.Empty); ShowLoadProfileErrorMessage(name, isLocked); } } // if _rootDataDirectory is still empty at this point either we're configured to always ask or loading the selected profile failed // keep asking until we get a good profile directory while (string.IsNullOrEmpty(_rootDataDirectory)) { SelectProfile selectProfile = new SelectProfile(); DialogResult result = selectProfile.ShowDialog(); if (result == DialogResult.OK) { string directory = selectProfile.DataFolder; var isLocked = IsProfileLocked(directory); if (!string.IsNullOrEmpty(directory) && Directory.Exists(directory) && !isLocked) { _rootDataDirectory = directory; UpdateTitleWithProfileName(selectProfile.ProfileName); break; } ShowLoadProfileErrorMessage(selectProfile.ProfileName, isLocked); } else if (result == DialogResult.Cancel) { var messageBox = new MessageBoxForm(Application.ProductName + " cannot continue without a vaild profile." + Environment.NewLine + Environment.NewLine + "Are you sure you want to exit " + Application.ProductName + "?", Application.ProductName,MessageBoxButtons.YesNo, SystemIcons.Warning); messageBox.ShowDialog(); if (messageBox.DialogResult == DialogResult.OK) { Environment.Exit(0); } } else { // SelectProfile.ShowDialog() should only return DialogResult.OK or Cancel, how did we get here? throw new NotImplementedException("SelectProfile.ShowDialog() returned " + result.ToString()); } } SetLogFilePaths(); }
private void PopulateProfileList() { var profile = new XMLProfileSettings(); int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0); if (profileCount == 0) { var item = new ProfileItem { Name = "Default", DataFolder = DataProfileForm.DefaultFolder }; comboBoxProfiles.Items.Add(item); } else { for (int i = 0; i < profileCount; i++) { var item = new ProfileItem { Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name", ""), DataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", "") }; comboBoxProfiles.Items.Add(item); } } comboBoxProfiles.SelectedIndex = 0; textBoxFileName.Text=@"VixenProfile"; textBoxSaveFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); }
private void PopulateProfileList() { XMLProfileSettings profile = new XMLProfileSettings(); int profileCount = profile.GetSetting("Profiles/ProfileCount", 0); if (profileCount == 0) { ProfileItem item = new ProfileItem(); item.Name = "Default"; item.DataFolder = defaultFolder; comboBoxProfiles.Items.Add(item); } else { for (int i = 0; i < profileCount; i++) { ProfileItem item = new ProfileItem(); item.Name = profile.GetSetting("Profiles/" + "Profile" + i.ToString() + "/Name", "New Profile"); item.DataFolder = profile.GetSetting("Profiles/" + "Profile" + i.ToString() + "/DataFolder", defaultFolder); comboBoxProfiles.Items.Add(item); } } comboBoxProfiles.SelectedIndex = 0; }
private void PopulateProfileList() { var profile = new XMLProfileSettings(); int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0); if (profileCount == 0) { MessageBox.Show(@"Unable to locate any profiles."); return; } for (int i = 0; i < profileCount; i++) { var item = new ProfileItem { Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name", ""), DataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", "") }; comboBoxProfiles.Items.Add(item); } comboBoxProfiles.SelectedIndex = 0; textBoxFileName.Text=@"VixenProfile"; textBoxSaveFolder.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); }
private void PopulateProfileList() { XMLProfileSettings profile = new XMLProfileSettings(); //Make sure we start with an empty listbox since we may repopulate after editing profiles listBoxProfiles.Items.Clear(); int profileCount = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", 0); for (int i = 0; i < profileCount; i++) { var dataFolder = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/DataFolder", string.Empty); if (!VixenApplication.IsProfileLocked(dataFolder)) //Only add the profile if it is not locked. { ProfileItem item = new ProfileItem(); item.Name = profile.GetSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i.ToString() + "/Name", "New Profile"); item.DataFolder = dataFolder; listBoxProfiles.Items.Add(item); } } }
private void TimedSequenceEditorForm_Load(object sender, EventArgs e) { settingsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen", "TimedSequenceEditorForm.xml"); ColorCollectionsPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Vixen", "ColorCollections.xml"); if (File.Exists(settingsPath)) { dockPanel.LoadFromXml(settingsPath, new DeserializeDockContent(DockingPanels_GetContentFromPersistString)); } else { GridForm.Show(dockPanel); ToolsForm.Show(dockPanel, DockState.DockLeft); MarksForm.Show(dockPanel, DockState.DockLeft); EffectsForm.Show(dockPanel, DockState.DockLeft); } XMLProfileSettings xml = new XMLProfileSettings(); //Get preferences _autoSaveTimer.Interval = xml.GetSetting(XMLProfileSettings.SettingType.Preferences, string.Format("{0}/AutoSaveInterval", Name), 300000); //Restore App Settings dockPanel.DockLeftPortion = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockLeftPortion", Name), 150); dockPanel.DockRightPortion = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockRightPortion", Name), 150); autoSaveToolStripMenuItem.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AutoSaveEnabled", Name), true); toolStripButton_SnapTo.Checked = toolStripMenuItem_SnapTo.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapToSelected", Name), true); PopulateSnapStrength(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapStrength", Name), 2)); toolStripMenuItem_ResizeIndicator.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorEnabled", Name),false); toolStripButton_DrawMode.Checked = TimelineControl.grid.EnableDrawMode = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DrawModeSelected", Name), false); toolStripButton_SelectionMode.Checked = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SelectionModeSelected", Name), true); ToolsForm.LinkCurves = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkCurves", Name), false); ToolsForm.LinkGradients = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkGradients", Name), false); cADStyleSelectionBoxToolStripMenuItem.Checked = TimelineControl.grid.aCadStyleSelectionBox = xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CadStyleSelectionBox", Name), false); CheckRiColorMenuItem(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorColor", Name), "Red")); foreach (ToolStripItem toolStripItem in toolStripDropDownButton_SnapToStrength.DropDownItems) { var toolStripMenuItem = toolStripItem as ToolStripMenuItem; if (toolStripMenuItem != null) { if(TimelineControl.grid.SnapStrength.Equals(Convert.ToInt32(toolStripMenuItem.Tag))) { toolStripMenuItem.PerformClick(); break; } } } WindowState = FormWindowState.Normal; if (xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name), "Normal").Equals("Maximized")) { WindowState = FormWindowState.Maximized; } else { var desktopBounds = new Rectangle(new Point(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y)),new Size(xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width), xml.GetSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height))); if (IsVisibleOnAnyScreen(desktopBounds)) { DesktopBounds = desktopBounds; } } _effectNodeToElement = new Dictionary<EffectNode, Element>(); _elementNodeToRows = new Dictionary<ElementNode, List<Row>>(); TimelineControl.grid.RenderProgressChanged += OnRenderProgressChanged; TimelineControl.ElementChangedRows += ElementChangedRowsHandler; TimelineControl.ElementsMovedNew += timelineControl_ElementsMovedNew; TimelineControl.ElementDoubleClicked += ElementDoubleClickedHandler; TimelineControl.DataDropped += timelineControl_DataDropped; TimelineControl.ColorDropped += timelineControl_ColorDropped; TimelineControl.CurveDropped += timelineControl_CurveDropped; TimelineControl.GradientDropped += timelineControl_GradientDropped; TimelineControl.PlaybackCurrentTimeChanged += timelineControl_PlaybackCurrentTimeChanged; TimelineControl.RulerClicked += timelineControl_RulerClicked; TimelineControl.RulerBeginDragTimeRange += timelineControl_RulerBeginDragTimeRange; TimelineControl.RulerTimeRangeDragged += timelineControl_TimeRangeDragged; TimelineControl.MarkMoved += timelineControl_MarkMoved; TimelineControl.DeleteMark += timelineControl_DeleteMark; EffectsForm.EscapeDrawMode += EscapeDrawMode; MarksForm.MarkCollectionChecked += MarkCollection_Checked; MarksForm.EditMarkCollection += MarkCollection_Edit; MarksForm.ChangedMarkCollection += MarkCollection_Changed; ToolsForm.StartColorDrag += ToolPalette_ColorDrag; ToolsForm.StartCurveDrag += ToolPalette_CurveDrag; ToolsForm.StartGradientDrag += ToolPalette_GradientDrag; TimelineControl.SelectionChanged += TimelineControlOnSelectionChanged; TimelineControl.grid.MouseDown += TimelineControl_MouseDown; TimeLineSequenceClipboardContentsChanged += TimelineSequenceTimeLineSequenceClipboardContentsChanged; TimelineControl.CursorMoved += CursorMovedHandler; TimelineControl.ElementsSelected += timelineControl_ElementsSelected; TimelineControl.ContextSelected += timelineControl_ContextSelected; TimelineControl.SequenceLoading = false; TimelineControl.TimePerPixelChanged += TimelineControl_TimePerPixelChanged; TimelineControl.grid.SelectedElementsCloneDelegate = CloneElements; TimelineControl.grid.StartDrawMode += DrawElement; _virtualEffectLibrary = ApplicationServices.Get<IAppModuleInstance>(VirtualEffectLibraryDescriptor.Guid) as VirtualEffectLibrary; _curveLibrary = ApplicationServices.Get<IAppModuleInstance>(CurveLibraryDescriptor.ModuleID) as CurveLibrary; if (_curveLibrary != null) { _curveLibrary.CurveChanged += CurveLibrary_CurveChanged; } _colorGradientLibrary = ApplicationServices.Get<IAppModuleInstance>(ColorGradientLibraryDescriptor.ModuleID) as ColorGradientLibrary; if (_colorGradientLibrary != null) { _colorGradientLibrary.GradientChanged += ColorGradientLibrary_CurveChanged; } LoadAvailableEffects(); PopulateDragBoxFilterDropDown(); InitUndo(); updateButtonStates(); UpdatePasteMenuStates(); LoadVirtualEffects(); LoadColorCollections(); _library = ApplicationServices.Get<IAppModuleInstance>(LipSyncMapDescriptor.ModuleID) as LipSyncMapLibrary; #if DEBUG ToolStripButton b = new ToolStripButton("[Debug Break]"); b.Click += b_Click; toolStripOperations.Items.Add(b); #endif }
private void TimedSequenceEditorForm_Load(object sender, EventArgs e) { settingsPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData), "Vixen", "TimedSequenceEditorForm.xml"); if (System.IO.File.Exists(settingsPath)) { dockPanel.LoadFromXml(settingsPath, new DeserializeDockContent(DockingPanels_GetContentFromPersistString)); } else { GridForm.Show(dockPanel); MarksForm.Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft); EffectsForm.Show(dockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockLeft); } XMLProfileSettings xml = new XMLProfileSettings(); dockPanel.DockLeftPortion = xml.GetSetting(string.Format("{0}/DockLeftPortion", this.Name), 150); dockPanel.DockRightPortion = xml.GetSetting(string.Format("{0}/DockLeftPortion", this.Name), 150); xml = null; _effectNodeToElement = new Dictionary<EffectNode, Element>(); _elementNodeToRows = new Dictionary<ElementNode, List<Row>>(); TimelineControl.grid.RenderProgressChanged += OnRenderProgressChanged; TimelineControl.ElementChangedRows += ElementChangedRowsHandler; TimelineControl.ElementsMovedNew += timelineControl_ElementsMovedNew; TimelineControl.ElementDoubleClicked += ElementDoubleClickedHandler; TimelineControl.DataDropped += timelineControl_DataDropped; TimelineControl.PlaybackCurrentTimeChanged += timelineControl_PlaybackCurrentTimeChanged; TimelineControl.RulerClicked += timelineControl_RulerClicked; TimelineControl.RulerBeginDragTimeRange += timelineControl_RulerBeginDragTimeRange; TimelineControl.RulerTimeRangeDragged += timelineControl_TimeRangeDragged; TimelineControl.MarkMoved += timelineControl_MarkMoved; TimelineControl.DeleteMark += timelineControl_DeleteMark; MarksForm.MarkCollectionChecked += MarkCollection_Checked; MarksForm.EditMarkCollection += MarkCollection_Edit; MarksForm.ChangedMarkCollection += MarkCollection_Changed; TimelineControl.SelectionChanged += TimelineControlOnSelectionChanged; TimelineControl.grid.MouseDown += TimelineControl_MouseDown; TimeLineSequenceClipboardContentsChanged += TimelineSequenceTimeLineSequenceClipboardContentsChanged; TimelineControl.CursorMoved += CursorMovedHandler; TimelineControl.ElementsSelected += timelineControl_ElementsSelected; TimelineControl.ContextSelected += timelineControl_ContextSelected; TimelineControl.SequenceLoading = false; _virtualEffectLibrary = ApplicationServices.Get<IAppModuleInstance>(VixenModules.App.VirtualEffect.VirtualEffectLibraryDescriptor.Guid) as VirtualEffectLibrary; LoadAvailableEffects(); InitUndo(); updateButtonStates(); UpdatePasteMenuStates(); LoadVirtualEffects(); #if DEBUG ToolStripButton b = new ToolStripButton("[Debug Break]"); b.Click += b_Click; toolStripOperations.Items.Add(b); #endif }