private void applyButton_Click(object sender, EventArgs e)
        {
            bool check = true;

            DialogResult = DialogResult.None;

            check &= VerifyUtils.verifyTextBoxes("You need to fill necessary fields.",
                                                 firstTimeTextBox, lastTimeTextBox);

            if (!check)
            {
                return;
            }

            check &= VerifyUtils.verifyOffsetFormat("Offset format is wrong on first offset field.",
                                                    firstTimeTextBox.Text, out firstOffset);

            if (!check)
            {
                return;
            }

            check &= VerifyUtils.verifyOffsetFormat("Offset format is wrong on second offset field.",
                                                    lastTimeTextBox.Text, out lastOffset);

            if (!check)
            {
                return;
            }

            FirstOffset = firstOffset;
            LastOffset  = lastOffset;
            VerifyUtils.performDefaultFormQuestion(this);
        }
예제 #2
0
        public SubList(List <T> originalList, int startIndex, int endIndex)
        {
            this.originalList = originalList;
            this.startIndex   = startIndex;
            this.endIndex     = endIndex;

            VerifyUtils.verifyListRangeOrThrow(originalList, startIndex, endIndex);
        }
        public static bool verifyInput(this ValueChanger changer, string text, out double value)
        {
            switch (changer)
            {
            case ValueChanger.BPM:
                return(VerifyUtils.verifyDouble("Please enter a valid BPM.", text, out value));

            default:
                throw new ArgumentException("Wrong passed argument: " + changer);
            }
        }
예제 #4
0
파일: IpAttribute.cs 프로젝트: yyalon/Sdf
 public override bool IsValid(object value)
 {
     if (value == null)
     {
         return(true);
     }
     if (value is string)
     {
         return(VerifyUtils.VerifyIP(value.ToString()));
     }
     return(false);
 }
예제 #5
0
 public override bool IsValid(object value)
 {
     if (value == null || String.IsNullOrEmpty(value.ToString()))
     {
         return(true);
     }
     if (value is string)
     {
         return(VerifyUtils.VerifyEmail(value.ToString()));
     }
     return(false);
 }
        public static bool verifyInput(this ValueChanger changer, string text, out int value)
        {
            switch (changer)
            {
            case ValueChanger.VOLUME_DIFF:
            case ValueChanger.VOLUME:
                return(VerifyUtils.verifyRangeFromString("Please enter a volume between 5 to 100.", text, 5, 100, out value));

            default:
                throw new ArgumentException("Wrong passed argument: " + changer);
            }
        }
 private void applyButton_Click(object sender, EventArgs e)
 {
     if (checkValues())
     {
         VerifyUtils.performDefaultFormQuestion(this);
         if (rememberCheckBox.Checked)
         {
             new EqualizeSvData(startTimeTextBox.Text, endTimeTextBox.Text, targetBpmTextBox.Text, svMultiplierTextBox.Text,
                                equalizeAllCheckBox.Checked, useRelativeSvCheckBox.Checked, rememberCheckBox.Checked).saveToPreferences();
         }
     }
 }
