public bool OnPatternNodeSetOccurrence(object args)
{
CheckDisposed();
ComplexConcPatternNode[] nodes = CurrentNodes;
int min, max;
var cmd = (Command) args;
if (cmd.Parameters.Count > 0)
{
string minStr = XmlUtils.GetManditoryAttributeValue(cmd.Parameters[0], "min");
string maxStr = XmlUtils.GetManditoryAttributeValue(cmd.Parameters[0], "max");
min = Int32.Parse(minStr);
max = Int32.Parse(maxStr);
}
else
{
bool paren;
if (nodes.Length > 1)
{
min = 1;
max = 1;
paren = true;
}
else
{
min = nodes[0].Minimum;
max = nodes[0].Maximum;
paren = !nodes[0].IsLeaf;
}
using (OccurrenceDlg dlg = new OccurrenceDlg(m_mediator.HelpTopicProvider, min, max, paren))
{
dlg.SetHelpTopic("khtpCtxtOccurComplexConcordance");
if (dlg.ShowDialog((XWindow) m_mediator.PropertyTable.GetValue("window")) == DialogResult.OK)
{
min = dlg.Minimum;
max = dlg.Maximum;
}
else
{
return true;
}
}
}
ComplexConcPatternNode node = nodes.Length > 1 ? GroupNodes(nodes) : nodes[0];
node.Minimum = min;
node.Maximum = max;
ReconstructView(node, false);
return true;
}