示例#1
0
        private void SaveDatasetInformation(NotificationMessageType messageType)
        {
            List<Dataset> datasets = messageType.MessageObject as List<Dataset>;
            if (!datasets.Any())
            {
                MessageBox.Show(IoC.Kernel.Get<IResourceHelper>().ReadResource("NoDatasetFoundToImport"),
                    GlobalData.MESSAGEBOXTITLE, MessageBoxButton.OK, MessageBoxImage.Information);
                Close();
                return;
            }
            //this test ensures we dont have any two datasets with same name from the file where we import data
            if (datasets.GroupBy(u => u.Name).Count() != datasets.Count)
            {
                var grp = datasets.GroupBy(u => u.Name).Where(v => v.Count() > 1).Select(w => w.Key).ToList();
                foreach (var item in grp)
                {
                    int i = 0;
                    //get all the datasets by this name and then add suffix to them
                    foreach (var dataset in datasets.Where(u => u.Name == item))
                    {
                        if (i > 0) dataset.Name = dataset.Name + "_" + i;
                        i += 1;
                    }
                }
            }

            var datasetsWithCurves = datasets.Where(u => u.DepthAndCurves.Any()).ToList();
          
            var datasetImport = new DatasetImportMappingView(datasetsWithCurves);
            datasetImport.ShowDialog();

            if (datasetImport.IsSaved) Close();
        }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.BrowseFiles:
             BrowseFiles();
             break;
     }
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.SelectLithologyImage:
             SelectedImage = messageType.MessageObject as Image;
             Close();
             break;
     }
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.SaveChartProperties:                   
             GlobalData.ShouldSave = true;
             Close();
             break;
     }
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch(messageType.MessageType)
     {
         case NotificationMessageEnum.SaveDepthImportView:
             ImportDataType = _dataContext.IsArithmeticAverageChecked ? ImportDataType.AverageChecked : ImportDataType.ExactOrCloserValue;
             IsSaved = true;
             Close();
             break;
     }
 }
示例#6
0
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.RemoveTrack:
             var result = MessageBox.Show(IoC.Kernel.Get<IResourceHelper>().ReadResource("Msg_TrackRemovalConfirmation"),
                 GlobalData.MESSAGEBOXTITLE, MessageBoxButton.YesNo, MessageBoxImage.Question);
             if (result == MessageBoxResult.Yes)
                 _dataContext.TrackRemovalApproved = true;
             break;             
     }
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch(messageType.MessageType)
     {
         case NotificationMessageEnum.SaveFullScreenSettings:
             Properties.Settings.Default["HideObjectNavigator"] = _dataContext.HideObjectNavigator;
             Properties.Settings.Default["HideToolbar"] = _dataContext.HideToolbar;
             Properties.Settings.Default["HideStatusbar"] = _dataContext.HideStatusBar;
             Properties.Settings.Default.Save();
             Close();
             break;                    
     }
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.PrintPreviewDataset:
             PrintReports(messageType.MessageObject as IEnumerable<Dataset>);
             break;
         case NotificationMessageEnum.PrintDataset:
             PrintReports(messageType.MessageObject as IEnumerable<Dataset>, true);
             break;
         case NotificationMessageEnum.PrinterSettings:
             PrinterSettings();
             break;
     }
 }
示例#9
0
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.BrowseFiles:
             BrowseFiles();
             break;
         case NotificationMessageEnum.OpenDepthImportView:
             OpenDepthImportScreen();
             break;
         case NotificationMessageEnum.SaveDatasetImport:
             SaveDatasetInformation(messageType);
             break;
     }
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.BrowseFiles:
             BrowseFiles();
             break;
         case NotificationMessageEnum.FormationsImportedSuccesfully:
             int formationsCount=Int32.Parse(messageType.MessageObject.ToString());
             MessageBox.Show(string.Format(IoC.Kernel.Get<IResourceHelper>().ReadResource("FormationsImportedInSystem"), formationsCount), GlobalData.MESSAGEBOXTITLE, MessageBoxButton.OK, MessageBoxImage.Information);
             GlobalData.ShouldSave = true;
             //FormationTopHelper.ShowHideFormation();
             Close();
             break;
     }
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch(messageType.MessageType)
     {
         case NotificationMessageEnum.RefreshListbox:
             lbDatasets.Items.Refresh();
             break;              
         case NotificationMessageEnum.UpdateDatasetWithMinMaxWarning:
             UpdateDatasetWithMinMaxWarning();
             break;
         case NotificationMessageEnum.ImportDataset:                    
             IsSaved = true; //this property notifies import data screen to close itself as data has been imported
             GlobalData.ShouldSave = true;
             Close();
             break;
     }            
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.BrowseFiles:
             SelectImage();
             break;
         case NotificationMessageEnum.SaveLithologies:
             SaveLithologies();
             break;
         case NotificationMessageEnum.ShouldDeleteLithology:
             RemoveLithologies();
             break;
         case NotificationMessageEnum.SetFocus:
             ExtendedFinalDepth.Focus();
             break;
     }
 }
