@@ -384,6 +384,8 @@ private void NewProject()
384
384
385
385
awaitClosingArchive . ContinueWith ( t =>
386
386
{
387
+ TokenStore . GetInstance ( ) . ResetCancellationToken ( TokenStore . TOKEN_SOURCE_THUMBNAIL_SLICE ) ;
388
+
387
389
RemoveMetaData ( ) ;
388
390
Program . ProjectModel . New ( ) ;
389
391
Invoke ( new Action ( ( ) =>
@@ -2882,6 +2884,9 @@ private void MoveItemsToProc(object threadParams)
2882
2884
newIndex ++ ;
2883
2885
}
2884
2886
2887
+ String gid = Guid . NewGuid ( ) . ToString ( ) ;
2888
+ TokenStore . GetInstance ( ) . ResetCancellationToken ( TokenStore . TOKEN_SOURCE_MOVE_ITEMS ) ;
2889
+
2885
2890
AppEventHandler . OnGlobalActionRequired ( this , new GlobalActionRequiredEvent (
2886
2891
Program . ProjectModel ,
2887
2892
0 ,
@@ -2891,9 +2896,13 @@ private void MoveItemsToProc(object threadParams)
2891
2896
UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages ,
2892
2897
AppEventHandler . OnGeneralTaskProgress ,
2893
2898
AppEventHandler . OnPageChanged ,
2894
- TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_MOVE_ITEMS ) . Token
2895
- )
2896
- ) ) ;
2899
+ TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_MOVE_ITEMS ) . Token ,
2900
+ false ,
2901
+ true ,
2902
+ gid
2903
+ ) ,
2904
+ gid
2905
+ ) ) ;
2897
2906
2898
2907
2899
2908
newIndex = tparams . NewIndex ;
@@ -3069,8 +3078,23 @@ private void MovePageProc(object movePagesThreadParams)
3069
3078
AppEventHandler . OnPageChanged ( this , new PageChangedEvent ( originalPage , null , PageChangedEvent . IMAGE_STATUS_CHANGED ) ) ;
3070
3079
}
3071
3080
3081
+ String gid = Guid . NewGuid ( ) . ToString ( ) ;
3082
+ TokenStore . GetInstance ( ) . ResetCancellationToken ( TokenStore . TOKEN_SOURCE_MOVE_ITEMS ) ;
3083
+
3072
3084
AppEventHandler . OnArchiveStatusChanged ( this , new ArchiveStatusEvent ( Program . ProjectModel , ArchiveStatusEvent . ARCHIVE_FILE_UPDATED ) ) ;
3073
- AppEventHandler . OnGlobalActionRequired ( this , new GlobalActionRequiredEvent ( Program . ProjectModel , GlobalActionRequiredEvent . MESSAGE_TYPE_INFO , "Page order changed. Rebuild pageindex now?" , "Rebuild" , GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD , UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages , AppEventHandler . OnGeneralTaskProgress , AppEventHandler . OnPageChanged , TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) . Token , false , true ) ) ) ;
3085
+ AppEventHandler . OnGlobalActionRequired ( this ,
3086
+ new GlobalActionRequiredEvent ( Program . ProjectModel ,
3087
+ GlobalActionRequiredEvent . MESSAGE_TYPE_INFO ,
3088
+ "Page order changed. Rebuild pageindex now?" ,
3089
+ "Rebuild" ,
3090
+ GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD ,
3091
+ UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages ,
3092
+ AppEventHandler . OnGeneralTaskProgress ,
3093
+ AppEventHandler . OnPageChanged ,
3094
+ TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) . Token ,
3095
+ false ,
3096
+ true , gid )
3097
+ , gid ) ) ;
3074
3098
3075
3099
Program . ProjectModel . IsChanged = true ;
3076
3100
} ) ) ;
@@ -4559,7 +4583,25 @@ private void ToolButtonRemoveFiles_Click(object sender, EventArgs e)
4559
4583
AppEventHandler . OnArchiveStatusChanged ( this , new ArchiveStatusEvent ( Program . ProjectModel , ArchiveStatusEvent . ARCHIVE_FILE_DELETED ) ) ;
4560
4584
}
4561
4585
4562
- AppEventHandler . OnGlobalActionRequired ( this , new GlobalActionRequiredEvent ( Program . ProjectModel , 0 , "Page order changed. Rebuild pageindex now?" , "Rebuild" , GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD , UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages , AppEventHandler . OnGeneralTaskProgress , AppEventHandler . OnPageChanged , TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_GLOBAL ) . Token , false , true ) ) ) ;
4586
+ String gid = Guid . NewGuid ( ) . ToString ( ) ;
4587
+ TokenStore . GetInstance ( ) . ResetCancellationToken ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) ;
4588
+
4589
+ AppEventHandler . OnGlobalActionRequired ( this ,
4590
+ new GlobalActionRequiredEvent ( Program . ProjectModel ,
4591
+ 0 ,
4592
+ "Page order changed. Rebuild pageindex now?" ,
4593
+ "Rebuild" ,
4594
+ GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD ,
4595
+ UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages ,
4596
+ AppEventHandler . OnGeneralTaskProgress ,
4597
+ AppEventHandler . OnPageChanged ,
4598
+ TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) . Token ,
4599
+ false ,
4600
+ true ,
4601
+ gid ) ,
4602
+ gid
4603
+ )
4604
+ ) ;
4563
4605
4564
4606
//Program.ProjectModel.UpdatePageIndices();
4565
4607
}
@@ -4583,7 +4625,25 @@ private void TypeSelectionToolStripMenuItem_Click(object sender, EventArgs e)
4583
4625
{
4584
4626
if ( PagesList . SelectedItems . Count > 1 )
4585
4627
{
4586
- HandleGlobalActionRequired ( null , new GlobalActionRequiredEvent ( Program . ProjectModel , 0 , "Page type changed. Rebuild pageindex now?" , "Rebuild" , GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD , UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages , AppEventHandler . OnGeneralTaskProgress , AppEventHandler . OnPageChanged , TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_GLOBAL ) . Token ) ) ) ;
4628
+ String gid = Guid . NewGuid ( ) . ToString ( ) ;
4629
+
4630
+ AppEventHandler . OnGlobalActionRequired ( null ,
4631
+ new GlobalActionRequiredEvent ( Program . ProjectModel ,
4632
+ 0 ,
4633
+ "Page type changed. Rebuild pageindex now?" ,
4634
+ "Rebuild" ,
4635
+ GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD ,
4636
+ UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages ,
4637
+ AppEventHandler . OnGeneralTaskProgress ,
4638
+ AppEventHandler . OnPageChanged ,
4639
+ TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) . Token ,
4640
+ false ,
4641
+ true ,
4642
+ gid
4643
+ ) ,
4644
+ gid
4645
+ )
4646
+ ) ;
4587
4647
}
4588
4648
else
4589
4649
{
@@ -4927,7 +4987,25 @@ private void ToolButtonEditImageProps_Click(object sender, EventArgs e)
4927
4987
4928
4988
if ( pageIndexUpdateNeeded )
4929
4989
{
4930
- AppEventHandler . OnGlobalActionRequired ( this , new GlobalActionRequiredEvent ( Program . ProjectModel , 0 , indexRebuildMessage , "Rebuild" , GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD , UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages , AppEventHandler . OnGeneralTaskProgress , AppEventHandler . OnPageChanged , TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_GLOBAL ) . Token ) ) ) ;
4990
+ String gid = Guid . NewGuid ( ) . ToString ( ) ;
4991
+ TokenStore . GetInstance ( ) . ResetCancellationToken ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) ;
4992
+
4993
+ AppEventHandler . OnGlobalActionRequired ( this ,
4994
+ new GlobalActionRequiredEvent ( Program . ProjectModel ,
4995
+ 0 ,
4996
+ indexRebuildMessage ,
4997
+ "Rebuild" ,
4998
+ GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD ,
4999
+ UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages ,
5000
+ AppEventHandler . OnGeneralTaskProgress ,
5001
+ AppEventHandler . OnPageChanged ,
5002
+ TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) . Token ,
5003
+ false ,
5004
+ true ,
5005
+ gid
5006
+ ) ,
5007
+ gid
5008
+ ) ) ;
4931
5009
}
4932
5010
}
4933
5011
}
@@ -5096,7 +5174,26 @@ private void ToolButtonSetPageType_ButtonClick(object sender, EventArgs e)
5096
5174
{
5097
5175
if ( PagesList . SelectedItems . Count > 1 )
5098
5176
{
5099
- AppEventHandler . OnGlobalActionRequired ( this , new GlobalActionRequiredEvent ( Program . ProjectModel , 0 , "Page type changed. Rebuild pageindex now?" , "Rebuild" , GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD , UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages , AppEventHandler . OnGeneralTaskProgress , AppEventHandler . OnPageChanged , TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_GLOBAL ) . Token ) ) ) ;
5177
+ String gid = Guid . NewGuid ( ) . ToString ( ) ;
5178
+ TokenStore . GetInstance ( ) . ResetCancellationToken ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) ;
5179
+
5180
+
5181
+ AppEventHandler . OnGlobalActionRequired ( this ,
5182
+ new GlobalActionRequiredEvent ( Program . ProjectModel ,
5183
+ 0 ,
5184
+ "Page type changed. Rebuild pageindex now?" ,
5185
+ "Rebuild" ,
5186
+ GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD ,
5187
+ UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages ,
5188
+ AppEventHandler . OnGeneralTaskProgress ,
5189
+ AppEventHandler . OnPageChanged ,
5190
+ TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_UPDATE_PAGE_INDEX ) . Token ,
5191
+ false ,
5192
+ true ,
5193
+ gid
5194
+ ) ,
5195
+ gid
5196
+ ) ) ;
5100
5197
}
5101
5198
else
5102
5199
{
@@ -6776,7 +6873,24 @@ private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
6776
6873
6777
6874
if ( pagesUpdated > 0 )
6778
6875
{
6779
- AppEventHandler . OnGlobalActionRequired ( this , new GlobalActionRequiredEvent ( Program . ProjectModel , 0 , "Page order changed. Rebuild pageindex now?" , "Rebuild" , GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD , UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages , AppEventHandler . OnGeneralTaskProgress , AppEventHandler . OnPageChanged , TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_GLOBAL ) . Token ) ) ) ;
6876
+ String gid = Guid . NewGuid ( ) . ToString ( ) ;
6877
+
6878
+ AppEventHandler . OnGlobalActionRequired ( this ,
6879
+ new GlobalActionRequiredEvent ( Program . ProjectModel ,
6880
+ 0 ,
6881
+ "Page order changed. Rebuild pageindex now?" ,
6882
+ "Rebuild" ,
6883
+ GlobalActionRequiredEvent . TASK_TYPE_INDEX_REBUILD ,
6884
+ UpdatePageIndexTask . UpdatePageIndex ( Program . ProjectModel . Pages ,
6885
+ AppEventHandler . OnGeneralTaskProgress ,
6886
+ AppEventHandler . OnPageChanged ,
6887
+ TokenStore . GetInstance ( ) . CancellationTokenSourceForName ( TokenStore . TOKEN_SOURCE_GLOBAL ) . Token ,
6888
+ false ,
6889
+ true ,
6890
+ gid
6891
+ ) ,
6892
+ gid
6893
+ ) ) ;
6780
6894
6781
6895
}
6782
6896
}
0 commit comments