private bool fnc_SetFormSize()
        {
            bool blRes;
            int  intTop;
            int  intLeft;
            int  intWidth;
            int  intHight;

            try
            {
                intTop   = this.Top;
                intLeft  = this.Left;
                intWidth = this.Width;
                intHight = this.Height;

                if (intTop < 0)
                {
                    intTop = 0;
                }
                if (intLeft < 0)
                {
                    intLeft = 0;
                }
                if (intWidth < 0)
                {
                    intWidth = 0;
                }
                if (intHight < 0)
                {
                    intHight = 0;
                }

                SaveImageCommon.SetIniValue("FormSize", "Top", intTop.ToString(), SaveImageCommon.CON_SAVEIMAGE_INI);
                SaveImageCommon.SetIniValue("FormSize", "Left", intLeft.ToString(), SaveImageCommon.CON_SAVEIMAGE_INI);
                SaveImageCommon.SetIniValue("FormSize", "Width", intWidth.ToString(), SaveImageCommon.CON_SAVEIMAGE_INI);
                SaveImageCommon.SetIniValue("FormSize", "Hight", intHight.ToString(), SaveImageCommon.CON_SAVEIMAGE_INI);

                blRes = true;
            }
            catch (Exception ex)
            {
                intTop   = 0;
                intLeft  = 0;
                intWidth = 0;
                intHight = 0;
                blRes    = false;
                CommonLogger.WriteLine(ex.Message);
            }
            return(blRes);
        }
 private void tsb_ImageFile_ExtList_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         // 画像拡張子INIファイルに設定
         this.pImageType = tsb_ImageFile_ExtList.Text;
         SaveImageCommon.SetIniValue("Option", "FileExtense", this.pImageType, SaveImageCommon.CON_SAVEIMAGE_INI);
     }
     catch (Exception ex)
     {
         // SaveImageCommon.SetIniValue("Option", "FileExtense", CON_EXTENSE_PNG, SaveImageCommon.CON_SAVEIMAGE_INI);
         SaveImageCommon.SetIniValue("Option", "FileExtense", SaveImageCommon.CON_EXTENSE_JPG, SaveImageCommon.CON_SAVEIMAGE_INI);
         CommonLogger.WriteLine(ex.Message);
     }
 }
        private bool fnc_SetImageExtense()
        {
            bool blRes;

            try
            {
                SaveImageCommon.SetIniValue("Option", "FileExtense", this.pImageType, SaveImageCommon.CON_SAVEIMAGE_INI);
                blRes = true;
            }
            catch (Exception ex)
            {
                blRes = false;
                CommonLogger.WriteLine(ex.Message);
            }
            return(blRes);
        }
        private bool fnc_SetImageVerticalScorllSize()
        {
            bool blRes;

            try
            {
                SaveImageCommon.SetIniValue("Option", "VerticalScorllSize", this.pImageVerticalScorllSize.ToString(), SaveImageCommon.CON_SAVEIMAGE_INI);
                blRes = true;
            }
            catch (Exception ex)
            {
                blRes = false;
                CommonLogger.WriteLine(ex.Message);
            }
            return(blRes);
        }
