예제 #1
0
        public void RemovePacketConverter(MainWindow_PacketConverter control)
        {
            if (control == null)
            {
                return;
            }

            /* 変換器を削除 */
            FormTaskManager.RemovePacketConverter(control.Instance);

            /* コントロールを削除 */
            Panel_ConverterList.Controls.Remove(control);

            AdjustControlSize();

            UpdateView();
        }
예제 #2
0
        public void AddPacketConverter(Guid class_id, PacketConverterProperty pcvtp)
        {
            var pcvti = FormTaskManager.CreatePacketConverter(class_id, pcvtp);

            if (pcvti == null)
            {
                return;
            }

            var control = new MainWindow_PacketConverter(this, pcvti);

            Panel_ConverterList.Controls.Add(control);

            AdjustControlSize();

            UpdateView();
        }
예제 #3
0
        public void MoveConverterIndex(MainWindow_PacketConverter control, Point pos_screen)
        {
            var index_old = Panel_ConverterList.Controls.GetChildIndex(control);
            var index_new = GetConverterIndex(Panel_ConverterList.PointToClient(pos_screen));

            if (index_new != index_old)
            {
                DebugManager.MessageOut(string.Format("MoveConverterIndex {0} => {1}", index_new, index_old));

                /* コントロールを入れ替え */
                Panel_ConverterList.Controls.SetChildIndex(control, (int)index_new);

                /* 変換器のインスタンスの順番も変更 */
                FormTaskManager.SetPacketConverterIndex(control.Instance, (int)index_new);

                ResumeLayout();
            }
        }