예제 #1
0
        public void ShowHistory(Model.HistoryData data)
        {
            var list = new List <String>();

            uint p = 0;

            foreach (var d in data.list)
            {
                String s = p.ToString() + ":" + d.Length.ToString() + " => [";

                ++p;

                for (uint i = 0; i < d.Length; ++i)
                {
                    if (s.Length + d[i].ToString().Length > 130)
                    {
                        s += "...";
                        break;
                    }

                    s += d[i].ToString();

                    if (i + 1 < d.Length)
                    {
                        s += ", ";
                    }
                }

                s += "]";

                list.Add(s);
            }

            view.ShowHistory(list, data.pointer);
        }
예제 #2
0
        public void showHistory(Model.HistoryData data)
        {
            var  list         = new List <String>();
            var  modelHistory = new Model.Model(kernel);
            uint p            = 0;

            foreach (var d in data.list)
            {
                String s = p.ToString() + ":" + d.Length.ToString() + " => [";
                if (!modelHistory.operations.ContainsKey("assign") || !modelHistory.operations.ContainsKey("reseat") ||
                    !modelHistory.operations.ContainsKey("undo") || !modelHistory.operations.ContainsKey("repeat"))
                {
                    ++p;

                    for (uint i = 0; i < d.Length; ++i)
                    {
                        if (s.Length + d[i].ToString().Length > 130)
                        {
                            s += "...";
                            break;
                        }

                        s += d[i].ToString();

                        if (i + 1 < d.Length)
                        {
                            s += ", ";
                        }
                    }
                }
                s += "]";

                list.Add(s);
            }

            view.showHistory(list, data.pointer);
        }