예제 #8
0
 public override bool IsValid(object value)
 {
     if (value == null || String.IsNullOrEmpty(value.ToString()))
     {
         return(true);
     }
     if (value is string)
     {
         return(!VerifyUtils.HasSpecialChart(value.ToString()));
     }
     return(false);
 }
        private bool verifyNoteCoordinates(string message, params TextBox[] textBoxes)
        {
            int index = 0;

            foreach (TextBox textBox in textBoxes)
            {
                string[] texts = textBox.Text.Split(',');
                if (texts.Length != 2)
                {
                    MessageBoxUtils.showError(message);
                    return(false);
                }
                texts[0] = texts[0].Trim();
                texts[1] = texts[1].Trim();

                int xCoordinate = Convert.ToInt32(texts[0]);
                int yCoordinate = Convert.ToInt32(texts[1]);

                if (!VerifyUtils.verifyRange(32, 512, xCoordinate) || !VerifyUtils.verifyRange(32, 384, yCoordinate))
                {
                    MessageBoxUtils.showError(message + " Detected coordinates: \"" + xCoordinate + ", " + yCoordinate + "\"");
                    return(false);
                }

                switch (index)
                {
                case 0:
                    fillArray(donPosition, xCoordinate, yCoordinate);
                    break;

                case 1:
                    fillArray(katPosition, xCoordinate, yCoordinate);
                    break;

                case 2:
                    fillArray(donFinisherPosition, xCoordinate, yCoordinate);
                    break;

                case 3:
                    fillArray(katFinisherPosition, xCoordinate, yCoordinate);
                    break;
                }
                index++;
            }
            return(true);
        }
 private void applyButton_Click(object sender, EventArgs e)
 {
     if (checkValues())
     {
         // Ask for user's confirmation about the change and close the dialog
         // if "Yes" or "No" is pressed. Cancel will return to this form instead.
         VerifyUtils.performDefaultFormQuestion(this);
         if (rememberCheckBox.Checked)
         {
             new SvChangerModel(firstTimeTextBox.Text, lastTimeTextBox.Text,
                                firstSvTextBox.Text, lastSvTextBox.Text, targetBpmTextBox.Text, gridSnapTextBox.Text,
                                svOffsetTextBox.Text, increaseModeComboBox.SelectedIndex, lastTimeTextBox.Text,
                                increaseMultiplierTextBox.Text, putPointsByNotesCheckBox.Checked,
                                activateTimeModeCheckBox.Checked).saveToPreferences();
         }
     }
 }
        private bool checkValues()
        {
            if (!equalizeAllCheckBox.Checked)
            {
                if (!VerifyUtils.verifyOffsetFormat("You need to enter a valid start time.", startTimeTextBox.Text, out int startOffset))
                {
                    return(false);
                }

                if (!VerifyUtils.verifyOffsetFormat("You need to enter a valid end time.", endTimeTextBox.Text, out int endOffset))
                {
                    return(false);
                }

                StartOffset = startOffset;
                EndOffset   = endOffset;
            }

            double value = 0;

            if (!string.IsNullOrEmpty(targetBpmTextBox.Text) && !VerifyUtils.verifyDouble("Target BPM format is wrong.", targetBpmTextBox.Text, out value))
            {
                return(false);
            }
            else
            {
                TargetBpm = value;
            }

            value = 0;
            if (!string.IsNullOrEmpty(svMultiplierTextBox.Text) && !VerifyUtils.verifyDouble("SV Multiplier format is wrong.", svMultiplierTextBox.Text, out value))
            {
                return(false);
            }
            else
            {
                SvMultiplier = value;
            }

            EqualizeAll   = equalizeAllCheckBox.Checked;
            UseRelativeSv = useRelativeSvCheckBox.Checked;
            return(true);
        }
예제 #12
0
        private void applyButton_Click(object sender, EventArgs e)
        {
            valueExtraOption   = extraOptionCheckBox.Checked;
            valueAllTaikoDiffs = allTaikoDiffsCheckBox.Checked;
            switch (changer)
            {
            case ValueChanger.BPM:
                if (changer.verifyInput(valueTextBox.Text, out valueDouble))
                {
                    VerifyUtils.performDefaultFormQuestion(this);
                }
                break;

            default:
                if (changer.verifyInput(valueTextBox.Text, out valueInt))
                {
                    VerifyUtils.performDefaultFormQuestion(this);
                }
                break;
            }
        }
 private void arrangeNotesButton_Click(object sender, EventArgs e)
 {
     // Check the textboxes first to see if their
     // texts are in appropriate format and they are filled. "True" means they are verified.
     if (VerifyUtils.verifyTextBoxes("Please fill all textboxes with correct formatting, e.g. \"192, 192\".",
                                     donPositionTextBox,
                                     katPositionTextBox,
                                     donFinisherPositionTextBox,
                                     katFinisherPositionTextBox))
     {
         // Check if the entered values are in between min-max values and formatting is okay.
         // "True" means they are verified.
         if (verifyNoteCoordinates("The correct formatting type should look like \"192, 192\" where x, y coordinates are separated by a comma. The maximum allowed range is from 32, 32 to 512, 384.",
                                   donPositionTextBox,
                                   katPositionTextBox,
                                   donFinisherPositionTextBox,
                                   katFinisherPositionTextBox))
         {
             // Ask for user's confirmation about the change and close the dialog
             // if "Yes" or "No" is pressed. Cancel will return to this form instead.
             VerifyUtils.performDefaultFormQuestion(this);
         }
     }
 }
