Changed the Multi-user refresh so that the selected node is not changed between the adding and the finalizing of the section addition.
Use the selected node prior to setting the section properties so that the node is added at the correct location.
This commit is contained in:
@@ -143,6 +143,19 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
//end jcb multiunit
|
||||
#endregion
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Node={0},Destination={1},Index={2},Unit={3},UnitIndex={4}",NodePath(this.Node),this.Destination, this.Index,this.Unit, this.UnitIndex);
|
||||
}
|
||||
|
||||
private string NodePath(TreeNode node)
|
||||
{
|
||||
string retval = "";
|
||||
if (node.Parent != null)
|
||||
retval = NodePath(node.Parent) + ":";
|
||||
retval += node.Text;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
public partial class vlnTreeItemInfoEventArgs
|
||||
{
|
||||
@@ -1956,7 +1969,7 @@ namespace Volian.Controls.Library
|
||||
if (!hasMetaSubs) doPseudo = true;
|
||||
}
|
||||
}
|
||||
using(Section section = CreateNewSection())
|
||||
using (Section section = CreateNewSection())
|
||||
{
|
||||
ShowBrokenRules(section.BrokenRulesCollection);
|
||||
SetLastValues(SectionInfo.Get(section.ItemID));
|
||||
@@ -2033,11 +2046,15 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
ShowBrokenRules(section.BrokenRulesCollection);
|
||||
SetLastValues(SectionInfo.Get(section.ItemID));
|
||||
TreeNode par = SelectedNode.Parent;
|
||||
if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK)
|
||||
{
|
||||
tn = new VETreeNode(_LastSectionInfo);
|
||||
TreeNode par = SelectedNode.Parent;
|
||||
par.Nodes.Insert(tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1), tn);
|
||||
int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1);
|
||||
if ((par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString())
|
||||
{
|
||||
tn = new VETreeNode(_LastSectionInfo);
|
||||
par.Nodes.Insert(indx, tn);
|
||||
}
|
||||
}
|
||||
else
|
||||
s2 = section.ItemID;
|
||||
|
Reference in New Issue
Block a user