Example #1
0
		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;
				}
		}
Example #2
0
		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;
		}
Example #3
0
        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);
            }
        }
Example #4
0
        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);
            }
        }
Example #5
0
        public ExportDialog(ISequence sequence)
        {
            InitializeComponent();

            ForeColor = ThemeColorTable.ForeColor;
            BackColor = ThemeColorTable.BackgroundColor;
            ThemeUpdateControls.UpdateControls(this, new List<Control>(new []{textBox1}));
            textBox1.BackColor = ThemeColorTable.BackgroundColor;
            textBox1.ForeColor = ThemeColorTable.ForeColor;
            textBox1.Font = SystemFonts.MessageBoxFont;
            textBox1.AutoSize = true;

            Icon = Resources.Icon_Vixen3;

            _sequence = sequence;
            _exportOps = new Export();
            _exportOps.SequenceNotify += SequenceNotify;

            _sequenceFileName = _sequence.FilePath;

            IEnumerable<string> mediaFileNames =
                (from media in _sequence.SequenceData.Media
                 where media.GetType().ToString().Contains("Audio")
                 where media.MediaFilePath.Length != 0
                 select media.MediaFilePath);

            _audioFileName = "";
            if (mediaFileNames.Any())
            {
                _audioFileName = mediaFileNames.First();
            }

            exportProgressBar.Visible = false;
            currentTimeLabel.Visible = false;

            _cancelled = false;

            backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
            backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);

            _profile = new XMLProfileSettings();
        }
Example #6
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            XMLProfileSettings profile = new XMLProfileSettings();
            SaveCurrentItem();
            profile.PutSetting("Profiles/ProfileCount", comboBoxProfiles.Items.Count);
            for (int i = 0; i < comboBoxProfiles.Items.Count; i++) {
                ProfileItem item = comboBoxProfiles.Items[i] as ProfileItem;
                profile.PutSetting("Profiles/" + "Profile" + i.ToString() + "/Name", item.Name);
                profile.PutSetting("Profiles/" + "Profile" + i.ToString() + "/DataFolder", item.DataFolder);
            }

            if (radioButtonAskMe.Checked)
                profile.PutSetting("Profiles/LoadAction", "Ask");
            else
                profile.PutSetting("Profiles/LoadAction", "LoadSelected");

            if (comboBoxLoadThisProfile.SelectedIndex >= 0)
                profile.PutSetting("Profiles/ProfileToLoad", comboBoxLoadThisProfile.SelectedIndex);

            DialogResult = System.Windows.Forms.DialogResult.OK;

            Close();
        }