예제 #14
0
 protected override void Awake()
 {
     base.Awake();
     input = transform.parent.Find("InputField").GetComponent <InputField>();
     actionDir.Add("按编号查询", () =>
     {
         SempleQueryWhere("ID",
                          () => VerifyUtils.IsNumber(input.text),
                          () => Kernel.Current.Desktop.OpenNew <DialogForm>().SetDialog(null, "不是数字!", "编号必须为数字."));
     });
     actionDir.Add("按民族查询", () =>
     {
         SempleQueryWhere("Nation", null, () => NullWarmDialog());
     });
     actionDir.Add("按身份证查询", () =>
     {
         SempleQueryWhere("IDCard", () => VerifyUtils.IsIDCard(input.text), () => MessageDialog("身份证无效"));
     });
     actionDir.Add("按地址查询", () =>
     {
         SempleQueryWhere("Address", null, () => NullWarmDialog());
     });
     actionDir.Add("按政治面貌查询", () =>
     {
         SempleQueryWhere("PoliticalOutlook", null, () => NullWarmDialog());
     });
     actionDir.Add("按学历查询", () =>
     {
         SempleQueryWhere("Education", null, () => NullWarmDialog());
     });
     actionDir.Add("按部门查询", () =>
     {
         if (input.text != string.Empty && input.text != null)
         {
             var departments = Kernel.Current.Sql.LoadEntitys <Department>();
             var id          = global::System.Array.Find(departments, x => x.Name == input.text);
             if (id != null)
             {
                 Kernel.Current.Desktop.OpenNew <SearchResultForm>().AddItems(new List <Personnel>(Kernel.Current.Sql.QueryWhere <Personnel>("DepartmentID=" + id.ID)));
             }
             else
             {
                 Kernel.Current.Desktop.OpenNew <SearchResultForm>();
             }
             input.text = string.Empty;
             return;
         }
         input.text = string.Empty;
         NullWarmDialog();
     });
     actionDir.Add("按姓名查询", () =>
     {
         SempleQueryWhere("Name", null, () => NullWarmDialog());
     });
     actionDir.Add("按手机号码查询", () =>
     {
         SempleQueryWhere("Phone", () => input.text.Length == 11, () => MessageDialog("电话号码必须为11位!"));
     });
     actionDir.Add("按职位查询", () =>
     {
         if (input.text != string.Empty && input.text != null)
         {
             var departments = Kernel.Current.Sql.LoadEntitys <Position>();
             var id          = global::System.Array.Find(departments, x => x.Name == input.text);
             if (id != null)
             {
                 Kernel.Current.Desktop.OpenNew <SearchResultForm>().AddItems(new List <Personnel>(Kernel.Current.Sql.QueryWhere <Personnel>("PositionID=" + id.ID)));
             }
             else
             {
                 Kernel.Current.Desktop.OpenNew <SearchResultForm>();
             }
             input.text = string.Empty;
             return;
         }
         input.text = string.Empty;
         NullWarmDialog();
     });
 }
