.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Imran Ghani
Post New Web Links

Problem implementing Undo/redo functionality in an UML editor

Posted By:      Posted Date: October 02, 2010    Points: 0   Category :WPF
 
Ok so I will try to make this short.
I am implementing undo/redo functionality in an UML diagram editor. I have objects of classes, all implementing my VisualUMLComponent interface.
I have a class, VisualUMLCollection, implementing ObservableCollection<VisualUMLComponent> to keep track of all objects (classes, interfaces, arrows, comments, abstracts, etc) to draw on my Canvas object. This works fine.

Now to the point.
I try to implement undo/redo, with having each object having a pointer to a PreviousState and NextState of type VisualUMLComponent. As such, when I change an object, I can first Clone() it, and insert it at the proper place in the doubly linked list.
I have made class for the undo/redo functionality. It has two stacks undoStack and redoStack of type Stack<DiagramChange>. DiagramChange class represents changes in the diagram. It can have three types: Add, Remove and Alter, for when adding an object, removing an object, or changing an object respectively.

My problem is with the code below, that I get an ArgumentOutOfRangeException    at System.Windows.Media.VisualCollection.Insert(Int32 index, Visual visual), when I try to .Add an old state object to my VisualUMLCollection:

public
 void


View Complete Post


More Related Resource Links

Embed Youtube inside Ajax Html Editor- problem

  

Hi,

When inserting a simple embed of youtube inside the ajax editor, on firefox and chrome problems occur. On the other hand on internet explorer 8 everything works fine. I found this solution http://www.nopcommerce.com/boards/t/4228/bug-in-ajax-html-editor.aspx . 

My question is where do I find the DesignPanel.pre.js ?


Thanks,

Roderick Vella


BIDS undo/redo buttons

  
In MS Visual Studio 2008 on Windows Server 2008 or BIDS my undo / redo buttons are grayed out when I am editing an SSIS package. I would like to know if there is a way to enable this. I have searched and searched everything looks retardedly complicated to get this working. Help? Anyone, anyone... Microsoft are you there?

Html editor word wrap problem

  
I created an html editor which uses an iframe for designing. The iframe doesnt wraps the text within it.... but the text keeps on extending in the same row towards the right. i tried setting scrolling='no' but it didnt work... tried word-wrap:break-word but thats also of no use........ please help! 

Seeking Advice for Implementing Document Library Functionality

  
I have an assignment to implement a mechanism in WSS 3.0 to deliver files from a document library as PDF when the user selects a particular file.  I have a third party tool for PDF conversion which I can use to do the conversion, and I have put together some C# code for the API that does what I need as far as that goes. Where I am having trouble is deciding how to implement this in Sharepoint.  The multiple steps involved in kicking off a workflow would confuse many users, especially those not used to Sharepoint.  I would like to find a solution that would involve a single click on the chosen document. I know my way around ASP.NET, but Sharepoint is less familiar.  I am not afraid to jump in, and am not asking anyone to write code for me, but I am trying to get traction on the Sharepoint road.  I would appreciate any thoughts others have as to a direction I might take. Thanks.

Problem with AjaxToolkit Editor

  

hi

i used Ajax Editor in Sevral web pages in som pages the buttons of ForColor and BackColor  dont show the Color Palent

i dont know if it has any special properties or not. i would appreciate if you could help me

thanks anyway

 


Problem with property editor of a web user control

  

Hi,

I created an asp.net user control with a property named 'TabList' , the property is visible when I place my control on a page, the default editor for this property was a simple text box, but I needed a DropDownList for editing the TabList property of my control, so I added following code to implement it:

<Category("Navigation Bar"), Editor(GetType(DropDownList), GetType(System.Drawing.Design.UITypeEditor)), Description("List of Tabs"), DefaultValue("SHISHIR WAHI")> Public Property TabList() As String
        Get
            Return _tablist
        End Get

        Set(ByVal value As String)
            _tablist = value
        End Set
    End Property

The Category() and DefaultValue() are working fine but Editor() and Description() are not, what could be the problem?

Please help.


