When all sorts of languages are focused on one person, the brain is a little messed up 1

Source: Internet
Author: User

Call the This function after operation.

public void NewState (Graphicslist graphicslist)

{

Keep objects state after operation.

Listafter = new list<drawobject> ();

Afterzoomrate = new list<pointf> ();

Drawobject Newo = null;

BOOL Bvalid = false;

foreach (drawobject o in graphicslist.graphicslist)

{

if (!bvalid)

{

afterzoomrate.x = o.objectzoomrate.x;

Afterzoomrate.y = O.objectzoomrate.y;

Afterzoomrate.add (New PointF (o.objectzoomrate.x, o.objectzoomrate.y));

Bvalid = true;

}

if (O.objecttype = = (int) DrawArea.DrawToolType.Line)

{

Listafter.add (O.clone ());

}

else if (O.objecttype = = (int) DrawArea.DrawToolType.PolyLine)

{

Newo = new DrawPolyline (((DrawPolyline) O). Pointarray[0]. X, ((DrawPolyline) O). Pointarray[0]. Y);

int num = 0;

foreach (PointF point in ((DrawPolyline) O). Pointarray.toarray ())

{

if (num >= 1)

{

((DrawPolyline) Newo). Addpoint (point);

}

num++;

}

Newo.id = o.id;

Newo.objecttype = O.objecttype;

The recording of the record, the reduction of the place ¤ Drag a Á?ì

Newo.objectzoomrate = o.objectzoomrate;

Newo.objectdragoffset = O.objectdragoffset;

When Ì?à more ¨¤, the o?à,list<t> refers to the ¨2 in ¨°. When the Ì?à ¨2 in the store?? Hair ¤?é |¨2 change à? ¥ then ¨° and ¨2 with the Change à? ¥ guide ì? No T method ¤?§ withdrawal? ¤ Pin ¨2 recovery? On |? One °, a á?? State??

Listafter.add (Newo);

}

}

}

public override void Undo (Graphicslist list)

{

List. Clear ();

foreach (drawobject o in Listbefore)

{

List. ADD (O.clone ());//O/o.clone ()

}

Undoobjects (list);

List. Updatezoomrate (beforezoomrate[0],true);

}

public override void Redo (Graphicslist list)

{

List. Clear ();

foreach (drawobject o in Listafter)

{

List. ADD (O.clone ());//o.clone () o

}

Redoobjects (list);

List. Updatezoomrate (Afterzoomrate[0],false);

}

Replace objects in graphicslist with objects from list

private void Undoobjects (Graphicslist graphicslist)

{

for (int i = 0; i < Graphicslist.count; i++)

{

drawobject replacement = null;

foreach (drawobject o in Listbefore)

{

if (o.id = = graphicslist[i].id)

{

replacement = O;

À¨¨ Example ¤y

Graphicslist.replace (i, replacement);

}

/* Else

{

O.resize (Beforezoomrate, o.objectzoomrate.x);

}*/

}

}

}

Replace objects in graphicslist with objects from list

private void Redoobjects (Graphicslist graphicslist)

{

for (int i = 0; i < Graphicslist.count; i++)

{

drawobject replacement = null;

foreach (drawobject o in Listafter)

{

if (o.id = = graphicslist[i].id)

{

replacement = O;

À¨¨ Example ¤y

Graphicslist.replace (i, replacement);

}

/* Else

{

O.resize (Afterzoomrate, o.objectzoomrate.x);

}*/

}

}

}

}

}

=============================================================================================================== =============================================================================================================== ========================

Using System;

Using System.Collections.Generic;

Using System.ComponentModel;

Using System.Data;

Using System.Drawing;

Using System.Linq;

Using System.Text;

Using System.Windows.Forms;

Namespace CSharp

{

public partial class Adminform:form

{

MainForm parentform = new MainForm ();

Public Adminform (mainform parent)

{

InitializeComponent ();

ParentForm = parent;

}

public float Getmergedis ()

{

return (float) (convert.todouble (Mergedistextbox.text));

}

public float Getsplitdis ()

{

return (float) ((convert.todouble (Splitdistextbox.text)) *parentform.drawarea.pxwidth);

}

}

}

==================================================================================

When all sorts of languages are focused on one person, the brain is a little messed up 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.