コード例 #1
0
        public Form1()
        {
            InitializeComponent();
            this.current_instance = new instance();

            /*
             * this.tts = new TextToSpeechProxy("169.254.226.148", 9559);
             * this.motion = new MotionProxy("169.254.226.148", 9559);
             * this.motion.setStiffnesses("Body", 0);
             *
             * this.label_raw_output.Text = "...";
             */
            this.BackColor = Color.Red;
            this.TextBox_max_timeline_value.Text = this.current_instance.timeline_end_frame.ToString();
            this.TextBox_min_timeline_value.Text = this.current_instance.timeline_start_frame.ToString();
            this.textBox_FPS.Text = this.current_instance.frames_per_second.ToString();

            for (int i = this.current_instance.timeline_start_frame; i < this.current_instance.timeline_end_frame; i = i + 1)
            {
                this.listView_timeline.Items.Add(i.ToString());
            }
        }
コード例 #2
0
        private void button_load_file_Click(object sender, EventArgs e)
        {
            string file_name = this.textBox_filename.Text;

            //now read from XML:

            System.Xml.Serialization.XmlSerializer reader =
                new System.Xml.Serialization.XmlSerializer(typeof(instance));

            System.IO.StreamReader file_i = new System.IO.StreamReader(
                @file_name);
            this.current_instance = (instance)reader.Deserialize(file_i);
            file_i.Close();

            this.current_instance.dict_to_list(false);

            //FILE IS LOADED, FILL FEILDS PROPERLY
            this.textBox_FPS.Text = this.current_instance.frames_per_second.ToString();
            this.TextBox_max_timeline_value.Text = this.current_instance.timeline_end_frame.ToString();
            this.TextBox_min_timeline_value.Text = this.current_instance.timeline_start_frame.ToString();

            this.listView_timeline.Items.Clear();
            for (int i = this.current_instance.timeline_start_frame; i < this.current_instance.timeline_end_frame; i = i + 1)
            {
                this.listView_timeline.Items.Add(i.ToString());
            }

            //bold the active keyframes
            for (int i = 0; i < this.listView_timeline.Items.Count; ++i)
            {
                if (this.current_instance.keys.Contains(this.listView_timeline.Items[i].Text))
                {
                    this.listView_timeline.Items[i].Font = new Font(this.listView_timeline.Items[i].Font,
                                                                    this.listView_timeline.Items[i].Font.Style | FontStyle.Bold | FontStyle.Underline);
                }
            }

            this.richTextBox_script.Text = this.current_instance.script;
        }