示例#13
0
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     switch(messageType.MessageType)
     {
         case NotificationMessageEnum.AddNote:
             AddNewNoteView view = new AddNewNoteView();
             view.ShowDialog();
             break;
         case NotificationMessageEnum.ShouldDeleteNotes:
             var result = MessageBox.Show(IoC.Kernel.Get<IResourceHelper>().ReadResource("DoYouWantToRemoveTheSelectedNotes"),
                 GlobalData.MESSAGEBOXTITLE, MessageBoxButton.YesNo, MessageBoxImage.Question);
             if (result == MessageBoxResult.Yes) _dataContext.ShouldDeleteNotes = true;
             break;
         case NotificationMessageEnum.EditNote:
             AddNewNoteView notesView = new AddNewNoteView();
             notesView.SelectedNote = messageType.MessageObject as NotesInfo;
             notesView.ShowDialog();
             break;
     }
 }
 protected override void ReceiveMessage(NotificationMessageType messageType)
 {
     
     switch (messageType.MessageType)
     {
         case NotificationMessageEnum.OpenAutomaticDepthScreen:
             OpenAutomaticDepthScreen();
             break;
         case NotificationMessageEnum.SaveSpreadsheet:
             IsSaved = true;
             Close();
             break;
         case NotificationMessageEnum.SpreadsheetExcel:
             ExportToExcel();
             break;
         case NotificationMessageEnum.CancelScreen:
             var result = MessageBox.Show(IoC.Kernel.Get<IResourceHelper>().ReadResource("SaveChangesBeforeClosingTheScreen"),
               GlobalData.MESSAGEBOXTITLE, MessageBoxButton.YesNo, MessageBoxImage.Question);
             if (result == MessageBoxResult.Yes) _dataContext.AutoSave = true;
             break;
     }
 }
示例#15
0
        protected override void ReceiveMessage(NotificationMessageType messageType)
        {
            if (_dicReceiveMessages.ContainsKey(messageType.MessageType))
                _dicReceiveMessages[messageType.MessageType].Invoke();

            switch (messageType.MessageType)
            {
                case NotificationMessageEnum.UndoRedoMessage:
                    TextBlockUndoRedoMessage.Text = messageType.MessageObject.ToString();
                    var storyBoard = Resources["test"] as Storyboard;
                    if (storyBoard != null) storyBoard.Begin();
                    break;
                case NotificationMessageEnum.ThemeChanged:
                    ThemeSelectionChanged();
                    break;
                case NotificationMessageEnum.LanguageChanged:
                    SetLanguage();
                    break;
                case NotificationMessageEnum.CancelLineEditor:
                    (this.Flyouts.Items[0] as Flyout).IsOpen = false;
                    GlobalDataModel.Instance.IsSubDatasetOpen = false;
                    break;
                case NotificationMessageEnum.CancelShalePointFilter:
                    if (this.Flyouts.Items.Count > 1)
                        (this.Flyouts.Items[1] as Flyout).IsOpen = false;
                    break;
                case NotificationMessageEnum.ShouldCancel:
                    var result = MessageBox.Show(
                        IoC.Kernel.Get<IResourceHelper>().ReadResource("ShouldCancel"),
                        GlobalData.MESSAGEBOXTITLE, MessageBoxButton.OKCancel, MessageBoxImage.Question);
                    if (result == MessageBoxResult.OK)
                    {
                        (messageType.MessageObject as LineEditorViewModel).ShouldCancel = true;
                    }
                    break;
                case NotificationMessageEnum.ShouldDeleteLine:
                    var shoulDeleteLine = MessageBox.Show(
                        IoC.Kernel.Get<IResourceHelper>().ReadResource("ShouldDeleteLine"), GlobalData.MESSAGEBOXTITLE, MessageBoxButton.OKCancel, MessageBoxImage.Question);
                    if (shoulDeleteLine == MessageBoxResult.OK)
                    {
                        (messageType.MessageObject as LineEditorViewModel).ShouldDeleteLine = true;
                    }
                    break;
                case NotificationMessageEnum.TakeScreenshot:
                    TakeScreenShot(messageType.MessageObject as SciChartSurface);
                    break;
                case NotificationMessageEnum.DatasetPropertiesScreen:
                    DatasetPropertiesScreen(messageType.MessageObject as Dataset);
                    break;
            }
        }