예제 #15
0
        public override void Awake()
        {
            base.Awake();
            if (nomalSprite == null)
            {
                nomalSprite = facialPhoto.sprite;
            }
            IdText.input.onValueChanged.AddListener((s) =>
            {
                if (VerifyUtils.IsNumber(s))
                {
                    personnel.ID  = int.Parse(s);
                    IdText.Verify = true;
                    return;
                }
                IdText.Verify = false;
            });
            IdCardText.input.onValueChanged.AddListener((s) =>
            {
                if (VerifyUtils.IsIDCard(s))
                {
                    personnel.IDCard  = s;
                    IdCardText.Verify = true;
                    return;
                }
                IdCardText.Verify = false;
            });
            archivalPhotoUpdateButton.onClick.AddListener(() =>
            {
                if (personnel != null)
                {
                    string file = Win32API.GetOpenFileName();
                    if (file != null)
                    {
                        archivalPhotoUpdateFileName = file;
                    }
                }
            });
            archivalPhotoButton.onClick.AddListener(() =>
            {
                if (personnel != null)
                {
                    if (!Kernel.Current.Image.View(archivalPhotoUpdateFileName))
                    {
                        Kernel.Current.Desktop.OpenNew <DialogForm>().SetDialog(null, "打开失败!", "图片不存在或被其他程序占用无法打开.");
                    }
                }
            });
            FacialPhotoButtion.onClick.AddListener(() =>
            {
                Sprite s = Kernel.Current.Image.Load(nomalSprite.texture.width, nomalSprite.texture.height);
                if (s != null)
                {
                    facialPhoto.sprite = s;
                }
            });
            PhoneText.input.onValueChanged.AddListener((s) =>
            {
                if (s?.Length <= 20)
                {
                    PhoneText.Verify = true;
                    personnel.Phone  = s;
                    return;
                }
                PhoneText.Verify = false;
            });
            UpdateToSql.onClick.AddListener(() =>
            {
                switch (state)
                {
                case InfoFormWorkMode.ViewAndModifiy:
                    {
                        UpdateImage();
                        Debug.Log(personnel.ArchivalPhoto);
                        Debug.Log(personnel.FacialPhoto);
                        Kernel.Current.Sql.UpdateEntity(personnel);
                        Kernel.Current.Desktop.OpenNew <DialogForm>().SetDialog(null, "修改完成", "修改成功");
                    }
                    break;

                case InfoFormWorkMode.CreateNew:
                    {
                        if (Kernel.Current.Sql.LoadEntity <Personnel>(personnel.ID) == null)
                        {
                            Kernel.Current.Desktop.OpenNew <TextBoxForm>().SetCallback("请输入人员入职信息", (x) =>
                            {
                                EntryRecord entryRecord = new EntryRecord();
                                entryRecord.Info        = x;
                                entryRecord.Time        = DateTime.Now;
                                entryRecord.PersonnelID = personnel.ID;
                                Kernel.Current.Sql.Insert(entryRecord);
                                UpdateImage();
                                Kernel.Current.Sql.InsertEntity(personnel);
                                Kernel.Current.Desktop.OpenNew <DialogForm>().SetDialog(null, "修改完成", "修改成功");
                            }, null);
                        }
                        else
                        {
                            Kernel.Current.Desktop.OpenNew <DialogForm>().SetDialog(null, "此编号已存在", "请尝试其他编号");
                        }
                    }
                    break;

                default:
                    break;
                }
            });
            delete.onClick.AddListener(() =>
            {
                Kernel.Current.Desktop.OpenNew <TextBoxForm>().SetCallback("添加此人员离职信息.", x =>
                {
                    Kernel.Current.Desktop.OpenNew <YesOrNoForm>().SetDialog(() =>
                    {
                        TurnoverRecord turnoverRecord = new TurnoverRecord();
                        turnoverRecord.Info           = x;
                        turnoverRecord.PersonnelID    = personnel.ID;
                        turnoverRecord.Time           = DateTime.Now;
                        Kernel.Current.Sql.Insert(turnoverRecord);
                        Kernel.Current.Sql.DeleteEntity(personnel);
                    }, null, "确认操作", "确认执行吗?");
                }, null);
            });
            SetWorkMode(InfoFormWorkMode.ViewAndModifiy);
        }
