示例#1
0
 private void Diagram_UserHandleClicked(object sender, UserHandleClickedEventArgs args)
 {
     SelectedNode = diagram.SelectedItems[0] as Node;
     if (args.Item.Name == "Delete")
     {
         diagram.RemoveNode(SelectedNode, true);
         (diagram.LayoutManager.Layout as MindMapLayout).UpdateLayout();
     }
     else if (args.Item.Name == "ExpColl")
     {
         if (SelectedNode.IsExpanded)
         {
             SelectedNode.IsExpanded        = false;
             args.Item.Content              = GetHandleImage("mindmapcollpase.png");
             diagram.UserHandles[0].Visible = false;
             if (SelectedNode == RootNode)
             {
                 diagram.UserHandles[1].Visible = false;
             }
         }
         else
         {
             SelectedNode.IsExpanded        = true;
             args.Item.Content              = GetHandleImage("mindmapexpand.png");
             diagram.UserHandles[0].Visible = true;
             if (SelectedNode == RootNode)
             {
                 diagram.UserHandles[1].Visible = true;
             }
         }
         (diagram.LayoutManager.Layout as MindMapLayout).UpdateLayout();
         diagram.Select(SelectedNode);
     }
     else if (args.Item.Name == "info")
     {
         AddInfo();
     }
     else
     {
         if (args.Item.Name == "Left")
         {
             CurrentHandle = UserHandlePosition.Left;
             ShowInfo();
         }
         else if (args.Item.Name == "Right")
         {
             CurrentHandle = UserHandlePosition.Right;
             ShowInfo();
         }
     }
 }
示例#2
0
 internal AlertBox(Context context, MindMap mindmap, string content, SfDiagram sfDiagram, UserHandlePosition CurrentHandle, Node selectedNode, Node rootNode, int index, Random rnd, UserHandleCollection left, UserHandleCollection right, List <Color> SColor, List <Color> FColor)
 {
     alertBuilder       = new AlertDialog.Builder(context);
     m_mindmap          = mindmap;
     editText           = new EditText(context);
     _inputstring       = content;
     diagram            = sfDiagram;
     this.CurrentHandle = CurrentHandle;
     SelectedNode       = selectedNode;
     RootNode           = rootNode;
     this.index         = index;
     this.rnd           = rnd;
     LeftSideHandles    = left;
     RightSideHandle    = right;
     this.SColor        = SColor;
     this.FColor        = FColor;
 }
示例#3
0
 private void Diagram_UserHandleClicked(object sender, UserHandleClickedEventArgs args)
 {
     if (Notifier != null && Notifier.Superview == this)
     {
         Notifier.RemoveFromSuperview();
         diagram.Layer.Opacity = 1;
         diagram.PageSettings.BackgroundColor = UIColor.White;
     }
     else if (InfoNotifier != null && InfoNotifier.Superview == this)
     {
         InfoNotifier.RemoveFromSuperview();
     }
     else
     {
         if (args.Item.Name == "Delete")
         {
             diagram.RemoveNode(SelectedNode, true);
             (diagram.LayoutManager.Layout as MindMapLayout).UpdateLayout();
         }
         else if (args.Item.Name == "ExpColl")
         {
             if (SelectedNode.IsExpanded)
             {
                 SelectedNode.IsExpanded        = false;
                 args.Item.Content              = CollapseTemplate;
                 diagram.UserHandles[0].Visible = false;
                 if (SelectedNode == RootNode)
                 {
                     diagram.UserHandles[1].Visible = false;
                 }
             }
             else
             {
                 SelectedNode.IsExpanded        = true;
                 args.Item.Content              = ExpandTemplate;
                 diagram.UserHandles[0].Visible = true;
                 if (SelectedNode == RootNode)
                 {
                     diagram.UserHandles[1].Visible = true;
                 }
             }
             (diagram.LayoutManager.Layout as MindMapLayout).UpdateLayout();
             diagram.Select(SelectedNode);
         }
         else if (args.Item.Name == "info")
         {
             ShowInfo();
         }
         else
         {
             if (args.Item.Name == "Left")
             {
                 CurrentHandle = UserHandlePosition.Left;
                 AddAnnotation("Add Topic");
             }
             else if (args.Item.Name == "Right")
             {
                 CurrentHandle = UserHandlePosition.Right;
                 AddAnnotation("Add Topic");
             }
         }
     }
 }