Ejemplo n.º 1
0
        private void FieldPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (_isLocked)
            {
                return;
            }

            _lwlcTool = ToolFactory.NewLWLCTool();

            _lwlcResultDataTable = _lwlcTool.Data;

            if (_selectedFeature.Fields.Count(f => f.IsSelected) >= 1)
            {
                _toolParameter = new BindingList <IToolParameter>(_lwlcTool.ToolParameterContainer.ToolParameter);

                //ProgressDialog.ShowProgressDialog("Running LWLC Tool", (Action) _lwlcTool.Run);
                ProgressDialogBuilder progressDialogBuilder = new ProgressDialogBuilder((Action <ProgressHandler>)_lwlcTool.Run);
                progressDialogBuilder.SetTitle("Running LWLC Tool").Build().Show();
            }
            else
            {
                RegisterToolParameterEvents();
            }

            PropertyChanged.Notify(() => LWLCParameter);
            PropertyChanged.Notify(() => LWLCResult);

            CommandManager.InvalidateRequerySuggested();
        }
Ejemplo n.º 2
0
        protected override void DoSendToInMemoryWorkspaceCommand()
        {
            _isSendToInMemoryWorkspaceCommand = !_isSendToInMemoryWorkspaceCommand;

            if (_isSendToInMemoryWorkspaceCommand && !_isLocked)
            {
                DoLockCommand();
            }

            if (_isSendToInMemoryWorkspaceCommand)
            {
                _mcdaExtension.DisplayLink(_wlcTool);
                //ProgressDialog.ShowProgressDialog("Creating Symbology", (Action<AbstractToolTemplate, DataTable>)_mcdaExtension.JoinToolResultByOID, _wlcTool, _wlcTool.Data);

                ProgressDialogBuilder progressDialogBuilder = new ProgressDialogBuilder((Action <AbstractToolTemplate, DataTable>)_mcdaExtension.JoinToolResultByOID, _wlcTool, _wlcTool.Data);
                progressDialogBuilder.SetTitle("Creating Symbology").SetHideCancelButton(true).SetIsIndeterminate(true).Build().Show();
            }

            if (!_isSendToInMemoryWorkspaceCommand)
            {
                DoLockCommand();
            }

            PropertyChanged.Notify(() => IsSendToInMemoryWorkspaceCommand);
        }
Ejemplo n.º 3
0
        private void SelectedFeaturePropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (_isLocked)
            {
                return;
            }

            _lwlcTool = ToolFactory.NewLWLCTool();

            _toolParameter = new BindingList <IToolParameter>(_lwlcTool.ToolParameterContainer.ToolParameter);

            if (_selectedFeature != null)
            {
                foreach (var currentField in _selectedFeature.Fields)
                {
                    currentField.UnRegisterPropertyHandler(_listOfpropertyChangedEventHandlersForFieldIsSelected);
                }
            }

            _selectedFeature = _mcdaExtension.SelectedFeature;

            if (_selectedFeature != null)
            {
                foreach (var currentField in _selectedFeature.Fields)
                {
                    _listOfpropertyChangedEventHandlersForFieldIsSelected.Add(currentField.RegisterPropertyHandler(f => f.IsSelected, FieldPropertyChanged));
                }

                if (_selectedFeature.Fields.Count(f => f.IsSelected) >= 1)
                {
                    //ProgressDialog.ShowProgressDialog("Running LWLC Tool", (Action)_lwlcTool.Run);

                    ProgressDialogBuilder progressDialogBuilder = new ProgressDialogBuilder((Action <ProgressHandler>)_lwlcTool.Run);
                    progressDialogBuilder.SetTitle("Running LWLC Tool").Build().Show();

                    _lwlcResultDataTable = _lwlcTool.Data;
                }
            }

            RegisterToolParameterEvents();

            PropertyChanged.Notify(() => LWLCParameter);
            PropertyChanged.Notify(() => LWLCResult);

            CommandManager.InvalidateRequerySuggested();
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        protected override void UpdateDrag()
        {
            if (!_isUpdateAllowed)
            {
                return;
            }

            //ProgressDialog.ShowProgressDialog("Running LWLC Tool", _lwlcTool.Run);

            ProgressDialogBuilder progressDialogBuilder = new ProgressDialogBuilder((Action <ProgressHandler>)_lwlcTool.Run);

            progressDialogBuilder.SetTitle("Running LWLC Tool").Build().Show();

            _lwlcResultDataTable = _lwlcTool.Data;

            if (_isSendToInMemoryWorkspaceCommand)
            {
                _mcdaExtension.JoinToolResultByOID(_lwlcTool, _lwlcTool.Data);
            }

            _isUpdateAllowed = false;
        }