예제 #16
0
        /// <summary>
        /// Tries to create a pack.
        /// </summary>
        /// <param name="project">The project.</param>
        /// <param name="pack">The pack.</param>
        /// <returns></returns>
        public static bool TryCreatePack(TBLogFile project, out Pack pack)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            TBLogFile log = project;

            string projectDir = project.Project.Path;

            Pack p = new Pack();

            p.BaseDir = projectDir;

            PackContainer projectOutput = p.Containers.AddItem("#ProjectOutput");

            TBLogConfiguration config = log.Configurations[0];


            if (!string.IsNullOrEmpty(config.OutputPath))
            {
                projectOutput.ContainerDir = config.OutputPath;
                projectOutput.BaseDir      = config.OutputPath;
            }

            foreach (TBLogItem item in config.ProjectOutput.Items)
            {
                if (item.IsShared)
                {
                    continue;
                }

                PackFile pf = projectOutput.Files.AddItem(QQnPath.MakeRelativePath(projectOutput.BaseDir, QQnPath.Combine(projectDir, item.Src)));

                pf.StreamName = item.Src;
            }

            PackContainer projectContent = p.Containers.AddItem("#ProjectContent");

            if (!string.IsNullOrEmpty(config.OutputPath))
            {
                projectContent.ContainerDir = "content/" + log.Project.Name;
                projectContent.BaseDir      = log.ProjectPath;
            }

            foreach (TBLogItem item in config.Content.Items)
            {
                PackFile pf = projectContent.Files.AddItem(QQnPath.MakeRelativePath(projectContent.BaseDir, QQnPath.Combine(projectDir, item.Src)));

                pf.StreamName = item.Src;
            }

            PackContainer projectScripts = p.Containers.AddItem("#ProjectScripts");

            if (!string.IsNullOrEmpty(config.OutputPath))
            {
                projectScripts.ContainerDir = "scripts/" + log.Project.Name;
                projectScripts.BaseDir      = log.Project.Path;
            }

            foreach (TBLogItem item in config.Content.Items)
            {
                PackFile pf = projectContent.Files.AddItem(QQnPath.MakeRelativePath(projectContent.BaseDir, QQnPath.Combine(projectDir, item.Src)));

                pf.StreamName = item.Src;
            }

            if (config.Target.KeySrc != null)
            {
                p.StrongNameKey = StrongNameKey.LoadFrom(QQnPath.Combine(log.Project.Path, config.Target.KeySrc));
            }
            else if (config.Target.KeyContainer != null)
            {
                p.StrongNameKey = StrongNameKey.LoadFromContainer(config.Target.KeyContainer, false);
            }


            foreach (PackContainer pc in p.Containers)
            {
                foreach (PackFile pf in pc.Files)
                {
                    VerifyUtils.UpdateFile(pf.BaseDir, pf);
                }
            }

            pack = p;

            return(true);
        }
