UNDO/REDO ARCHITECTURE ACROSS MULTIPLE FILES
Editing operations are monitored for operations for which information must be stored in order to properly apply an undo or undo/redo sequence to plurality of files. A snapshot is taken and persisted before such an operation is performed. Upon the execution of an undo or redo command, the persisted snapshot is retrieved and applied to the newly generated editing element.
Latest Microsoft Patents:
- SYSTEMS, METHODS, AND COMPUTER-READABLE MEDIA FOR IMPROVED TABLE IDENTIFICATION USING A NEURAL NETWORK
- Secure Computer Rack Power Supply Testing
- SELECTING DECODER USED AT QUANTUM COMPUTING DEVICE
- PROTECTING SENSITIVE USER INFORMATION IN DEVELOPING ARTIFICIAL INTELLIGENCE MODELS
- CODE SEARCH FOR EXAMPLES TO AUGMENT MODEL PROMPT
The present application is a continuation of U.S. patent application Ser. No. 10/165,749 filed Jun. 7, 2002, entitled “UNDO/REDO ARCHITECTURE ACROSS MULTIPLES FILES” which is hereby incorporated by reference in its entirety.
COPYRIGHT NOTICE/PERMISSIONA portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent files or records, but otherwise reserves all copyright rights whatsoever. The following notice applies to the software and data as described below and in the drawings hereto: Copyright© 2002, Microsoft Corporation, All Rights Reserved.
TECHNICAL FIELDThis invention relates to the field of computing and in particular to the field of editing tools.
BACKGROUNDIn some editors it is possible to “back out” and “re-instate” changes made to a document. For example, in MICROSOFT WORD, a user can use an “undo” and “redo” function available from the standard toolbar to “undo” a change that was previously made or “redo” a change that was previously undone. This function can be performed multiple times. In other words, activating “undo” four times will undo the last four changes made to a document. Subsequently activating “redo” three times will redo three of those last four changes, effectively resulting in the same effect as activating “undo” once.
When performing certain types of tasks, such as performing certain types of programming projects using certain editors, the editor may open several documents. When a user edits or changes one document, changes are made to the other document or documents automatically to reflect the changes the user made to the first document. Typically, however, the undo/redo function does not extend across multiple documents. Hence problems may arise when, for example, an element is deleted from a document and then the delete function is undone. The element may be deleted in the first document and then be reinstated to its original condition (by the undo) but the corresponding changes to the related document may not be made, so that the related document is not properly reinstated to its original condition.
For example, in an active server page (ASP) file declarative tags (HTML, ASP directives, server controls and static text, and the user interface (UI) part) are combined with the code. In certain environments, the code either can be stored on the same page as the tags or on a separate page known herein as the Code-Behind page. When an element such as a control is deleted in the UI component, associated elements such as the declaration, events and properties of the control are deleted from the code file. Problems arise, however, for example, when the delete is undone. When the delete is undone, the declaration, properties and events should be reapplied to the related Code-Behind file, however, heretofore, no known method has been available to apply the undo (or undo/redo, etc.) to the related document because the undo/redo function has been confined to a single document. Hence it would be helpful if an undo/redo function could support undo/redo changes across multiple documents.
SUMMARYEditing operations are monitored for operations for which information must be stored in order to properly apply an undo, redo, or undo/redo sequence or the like to a plurality of files. A snapshot is taken and persisted before such an operation is performed. Upon the execution of an undo or redo command, the persisted snapshot is retrieved and applied to the newly generated editing element. Hence editing operations such as but not limited to undo/redo operations are performed essentially simultaneously to multiple files, wherein an editing operation such as an undo, a redo or the like, performed on one file is propagated to a related file or files automatically.
The foregoing summary, as well as the following detailed description of preferred embodiments, is better understood when read in conjunction with the appended drawings. For the purpose of illustrating the invention, there is shown in the drawings exemplary constructions of the invention; however, the invention is not limited to the specific methods and instrumentalities disclosed. In the drawings:
Although not required, the invention can be implemented via an application programming interface (API), for use by a developer, and/or included within the network browsing software which will be described in the general context of computer-executable instructions, such as program modules, being executed by one or more computers, such as client workstations, servers, or other devices. Generally, program modules include routines, programs, objects, components, data structures and the like that perform particular tasks or implement particular abstract data types. Typically, the functionality of the program modules may be combined or distributed as desired in various embodiments. Moreover, those skilled in the art will appreciate that the invention may be practiced with other computer system configurations. Other well known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to, personal computers (PCs), automated teller machines, server computers, hand-held or laptop devices, multi-processor systems, microprocessor-based systems, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and the like. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network or other data transmission medium. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
With reference to
Computer 110 typically includes a variety of computer readable media. Computer readable media can be any available media that can be accessed by computer 110 and includes both volatile and nonvolatile media, removable and non-removable media. By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CDROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by computer 110. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared, and other wireless media. Combinations of any of the above should also be included within the scope of computer readable media.
The system memory 130 includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) 131 and random access memory (RAM) 132. A basic input/output system 133 (BIOS), containing the basic routines that help to transfer information between elements within computer 110, such as during start-up, is typically stored in ROM 131. RAM 132 typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit 120. By way of example, and not limitation,
The computer 110 may also include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only,
The drives and their associated computer storage media discussed above and illustrated in
A monitor 191 or other type of display device is also connected to the system bus 121 via an interface, such as a video interface 190. A graphics interface 182, such as Northbridge, may also be connected to the system bus 121. Northbridge is a chipset that communicates with the CPU, or host processing unit 120, and assumes responsibility for accelerated graphics port (AGP) communications. One or more graphics processing units (GPUs) 184 may communicate with graphics interface 182. In this regard, GPUs 184 generally include on-chip memory storage, such as register storage and GPUs 184 communicate with a video memory 186. GPUs 184, however, are but one example of a coprocessor and thus a variety of coprocessing devices may be included in computer 110. A monitor 191 or other type of display device is also connected to the system bus 121 via an interface, such as a video interface 190, which may in turn communicate with video memory 186. In addition to monitor 191, computers may also include other peripheral output devices such as speakers 197 and printer 196, which may be connected through an output peripheral interface 195.
The computer 110 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 180. The remote computer 180 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 110, although only a memory storage device 181 has been illustrated in
When used in a LAN networking environment, the computer 110 is connected to the LAN 171 through a network interface or adapter 170. When used in a WAN networking environment, the computer 110 typically includes a modem 172 or other means for establishing communications over the WAN 173, such as the Internet. The modem 172, which may be internal or external, may be connected to the system bus 121 via the user input interface 160, or other appropriate mechanism. In a networked environment, program modules depicted relative to the computer 110, or portions thereof, may be stored in the remote memory storage device. By way of example, and not limitation,
One of ordinary skill in the art can appreciate that a computer 110 or other client device can be deployed as part of a computer network. In this regard, the present invention pertains to any computer system having any number of memory or storage units, and any number of applications and processes occurring across any number of storage units or volumes. The present invention may apply to an environment with server computers and client computers deployed in a network environment, having remote or local storage. The present invention may also apply to a standalone computing device, having programming language functionality, interpretation and execution capabilities.
Undo/Redo System and Method
Overview
When an editing operation is performed on an element (element one) in a first file, the editing operation associated with another element (element two) in a related file or files, a notification is sent to a listener object such as Listener Manager 218. If the operation is one for which information must be captured in order for an undo or a redo to be correctly performed, a snapshot (element three) of an aspect of element one of the first file or a snapshot of element two from the related file or files is taken by a serializer/deserializer 220 before the selection is operated on. The snapshot is stored in a snapshot store. In one embodiment, the snapshot is stored as an object in an object store 222. An operation unit including the operation and the element on which the operation was performed is added to an operation store 224. If an operation such as, for example, an “undo” is received, the appropriate operation and element are retrieved from the operation store 224, the snapshot is retrieved from the snapshot store and applied to the element of the first file to generate the element of the second file or the snapshot of the second element is retrieved from the snapshot store and is applied to the related file or files. An operation unit (e.g., custom undo unit) for the undo is stored in an operation store 224 maintained by Listener Manager 218.
For example, assume that two homogeneous or heterogeneous documents are being simultaneously edited and that document 1 is associated with a block of text comprising the words “Software Version 1.0”. Assume further that the words “Software Version 1.0” are associated with the words “MixItWell Package” in document 2. If an editing operation such as “delete” or “cut” of “Software Version 1.0” is received, typically, “Software Version 1.0” will be deleted from document 1 and “MixItWell Package” will be deleted from document 2. In accordance with one embodiment of the invention, before “Software Version 1.0” is deleted from document 1 and before “MixItWell Package” is deleted from document 2, a notification is sent to Listener Manager 218 so that a snapshot of “MixItWell Package” is taken and stored in a snapshot store so that if the deletion of “Software Version 1.0” is undone, restoring “Software Version 1.0” to document 1, “MixItWell Package” is likewise restored to document 2.
In this case receipt of a undo delete command would result in “Software Version 1” being re-instated in document 1 and “MixItWell Package” being retrieved from the snapshot store and re-applied to document 2. An operation unit is added to the operation store 224. The operation unit includes an identifier of the edited element (e.g., “Software Version 1” and the operation performed (e.g., delete undo).
Undo/Redo Across Multiple Files in the .NET Environment
One of the four major pieces of the .NET framework is ASP.NET, the successor to Active Server Pages (ASP). ASP.NET is a programming environment for Web applications that run on the Internet Information Services (IIS) Web server and interact with users through a browser. ASP.NET loads dynamic Web pages, parses the pages for .NET code (i.e., code written in Visual Basic.NET, C#, JScript, or other .NET languages), and passes the code along to .NET language compilers and the CLR (Common Language Runtime). ASP.NET supports the CLR libraries, and languages.
ASP.NET reduces the amount of code required to write a Web application or Web service and introduces new methods for implementing Web services. Additional information concerning the .NET platform produced by Microsoft Corporation of Redmond, Wash. is described in PCT Publication WO 01/98936, having an international filing date of Jun. 22, 2001 and incorporated herein by reference.
ASP.NET developers create pages by assembling and customizing the Web Forms controls provided by the class libraries. Developers customize controls by setting properties, such as but not limited to font, size, placement and by supplying application-specific “event handler” code. This code is invoked upon each user request or response. Developers can also create custom controls, which could allow commercial independent software vendors (ISVs) to offer add-on libraries of ASP.NET controls similar to the libraries of ActiveX controls available for Visual Basic today.
Visual Studio Integrated Development Environment (IDE)
Visual Studio.NET provides tools including an editor for writing source code and wizards that automatically generate source code for common programming tasks. For example, developers can automatically generate the code required to call a Web service by dragging and dropping a link to the Web service site into the client application's source code in the IDE. Graphical editors in Visual Studio.NET enable developers to build Web Forms by dragging and dropping fields and other components from a toolbox. Visual Studio.NET provides a single Integrated Design Environment (IDE) that supports all of its programming languages and covers Web applications and desktop applications.
Hence the .NET platform enables the separation of the UI portion 202 (called a Web form and preferably denoted by a file extension of “aspx” or “ascx”) of the ASP.NET page from the code part 204 (preferably denoted by a file extension of “cs” if the code is written in C# or “vb”, if the code is written in Visual Basic). The file that contains the code part is called herein the “Code-Behind” or “Code-Beside” file. At runtime, the two files are compiled into one file.
Within the Design Editor 216 of the IDE 214, an ASP.NET developer can create a page by assembling and customizing the Web Forms controls provided by the class libraries. A Web Form control is a component embedded in a Web page and that runs on a Web server. When a page is accessed, the Web Forms controls embedded in the page accept and validate the user's input and generate the appropriate HTML output in response. Web Forms controls include simple form input fields and buttons and complex elements such as a grid control that enables users to view and edit live database data as is done, for example, in a spreadsheet like Excel. Web Forms provide built-in code to handle common tasks such but not limited to:
Validating input data (e.g., preventing a user from entering letters into a “quantity” field).
Keeping track of page state and displaying the state appropriately when the user refreshes the page in the browser (e.g., input field controls display their last entered value).
Determining what browser version the user has and adapting output to that browser.
A developer can customize a control by setting the properties of provided controls. The properties used for customization may include but are not limited to font, size, and placement. Controls can also be customized by supplying application-specific “event handler” code which is invoked upon a user request or response. A developer can also create a custom control, (e.g., a custom control may be developed by a commercial independent software vendor (ISV) so that add-on libraries of ASP.NET controls could be added similar to the libraries of ActiveX controls available for Visual Basic today).
Typically, a control is uniquely identified in the Code-Behind file using the attribute ID (e.g., ID=Button1 might identify a first button on a page.) Hence in the Code-Behind file a declaration for the control will exist, as will events and properties associated with the control. Each event is associated with an event handler. During runtime, an instance of a class (e.g., an instance of a Button class) is generated for each control. The instance of a class (the object) is associated with the defined properties such as ID (e.g., Button1), backcolor (e.g., red), text (e.g., “Hello”), an event (e.g., a click event) and so on.
Now assume that two heterogeneous files are being edited, where the first file is a WebForm document 300 and the second file is the Code-Behind file 500. It should be understood that while in this example the two files are heterogeneous, the files in question could alternatively be homogeneous files. Assume that WebForm document 300 includes a control 402. Control 402 may be associated with state, that is, particular values to which characteristics or properties of the control have been set. The state of the control may be associated with particular code in Code-Behind file 500 such as a ClickEvent and event handler. Assume that user input has been received that indicates that an editing operation (e.g., a delete of control 402) has been received. Before the control is deleted from the WebForm document 300 and the code associated with the state of the control is deleted from the Code-Behind file 500, a notification is sent to a listener object (e.g., Listener Manager 218) and a snapshot of the state of the control being deleted is taken by the serializer/deserializer 220 and stored (e.g., as an object) in a snapshot store, (e.g., object store 222).
For example, if the input received indicates that the control 402 (e.g., Button1) is to be deleted from WebForm 300, a notification is sent to Listener Manager 218 so that before Button1 is deleted from the form, a snapshot of the state of Button1 is taken by the serializer/deserializer 220 and stored as an object in object store 222.
Thus, it should be understood that any element or any aspect of the element may be captured by the snapshot. The use of state in the example above is merely exemplary. In one embodiment, operations on an element for which a snapshot is required (e.g., cut, delete and the like) may be determined by the presence of an “accountable” attribute, but any suitable method of determining such operations is contemplated by the invention. Similarly, it should be understood that serializer/deserializer 220 may be any appropriate module capable of capturing an element or aspect of an element, such as but not limited to, the state of a control. The captured element or aspect of an element, in one embodiment of the invention, is a code object and is stored in an object store 222 but it should be understood that the element or aspect of the element may be captured as an object, code object, string, XML, BLOB or in any other suitable fashion and may be stored in any suitable store. An operation unit (e.g. custom undo unit) that identifies an editing operation on an element is stored in an operation store 224. In one embodiment of the invention, the operation store 224 is a LIFO stack. The operation store 224 may include different kinds of operations (e.g., both undo and redo operations and the like) or one store may be maintained for each different type of operation (e.g., undo operations may be stored in an undo store and redo operations may be stored in a redo store).
For example, if an undo is subsequently received for the deletion of Button1, a new instance of Button1 is re-instated in WebForm document 300, the pre-deletion state of Button1 is retrieved by retrieving the snapshot stored in object store 222 for Button1, the retrieved code object is applied to Button1 and the resultant code is applied to Code-Behind file 500. An operation unit that identifies Button1 (the control that was deleted) and the operation (undo delete) is added to the operation store 224. An operation unit is added to the operation store 224 so that a subsequent redo operation can be performed, if requested. While the examples above have detailed a delete operation followed by an undo, it should be understood that other operations requiring the capture of additional information such as state of a control are contemplated by the invention (e.g., the redo of an “undone” operation or any sequence of undo/redo operations or the like).
For example, and referring now to
Referring again to
At step 1204, an editing operation is performed. For example, assume that a button is moved from one location to another within document 300, or background color is changed. At step 1206, a notification is sent to Listener Manager 218. Listener Manager 218 determines that this editing operation is not one that requires additional information such as state to be saved. At step 1214, it is determined that this is not an undo or redo operation so processing returns to step 1204. At step 1204 a control (e.g., Button1 402) is selected and deleted. At step 1206, a notification is sent to Listener Manager 218. In one embodiment, a change service notification (e.g., OnComponentRemoving) is used to detect that a control (i.e., Button1) is being removed from the WebForm document 300. Preferably notifications fired as part of destroying or closing document 300 are ignored. It is determined that this is an operation for which state needs to be saved, so processing continues at step 1208.
At step 1208, a snapshot is taken. In one embodiment the snapshot is taken by calling a module (e.g., CodeDomSerializer.Serialize) on the serializer associated with the type of control, (in this case, a Button control). At step 1210 the snapshot is stored. In one embodiment, the snapshot is a code object generated by the serializer. In one embodiment the code object is stored in a hash table keyed off the unique identifier of the control (e.g., Button1). The hash table includes the key (Button1) and a value (the code object).
An operation unit is added to the operation store at step 1212. In one embodiment the Undo/Redo Manager keeps track of operations than can be undone or redone by maintaining a LIFO (last in first out) stack of undo and redo units. Every editing operation that can be undone generates an undo unit. Every undo operation generates a redo unit. Hence, when an element such as Button1 is deleted, a parent undo unit is created and is added to the stack of undo units. When the notification is fired, a new instance of a custom undo unit (i.e., an operation unit) is created. The pre-made operation unit itself may be customized or overridden. The operation unit is created to hold the code-behind data (e.g., the state of Button1) from Code-Behind document 500 and in one embodiment is added as a child of the parent undo unit created when Button1 was deleted from WebForm document 300. In one embodiment, the child undo unit is added to the parent undo unit through IOleUndoManager.Add. In one embodiment, operation units cache the code object and respective code DOM serializer(s) and do not hold references to live controls or to their corresponding designer instances.
Processing returns to step 1204. Assume that the next editing operation that is performed is “undo”, that is, just-deleted Button1 is to be re-instated in WebForm 300. When Button1 is regenerated by the undo, Button1 does not have the original properties associated with it in the Code-Behind file. At step 1206 it is determined that the editing operation is not an operation requiring state to be stored, and processing proceeds to step 1214. At step 1214 it is determined that the editing operation is an undo or redo. The editing operation is undone on the first file. In one embodiment a notification is sent that preferably includes the unique ID (Button), and the operation (undo). In one embodiment, this notification is a call to IOleUndoUnit::Do. At step 1215, the appropriate operation unit is retrieved. (e.g., through IOleUndoUnit::Do). In one embodiment Undo/Redo Manager implements the undo. Undo/Redo Manager retrieves the operation unit from the operation store and calls IOleUndoUnit::Do. IOleUndoUnit::Do places the new operation (undo) unit on a redo stack and adds Button1 back to WebForm document 300. When Button1 is regenerated by Undo/Redo Manager, Button1 does not have the original properties associated with it in the Code-Behind file. At step 1216 a notification is sent indicating that a control whose unique ID is “Button1” has been added to WebForm 300. In one embodiment the cached code-behind information is retrieved from the hash table from the unique key (e.g., Button1) and the state stored in the code object is applied on the appropriate control instance by calling CodeDomSerializer.Deserialize. Deserialization applies the state stored in the code object to an instance (e.g., Button1). Hence, the code object that the serializer returned in step 1208 is retrieved from the hash table and the deserializer applies the properties stored in the code object to the Button1 control. Preferably, the code object can be applied to the same instance or to a different instance of the same type of control.
Hence Button1 (element one) is added back to WebForm 300, and the appropriate code (element two) is added back to Code-Behind file 500. At step 1218, the undo operation unit is added to the operation store. In one embodiment the operation unit is added to the operation store by calling IOleUndoManager.Add). The operation unit is added to the operation store so that the operation can be redone, if desired. It should be understood that although the example demonstrated a delete and an undo, an undo and a redo, any combination of undos and redos or the like may be performed, limited only by the size of the operation store or stores. Processing continues at step 1204.
CONCLUSIONIt is noted that the foregoing examples have been provided merely for the purpose of explanation and are in no way to be construed as limiting of the present invention. While the invention has been described with reference to various embodiments, it is understood that the words which have been used herein are words of description and illustration, rather than words of limitation. Further, although the invention has been described herein with reference to particular means, materials and embodiments, the invention is not intended to be limited to the particulars disclosed herein; rather, the invention extends to all functionally equivalent structures, methods and uses, such as are within the scope of the appended claims. Those skilled in the art, having the benefit of the teachings of this specification, may effect numerous modifications thereto and changes may be made without departing from the scope and spirit of the invention in its aspects.
Claims
1. A computer-implemented method for performing a plurality of editing operations on a plurality of files simultaneously, the method comprising:
- a computer opening the plurality of files, the plurality of files comprising at least a first file comprising a user interface file and a first element, and a second file comprising a Code-Behind file that is separate from but related to the first file and comprising a second element that is different than but related to the first element of the first file such that an editing operation performed on the first element of the first file requires an editing operation to be performed on the corresponding second element of the second file;
- the computer receiving a notification that a first editing operation is to be performed on the first element of the first file, wherein performance of the first editing operation on the first element of the first file will result in a second editing operation being automatically performed on the corresponding second element of the second file;
- upon receiving the notification, the computer determining whether the first editing operation is one that is capable of being reversed, and when the first editing operation is capable of being reversed, automatically capturing the pre-operation state of at least the second element in the second file within persistent storage and storing within an operation store an operation unit representative of the operation and state of the operation performed for the first element and the second element;
- after the first editing operation has been performed on the first element of the first file and the second editing operation has been automatically performed on the corresponding second element of the second file, the computer receiving a command to reverse the first editing operation on the first element of the first file; and
- in response to the command, the computer automatically retrieving the pre-operation state of the second element of the second file and the operation performed on the second element from the operation store and applying the retrieved state and operation of the second element to the second file to automatically reverse the second operation performed on the second element, wherein the reverse operation comprises reapplying the state and operation on the second element and storing the operation unit and operation state for the reverse operation in persistent storage.
2. The method of claim 1, wherein the command is one of an undo operation or a redo operation and the command produces changes that are not the same for a user interface file as they are for a Code-Behind file.
3. The method of claim 1, wherein performing the first editing operation on the first element in the first file further comprises:
- in response to determining that the first element is not the same as the second element, persisting the second element in a first store.
4. The method of claim 1, wherein in response to determining that the first element is not the same as the second element, the computer persisting a third element and an identifier of the first element in a first store within the persistent storage.
5. The method of claim 4, wherein the second element is the same as the third element.
6. The method of claim 4, wherein the second element is generated by applying the third element to the first element.
7. The method of claim 4, wherein the first store is a hash table, keyed on a first element identifier.
8. The method of claim 4, further comprising adding an operation unit identifying the first editing operation and an identifier of the first element to an operation store within the persistent storage.
9. The method of claim 1, wherein in response to receiving the command, the method further comprises:
- the computer retrieving an operation unit state associated with the first editing operation from an operation store, wherein the operation unit state comprises an element identifier and associated state for the element;
- the computer retrieving an identifier of the first element from the operation unit state;
- the computer retrieving the pre-operation state of the second element associated with the identifier of the first element from the persistent storage; and
- the computer applying the second element to the second file.
10. The method of claim 4, wherein in response to receiving the command, the method further comprises:
- the computer retrieving an operation unit state associated with the first editing operation from an operation store, wherein the operation unit state comprises an element identifier and associated state for the element;
- the computer retrieving an identifier of the first element from the operation unit state;
- the computer retrieving the third element associated with the identifier of the first element from the first store;
- the computer applying the third element to the first element to generate the second element; and
- the computer applying the second element to the second file.
11. The method of claim 10, further comprising the computer adding a second operation unit to the operation store, the second operation unit identifying the command and the identifier of the first element to an operation stack.
12. The method of claim 1, wherein the plurality of files are documents.
13. The method of claim 1, wherein the first file is a WebForm and the second file is a Code-Behind file.
14. The method of claim 1, wherein the first editing operation is one of a delete or a cut.
15. The method of claim 1, wherein the first element is a control.
16. The method of claim 1, wherein the second element is a state of the control.
17. The method of claim 16, wherein a serializer persists the state of the control as one of a code object, XML, string or BLOB.
18. A computer-readable storage medium including computer-readable instructions for performing a plurality of editing operations on a plurality of files simultaneously, the instructions, when executed on a computer, causing the computer to:
- open the plurality of files, the plurality of files comprising at least a first file comprising a user interface file and a first element, and a second file comprising a Code-Behind file that is separate from but related to the first file and comprising a second element that is different than but related to the first element of the first file such that an editing operation performed on the first element of the first file requires an editing operation to be performed on the corresponding second element of the second file;
- receive a notification that a first editing operation is to be performed on the first element of the first file, wherein performance of the first editing operation on the first element of the first file will result in a second editing operation being automatically performed on the corresponding second element of the second file;
- upon receiving the notification, determine whether the first editing operation is one that is capable of being reversed, and when the first editing operation is capable of being reversed, automatically capture the pre-operation state of at least the second element in the second file within persistent storage and storing within an operation store an operation unit representative of the operation and state of the operation performed for the first element and the second element;
- after the first editing operation has been performed on the first element of the first file and the second editing operation has been automatically performed on the corresponding second element of the second file, receive a command to reverse the first editing operation on the first element of the first file; and
- in response to the command, automatically retrieve the pre-operation state of the second element of the second file and the operation performed on the second element from the operation store and apply the retrieved state and operation of the second element to the second file to automatically reverse the second editing operation performed on the second element, wherein the reverse editing operation comprises reapplying the state and operation on the second element and storing the state and the operation unit for the reverse editing operation in persistent storage where an editing command produces changes that are not the same for the first file as they are for the second file.
19. The computer-readable medium of claim 18 further comprising computer-readable instructions for:
- receiving a request to perform a second operation on the first element in the first file;
- in response to determining that the second operation is one of an undo and a delete operation, retrieving the object identifying the operation and the first element from the second store;
- retrieving the second element from the first store; and
- applying the second element to the second file.
20. A computing system comprising a processor and a computing memory having stored therein instructions that when executed by the processor cause the computing system to:
- open the plurality of files, the plurality of files comprising at least a first file comprising a user interface file and a first element, and a second file comprising a Code Behind file that is separate from but related to the first file and comprising a second element that is different than but related to the first element of the first file such that an editing operation performed on the first element of the first file requires an editing operation to be performed on the corresponding second element of the second file;
- receive a notification that a first editing operation is to be performed on the first element of the first file, wherein performance of the first editing operation on the first element of the first file will result in a second editing operation being automatically performed on the corresponding second element of the second file;
- upon receiving the notification, determine whether the first editing operation is one that is capable of being reversed, and when the first editing operation is capable of being reversed, automatically capture the pre-operation state of at least the second element in the second file within persistent storage and storing within an operation store an operation unit representative of the operation and state of the operation performed for the first element and the second element;
- after the first editing operation has been performed on the first element of the first file and the second editing operation has been automatically performed on the corresponding second element of the second file, receive a command to reverse the first editing operation on the first element of the first file; and
- in response to the command, automatically retrieve the pre-operation state of the second element of the second file and the operation performed on the second element from the operation store and apply the retrieved state and operation of the second element to the second file to automatically reverse the second editing operation performed on the second element, wherein the reverse editing operation comprises reapplying the state and operation on the second element and storing the state and the operation unit for the reverse editing operation in persistent storage where an editing command produces changes that are not the same for the first file as they are for the second file.
21. The computing system of claim 20 further having stored therein instructions that when executed by the processor cause the computing system to:
- receive a request to perform a second operation on the first element in the first file;
- in response to determine that the second operation is one of an undo and a delete operation, retrieve the object identifying the operation and the first element from the second store;
- retrieve the second element from the first store; and
- apply the second element to the second file.
Type: Application
Filed: Oct 25, 2010
Publication Date: Feb 10, 2011
Applicant: MICROSOFT CORPORATION (Redmond, WA)
Inventor: Ibrahim A. Mohamed (Sammamish, WA)
Application Number: 12/911,014
International Classification: G06F 9/44 (20060101);