Example #7
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            XMLProfileSettings profile = new XMLProfileSettings();
            List<string> checkName = new List<string>();
            List<string> checkDataFolder = new List<string>();
            List<string> duplicateItems = new List<string>();
            List<string> checkDataPath = new List<string>();
            bool duplicateName = false;
            bool duplicateDataFolder = false;
            bool invalidDataPath = false;

            //Check for null values, duplicate profile name or datapath and non rooted datapath
            foreach (ProfileItem item in comboBoxProfiles.Items)
            {
                if (item.Name == null || item.DataFolder == null)
                {
                    MessageBox.Show(
                        @"One or more of your profile entries has a blank name or data folder. You must correct this before continuing.",
                        @"Warning - Blank Entries", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                if (checkName.Contains(item.Name))
                {
                    duplicateName = true;
                    duplicateItems.Add(item.Name + ":\t " + item.DataFolder);
                }
                checkName.Add(item.Name);

                if (checkDataFolder.Contains(item.DataFolder))
                {
                    duplicateDataFolder = true;
                    duplicateItems.Add(item.Name + ":\t " + item.DataFolder);
                }

                checkDataFolder.Add(item.DataFolder);

                if (!Path.IsPathRooted(item.DataFolder) || !item.DataFolder.Contains(@"\"))
                {
                    invalidDataPath = true;
                    checkDataPath.Add(item.Name + ":\t " + item.DataFolder);
                }
            }

            if (duplicateName || duplicateDataFolder)
            {
                //Not pretty here, but works well on the dialog
                var result =
                    MessageBox.Show(
                        @"A duplicate profile name, or data path exists." + Environment.NewLine + Environment.NewLine +
                        @"The duplicate items found were:" + Environment.NewLine + Environment.NewLine + string.Join(Environment.NewLine,duplicateItems) + Environment.NewLine + Environment.NewLine +
                        @"Click OK to accept and contine, or Cancel to go back and edit.",
                        @"Warning - Duplicate Entries", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

                if (result != DialogResult.OK)
                {
                    DialogResult = DialogResult.None;
                    return;
                }
            }

            if (invalidDataPath)
            {
                var result =
                MessageBox.Show(
                    @"An invalid profile data folder exists." + Environment.NewLine + Environment.NewLine +
                    @"The items with invalid paths were:" + Environment.NewLine + Environment.NewLine + string.Join(Environment.NewLine, checkDataPath) + Environment.NewLine + Environment.NewLine +
                    @"Click OK to accept and contine, or Cancel to go back and edit.",
                    @"Warning - Invalid Data Path", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);

                if (result != DialogResult.OK)
                {
                    DialogResult = DialogResult.None;
                    return;
                }
            }

            SaveCurrentItem();
            profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", comboBoxProfiles.Items.Count);
            for (int i = 0; i < comboBoxProfiles.Items.Count; i++) {
                ProfileItem item = comboBoxProfiles.Items[i] as ProfileItem;
                profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i + "/Name", item.Name);
                profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i + "/DataFolder", item.DataFolder);
                //We're getting out of here and expect a restart by user, if the specified DataFolder doesn't exist, we should create it.

                if (item.DataFolder != string.Empty)
                {
                    if (!Directory.Exists(item.DataFolder))
                        Directory.CreateDirectory(item.DataFolder);
                }
            }

            profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "LoadAction",
                radioButtonAskMe.Checked ? "Ask" : "LoadSelected");

            if (comboBoxLoadThisProfile.SelectedIndex >= 0)
                profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "ProfileToLoad", comboBoxLoadThisProfile.SelectedIndex);

            DialogResult = DialogResult.OK;
            Close();
        }
Example #8
0
        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;
        }