예제 #17
0
        public void TestFileWrite()
        {
            ClearMap();
            using (DirectoryMap dm = DirectoryMap.Get(DirMapPath))
            {
                using (Stream fs = dm.CreateFile("test.txt"))
                {
                    using (StreamWriter sw = new StreamWriter(fs))
                    {
                        sw.WriteLine("46357865-EFF5-454B-9B8F-845C6C17F9D5");
                    }
                }

                using (Stream fs = dm.CreateFile("sd/test.txt"))
                {
                    using (StreamWriter sw = new StreamWriter(fs))
                    {
                        sw.WriteLine("46357865-EFF5-454B-9B8F-845C6C17F9D5");
                    }
                }

                using (Stream fs = dm.CreateFile("q/r/s/test.txt"))
                {
                    using (StreamWriter sw = new StreamWriter(fs))
                    {
                        sw.WriteLine("46357865-EFF5-454B-9B8F-845C6C17F9D5");
                    }
                }

                DirectoryMapFile mf = dm.GetFile("test.txt");

                Assert.That(mf, Is.Not.Null);
            }

            using (DirectoryMap dm = DirectoryMap.Get(DirMapPath))
            {
                Assert.That(dm.GetFile("test.txt"), Is.Not.Null);
                Assert.That(dm.GetFile("-not-existing"), Is.Null);

                Assert.That(dm.GetFile("sD/TeSt.TXT"), Is.Not.Null);

                Assert.That(dm.GetFile("q/r/s/TEST.txt"), Is.Not.Null);
                Assert.That(dm.GetFile("q\\r/s/./test.txt"), Is.Not.Null, "non-normalized file exists");

                Assert.That(dm.GetFile("test.txT").FileSize, Is.EqualTo(38L));
                Assert.That(dm.GetFile("test.txT").FileHash, Is.EqualTo("b2cf3a852a1793273d1029ea777099523da1f734,type=SHA1"));

                DirectoryMapFile dmf = dm.GetFile("test.txt");

                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.Full), "File is the same in full");

                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.Time), Is.True, "File is the same in time");
                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.TimeSize), Is.True, "File is the same in size");
                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.FileHash), Is.True, "File is the same in filehash");

                File.SetLastWriteTime(dm.GetFile("test.txt").FullName, DateTime.Now);
                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.Time), Is.False, "File time changed");
                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.TimeSize), Is.False, "FileTime+Size changed");
                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.FileHash), Is.True, "File is the same in filehash");
                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.Full), Is.True, "File has not changed");

                dmf.Update();

                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.TimeSize), "File is the same in timesize after update");
                Assert.That(VerifyUtils.VerifyFile(DirMapPath, dmf, VerifyMode.Full), "File is the same in full");
            }
        }
        // Checks the values and sets them on the fly.
        //
        private bool checkValues()
        {
            bool check = true;

            // Check the SV increase mode first.
            check = VerifyUtils.verifyRange("You need to select a SV increase mode.",
                                            0, increaseModeComboBox.Items.Count, increaseModeComboBox.SelectedIndex) &&

                    // Check the necessary textboxes afterwards.
                    VerifyUtils.verifyTextBoxes("You need to fill necessary fields.",
                                                increaseModeComboBox.SelectedIndex != 0 ? increaseMultiplierTextBox : null,
                                                firstTimeTextBox,
                                                lastTimeTextBox,
                                                firstSvTextBox,
                                                lastSvTextBox) &&

                    // Check if grid snap is entered if "Put points by note snaps"
                    // is not enabled.
                    (putPointsByNotesCheckBox.Checked || VerifyUtils.verifyTextBoxes(
                         "You need to fill the \"Grid Snap\" value if you don\'t check\n" +
                         "\"Put points by note snaps\" checkbox."));

            // If anything was wrong here, don't check the rest.
            if (!check)
            {
                return(false);
            }

            // Set the sv increase mode.
            SvIncreaseMode = increaseModeComboBox.SelectedIndex;

            // Starting from here, check the values themselves.
            // Start with the extracted times.
            check = VerifyUtils.verifyOffsetFormat("First entered time format is wrong.",
                                                   firstTimeTextBox.Text, out FirstOffset);

            if (!check)
            {
                return(false);
            }

            // Check the last time text box if time mode checkbox is checked.
            // Otherwise, try to parse the integer as count.
            if (activateTimeModeCheckBox.Checked)
            {
                check = VerifyUtils.verifyOffsetFormat("Last entered time format is wrong.",
                                                       lastTimeTextBox.Text, out LastOffset);

                if (!check)
                {
                    return(false);
                }
                else if (LastOffset <= FirstOffset)
                {
                    MessageBoxUtils.showError("You cannot use the last time point before the first time point.");
                    return(false);
                }
            }
            else
            {
                check = VerifyUtils.verifyRangeFromString("Count text is wrong, value must be higher than 0.", lastTimeTextBox.Text,
                                                          0, int.MaxValue, out Count);

                if (!check)
                {
                    return(false);
                }
            }

            check = ParseUtils.GetDouble(firstSvTextBox.Text, out FirstSv);
            if (!check)
            {
                MessageBoxUtils.showError("Entered first SV value is wrong.");
                return(false);
            }

            check = ParseUtils.GetDouble(lastSvTextBox.Text, out LastSv);
            if (!check)
            {
                MessageBoxUtils.showError("Entered last SV value is wrong.");
                return(false);
            }

            if (SvIncreaseMode != 0)
            {
                check = VerifyUtils.verifyRangeFromString("Sv increase multiplier text is wrong, value must be higher than 0.", increaseMultiplierTextBox.Text,
                                                          0, int.MaxValue, out SvIncreaseMultiplier);

                if (!check)
                {
                    return(false);
                }
            }

            // If "Put points by notes" is not checked,
            // the grid snap value has to be defined.
            // Check that there.
            if (putPointsByNotesCheckBox.Checked)
            {
                GridSnap         = 0;
                PutPointsByNotes = true;
                check            = true;
            }
            else
            {
                check = VerifyUtils.verifyGridSnap("Grid snap value is wrong. Example: 1/4",
                                                   gridSnapTextBox.Text, out GridSnap);

                if (!check)
                {
                    return(false);
                }
            }

            // Check the target BPM and SV offset here. These fields are optional,
            // so accept blank text, but if it cannot parse, warn the user.
            check = VerifyUtils.verifyRangeFromString("Target BPM is wrong, example: 200.\nThis field is optional, so you can keep it blank.",
                                                      targetBpmTextBox.Text, 0, double.MaxValue, out TargetBpm, true);

            if (!check)
            {
                return(false);
            }

            check = VerifyUtils.verifyRangeFromString("SV offset is wrong, it should be between -10 and 0.\nThis field is optional, so you can keep it blank.",
                                                      svOffsetTextBox.Text, -10, 0, out SvOffset, true);

            // Finally, return true or false if checks are done.
            return(check);
        }