protected override void DoLockCommand() { _isLocked = !_isLocked; if (!_isLocked && _isSendToInMemoryWorkspaceCommand) { ESRI.ArcGIS.Framework.IMessageDialog msgBox = new ESRI.ArcGIS.Framework.MessageDialogClass(); bool userResult = msgBox.DoModal("Unlocking", "Unlocking also disconnects from the managed layer.", "Unlock", "Abort", ArcMap.Application.hWnd); //if the user hit no we have to set the lock state back to locked if (!userResult) { _isLocked = !_isLocked; return; } if (userResult) { _isSendToInMemoryWorkspaceCommand = !_isSendToInMemoryWorkspaceCommand; _mcdaExtension.RemoveLink(_wlcTool); this.SelectedFeaturePropertyChanged(this, null); PropertyChanged.Notify(() => IsSendToInMemoryWorkspaceCommand); } } if (_isLocked) { //ProgressDialog.ShowProgressDialog("Creating In Memory Representation", // (Action<AbstractToolTemplate>)_mcdaExtension.EstablishLink, _wlcTool); ProgressDialogBuilder progressDialogBuilder = new ProgressDialogBuilder((Action <AbstractToolTemplate>)_mcdaExtension.EstablishLink, _wlcTool); progressDialogBuilder.SetTitle("Creating In Memory Representation").SetHideCancelButton(true).SetIsIndeterminate(true).Build().Show(); } if (!_isLocked && !_isSendToInMemoryWorkspaceCommand) { _mcdaExtension.RemoveLink(_wlcTool); this.SelectedFeaturePropertyChanged(this, null); } PropertyChanged.Notify(() => IsLocked); }
protected override void DoLockCommand() { _isLocked = !_isLocked; if (!_isLocked && _isSendToInMemoryWorkspaceCommand) { ESRI.ArcGIS.Framework.IMessageDialog msgBox = new ESRI.ArcGIS.Framework.MessageDialogClass(); var userResult = msgBox.DoModal("Unlocking", "Unlocking also disconnects from the managed layer.", "Unlock", "Abort", ArcMap.Application.hWnd); //if the user hit no we have to set the lock state back to locked if (!userResult) { _isLocked = !_isLocked; return; } if (userResult) { _isSendToInMemoryWorkspaceCommand = !_isSendToInMemoryWorkspaceCommand; _mcdaExtension.RemoveLink(_lwlcTool); this.SelectedFeaturePropertyChanged(this, null); PropertyChanged.Notify(() => IsSendToInMemoryWorkspaceCommand); } } if (_isLocked) { ProgressDialog.ShowProgressDialog("Creating In Memory Representation", (Action <AbstractToolTemplate>)_mcdaExtension.EstablishLink, _lwlcTool); // the lwlc depends on the featureClass data, thus we have to make sure that we work on the featureClass of the in memory workspace _lwlcTool.FeatureClass = _mcdaExtension.LinkDictionary[_lwlcTool].FeatureClass; } if (!_isLocked && !_isSendToInMemoryWorkspaceCommand) { _mcdaExtension.RemoveLink(_lwlcTool); this.SelectedFeaturePropertyChanged(this, null); } PropertyChanged.Notify(() => IsLocked); }