Example #9
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            XMLProfileSettings profile = new XMLProfileSettings();
            List<string> checkName = new List<string>();
            List<string> checkDataFolder = new List<string>();
            List<string> duplicateItems = new List<string>();
            List<string> checkDataPath = new List<string>();
            bool duplicateName = false;
            bool duplicateDataFolder = false;
            bool invalidDataPath = false;

            //Check for null values, duplicate profile name or datapath and non rooted datapath
            foreach (ProfileItem item in comboBoxProfiles.Items)
            {
                if (item.Name == null || item.DataFolder == null)
                {
                    //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                    MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
                    var messageBox = new MessageBoxForm("One or more of your profile entries has a blank name or data folder. You must correct this before continuing.",
                        @"Warning - Blank Entries", false, false);
                    messageBox.ShowDialog();
                }

                if (checkName.Contains(item.Name))
                {
                    duplicateName = true;
                    duplicateItems.Add(item.Name + ":\t " + item.DataFolder);
                }
                checkName.Add(item.Name);

                if (checkDataFolder.Contains(item.DataFolder))
                {
                    duplicateDataFolder = true;
                    duplicateItems.Add(item.Name + ":\t " + item.DataFolder);
                }

                checkDataFolder.Add(item.DataFolder);

                if (!Path.IsPathRooted(item.DataFolder) || !item.DataFolder.Contains(@"\"))
                {
                    invalidDataPath = true;
                    checkDataPath.Add(item.Name + ":\t " + item.DataFolder);
                }
            }

            if (duplicateName || duplicateDataFolder)
            {
                //Not pretty here, but works well on the dialog
                //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
                var messageBox = new MessageBoxForm("A duplicate profile name, or data path exists." + Environment.NewLine + Environment.NewLine +
                        @"The duplicate items found were:" + Environment.NewLine + Environment.NewLine + string.Join(Environment.NewLine, duplicateItems) + Environment.NewLine + Environment.NewLine +
                        @"Click OK to accept and contine, or Cancel to go back and edit.",
                        @"Warning - Duplicate Entries", false, true);
                messageBox.ShowDialog();

                if (messageBox.DialogResult != DialogResult.OK)
                {
                    DialogResult = DialogResult.None;
                    return;
                }
            }

            if (invalidDataPath)
            {
                //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                MessageBoxForm.msgIcon = SystemIcons.Warning; //this is used if you want to add a system icon to the message form.
                var messageBox = new MessageBoxForm("An invalid profile data folder exists." + Environment.NewLine + Environment.NewLine +
                    @"The items with invalid paths were:" + Environment.NewLine + Environment.NewLine + string.Join(Environment.NewLine, checkDataPath) + Environment.NewLine + Environment.NewLine +
                    @"Click OK to accept and contine, or Cancel to go back and edit.",
                    @"Warning - Invalid Data Path", false, true);
                messageBox.ShowDialog();

                if (messageBox.DialogResult != DialogResult.OK)
                {
                    DialogResult = DialogResult.None;
                    return;
                }
            }

            SaveCurrentItem();
            profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "ProfileCount", comboBoxProfiles.Items.Count);
            for (int i = 0; i < comboBoxProfiles.Items.Count; i++) {
                ProfileItem item = comboBoxProfiles.Items[i] as ProfileItem;
                profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i + "/Name", item.Name);
                profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "Profile" + i + "/DataFolder", item.DataFolder);
                if (!Directory.Exists(item.DataFolder))
                {
                    //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible)
                    MessageBoxForm.msgIcon = SystemIcons.Exclamation; //this is used if you want to add a system icon to the message form.
                    var messageBox = new MessageBoxForm("The data directory '" + item.DataFolder + "' for profile '" + item.Name + "' does not exist.  Would you like to create it?",
                        Application.ProductName, true, false);
                    messageBox.ShowDialog();
                    if (messageBox.DialogResult == DialogResult.OK)
                    {
                        try
                        {
                            Directory.CreateDirectory(item.DataFolder);
                        }
                        catch (Exception)
                        {
                            //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.
                            messageBox = new MessageBoxForm("Could not create new profile directory: " + item.DataFolder + Environment.NewLine + Environment.NewLine +
                                "Click OK to ignore and continue, or Cancel to go back and edit.",
                                "Error", false, true);
                            messageBox.ShowDialog();
                            if (messageBox.DialogResult == DialogResult.Cancel)
                            {
                                DialogResult = DialogResult.None;
                                return;
                            }
                        }
                    }
                }
            }

            profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "LoadAction",
                radioButtonAskMe.Checked ? "Ask" : "LoadSelected");

            if (comboBoxLoadThisProfile.SelectedIndex >= 0)
                profile.PutSetting(XMLProfileSettings.SettingType.Profiles, "ProfileToLoad", comboBoxLoadThisProfile.SelectedIndex);

            DialogResult = DialogResult.OK;
            Close();
        }
Example #10
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();
        }
Example #11
0
        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;
        }
Example #12
0
        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
        }
Example #13
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);
		}
Example #14
0
        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
        }
Example #15
0
        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);
            }
        }
Example #16
0
        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;
        }
Example #17
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();
        }
Example #18
0
        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);
        }
Example #19
0
 private void SaveWindowState()
 {
     XMLProfileSettings xml = new XMLProfileSettings();
     xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height);
     xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width);
     xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X);
     xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y);
     xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name),
         WindowState.ToString());
 }
Example #20
0
        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
        }
