private void deleteImg_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                mn = MainForm.getInstance;
                if (mn.PresetName.Equals(this.PresetName))
                {
                    MessageBox.Show("현재 작업중인 프리셋은 삭제할 수 없습니다.");
                }
                else
                {
                    Util.Preset preset = new Util.Preset();
                    preset.deletePreset(this.PresetName);
                    updateList(this.PresetName);

                    if (mn.presetList.list.Height > 218)
                    {
                        Console.WriteLine("스크롤 참" + mn.presetList.scrollPanel.Height);
                        mn.presetList.customScrollbar1.Visible = true;

                        mn.presetList.customScrollbar1.Minimum     = 0;
                        mn.presetList.customScrollbar1.Maximum     = mn.presetList.scrollPanel.DisplayRectangle.Height;
                        mn.presetList.customScrollbar1.LargeChange = mn.presetList.customScrollbar1.Maximum / mn.presetList.customScrollbar1.Height + mn.presetList.scrollPanel.Height;
                        mn.presetList.customScrollbar1.SmallChange = 15;
                        mn.presetList.customScrollbar1.Value       = Math.Abs(mn.presetList.AutoScrollPosition.Y);
                    }
                    else
                    {
                        mn.presetList.customScrollbar1.Visible = false;
                    }
                }
            }
        }
 //교체할 프리셋과 바인딩
 private void settingPreset()
 {
     mn            = MainForm.getInstance;
     mn.PresetName = this.PresetName;
     Util.Preset preset = new Util.Preset();
     preset.settingPreset();
 }
        private void checkImg_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Util.Preset preset = new Util.Preset();

                if (preset.renamePreset(this.PresetName, this.rename.Text))
                {
                    this.PresetName    = this.rename.Text;
                    renameImg.Visible  = true;
                    checkImg.Visible   = false;
                    this.ActiveControl = checkImg;
                    rename.ReadOnly    = true;
                }
            }
        }
        private void rename_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                Util.Preset preset = new Util.Preset();

                if (preset.renamePreset(this.PresetName, this.rename.Text))
                {
                    this.PresetName    = this.rename.Text;
                    renameImg.Visible  = true;
                    checkImg.Visible   = false;
                    this.ActiveControl = checkImg;
                    rename.ReadOnly    = true;
                }
            }
        }
Exemple #5
0
        private bool createPreset()
        {
            string currentFilePath = mn.PresetPath + @"\" + mn.AppName + @"\" + this.preset_name.Text + ".xml";

            if (System.IO.File.Exists(currentFilePath)) //파일 존재?
            {
                Console.WriteLine("파일이 존재합니다");
                return(false);
            }

            mn = MainForm.getInstance;
            Util.Preset preset = new Util.Preset();
            Console.WriteLine(mn.PresetName + "을 저장합니다");
            preset.savePreset(mn.PresetPath, mn.AppName, mn.PresetName);

            Component.PresetItem presetItem = new Component.PresetItem();
            presetItem.PresetName = this.preset_name.Text;

            mn.PresetName = this.preset_name.Text;

            mn.presetList.list.Controls.Add(presetItem);

            Console.WriteLine(mn.PresetName + "을 생성합니다");
            preset.savePreset(mn.PresetPath, mn.AppName, mn.PresetName);

            //프리셋 생성한뒤 모든 데이터값 초기화;
            for (int i = 0; i < mn.Payloads.Length; i++)
            {
                mn.Payloads[i] = new DeviceData.Payload();
            }
            Util.MainRender render = new Util.MainRender();
            render.initUI();
            render.closeList();
            preset.savePropertyPreset(this.preset_name.Text);
            return(true);
        }
 //이전 프리셋 저장
 private void prevSavePreset()
 {
     mn = MainForm.getInstance;
     Util.Preset preset = new Util.Preset();
     preset.savePreset(mn.PresetPath, mn.AppName, mn.PresetName);
 }
Exemple #7
0
 private void savePrevPreset()
 {
     Util.Preset preset = new Util.Preset();
     preset.savePreset(mn.PresetPath, mn.AppName, mn.PresetName);
 }
Exemple #8
0
 private void getPresets()
 {
     mn = MainForm.getInstance;
     Util.Preset preset = new Util.Preset();
     preset.getPresetFiles();
 }