Exemplo n.º 1
0
        public bool SaveDebugConfig()
        {
            StreamWriter writer = null;

            try
            {
                writer = new StreamWriter(configdebugPath, false, Config.Encode);
                for (int i = 0; i < debugArray.Length; i++)
                {
                    AConfigItem item = debugArray[i];
                    if (item == null)
                    {
                        continue;
                    }
                    writer.WriteLine(item.ToString());
                }
            }
            catch (Exception)
            {
                return(false);
            }
            finally
            {
                if (writer != null)
                {
                    writer.Close();
                }
            }
            return(true);
        }
Exemplo n.º 2
0
        public bool SaveConfig()
        {
            StreamWriter writer = null;

            try
            {
                writer = new StreamWriter(configPath, false, Config.Encode);
                for (int i = 0; i < configArray.Length; i++)
                {
                    AConfigItem item = configArray[i];
                    if (item == null)
                    {
                        continue;
                    }

                    //1806beta001 CompatiDRAWLINEの廃止、CompatiLinefeedAs1739へ移行
                    if (item.Code == ConfigCode.CompatiDRAWLINE)
                    {
                        continue;
                    }
                    if ((item.Code == ConfigCode.ChangeMasterNameIfDebug) && (item.GetValue <bool>()))
                    {
                        continue;
                    }
                    if ((item.Code == ConfigCode.LastKey) && (item.GetValue <long>() == 0))
                    {
                        continue;
                    }
                    //if (item.Code == ConfigCode.IgnoreWarningFiles)
                    //{
                    //    List<string> files = item.GetValue<List<string>>();
                    //    foreach (string filename in files)
                    //        writer.WriteLine(item.Text + ":" + filename.ToString());
                    //    continue;
                    //}
                    writer.WriteLine(item.ToString());
                }
            }
            catch (Exception)
            {
                return(false);
            }
            finally
            {
                if (writer != null)
                {
                    writer.Close();
                }
            }
            return(true);
        }