Beispiel #1
0
        public void MoveNext()
        {
            Setup.TimerStart($"==>{Setup.CallerName()} Started");

            int      i = 0;
            BaseType n = Setup.FD;
            string   content;

            while (n != null)
            {
                if (n is DisplayedType)
                {
                    content = ": title: " + (n as DisplayedType).title;
                }
                else if (n is PropertyType)
                {
                    content = ": " + (n as PropertyType).propName + ": " + (n as PropertyType).val;
                }
                else
                {
                    content = "";
                }

                Debug.Print(n.ObjectID.ToString().PadLeft(4) + ": " + i.ToString().PadLeft(4) + ": " + (n.name ?? "").PadRight(20) + ": " + (n.ElementName ?? "").PadRight(25) + content);
                n = SdcUtil.ReflectNextElement(n);
                i++;
            }
            Setup.TimerPrintSeconds("  seconds: ", $"\r\n<=={Setup.CallerName()} Complete");
        }
Beispiel #2
0
        public void MovePrevFast()
        {
            Setup.TimerStart($"==>{Setup.CallerName()} Started");

            Stopwatch.StartNew();

            var a = (float)Stopwatch.GetTimestamp();


            var total = a;

            BaseType[] sortedNodes = new BaseType[Setup.FD.Nodes.Count()];
            int        i           = 0;
            BaseType   n           = Setup.FD;
            string     content;

            n = Setup.FD;
            while (n != null)
            {
                sortedNodes[i] = n;
                n = SdcUtil.ReflectNextElement(n);
                //if (n is null) Debugger.Break();
                i++;
            }

            Debug.Print("Seconds to Create Node Array: " + ((Stopwatch.GetTimestamp() - a) / Stopwatch.Frequency).ToString());
            Debug.Print("Seconds per Node: " + (((Stopwatch.GetTimestamp() - a) / Stopwatch.Frequency) / Setup.FD.Nodes.Count()).ToString());
            a = (float)Stopwatch.GetTimestamp();

            for (i = Setup.FD.Nodes.Count() - 1; i >= 0; i--)
            {
                n = sortedNodes[i];
                if (n is DisplayedType)
                {
                    content = ": title: " + (n as DisplayedType).title;
                }
                else if (n is PropertyType)
                {
                    content = ": " + (n as PropertyType).propName + ": " + (n as PropertyType).val;
                }
                else
                {
                    content = "";
                }

                Debug.Print(n.ObjectID.ToString().PadLeft(4) + ": " + i.ToString().PadLeft(4) + ": " + (n.name ?? "").PadRight(20) + ": " + (n.ElementName ?? "").PadRight(25) + content);
            }

            Debug.Print("Output Time" + ((Stopwatch.GetTimestamp() - a) / Stopwatch.Frequency).ToString());
            Debug.Print("Seconds per Node" + (((Stopwatch.GetTimestamp() - a) / Stopwatch.Frequency) / Setup.FD.Nodes.Count()).ToString());
            Debug.Print("Total Time: " + ((Stopwatch.GetTimestamp() - total) / Stopwatch.Frequency).ToString());


            Setup.TimerPrintSeconds("  seconds: ", $"\r\n<=={Setup.CallerName()} Complete");
        }