Beispiel #1
0
 internal void Render(bool reload)
 {
     if (!reload)
     {
         IsExpanded = !IsExpanded;
         IsExpanded = !IsExpanded;
         return;
     }
     IsExpanded = false;
     _Control.ResetGrid(true);
     Filter = string.Empty;
     ParentList.Clear();
     foreach (var file in _Proxy.GetParentList())
     {
         ParentList.Add(file);
     }
     using (FileList.DeferRefresh())
     {
         _AddSortDescription();
         IsExpanded = true;
     }
     CurrentParent = _DefaultFile;
     if (0 != ParentList.Count)
     {
         CurrentParent = ParentList.First();
         _Control.ResetGrid(false);
     }
     CurrentParent.Load();
     IsRendered = true;
     PopulateAvailableItems();
 }
Beispiel #2
0
        public virtual MerkleNode AppendLeaf(MerkleNode node)
        {
            if (CurrentLeaf == null) // Meaning we have an even number of nodes (or zero)
            {
                // There were an even number of Leaves, including zero
                if (CurrentParent == null)
                {
                    // This is the first node
                    CurrentParent = CreateNode(node, null);
                    CurrentLeaf   = node;
                }
                else
                {
                    // Append the leaf on the left, creating a new parent for it
                    CurrentParent = CurrentParent.AppendMerkleNode(node);
                    CurrentLeaf   = node;
                }
            }
            else
            {
                // Append the leaf on the right, creating a new parent for it
                CurrentParent = CurrentParent.AppendMerkleNode(node);
                CurrentLeaf   = null;
            }

            return(node);
        }