Functionality problem

  

I have a textbox on my form that I have included an ajax extension to. This control is for entering a birth dat. I also have a validation control associated with those control. My dilemna is that I have to click twice in order to submit this form. Has anyone ever ran into this problem before. Any recommendations. Thanks!!!


How to Implement Undo and Redo in c#

  

Hi,

    I have a picture box in my page..i am drawing some graphics like circle ,ellipse and arrow on the picture box in the picturebox_mouseup event .I need to undo or redo the drawing that i have drawn on the picture box after clicking undo or redo button..i don't know how to implement this in my page..Can you please help me with code...Here is my code in the picturebox mouse_up event..

  private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
          
            blnDrawing = false;
            blnErasing = false;
            a =e.X;
            b=e.Y;
            
              if (circle == 1 || text == 1 || ellipse == 1 || arrow == 1)
                {

                   

undo/redo

  
how do i implement undo/redo features in C#

SharePoint Brnading: Problem with Web Part Editor Pane

  

Hi All,

 

I am facing a problem. With custom Master Page when I set the Width of "Body Container" to 1020px, the Editor pane is not shown on screen (it moves to extreme right and Editor Pane is not visible on screen).

I have added lot of DIV control, Code is below

 

<%@ Master language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="MUISelector" src=

SharePoint Branding: Problem with Web Part Editor Pane

  

Hi All,

 

I am facing a problem. With custom Master Page when I set the Width of "Body Container" to 1020px, the Editor pane is not shown on screen (it moves to extreme right and Editor Pane is not visible on screen).

I have added lot of DIV control, Code is below

 

<%@ Master language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="MUISelector" src=

how to create undo / redo function into my form

  
Im new to VB but have a strong aptitude for code and with a bit of guidence I can usally get it done. Is this function tought to get working?

how to create undo / redo function into my form

  
I posted this in the wrong area sorry for that..
Im new to VB but have a strong aptitude for code and with a bit of guidence I can usally get it done. Is this function tought to get working?

Content Editor text format functionality lost after deploying branding solution package

  

I've got two identical SharePoint 2010 servers.  One is a dev box and one is production.  We've got a branding solution package.  After deploying the package on the production server, when I go into edit a page, the text format functionality in the content editor works fine, i.e. I can change font, font size, font color, etc.  However, when I deploy the solution package on the dev server and then attempt to edit a page, the text format functionality is disabled/broken.  I can utilize bold, underline, or italicize but cannot change font, font color, font size, etc. 

I've copied a site collection from my production site (which works perfectly) over to the dev site with the same results, meaning once on the dev box, the copied site collection no longer has editing functionalilty in the content editor. Permissions are set the same on both boxes and as mentioned, editing works fine until deployment of the solution package on the dev box.   Any help would be greatly appreciated. 

Could Visual Studio installed on my Dev box cause this?


TJCNAVL

implementing multilanguages applications - binding problem

  

Hi I have to add support for other languages in my application. Almost entire application is ready however I have a problem with translating a tooltip which is 'loaded' from resourcesDictioanry file. For couple element in my application I have the same tooltip. So instead of writting the same code over and over again I decied to put a tooltip into ResourceDitionary. My tooltip looks like that

<ToolTip x:Key="BasicTooltip" Background="#E3EFFF" MaxWidth="350

HTML Editor problem

  

Hi

Not sure whats happening but the default html 'Rich text Editor' is missing a save button anywhere in the editor. Anybody have any idea how to troubleshoot this. Tried different versions or IE and different computers but no help. Alternatively any other free editor i can install?

Thanks for any help

Gavin


Problem with Implementing Transport Message Security with WCF 4.0 and VS 2010

  

Hi,

I'm working on a tree tier project in this solution I have tree project ,

the Service layer,the ServiceContract Layer and presentation layer

At first I implemented it without security and it worked  properly,

But when I tried to add Transport Message security with SSL I faced some problem here is some of my code :

web.config in service layer:

 

<br/>
 <br/>
<system.serviceModel><br/>
  <bindings><br/>
   <basicHttpBinding><br
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend