示例#1
0
        // 读取ini中配置, 赋值给全局变量
        private void ReadDefault()
        {
            markNames = new List <string>();
            markNames.AddRange(OperIni.ReadIni("Default", "DWNames", iniFilePath).Split(','));
            string tmp = OperIni.ReadIni("Default", "MarkKind", iniFilePath).ToString();

            switch (tmp)
            {
            case "Solid":
                markKind = MarkKind.Solid;
                break;

            case "Names":
                markKind = MarkKind.Names;
                break;

            case "Numbers":
                markKind = MarkKind.Numbers;
                break;

            default:
                markKind = MarkKind.Solid;
                break;
            }
            markText       = OperIni.ReadIni("Default", "Text", iniFilePath);
            markOrderStart = Convert.ToInt32(OperIni.ReadIni("Default", "OrderStart", iniFilePath));
            markOrderEnd   = Convert.ToInt32(OperIni.ReadIni("Default", "OrderEnd", iniFilePath));
            markFont       = OperIni.ReadIni("Default", "Font", iniFilePath);
            markWidth      = Convert.ToInt32(OperIni.ReadIni("Default", "Width", iniFilePath));
            markHeight     = Convert.ToInt32(OperIni.ReadIni("Default", "Height", iniFilePath));
            markFontColor  = ColorTranslator.FromHtml(OperIni.ReadIni("Default", "FontColor", iniFilePath));
            markRotation   = Convert.ToInt32(OperIni.ReadIni("Default", "Rotation", iniFilePath));
        }
示例#2
0
 private bool CheckAllValues()
 {
     if (rdoNames.Checked)
     {
         if (string.IsNullOrEmpty(OperIni.ReadIni("Default", "DWNames", iniFilePath)))
         {
             MessageBox.Show("配置文件中找不到单位名称名单");
             return(false);
         }
     }
     if (rdoSolid.Checked)
     {
         if (string.IsNullOrEmpty(txtSolidText.Text.Trim()))
         {
             txtSolidText.Focus();
             return(false);
         }
     }
     if (string.IsNullOrEmpty(txtFont.Text.Trim()))
     {
         txtFont.Focus();
         return(false);
     }
     return(true);
 }