Example #21
0
        void IEditorUserInterface.EditorClosing()
        {
            if (WindowState == FormWindowState.Minimized)
            {
                //Don't close with a minimized window.
                WindowState = FormWindowState.Normal;
            }

            dockPanel.SaveAsXml(_settingsPath);
            MarksForm.Close();
            EffectsForm.Close();
            LayerEditor.Close();

            var xml = new XMLProfileSettings();
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockLeftPortion", Name), (int)dockPanel.DockLeftPortion);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockRightPortion", Name), (int)dockPanel.DockRightPortion);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AutoSaveEnabled", Name), autoSaveToolStripMenuItem.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DrawModeSelected", Name), toolStripButton_DrawMode.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SelectionModeSelected", Name), toolStripButton_SelectionMode.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapToSelected", Name), toolStripButton_SnapTo.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name), WindowState.ToString());
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapStrength", Name), TimelineControl.grid.SnapStrength);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CloseGapThreshold", Name), TimelineControl.grid.CloseGap_Threshold);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AlignToThreshold", Name), AlignTo_Threshold);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorEnabled", Name), TimelineControl.grid.ResizeIndicator_Enabled);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CadStyleSelectionBox", Name), cADStyleSelectionBoxToolStripMenuItem.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorColor", Name), TimelineControl.grid.ResizeIndicator_Color);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkCurves", Name), ToolsForm.LinkCurves);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkGradients", Name), ToolsForm.LinkGradients);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ZoomUnderMousePosition", Name), zoomUnderMousePositionToolStripMenuItem.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WaveFormHeight", Name), TimelineControl.waveform.Height);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/RulerHeight", Name), TimelineControl.ruler.Height);

            //This .Close is here because we need to save some of the settings from the form before it is closed.
            ToolsForm.Close();

            //These are only saved in options
            //xml.PutPreference(string.Format("{0}/AutoSaveInterval", Name), _autoSaveTimer.Interval);

            //Clean up any old locations from before we organized the settings.
            xml.RemoveNode("StandardNudge");
            xml.RemoveNode("SuperNudge");
            xml.RemoveNode(Name);
        }
Example #22
0
 void IEditorUserInterface.EditorClosing()
 {
     dockPanel.SaveAsXml(settingsPath);
     XMLProfileSettings xml = new XMLProfileSettings();
     xml.PutSetting(string.Format("{0}/DockLeftPortion",this.Name),(int)dockPanel.DockLeftPortion);
     xml.PutSetting(string.Format("{0}/DockRihtPortion", this.Name), (int)dockPanel.DockLeftPortion);
     xml = null;
 }
Example #23
0
        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);
                }
            }
        }
Example #24
0
 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();
 }
Example #25
0
        void IEditorUserInterface.EditorClosing()
        {
            dockPanel.SaveAsXml(settingsPath);
            MarksForm.Close();
            EffectsForm.Close();

            var xml = new XMLProfileSettings();
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockLeftPortion", Name), (int)dockPanel.DockLeftPortion);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DockRightPortion", Name), (int)dockPanel.DockLeftPortion);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/AutoSaveEnabled", Name), autoSaveToolStripMenuItem.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/DrawModeSelected", Name), toolStripButton_DrawMode.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SelectionModeSelected", Name), toolStripButton_SelectionMode.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapToSelected", Name), toolStripButton_SnapTo.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowHeight", Name), Size.Height);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowWidth", Name), Size.Width);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationX", Name), Location.X);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowLocationY", Name), Location.Y);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/WindowState", Name), WindowState.ToString());
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SnapStrength", Name), TimelineControl.grid.SnapStrength);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorEnabled", Name), TimelineControl.grid.ResizeIndicator_Enabled);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/CadStyleSelectionBox", Name), cADStyleSelectionBoxToolStripMenuItem.Checked);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ResizeIndicatorColor", Name), TimelineControl.grid.ResizeIndicator_Color);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkCurves", Name), ToolsForm.LinkCurves);
            xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/ToolPaletteLinkGradients", Name), ToolsForm.LinkGradients);

            ToolsForm.Close();

            //These are only saved in options
            //xml.PutPreference(string.Format("{0}/AutoSaveInterval", Name), _autoSaveTimer.Interval);

            //Clean up any old locations from before we organized the settings.
            xml.RemoveNode("StandardNudge");
            xml.RemoveNode("SuperNudge");
            xml.RemoveNode(Name);
        }
Example #26
0
 private void Form_Marks_Closing(object sender, FormClosingEventArgs e)
 {
     var xml = new XMLProfileSettings();
     xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/StandardNudge", Name), Convert.ToInt32(numericUpDownStandardNudge.Value));
     xml.PutSetting(XMLProfileSettings.SettingType.AppSettings, string.Format("{0}/SuperNudge", Name), Convert.ToInt32(numericUpDownSuperNudge.Value));
 }