Exemple #5
0
        private bool fnc_SetUrlExclusionList()
        {
            bool   blRes;
            int    intCnt, intList;
            string strExcUrl;

            try
            {
                // INIファイル定義をいったん削除
                SaveImageCommon.SetIniValue("UrlExclusion", null, null, SaveImageCommon.CON_SAVEIMAGE_INI);

                if (lst_url_exclustion.Items.Count <= 0)
                {
                    SaveImageCommon.SetIniValue("UrlExclusion", "Key01", SaveImageCommon.CON_DEF_EXC_KEY, SaveImageCommon.CON_SAVEIMAGE_INI);
                }
                else
                {
                    // 保存対象をINIファイルに出力
                    intCnt = 0;
                    for (intList = 0; intList < lst_url_exclustion.Items.Count; intList++)
                    {
                        strExcUrl = lst_url_exclustion.Items[intList].ToString().Trim();
                        if (lst_url_exclustion.Items[intList].ToString().Trim() != "")
                        {
                            intCnt = intCnt + 1;
                            SaveImageCommon.SetIniValue("UrlExclusion", "Key" + (intCnt).ToString("00"), strExcUrl, SaveImageCommon.CON_SAVEIMAGE_INI);
                        }
                    }
                }

                blRes = true;
            }
            catch (Exception ex)
            {
                CommonLogger.WriteLine(ex.Message);
                blRes = false;
            }
            return(blRes);
        }
        private bool fnc_SetUrlList()
        {
            bool blRes;
            int  intCnt;
            int  intList, intExcList;

            string[] strTempUrl, strUrl;
            string   strExc;

            try
            {
                // 保存除外キーを含む対象を取得
                fnc_GetUrlExclusionList();

                strTempUrl = new string[cob_url.Items.Count];
                intList    = 0;
                // コンボボックスからアイテムを取得
                for (intList = 0; intList < cob_url.Items.Count; intList++)
                {
                    if (intList < CON_COB_URL_CNT)
                    {
                        strTempUrl[intList] = cob_url.Items[intList].ToString().Trim();
                    }
                }

                // 保存除外キーを含む対象を除外
                intCnt = 0;
                strUrl = new string[cob_url.Items.Count];
                for (intList = 0; intList < strTempUrl.Length; intList++)
                {
                    strExc = "";
                    for (intExcList = 0; intExcList < this.pUrlExclusionList.Length; intExcList++)
                    {
                        strExc = this.pUrlExclusionList[intExcList].Trim();
                        if (strExc == "")
                        {
                            break;
                        }

                        // 両端は「*」の場合
                        if (strExc[0] == char.Parse("*") && strExc[strExc.Length - 1] == char.Parse("*"))
                        {
                            strExc = strExc.Substring(1, strExc.Length - 2);
                            if (strExc != "")
                            {
                                if (strTempUrl[intList].Contains(strExc) == false)
                                {
                                    strUrl[intCnt] = strTempUrl[intList].Trim(); intCnt = intCnt + 1;
                                }
                            }
                        }
                        else
                        {
                            // 先頭は「*」の場合
                            if (strExc[0] == char.Parse("*"))
                            {
                                strExc = strExc.Substring(1, strExc.Length - 1);
                                if (strExc != "")
                                {
                                    if (strTempUrl[intList].EndsWith(strExc) == false)
                                    {
                                        strUrl[intCnt] = strTempUrl[intList].Trim(); intCnt = intCnt + 1;
                                    }
                                }
                            }
                            // 最後は「*」の場合
                            else if (strExc[strExc.Length - 1] == char.Parse("*"))
                            {
                                strExc = strExc.Substring(0, strExc.Length - 1);
                                if (strExc != "")
                                {
                                    if (strTempUrl[intList].StartsWith(strExc) == false)
                                    {
                                        strUrl[intCnt] = strTempUrl[intList].Trim(); intCnt = intCnt + 1;
                                    }
                                }
                            }
                            else
                            {
                                // 両端は「*」以外の場合
                                if (strTempUrl[intList] != strExc)
                                {
                                    strUrl[intCnt] = strTempUrl[intList].Trim(); intCnt = intCnt + 1;
                                }
                            }
                        }
                    }
                }

                // INIファイル定義をいったん削除
                SaveImageCommon.SetIniValue("UrlList", null, null, SaveImageCommon.CON_SAVEIMAGE_INI);

                // 保存対象をINIファイルに出力
                if (intCnt == 0)
                {
                    // 除外キー情報は存在しない場合
                    intCnt = 0;
                    for (intList = 0; intList < strTempUrl.Length; intList++)
                    {
                        if (strTempUrl[intList] != null && strTempUrl[intList] != "")
                        {
                            intCnt = intCnt + 1;
                            SaveImageCommon.SetIniValue("UrlList", "List" + (intCnt).ToString("00"), strTempUrl[intList], SaveImageCommon.CON_SAVEIMAGE_INI);
                        }
                    }
                }
                else
                {
                    // 除外キー情報は存在し、突合せ実施した場合
                    intCnt = 0;
                    for (intList = 0; intList < strUrl.Length; intList++)
                    {
                        if (strUrl[intList] != null && strUrl[intList] != "")
                        {
                            intCnt = intCnt + 1;
                            SaveImageCommon.SetIniValue("UrlList", "List" + (intCnt).ToString("00"), strUrl[intList], SaveImageCommon.CON_SAVEIMAGE_INI);
                        }
                    }
                }

                blRes = true;
            }
            catch (Exception ex)
            {
                CommonLogger.WriteLine(ex.Message);
                blRes = false;
            }
            return(blRes);
        }