예제 #1
0
        public static void Test_TraceCompanies(string file, TypeValues <Test_Company> typeValues, bool onlyNextValue)
        {
            string[] values = typeValues.TypeValueNodes.Values.Where(memberValue => memberValue.TypeValueAccess.IsValueType).Select(memberValue => memberValue.TypeValueAccess.TreeName).ToArray();
            int      index  = 1;

            foreach (Test_Company company in Test_Data.GetCompanies(file))
            {
                typeValues.SetData(company);
                Trace.WriteLine("row {0}", index++);

                foreach (string value in values)
                {
                    Trace.Write("  {0,-20}", value);
                }
                Trace.WriteLine();

                foreach (string value in values)
                {
                    Trace.Write("  {0,-20}", typeValues.GetValue(value));
                }
                Trace.WriteLine();

                while (typeValues.NextValues())
                {
                    foreach (string value in values)
                    {
                        Trace.Write("  {0,-20}", typeValues.GetValue(value, onlyNextValue: onlyNextValue));
                    }
                    Trace.WriteLine();
                }

                Trace.WriteLine();
            }
        }
예제 #2
0
        public static void Test_TypeValues_02(string file, params string[] values)
        {
            bool onlyNextValue = true;
            //bool onlyNextValue = false;

            TypeValues <Test_Company> typeValues = new TypeValues <Test_Company>();

            foreach (string value in values)
            {
                typeValues.AddValue(value);
            }

            int index = 1;

            foreach (Test_Company company in Test_Data.GetCompanies(file))
            {
                typeValues.SetData(company);
                Trace.WriteLine("row {0}", index++);

                foreach (string value in values)
                {
                    Trace.Write("  {0,-20}", value);
                }
                Trace.WriteLine();

                foreach (string value in values)
                {
                    Trace.Write("  {0,-20}", typeValues.GetValue(value));
                }
                Trace.WriteLine();

                while (typeValues.NextValues())
                {
                    foreach (string value in values)
                    {
                        Trace.Write("  {0,-20}", typeValues.GetValue(value, onlyNextValue: onlyNextValue));
                    }
                    Trace.WriteLine();
                }

                Trace.WriteLine();
            }
        }