Beispiel #1
0
        private void editPropertiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EditProperties editProperties = new EditProperties();

            editProperties.group   = modelStencil.Groups[0] as string;
            editProperties.tag     = modelStencil.Tag;
            editProperties.anchors = modelStencil.Anchors;

            if (editProperties.ShowDialog() == DialogResult.OK)
            {
                modelStencil.Groups[0] = editProperties.group;
                modelStencil.Tag       = editProperties.tag;

                ArrayList newAnchors = new ArrayList();
                foreach (Anchor anchor in modelStencil.Anchors)
                {
                    if (editProperties.listView1.Items.ContainsKey(anchor.Tag))
                    {
                        newAnchors.Add(anchor);
                    }
                }
                modelStencil.Anchors = newAnchors;

                foreach (ListViewItem listViewItem in editProperties.listView1.Items)
                {
                    bool anchorFound = false;

                    foreach (Anchor anchor in modelStencil.Anchors)
                    {
                        if (anchor.Tag == listViewItem.Text)
                        {
                            anchorFound = true;
                            anchor.Look = (short)editProperties.listView1.Groups.IndexOf(listViewItem.Group);
                        }
                    }

                    if (!anchorFound)
                    {
                        Anchor newAnchor = new Anchor(listViewItem.Text, AnchorType.Process,
                                                      (short)editProperties.listView1.Groups.IndexOf(listViewItem.Group));
                        modelStencil.Anchors.Add(newAnchor);
                        newAnchor.Positions = new ArrayList();
                    }
                }
            }

            ResetFlowChart(true);
            SetStencil(modelStencil);
            SetControls(modelStencil);
        }
Beispiel #2
0
    private void editPropertiesToolStripMenuItem_Click(object sender, EventArgs e)
    {
      EditProperties editProperties = new EditProperties();
      editProperties.group = modelStencil.Groups[0] as string;
      editProperties.tag = modelStencil.Tag;
      editProperties.anchors = modelStencil.Anchors;

      if (editProperties.ShowDialog() == DialogResult.OK)
      {
        modelStencil.Groups[0] = editProperties.group;
        modelStencil.Tag = editProperties.tag;

        ArrayList newAnchors = new ArrayList();
        foreach (Anchor anchor in modelStencil.Anchors)
        {
          if (editProperties.listView1.Items.ContainsKey(anchor.Tag))
          {
            newAnchors.Add(anchor);
          }
        }
        modelStencil.Anchors = newAnchors;

        foreach (ListViewItem listViewItem in editProperties.listView1.Items)
        {
          bool anchorFound = false;

          foreach (Anchor anchor in modelStencil.Anchors)
          {
            if (anchor.Tag == listViewItem.Text)
            {
              anchorFound = true;
              anchor.Look = (short)editProperties.listView1.Groups.IndexOf(listViewItem.Group);
            }
          }

          if (!anchorFound)
          {
            Anchor newAnchor = new Anchor(listViewItem.Text, AnchorType.Process,
                (short)editProperties.listView1.Groups.IndexOf(listViewItem.Group));
            modelStencil.Anchors.Add(newAnchor);
            newAnchor.Positions = new ArrayList();
          }
        }
      }

      ResetFlowChart(true);
      SetStencil(modelStencil);
      SetControls(modelStencil);
    }