Example #1
0
        void mi_ChooseFileSeparator_Click(object sender, EventArgs e)
        {
            ExtractionConfiguration toSetDescriptionOn = Activator.RepositoryLocator.DataExportRepository.GetObjectByID <ExtractionConfiguration>(_rightClickedRowExtractionConfigurationID);

            if (toSetDescriptionOn.IsReleased)
            {
                return;
            }

            TypeTextOrCancelDialog dialog = new TypeTextOrCancelDialog("Separator", "Choose a character(s) separator", 3, toSetDescriptionOn.Separator);

            dialog.ShowDialog(this);

            if (dialog.DialogResult == DialogResult.OK)
            {
                toSetDescriptionOn.Separator = dialog.ResultText;
                toSetDescriptionOn.SaveToDatabase();
                RefreshLists();
            }
        }
Example #2
0
        void mi_SetDescription_Click(object sender, EventArgs e)
        {
            ExtractionConfiguration toSetDescriptionOn = Activator.RepositoryLocator.DataExportRepository.GetObjectByID <ExtractionConfiguration>(_rightClickedRowExtractionConfigurationID);

            if (toSetDescriptionOn.IsReleased)
            {
                return;
            }

            TypeTextOrCancelDialog dialog = new TypeTextOrCancelDialog("Description", "Enter a Description for the Extraction:", 1000, toSetDescriptionOn.Description);

            dialog.ShowDialog(this);

            if (dialog.DialogResult == DialogResult.OK)
            {
                toSetDescriptionOn.Description = dialog.ResultText;
                toSetDescriptionOn.SaveToDatabase();
                RefreshLists();
            }
        }
        public override void Execute()
        {
            base.Execute();

            TypeTextOrCancelDialog dialog = new TypeTextOrCancelDialog("Permission Window Name", "Enter name for the PermissionWindow e.g. 'Nightly Loads'", 1000);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                string windowText = dialog.ResultText;
                var    newWindow  = new PermissionWindow(Activator.RepositoryLocator.CatalogueRepository);
                newWindow.Name = windowText;
                newWindow.SaveToDatabase();

                if (_cacheProgressToSetOnIfAny != null)
                {
                    new ExecuteCommandSetPermissionWindow(Activator, _cacheProgressToSetOnIfAny).SetTarget(newWindow).Execute();
                }

                Publish(newWindow);
                Activate(newWindow);
            }
        }
Example #4
0
        private void chart1_MouseUp(object sender, MouseEventArgs e)
        {
            if (!annotating)
            {
                return;
            }

            var pointEndX = chart1.ChartAreas[0].AxisX.PixelPositionToValue(e.X);
            var pointEndY = chart1.ChartAreas[0].AxisY.PixelPositionToValue(e.Y);


            TypeTextOrCancelDialog inputBox = new TypeTextOrCancelDialog("Enter Annotation Text", "Type some annotation text (will be saved to the database for other data analysts to see)", 500);

            if (DialogResult.OK == inputBox.ShowDialog())
            {
                //create new annotation in the database
                new DQEGraphAnnotation(_currentEvaluation.DQERepository, pointStartX, pointStartY, pointEndX, pointEndY, inputBox.ResultText, _currentEvaluation, DQEGraphType.TimePeriodicityGraph, _pivotCategoryValue);

                //refresh the annotations
                AddUserAnnotations(_currentEvaluation);
            }
        }
Example #5
0
        public void SetOperationTo(SetOperation newOperation)
        {
            var oldOperation = _container.Operation;

            _container.Operation = newOperation;

            //if the old name was UNION and we are changing to INTERSECT Operation then we should probably change the Name too! even if they have something like 'INTERSECT the people who are big and small' and they change to UNION we want it to be changed to 'UNION the people who are big and small'
            if (_container.Name.StartsWith(oldOperation.ToString()))
            {
                _container.Name = newOperation + _container.Name.Substring(oldOperation.ToString().Length);
            }
            else
            {
                var dialog = new TypeTextOrCancelDialog("New name for container?", "You have changed the operation, do you want to give it a new description?", 1000, _container.Name);

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    _container.Name = dialog.ResultText;
                }
            }
            _container.SaveToDatabase();
            Publish(_container);
        }
Example #6
0
        private object GetValueForParameterOfType(ParameterInfo parameterInfo, Type paramType)
        {
            if (typeof(ICatalogueRepository).IsAssignableFrom(paramType))
            {
                return(Activator.RepositoryLocator.CatalogueRepository);
            }

            if (typeof(IDataExportRepository).IsAssignableFrom(paramType))
            {
                return(Activator.RepositoryLocator.DataExportRepository);
            }

            if (typeof(IRDMPPlatformRepositoryServiceLocator).IsAssignableFrom(paramType))
            {
                return(Activator.RepositoryLocator);
            }

            if (typeof(IActivateItems).IsAssignableFrom(paramType))
            {
                return(Activator);
            }

            if (typeof(DirectoryInfo).IsAssignableFrom(paramType))
            {
                var fb = new FolderBrowserDialog();
                if (fb.ShowDialog() == DialogResult.OK)
                {
                    return(new DirectoryInfo(fb.SelectedPath));
                }

                return(null);
            }

            if (typeof(DatabaseEntity).IsAssignableFrom(paramType))
            {
                IMapsDirectlyToDatabaseTable[] availableObjects;
                if (Activator.RepositoryLocator.CatalogueRepository.SupportsObjectType(paramType))
                {
                    availableObjects = Activator.RepositoryLocator.CatalogueRepository.GetAllObjects(paramType).ToArray();
                }
                else if (Activator.RepositoryLocator.DataExportRepository.SupportsObjectType(paramType))
                {
                    availableObjects = Activator.RepositoryLocator.DataExportRepository.GetAllObjects(paramType).ToArray();
                }
                else
                {
                    return(null);
                }


                return(PickOne(parameterInfo, paramType, availableObjects));
            }

            if (typeof(IMightBeDeprecated).IsAssignableFrom(paramType))
            {
                return(PickOne(parameterInfo, paramType,
                               Activator.CoreChildProvider.GetAllSearchables()
                               .Keys.OfType <IMightBeDeprecated>()
                               .Cast <IMapsDirectlyToDatabaseTable>()
                               .ToArray()));
            }

            if (typeof(ICheckable).IsAssignableFrom(paramType))
            {
                return(PickOne(parameterInfo, paramType, Activator.CoreChildProvider.GetAllSearchables()
                               .Keys.OfType <ICheckable>()
                               .Cast <IMapsDirectlyToDatabaseTable>()
                               .Where(paramType.IsInstanceOfType)
                               .ToArray()));
            }

            if (parameterInfo.HasDefaultValue)
            {
                return(parameterInfo.DefaultValue);
            }

            if (paramType.IsValueType && !typeof(Enum).IsAssignableFrom(paramType))
            {
                var typeTextDialog = new TypeTextOrCancelDialog("Enter Value", "Enter value for '" + parameterInfo.Name + "' (" + paramType.Name + ")", 1000);

                if (typeTextDialog.ShowDialog() == DialogResult.OK)
                {
                    return(Convert.ChangeType(typeTextDialog.ResultText, paramType));
                }
            }

            return(null);
        }