ã¯ããã«
ãã®èšäºã§ã¯ãã¢ããªã±ãŒã·ã§ã³ã®ãã¹ãŠã®ã¢ã¯ã·ã§ã³ã«å¯ŸããŠå
ã«æ»ã/ããçŽãæ©èœãæäŸããã©ã€ãã©ãªã«ã€ããŠèª¬æããŸãã è€éãªããŒã¿æ§é ãšè€éãªã¢ã«ãŽãªãºã ã¯ããŠãŒã¶ãŒã®èŠæ±ãŸãã¯ãšã©ãŒã®çµæãšããŠã以åã®ç¶æ
ã«ã©ã®ããã«è»¢éãããããèããããšãªã䜿çšã§ããŸãã
èæ¯
è€éãªããŒã¿çšã®ã°ã©ãã£ãã¯ãšãã£ã¿ãŒãŸãã¯ãã¶ã€ããŒãéçºããããšãããå Žåã¯ãã¢ããªã±ãŒã·ã§ã³å
šäœã§ãµããŒããããå
ã«æ»ã/ããçŽãæ©èœãå®è£
ãããšããæéã®ãããã¿ã¹ã¯ã«çŽé¢ããŠããŸãã åæäœã«ãã¢ã®Doã¡ãœãããšUndoã¡ãœãããå®è£
ããããšã¯ãé»åãããæ·±å»ãªäœããéçºããå Žåãéå±ã§ãšã©ãŒãçºçããããããã»ã¹ã§ãã å®éšã®çµæãå
ã«æ»ã/ããçŽãã®ãµããŒããããžãã¹ããžãã¯ã«å¯ŸããŠééçã«ããæ¹æ³ãèŠã€ããŸããã ãããå®çŸããããã«ããžã§ããªãã¯ã®éæ³ã䜿çšããŸãã
ãã®ãããžã§ã¯ãã¯CodePlexã§å ¬éãããŠããããã誰ã§ã䜿çšãããè²¢ç®ãããã§ããŸãã
ã³ãŒãã®äœ¿çš
è¯ããã¥ãŒã¹ã2ã€ãããŸãã ãŸããããŒã¿ã¯ã©ã¹ã®ãããªãã¯ããããã£ãå€æŽããå¿ èŠã¯ãããŸããã ãã©ã€ããŒããã£ãŒã«ãã¯éåžžãšã¯ç°ãªãæ¹æ³ã§å®£èšããã ãã§ãã 第äºã«ãããžãã¹ããžãã¯ãå€æŽããå¿ èŠããããŸããã å¿ èŠãªã®ã¯ããã®ã³ãŒãã®éå§ãšçµäºããã©ã³ã¶ã¯ã·ã§ã³ã®ããã«ããŒã¯ããããšã ãã§ãã ãããã£ãŠãã³ãŒãã¯æ¬¡ã®ããã«ãªããŸãã
UndoRedoManager.Start( "My Command" ); //
myData1.Name = "Name1" ;
myData2.Weight = 33;
myData3.MyList.Add(myData2);
UndoRedoManager.Commit(); //
ãã®ãããã¯ã®ãã¹ãŠã®å€æŽã1è¡ã®ã³ãŒãã§ããŒã«ããã¯ã§ããŸãã
UndoRedoManager.Undo();
次ã®è¡ã¯ãå ã«æ»ãããå€æŽãå床é©çšããŸãã
UndoRedoManager.Redo();
æäœã«åå ãããªããžã§ã¯ãã®æ°ã䜿çšãããããŒã¿ã®çš®é¡ã«é¢ä¿ãªãããã¹ãŠã®å€æŽã1ã€ã®ãã©ã³ã¶ã¯ã·ã§ã³ã®çµæãšããŠé©çš/ãã£ã³ã»ã«ã§ããããšã«æ³šæããŠãã ããã åç §ãšããŒã¿åã®äž¡æ¹ãå€ã§æäœã§ããŸãã UndoRedoFrameworkã¯ãListããã³DictionaryããŒã¿åããµããŒãããŠããŸãã ããŒã¿ã¯ã©ã¹ã宣èšãããã®æ©èœãå®è£ ããæ¹æ³ãèŠãŠã¿ãŸãããã äžçªäžã®è¡ã¯ããã©ã€ããŒããã£ãŒã«ããç¹å¥ãªãžã§ããªãã¯åUndoRedo <>ã§ã©ããããå¿ èŠããããšããããšã§ãã
class MyData
{
private readonly UndoRedo name = new UndoRedo< string />( "" );
public string string Name
{
get { return name.Value; }
set { name.Value = value ; }
}
//...
}
以äžã¯ãåã®äŸãšæ¯èŒã§ããããã«ãè£å©ãã£ãŒã«ããæã€å€å žçãªããããã£å®£èšã§ãã
class MyData
{
private string name = "" ;
public string string Name
{
get { return name; }
set { name = value ; }
}
//...
}
ãããã®ã³ãŒãã¹ããããã«ã¯ã3ã€ã®éèŠãªéãããããŸãã
- è£å©ãã£ãŒã«ãã«UndoRedo <>ãžã§ããªãã¯åã䜿çšããŠããŸãã ãã£ãŒã«ãèªäœã¯å€ãä¿åããŸããããå€ãä¿åããã³ã³ãããåç §ããŸãã
- ãã«ããŒãã£ãŒã«ãã«ã¢ã¯ã»ã¹ããå¿ èŠãããå Žåãnameã®ä»£ããã«name.Valueã䜿çšããŸãã name.Valueãåãã£ã¹ããªãã§äœ¿çšãããŠããããšãããããŸãã ããã¯ãValueã®ã¿ã€ããåžžã«UndoRedo <...>æ¬åŒ§ã§å²ãŸããŠããããã§ãã
- ãã©ã€ããŒããã£ãŒã«ãã¯èªã¿åãå°çšã§ãã ããã¯ããã£ãŒã«ããå€æŽæ å ±ã®ä¿åãæ åœããã³ã³ããã§ããããã§ãã 芪ãšã³ãã£ãã£ãååšããéãååšããå¿ èŠããããŸãã ã³ã³ããèªäœãå€æŽããå¿ èŠã¯ãããŸãããããã¡ããValueãå€æŽã§ããŸãã
ãã®ãœãªã¥ãŒã·ã§ã³ã¯ãåç §åãšå€åã®äž¡æ¹ã§æ©èœããŸãã
å®è£
å®è£
ã®è©³çŽ°ã«èå³ããªãå Žåã¯ã次ã®ã»ã¯ã·ã§ã³ã«å®å
šã«é²ãããšãã§ããŸãã ãã®èšäºã§ã¯ãããã€ãã®åºæ¬çãªå®è£
ã®è©³çŽ°ã®ã¿ã«æ³šç®ããŸãã 詳现ã«ã€ããŠã¯ããœãŒã¹ã³ãŒããã芧ãã ããã ç°¡æœã§ååã«ã·ã³ãã«ã§ãã ãã¬ãŒã ã¯ãŒã¯ã®äž»ãªã¯ã©ã¹ã¯ãUndoRedoManagerãšUndoRedo <>ã§ãã UndoRedoManagerã¯ãã³ãã³ããæäœããããã®éçã¡ãœãããå«ããã¡ãµãŒãã¯ã©ã¹ã§ãã 以äžã¯ã¡ãœããã®éšåçãªãªã¹ãã§ãã
public static class UndoRedoManager
{
public static IDisposable Start( string commandCaption) { ... }
public static void Commit() { ... }
public static void Cancel() { ... }
public static void Undo() { ... }
public static void Redo() { ... }
public static bool CanUndo { get { ... } }
public static bool CanRedo { get { ... } }
public static void FlushHistory() { ... }
}
UndoRedoManagerã¯ã©ã¹ã«å ããŠã次ã®ãªããžã§ã¯ãããã¬ãŒã ã¯ãŒã¯æäœãæäŸããŸãã
- UndoRedoManager
- æŽå²
- ã³ãã³ã
- å€æŽ
- OldValueãNewValue
ã€ãŸããUndoRedoManagerã¯ã³ãã³ãã®å±¥æŽãä¿æããŸãã åããŒã ã«ã¯ãç¬èªã®ä¿®æ£ãªã¹ãããããŸãã åChangeãªããžã§ã¯ãã«ã¯ãå€ãå€ãšæ°ããå€ãæ ŒçŽãããŸãã Changeãªããžã§ã¯ãã¯ããŠãŒã¶ãŒãå€æŽãå ãããšUndoRedoïŒïŒã¯ã©ã¹ã«ãã£ãŠäœæãããŸãã èŠããŠããããã«ãäžèšã®äŸã§è£å©ãã£ãŒã«ãã宣èšãããšãã«UndoRedoïŒïŒã¯ã©ã¹ã䜿çšããŸããã ãã®ã¯ã©ã¹ã¯ãChangeãªããžã§ã¯ããäœæããããã«å€ãå€ãšæ°ããå€ãèšå®ããŸãã ãã®ã¯ã©ã¹ã®äž»èŠãªéšåã¯æ¬¡ã®ãšããã§ãã
public class UndoRedo : IUndoRedoMember
{
//...
TValue tValue;
public TValue Value
{
get { return tValue; }
set
{
if (!UndoRedoManager.CurrentCommand.ContainsKey( this ))
{
Change change = new Change();
change.OldState = tValue;
UndoRedoManager.CurrentCommand[ this ] = change;
}
tValue = value ;
}
}
//...
}
äžèšã®ã³ãŒãã¯ããã¬ãŒã ã¯ãŒã¯å šäœã®éèŠãªéšåã§ãã åã®ã»ã¯ã·ã§ã³ã§çºè¡šããã«ã¹ã¿ã ããããã£å ã§ã©ã®ããã«å€æŽããã£ããã£ããããã瀺ããŠããŸãã ãžã§ããªãã¯ã®ãããã§ãValueããããã£ã§ã®åå€æãåé¿ã§ããŸãã Changeãªããžã§ã¯ãã¯ãããããã£ãèšå®ããæåã®è©Šã¿ã§ãã®ã³ãã³ãå ã«äœæãããŸãã T.O. ããã©ãŒãã³ã¹ã®äœäžã¯æå°éã«æããããŠããŸãã ãŠãŒã¶ãŒãã³ãã³ããåŒã³åºããšãåChangeãªããžã§ã¯ãã«æ°ããå€ãå ¥åãããŸãã ãã¬ãŒã ã¯ãŒã¯ã¯ãå€æŽãããããããã£ããšã«OnCommitã¡ãœãããèªåçã«åŒã³åºããŸãã
public class UndoRedo : IUndoRedoMember
{
//...
void IUndoRedoMember.OnCommit( object change)
{
((Change)change).NewState = tValue;
}
//...
}
äžèšã§ååŸããå€ãå€ãšæ°ããå€ã¯ããã¬ãŒã ã¯ãŒã¯ã§å ã«æ»ã/ããçŽãæäœãå®è¡ããããã«äœ¿çšãããŸãã ããã«ããããã©ãŒãã³ã¹ãã»ã¯ã·ã§ã³ã§ã¯ãããããã¹ãŠã®ã¢ã¯ã·ã§ã³ãéåžžã«å°ããªããã©ãŒãã³ã¹ã®äœäžãåŒãèµ·ããããšãããããŸãã å®éã®ã¢ããªã±ãŒã·ã§ã³ã§ã¯ã1ïŒ æªæºã«ãªãå ŽåããããŸãã
ã³ã¬ã¯ã·ã§ã³
åè¿°ããããã«ããªã¹ããšèŸæžã®å€æŽã¯ãåçŽãªããããã£ãšåãæ¹æ³ã§é©çš/ãã£ã³ã»ã«ã§ããŸãã ãããã®ç®çã®ããã«ãã©ã€ãã©ãªã¯UndoRedoList <>ããã³UndoRedoDictionary <>ã¯ã©ã¹ãæäŸããŸãããããã®ã¯ã©ã¹ã¯ãæšæºã¯ã©ã¹ã®List <>ããã³Dictionary <>ãšåãã€ã³ã¿ãŒãã§ã€ã¹ãæã¡ãŸãã ãã ãããã®é¡äŒŒæ§ã«ããããããããããã®ã¯ã©ã¹ã®å
éšå®è£
ã¯ãå
ã«æ»ã/ããçŽãæ©èœã«ãã£ãŠè£å®ãããŸãã ããŒã¿ãªããžã§ã¯ãããªã¹ãã宣èšããæ¹æ³ãæ€èšããŸãã
class MyData
{
private readonly UndoRedoList myList= new UndoRedoList();
public UndoRedoList MyList
{
get { return myList; }
}
}
ããã§ã¯ããªã¹ãããã©ã³ã¶ã¯ã·ã§ã³ããµããŒãããŠãããããªã¹ããžã®ãªã³ã¯ã¯ãµããŒãããŠããªããšããããªãã¯ããããŸãã ã€ãŸããèŠçŽ ãè¿œå ãåé€ã䞊ã¹æ¿ããããšãã§ããããããã¹ãŠã®å€æŽãæ£ããå ã«æ»ãããšãã§ããŸãã ãã ãããªã¹ããžã®ãªã³ã¯ãå¥ã®ãªã¹ããžã®ãªã³ã¯ã«å€æŽããããšã¯ã§ããŸãããããã¯èªã¿åãå°çšã§ããããã§ãã
å®éãç§èªèº«ã®çµéšããèšãã°ãã»ãšãã©ã®å Žåãã¯ã©ã¹ãã£ãŒã«ãã«æ ŒçŽãããŠãããªã¹ãã¯èŠªããŒã¿ãªããžã§ã¯ããšåãæ°ã ãååšããããããããåé¡ãåŒãèµ·ããããšã¯ãããŸããã å¥ã®ãã¶ã€ã³ã«æ £ããŠããŠããªã¹ããžã®ãªã³ã¯ãå€æŽãããå Žåã¯ãå°ã泚æãå¿ èŠã§ãã 以äžã«ç€ºãããã«ã2ã€ã®æ±çšUndoRedo <>ãšUndoRedoList <>ãçµã¿åãããŸãã
private readonly UndoRedo<UndoRedoList> myList ...
èŸæžã¯ãªã¹ããšåãããã«äœ¿çšã§ãããããç¹°ãè¿ããŸããã
é害ä¿è·
ã³ãŒãã®å®è¡ããšã©ãŒã«ããäžæãããå ŽåããããŸãã I / Oãšã©ãŒãŸãã¯å éšãšã©ãŒã¯ããšã©ãŒãé©åã«åŠçãããå Žåã§ããããŒã¿ã®æŽåæ§ãæãªãå¯èœæ§ããããŸãã UndoRedoFrameworkã¯ããã§åœ¹ç«ã¡ãããŒã¿ãå ã®ç¶æ ã«æ»ãããšãã§ããŸãã ã³ãŒãããšã©ãŒãªãã§å®è¡ããããšããã¹ãŠã®å€æŽãä¿åãããŸãã ãã以å€ã®å ŽåãããŒã«ããã¯ãè¡ãããŸãã
try
{
UndoRedoManager.Start( "My Command" );
//
//...
UndoRedoManager.Commit();
}
catch (Exception)
{
UndoRedoManager.Cancel();
}
ããã«ãåãæåãåããŠããã®ã³ãŒãã®ãããšã¬ã¬ã³ããªã¬ã³ãŒãã䜿çšã§ããŸãã
using (UndoRedoManager.Start( "My Command" ))
{
//
//...
UndoRedoManager.Commit();
}
ã芧ã®ãšãããæåŸã®äŸã§ã¯ã倱æããå€æŽã®ããŒã«ããã¯ã¯ãããŸããã ããã¯ãã³ãŒãã®å®è¡ãCommitã¡ãœããã®åŒã³åºãã«å°éããªãå Žåã«ããŒã«ããã¯ãèªåçã«å®è¡ããããšããäºå®ã«ããå¯èœã§ãã ãšã©ãŒã®å Žåã ãã®åäœã¯ãå ã«æ»ã/ããçŽãæ©èœãå¿ èŠãªãå Žåã§ããé«åºŠãªä¿¡é Œæ§ãæäŸããŸãã ãšã©ãŒãçºçãããšãã¢ããªã±ãŒã·ã§ã³ã¯å埩ããåäœç¶æ ãä¿åããŸãã
UIãšããŒã¿ã®åæ
è€éãªUIã¯ãå€ãã®å ŽåãModel-View-Controllerãã¿ãŒã³ã䜿çšããŠå®è£ ãããŸãã åçŽãªWindowsã¢ããªã±ãŒã·ã§ã³ã§ã¯ãããŒã¿å±€ãšãã¬ãŒã³ããŒã·ã§ã³å±€ã®ã¿ããããŸãã ãã ããã©ã¡ãã®å Žåã§ããéçºè ã¯ç¹å®ã®ã³ãŒããäœæããŠUIãšããŒã¿ãåæããå¿ èŠããããŸãã ãã¢ãããžã§ã¯ãã«ã¯ã3ã€ã®UIã³ã³ãããŒã«ãæã€ã¡ã€ã³ãã©ãŒã ããããŸãã
- EditCityControl
- CitiesChartControl
- UndoRedoControlã¯ãéœåžããŒã¿ã«é©çš/ãã£ã³ã»ã«ã§ããã³ãã³ãã®2ã€ã®ãªã¹ãã衚瀺ããŸãã
ãããã®ã³ã³ãããŒã«ã¯ãéœåžã®åãããŒã¿ã®ç°ãªãè¡šçŸã瀺ããŸãã å®éã®ã¢ããªã±ãŒã·ã§ã³ãã€ãŸã ãã¶ã€ããŒãŸãã¯ãšãã£ã¿ãŒã¯ãå€æ°ã®ãã®ãããªã³ã³ãããŒã«ã§æ§æãããŠããŸãã ããŒã¿åæã®åé¡ããããŸãã1ã€ã®ãšã³ãã£ãã£ãå€æŽãããšããžãã¹ããžãã¯ã«åŸã£ãŠä»ã®ãšã³ãã£ãã£ãå€æŽã§ãããããã³ã³ãããŒã«ã®1ã€ãããŒã¿ãå€æŽããå Žåããã¹ãŠã®ã³ã³ãããŒã«ãããŒã¿ãæŽæ°ããå¿ èŠããããŸãã
ããã§ãäœãå¿ èŠã§ããïŒ ãŸããåæãå®è¡ããã³ãŒãã¯ãã³ã³ãããŒã«ãŸãã¯ããžãã¹ããžãã¯ã®ã©ããã§è¡ãããå€æŽãæ€åºããå¿ èŠããããŸãã 次ã«ããã©ãŒã äžã®ã³ã³ãããŒã«ããªããŒãããŠãæ°ããããŒã¿ã衚瀺ããå¿ èŠããããŸãã
ãã®åé¡ã¯ããŸããŸãªæ¹æ³ã§è§£æ±ºã§ããŸã-è¯ãé¢ãšæªãé¢ã§ãã ç§ã¯ãã³ãŒããéŠå°Ÿäžè²«ããªãããã«åªåããŠããŸãã ãã©ãŒã ã¯ã³ã³ããŒãã³ãã«ã€ããŠå€ããç¥ãå¿ èŠã¯ãªããã³ã³ããŒãã³ãã¯ãäºãã«ã€ããŠç¥ãå¿ èŠããããŸããã æ£çŽãªãšããããã©ãŒã ã«æ°ããã³ã³ããŒãã³ããè¿œå ãããã³ã«åæã³ãŒããæžãã®ã¯é¢åã§ãã ãã®èšäºã®ãã¢ãããžã§ã¯ããã芧ãã ãããéåžžã«ã·ã³ãã«ãªãã©ãŒã ã衚瀺ãããŸãã
public partial class DemoForm : Form
{
public DemoForm()
{
InitializeComponent();
// init data
CitiesList cities = CitiesList.Load();
chartControl.SetData(cities);
editCityControl.SetData(cities);
}
}
ãã©ãŒã ã¯ãåæããŒã¿ãã³ã³ãããŒã«ã«ããŒãããã ãã§ãã ãããã£ãŠããã©ãŒã ã¯åæããŸããã ã³ã³ãããŒã«ã€ãã³ããã³ãã©ãŒãåæããŸãããããšãã°ãEditCityControlã«ã¯ãRemove Cityããã¿ã³ã€ãã³ããã³ãã©ãŒããããŸãã
private void removeCity_Click( object sender, EventArgs e)
{
if (CurrentCity != null )
{
UndoRedoManager.Start( "Remove " + CurrentCity.Name);
cities.Remove(CurrentCity);
UndoRedoManager.Commit();
}
}
ããã«ãããããããããŒã¿ãå€æŽããããšããã©ãŒã äžã®ãã¹ãŠã®ã³ã³ãããŒã«ãæŽæ°ãããŸãã ããã¯ãããŒã¿ãå€æŽãŸãã¯ãã£ã³ã»ã«ããããšãã«çºçããç¹å¥ãªãã¬ãŒã ã¯ãŒã¯ã€ãã³ãã«ãããã®ã§ãã ããã«ããããã¹ãŠã®UIæŽæ°ã³ãŒãã1ãæã§ç®¡çã§ããŸãã
public EditCityControl()
{
//...
UndoRedoManager.CommandDone += delegate { ReloadData(); };
//...
}
ãããã£ãŠãCommandDoneã€ãã³ãã«ãµãã¹ã¯ã©ã€ãããã ãã§ãã³ã³ãããŒã«ã¯å€ãã®åé¡ã解決ããŸãã ä»ã®ã³ã³ããŒãã³ãã§å€æŽãçºçãããšãã³ã³ãããŒã«ã¯åžžã«æŽæ°ãããããŒã¿ã衚瀺ããŸãã ããã«ããŠãŒã¶ãŒãå ã«æ»ããŸãã¯ããçŽãæäœãå®è¡ãããšãæŽæ°ãå®è¡ãããŸãã
æ§èœ
ããã©ãŒãã³ã¹ãšæé©åã¯åžžã«äºãã«ç«¶ãåããŸã...ãããŠããããéçºè
ã®ã¬ãŒã«ãã¬ã³ããšèªç±æéã®ããã«ç«¶ããŸãã ãã®èšäºã§ã¯ãæåã®2ã€ã®èŠå ã®ã¿ãæ€èšããŸãã 幞ããªããšã«ããšãã£ã¿ãŒããã¶ã€ããŒã¯ããªã¢ã«ã¿ã€ã ã·ã¹ãã ãšã¯ç°ãªããã»ãšãã©ã®æäœã«å¯ŸããŠå³ããããã©ãŒãã³ã¹èŠä»¶ãèšå®ããŠããŸããã ããã€ãã®ã±ãŒã¹ã«ã€ããŠã¯ããŸã çãããã©ãŒãã³ã¹åæãè¡ããŸãã
- ããŒã¿ãèªã¿åã£ãŠããããã©ãŒãã³ã¹ãäœäžããããšã¯ãããŸããã ãžã§ããªãã¯ã®ãããã§ãåå€æãšããã¯ã¹å/ããã¯ã¹å解é€ãåé¿ãããŸãã å€ã¯ããã«è¿ãããŸãããã®å Žåãå€æŽå±¥æŽãæ€çŽ¢ããå¿ èŠã¯ãããŸããã
- ããããã£ãå€æŽããããšãããšãå éšããã·ã¥ããŒãã«ã§åäžã®æ€çŽ¢ãè¡ãããŸãã ãŸããããããã£ãæåã«å€æŽããããšãããšããã®å€ãå€æŽå±¥æŽã«ã³ããŒãããŸãã
- ãªã¹ããå€æŽããããšãããšãå éšããã·ã¥ããŒãã«ã§åäžã®æ€çŽ¢ãè¡ãããŸãã ããã«ãåããŠãªã¹ããå€æŽããããšãããšããã¬ãŒã ã¯ãŒã¯ã¯ãªã¹ãã®ã³ããŒãäœæããããããªã¹ãå€æŽå±¥æŽã«æžã蟌ã¿ãŸãã
- èŸæžãå€æŽããããšãããšãå éšããã·ã¥ããŒãã«ã§1åæ€çŽ¢ããã2ã€ã®å°ããªãªããžã§ã¯ããäœæãããŸãã ãã¬ãŒã ã¯ãŒã¯ãèŸæžã®å®å šãªã³ããŒãäœæããããšã¯ãããŸããã 代ããã«ãå€æŽãå±¥æŽã«çŽæ¥ä¿åããã ãã§ãã
- å ã«æ»ãæ¹æ³ãšããçŽãæ¹æ³ã¯ãå€æŽãããå€ã®ã¿ã埩å ããŸãã å€ãå€æŽããã«ã¢ã¯ã·ã§ã³ãå®è¡ããããšã¯ãããŸããã
ã€ãŸããããã©ãŒãã³ã¹ãå€§å¹ ã«äœäžãããããšãªãã次ã®ããšãã§ããŸãã
- ããããã£ãèªã¿åããå€æŽããŸãã
- äžèŠæš¡ã®ãªã¹ããèªãã§å€æŽããŸãã
- 倧èŠæš¡ãªèŸæžãèªãã§é©åºŠã«ä¿®æ£ããŸãã
ãã ããè€æ°ã®å€§ããªãªã¹ããé »ç¹ã«å€æŽãããšãããã©ãŒãã³ã¹ãäœäžããå ŽåããããŸãã ãã®å ŽåãããŒã¿èšèšãæ¹èšãã倧ããªãªã¹ããéšåã«åå²ããããšããå§ãããŸãã
以äžã«ãå®éã®ã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãã¹ãããŒã¿ã瀺ããŸãã ãã®äŸã§ã¯ããŠãŒã¶ãŒã¯ãã¶ã€ããŒã§ã°ã©ãã£ãã¯ãªããžã§ã¯ãã®ãµã€ãºãå€æŽããŸãã å¹³åçãªæäœã§ã¯ã5500åã®èªã¿åãã70åã®ããããã£ã®å€æŽã4åã®èŸæžã®å€æŽãå®è¡ãããŸãã å ã«æ»ã/ããçŽãã«é¢é£ããäœåãªäœæ¥ã¯ãã¹ãŠ0.7ããªç§æªæºã§ãã ãã¹ãçµæã¯æ¬¡ã®ãšããã§ãã
åŒã³åºãåæ° | åèšããªç§ | åèšïŒ | |
ç»åã®ãµã€ãºå€æŽãšåæç» | 159.328 | 100ïŒ | |
å ã«æ»ã/ããçŽãæäœã®å®è¡ | 0.677 | 0.425ïŒ | |
ããŒã ã®åæå | 1 | 0.008 | 0.005ïŒ |
ããããã£ã®èªã¿åã | 5461 | 0.114 | 0.071ïŒ |
ããããã£ã¬ã³ãŒã | 71 | 0.026 | 0.017ïŒ |
èŸæžã®å€æŽ | 4 | 0.065 | 0.041ïŒ |
ããŒã å®æ | 1 | 0.463 | 0.291ïŒ |
èšæ¶
UndoRedoFrameworkã¯ãå€æŽãä¿åããããã«ã®ã¿ã¡ã¢ãªã䜿çšããŸãã ã¡ã¢ãªæ¶è²»ã¯ããŒã¿ã®åèšãµã€ãºã«äŸåãããå€æŽãããããŒã¿ã®éã«ã®ã¿äŸåããŸãã ã€ãŸã åèšããŒã¿ãµã€ãºãæ°ã¡ã¬ãã€ãã§ãã£ãŠããå€æŽå±¥æŽã®ãµã€ãºã¯æ°ãããã€ãã«ãªããŸãã ã¹ããŒãªãŒã®ãµã€ãºã¯ããã©ã«ãã§å¶éãããŠããŸããããéçããããã£UndoRedoManager.MaxHistorySizeã䜿çšããŠå¶éã§ããŸãã ãã®ããããã£ã¯ãå±¥æŽã«ä¿åãããæäœã®æ°ã決å®ããŸãã æå®ããæ°ã®æäœã«éãããšãå€ãæäœã¯å±¥æŽããåé€ãããŸãã
ãŸãããªã³ã¯ãšã¬ããŒãžã³ã¬ã¯ã·ã§ã³ã«é¢é£ããããã€ãã®ãã€ã³ãã«ã€ããŠã説æããŸãããã£ãŒã«ãã«æ ŒçŽãããŠãããªã³ã¯ã¯ãå¥ã®ãªã³ã¯ã«çœ®ãæããããšãã§ããŸãã ãã®ãªããžã§ã¯ããžã®ä»ã®åç §ããªãå Žåãã¬ããŒãžã³ã¬ã¯ã¿ãŒã«ããåé€ã®åè£ã«ãªããŸãã 以åã®ç¶æ ã«æ»ãããã®ã§ãããã¯ç§ãã¡ã«ã¯é©ããŠããŸããã 幞ããªããšã«ããªã³ã¯ã¯å±¥æŽã«ä¿åããããªããžã§ã¯ããããŒã¿ã¢ãã«ã§äœ¿çšãããªããªã£ãŠãããªããžã§ã¯ãã¯ã¬ããŒãžã³ã¬ã¯ã¿ã«ãã£ãŠåé€ãããŸããã
T.O. å€ããªããžã§ã¯ãã¯ã察å¿ããæäœãå±¥æŽã«ä¿åããããŸã§åé€ã®åè£ã«ãªããŸããã ããã«ãããããŒã¿ã®æŽåæ§ãä¿èšŒãããŸãããã¡ã¢ãªäœ¿çšéãè©äŸ¡ããéã«ã¯ãã®ããšã«çæããå¿ èŠããããŸãã
ãžã§ããªãã¯ãŸãã¯ãããã·
å ã«æ»ã/ããçŽãæ©èœãå®è£ ããå¥ã®æ¹æ³ã¯ããããã·ã䜿çšããããšã§ãã ãããã·ã¯ã.NETã®ãåŒã³åºãã³ã³ããã¹ããæ©èœã䜿çšããŠãããããã£åŒã³åºããã€ã³ã¿ãŒã»ããããŸãã ãã®ã¢ãããŒãã«ãããå€æŽã«é¢ããæ å ±ãä¿åãããã®åŸå€æŽããã£ã³ã»ã«ã§ããŸãã ãã®ã¢ãããŒããå®è£ ããèšäºããã®ãµã€ãã§èŠã€ããããšãã§ããŸãã ãããã¯ãã®åéã®å°é家ã«ãã£ãŠæžãããè¯ãèšäºã§ãã 次ã«ããããã®ã¢ãããŒãã®éãã«ã€ããŠèª¬æããŸãã
ãããã·ãšã¯ãå€æŽãäœããã®ãå€éšãæ¹æ³ã§ååãããããšãæå³ããŸãã ããããã£ã«ãã£ãŠå®è¡ãããåã«ãã»ãã¿ãŒããããã£ã®åŒã³åºããã€ã³ã¿ãŒã»ããããŸãã å€æŽã®å»æ¢ãå€éšæäœã§ãã ããããã£ã®ä»¥åã®å€ã埩å ããããã«ããããã·ã¯é©åãšæãããããããã£ã®ã»ãã¿ãŒãåŒã³åºããŸãã ãã®å ŽåãããŸããŸãªå¯äœçšãçºçããå¯èœæ§ããããŸããããããã£ã®å€æŽãä»ã®ããããã£ã«åœ±é¿ããå Žåã¯ã©ããªããŸããïŒ ããããã£ãéç¥ã€ãã³ããçæããå Žåã¯ã©ããªããŸããïŒ ãã®ããããã£ããå€ããŸã 埩å ãããŠããªãå¥ã®ããããã£ã«é¢é£ä»ããããããžãã¹ããžãã¯ã䜿çšããå Žåã¯ã©ããªããŸããïŒ ãããã£ãŠããè±å¯ãªãããããã£ã䜿çšãããšãå ã«æ»ã/ããçŽããäºæããªãçµæãæãå¯èœæ§ããããŸãã
äžæ¹ããžã§ããªãã¯ã¯å®å šã«æ©èœããŸãã ãã®ææ³ã¯ãããããã£ãšãã®ããžãã¯ã«åœ±é¿ãäžããããšãªããå€æŽããã£ããã£ããŠåŸ©å ããŸãã å€æŽã埩å ããããã»ã¹ã¯å®å šã«ç®ã«èŠããŸããã ããžãã¹ã«ãŒã«ãšéç¥ã¯è€è£œãããŸããã ãããã£ãŠãå€æŽã®ãªã«ããªäžã«ããŒã¿ã®æŽåæ§ãæãªãããããšã¯ãããŸããã
ãããªãä»äº
ç§ã¯è¿œå æ©èœãéçºãããããã¿ã€ããäœæããŠããŸãïŒ
- ããŒã¿ã®å€æŽãåå¥ã«ä¿åããããåé¢ãããå€æŽãªããžããªãã®å®è£ ã ããã¯ããŠãŒã¶ãŒãåããã¥ã¡ã³ãã®å€æŽãåå¥ã«å€æŽ/å ã«æ»ãããšãã§ãããã«ãããã¥ã¡ã³ãã¢ããªã±ãŒã·ã§ã³ã§äœ¿çšã§ããŸãã
- ãã©ã³ã¶ã¯ã·ã§ã³å ã®ãã¡ã€ã«ã®ãµããŒãã å Žåã«ãã£ãŠã¯ãããŒã¿åŠçã§ã¯ããªãœãŒã¹ãã¡ã€ã«ãåã«äžæãã¡ã€ã«ãªã©ã®äžéãã¡ã€ã«ã䜿çšããå ŽåããããŸãã ãã®å Žåããããã®ãã¡ã€ã«ã®ããŒãžã§ã³ã¯ã¡ã¢ãªå ã®ããŒã¿ãšäºææ§ããªããã°ãªãããå€æŽã¯å ã«æ»ãããšãã§ããŸãã ãã¬ãŒã ã¯ãŒã¯ã¯ãã¡ã¢ãªå ã®ããŒã¿ã®å€æŽãšãšãã«ãã¡ã€ã«ãžã®å€æŽãå ã«æ»ãããšãã§ããŸãã
- åã®2ã€ã®ã¿ã¹ã¯ã®ãã«ãã¹ã¬ãããµããŒãã
ãã®ãããžã§ã¯ãã¯CodePlexã§å ¬éãããŠããããã誰ã§ã䜿çšãããè²¢ç®ãããã§ããŸãã