예제 #1
0
        public void UpdateItems(Element el, bool check_hash = true)
        {
            if (el.revisions == null)
            {
                return;
            }
            try
            {
                String hash = "";
                lock (el.revisions)
                {
                    curr = el;
                    TRevisionSet rs   = el.revisions;
                    tl           root = rs.root;
                    if (control.items2_list.Count > 0 && check_hash)
                    {
                        hash = GetHash(root);
                        if (tmp_hash.Equals(hash))
                        {
                            return;
                        }
                    }

                    int top_index = control.TopIndex;

                    String top_rand_s = "";
                    double top_rand   = -1;
                    try
                    {
                        top_rand_s = control.Items[top_index].ToString();
                        foreach (RevListElement i in control.items2_list)
                        {
                            if (i.rand_s.Equals(top_rand_s))
                            {
                                top_rand = i.rand; break;
                            }
                        }
                    }
                    catch { }

                    int new_index = top_index;

                    control.BeginUpdate();
                    control.Clear();

                    CreateItems(root);

                    control.TopIndex = new_index;
                    control.EndUpdate();
                    control.PerformLayout();
                    tmp_hash = hash;
                }
            }
            catch (Exception) { return; }
        }
예제 #2
0
 public void MakeRevisions()
 {
     revisions = new TRevisionSet(page);
 }