Ejemplo n.º 1
0
        public static void Cut(SelectedNodes nodes)
        {
            if (nodes.Count > 0)
            {
                internalClipboard.Clear();

                StringBuilder     str        = new StringBuilder();
                MapTextSerializer serializer = new MapTextSerializer();

                bool[] exclude = nodes.ExcludeNodesAlreadyPartOfHierarchy();
                for (int i = 0; i < nodes.Count; i++)
                {
                    if (!exclude[i])
                    {
                        internalClipboard.Add(nodes[i]);
                    }
                }
                internalClipboard.ForEach(n =>
                {
                    serializer.Serialize(n, str);
                    n.Detach();
                });


                var cbData = new MindMateTextDataObject();
                cbData.SetData(str.ToString());
                Clipboard.SetDataObject(cbData);

                hasCutNode = true;
                if (StatusChanged != null)
                {
                    StatusChanged();
                }
            }
        }
Ejemplo n.º 2
0
        public static void Copy(SelectedNodes nodes)
        {
            if (nodes.Count > 0)
            {
                internalClipboard.Clear();

                StringBuilder     str        = new StringBuilder();
                MapTextSerializer serializer = new MapTextSerializer();

                bool[] exclude = nodes.ExcludeNodesAlreadyPartOfHierarchy();
                for (int i = 0; i < nodes.Count; i++)
                {
                    if (!exclude[i])
                    {
                        internalClipboard.Add(nodes[i].CloneAsDetached());
                        serializer.Serialize(nodes[i], str);
                    }
                }

                var cbData = new MindMateTextDataObject();
                cbData.SetData(str.ToString());
                Clipboard.SetDataObject(cbData);
                //Clipboard.SetText(str.ToString(), TextDataFormat.Text);

                hasCutNode = false;

                if (StatusChanged != null)
                {
                    StatusChanged();
                }
            }
        }
Ejemplo n.º 3
0
        public static void Copy(SelectedNodes nodes)
        {
            if (nodes.Count > 0)
            {
                internalClipboard.Clear();

                StringBuilder str = new StringBuilder();
                MapTextSerializer serializer = new MapTextSerializer();

                bool[] exclude = nodes.ExcludeNodesAlreadyPartOfHierarchy();
                for (int i = 0; i < nodes.Count; i++ )
                {
                    if (!exclude[i])
                    {
                        internalClipboard.Add(nodes[i].CloneAsDetached());
                        serializer.Serialize(nodes[i], str);
                    }
                }

                var cbData = new MindMateTextDataObject();
                cbData.SetData(str.ToString());
                Clipboard.SetDataObject(cbData);
                //Clipboard.SetText(str.ToString(), TextDataFormat.Text);

                hasCutNode = false;

                if(StatusChanged != null) { StatusChanged(); }
            }
        }
Ejemplo n.º 4
0
        public static void Cut(SelectedNodes nodes)
        {
            if(nodes.Count > 0)
            {
                internalClipboard.Clear();

                StringBuilder str = new StringBuilder();
                MapTextSerializer serializer = new MapTextSerializer();

                bool[] exclude = nodes.ExcludeNodesAlreadyPartOfHierarchy();
                for (int i = 0; i < nodes.Count; i++)
                {
                    if(!exclude[i])
                    {
                        internalClipboard.Add(nodes[i]);
                    }
                }
                internalClipboard.ForEach(n =>
                    {
                        serializer.Serialize(n, str);
                        n.Detach();
                    });

                var cbData = new MindMateTextDataObject();
                cbData.SetData(str.ToString());
                Clipboard.SetDataObject(cbData);

                hasCutNode = true;
                if (StatusChanged != null) { StatusChanged(); }
            }
        }