Exemplo n.º 1
0
        public void WriteConfigFile()
        {
            string str = @"<?xml version='1.0'?>
<ArrayOfDynamicConfigFileManagerTest_c1>
  <DynamicConfigFileManagerTest_c1>
<StrData>abc123中国</StrData>
    <IntData>123</IntData>
    <DoubleData>123.123</DoubleData>
    <LongData>220000000000</LongData>
    <BoolData>true</BoolData>
  </DynamicConfigFileManagerTest_c1>

  <DynamicConfigFileManagerTest_c1>
<StrData>abc123中国2</StrData>
    <IntData>1232</IntData>
    <DoubleData>123.1232</DoubleData>
    <LongData>120000000000</LongData>
    <BoolData>false</BoolData>
  </DynamicConfigFileManagerTest_c1>

</ArrayOfDynamicConfigFileManagerTest_c1>
";

            Logs.AddAppender(FileAppender.GetAppender("debug.log"));
            Logs.AddAppender(new DebugAppender());
            Logs.AddAppender(new ConsoleAppender());

            Logs.SetMessageLevel <FileAppender>(LogMessageType.MSG_DEBUG);

            File.WriteAllText("d_1.config", str.Replace("'", "\""));
        }
Exemplo n.º 2
0
        public void WriteConfigFile()
        {
            string str = @"<?xml version='1.0'?>
<root>
    <BaseArray>
        <StrData>abc123中国</StrData>
        <StrData>abc123中国2</StrData>
        <IntData>1</IntData>
        <IntData>2</IntData>
        <IntData>3</IntData>
        <LongData>220000000000</LongData>
        <BoolData>true</BoolData>
        <BoolData>false</BoolData>
    </BaseArray>

    <ClassArrayProperty>
        <Pt>
            <StrData>abc123中国</StrData>
            <IntData>123</IntData>
            <DoubleData>123.123</DoubleData>
            <LongData>220000000000</LongData>
            <BoolData>true</BoolData>
        </Pt>
        <Pt>
            <StrData>123中国</StrData>
            <IntData>321</IntData>
            <DoubleData>321.321</DoubleData>
            <LongData>110000000000</LongData>
        </Pt>
    </ClassArrayProperty>


</root>
";

            Logs.AddAppender(FileAppender.GetAppender("debug.log"));
            Logs.SetMessageLevel <FileAppender>(LogMessageType.MSG_DEBUG);

            File.WriteAllText("testArray.config", str.Replace("'", "\""));
        }
Exemplo n.º 3
0
        public void WriteConfigFile()
        {
            string str = @"<?xml version='1.0'?>
<root>
    <TestConfigClass1>
        <StrData>abc123中国</StrData>
        <IntData>123</IntData>
        <DoubleData>123.123</DoubleData>
        <LongData>220000000000</LongData>
        <BoolData>true</BoolData>
    </TestConfigClass1>

    <TestConfigClassByDefaultValue>
        <LongData>220000000000</LongData>
        <BoolData>true</BoolData>
    </TestConfigClassByDefaultValue>

    <OtherNameNode>
        <StrData2>abc中国</StrData2>
        <LongData>220000000000</LongData>
    </OtherNameNode>

    <ClassProperty>
        <Pt>
            <StrData>abc123中国</StrData>
            <IntData>123</IntData>
            <DoubleData>123.123</DoubleData>
            <LongData>220000000000</LongData>
            <BoolData>true</BoolData>
        </Pt>
    </ClassProperty>

</root>
";

            Logs.AddAppender(FileAppender.GetAppender("debug.log"));
            Logs.SetMessageLevel <FileAppender>(LogMessageType.MSG_DEBUG);

            File.WriteAllText("test.config", str.Replace("'", "\""));
        }
Exemplo n.º 4
0
 public void Init()
 {
     Logs.AddAppender(FileAppender.GetAppender("debug.log"));
     Logs.SetMessageLevel <FileAppender>(LogMessageType.MSG_DEBUG);
 }