Exemplo n.º 1
0
        public bool ProcessFile(string Vixen2File)
        {
            var result = false;

            this.Show();
            this.Text = "Importing " + Path.GetFileName(Vixen2File);

            parsedV2Sequence = new Vixen2SequenceData(Vixen2File);

            // make a channel mapping, and present that to the user. Not editable at the moment.
            mappings = new List <ChannelMapping>();

            foreach (ElementNode element in VixenSystem.Nodes.GetLeafNodes())
            {
                if (mappings.Count >= parsedV2Sequence.ElementCount)
                {
                    break;
                }

                string newName = "Channel " + (mappings.Count + 1).ToString();
                mappings.Add(new ChannelMapping(newName, element));
            }

            // pad out the mappings with null elements; we want to be able to not map some stuff (later on)
            while (mappings.Count < parsedV2Sequence.ElementCount)
            {
                string newName = "Channel " + (mappings.Count + 1).ToString();
                mappings.Add(new ChannelMapping(newName, null));
            }

            initializeProgressBar();

            // show the user the mapping form
            Vixen2xSequenceImporterChannelMapper mappingForm = new Vixen2xSequenceImporterChannelMapper(mappings);

            mappingForm.ShowDialog();

            createTimedSequence();
            importSequenceData(mappings);

            result = true;

            Close();

            return(result);
        }
Exemplo n.º 2
0
        private void createMapButton_Click(object sender, EventArgs e)
        {
            using (
                Vixen2xSequenceImporterChannelMapper mappingForm =
                    new Vixen2xSequenceImporterChannelMapper(channelMappings, mapExists, vixen2ToVixen3MappingTextBox.Text)) {
                if (mappingForm.ShowDialog() == DialogResult.OK)
                {
                    //add to or update the dictionary
                    AddDictionaryEntry(mappingForm.MappingName, mappingForm.Mappings);

                    //Clear out the text box and make the user re-select the mapping
                    vixen2ToVixen3MappingTextBox.Text = string.Empty;
                }

                //User either created a new map or canceled out of the form so lets reload our
                //maps which will disable the convert button and clean out the Vixen 2 to Vixen 3 Map text box
                LoadMaps();
            }
        }
Exemplo n.º 3
0
        private void createMapButton_Click(object sender, EventArgs e)
        {
            using (
                Vixen2xSequenceImporterChannelMapper mappingForm =
                    new Vixen2xSequenceImporterChannelMapper(channelMappings, mapExists, vixen2ToVixen3MappingTextBox.Text)) {
                if (mappingForm.ShowDialog() == DialogResult.OK) {
                    //add to or update the dictionary
                    AddDictionaryEntry(mappingForm.MappingName, mappingForm.Mappings);

                    //Clear out the text box and make the user re-select the mapping
                    vixen2ToVixen3MappingTextBox.Text = string.Empty;
                }

                //User either created a new map or canceled out of the form so lets reload our
                //maps which will disable the convert button and clean out the Vixen 2 to Vixen 3 Map text box
                LoadMaps();
            }
        }
        public bool ProcessFile(string Vixen2File)
        {
            var result = false;
            this.Show();
            this.Text = "Importing " + Path.GetFileName(Vixen2File);

            parsedV2Sequence = new Vixen2SequenceData(Vixen2File);

            // make a channel mapping, and present that to the user. Not editable at the moment.
            mappings = new List<ChannelMapping>();

            foreach (ElementNode element in VixenSystem.Nodes.GetLeafNodes()) {
                if (mappings.Count >= parsedV2Sequence.ElementCount)
                    break;

                string newName = "Channel " + (mappings.Count + 1).ToString();
                mappings.Add(new ChannelMapping(newName, element));
            }

            // pad out the mappings with null elements; we want to be able to not map some stuff (later on)
            while (mappings.Count < parsedV2Sequence.ElementCount) {
                string newName = "Channel " + (mappings.Count + 1).ToString();
                mappings.Add(new ChannelMapping(newName, null));
            }

            initializeProgressBar();

            // show the user the mapping form
            Vixen2xSequenceImporterChannelMapper mappingForm = new Vixen2xSequenceImporterChannelMapper(mappings);
            mappingForm.ShowDialog();

            createTimedSequence();
            importSequenceData(mappings);

            result = true;

            Close();

            return result;
        }