private void btn_DeleteProject_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show(
                string.Format("{0}{1}", ResourceStringManager.GetResourceByKey("ConfirmDeleteMessageBoxMessage"), this.SelectedProject.Name),
                ResourceStringManager.GetResourceByKey("ConfirmDeleteMessageBoxTitle"),
                System.Windows.MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                var projectLogic = new ProjectLogic();
                try
                {
                    projectLogic.DeleteProject(this.SelectedProject.Id);
                }
                catch (Exception ex)
                {
                    Logger.LogException(ex);
                    MessageBox.Show(ResourceStringManager.GetResourceByKey("DeleteProjectFailedTitle"),
                                    ResourceStringManager.GetResourceByKey("DeleteProjectFailedMessage"), MessageBoxButton.OK,
                                    MessageBoxImage.Error);
                }
                projectLogic.Dispose();
                this.lv_Projects.SelectedItem = null;
                this.Load();
                this.RefreshBindings(this.PagingManager.CurrentPage);
            }
        }
 public LocalizationModel()
 {
     _resourceStringManager = new ResourceStringManager(
         Extension.AssemblyNameConst,
         "Model.Strings.LocalizationModel");
     _localeInfos = new ObservableCollection <LocaleInfo>();
     Refresh();
 }
 public SubtaskGridViewModel(Subtask subtask)
 {
     this.Id            = subtask.Id;
     this.Name          = subtask.Name;
     this.Description   = subtask.Description;
     this.Priority      = ResourceStringManager.GetResourceBySubtaskPriority(subtask.Priority);
     this.assignment    = subtask.Assignment;
     this.StatusAsImage = GetImageByStatus(subtask.Status);
 }
        private void LoadProjects()
        {
            var projectLogic = new ProjectLogic();

            this.ProjectViewModels = projectLogic.GetAllProjects().Where(p => p.ProjectStatus != EnumDefinition.ProjectStatus.Archived)
                                     .Select(p => new ProjectViewModel(p))
                                     .ToList();
            projectLogic.Dispose();
            this.ProjectViewModels.Add(new ProjectViewModel {
                Id = 0, Name = ResourceStringManager.GetResourceByKey("All")
            });
        }
        private void LoadSubtasksForAssignment(int assignment_id)
        {
            var subtaskLogic = new SubtaskLogic();

            this.SubtaskViewModels = subtaskLogic.GetByAssignmentId(assignment_id)
                                     .Select(s => new SubtaskComboBoxViewModel(s))
                                     .ToList();
            subtaskLogic.Dispose();
            this.SubtaskViewModels.Add(new SubtaskComboBoxViewModel {
                Id = 0, Name = ResourceStringManager.GetResourceByKey("All")
            });
            this.cb_SubtaskFilter.SelectedItem = this.SubtaskViewModels.Single(s => s.Id == 0);
        }
        private void LoadAssignmentsForProject(int project_id)
        {
            var assignmentLogic = new AssignmentLogic();

            this.AssignmentViewModels = assignmentLogic.GetAssignmentsByProjectId(project_id)
                                        .Select(a => new AssignmentViewModel(a))
                                        .ToList();
            assignmentLogic.Dispose();
            this.AssignmentViewModels.Add(new AssignmentViewModel {
                Id = 0, Name = ResourceStringManager.GetResourceByKey("All")
            });
            this.cb_AssignmentFilter.SelectedItem = this.AssignmentViewModels.Single(a => a.Id == 0);
        }
        private void btn_DeleteEntry_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var result = MessageBox.Show(ResourceStringManager.GetResourceByKey("ConfirmDeleteMessage"), ResourceStringManager.GetResourceByKey("ConfirmDeleteTitle"), MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (result == MessageBoxResult.Yes)
            {
                var entryLogic = new EntryLogic();
                entryLogic.DeleteEntry(SelectedEntry.Id);
                entryLogic.Dispose();
            }
            Load();
            this.RefreshBindings(this.PagingManager.CurrentPage);
        }
        private string[] ResolveWeekdayNames(IEnumerable <MostProductiveWeekDaysViewModel> viewModels)
        {
            var labels = new List <string>();

            foreach (var vm in viewModels)
            {
                string formattedAvgHours = string.Format("{0}(Ø {1:0.00}h){2}(Total: {3:0.00}h)", System.Environment.NewLine,
                                                         vm.AverageHours, System.Environment.NewLine, vm.TotalHours);
                labels.Add(ResourceStringManager.GetResourceByKey(vm.Day.ToString()) + formattedAvgHours);
            }

            return(labels.ToArray());
        }
Esempio n. 9
0
        private void LoadProjectViewModels()
        {
            var projectLogic = new ProjectLogic();

            this.ProjectViewModels = projectLogic.GetAllProjects()
                                     .Where(p => p.ProjectStatus == EnumDefinition.ProjectStatus.Active)
                                     .Select(p => new Projects.ProjectViewModel(p)).ToList();
            string projectAllSelectItemName = ResourceStringManager.GetResourceByKey("ProjectsAll");

            this.ProjectViewModels.Insert(0, new Projects.ProjectViewModel {
                Name = projectAllSelectItemName, Id = 0
            });
            this.cb_ProjectSelection.ItemsSource  = this.ProjectViewModels;
            this.cb_ProjectSelection.SelectedItem = this.ProjectViewModels.Where(p => p.Id == 0);
        }
 public AddEntry(int projectId, int assignmentId)
 {
     InitializeComponent();
     this.project_id    = projectId;
     this.assignment_id = assignmentId;
     timer                      = new DispatcherTimer(DispatcherPriority.Send);
     timer.Interval             = new TimeSpan(0, 0, 1);
     this.btn_StartStop.Content = ResourceStringManager.GetResourceByKey("ButtonTextStart");
     this.Load();
     this.cb_Subtask.SelectedItem = this.SubtaskViewModels.FirstOrDefault(s => s.Id > 0);
     if (!this.SubtaskViewModels.Any())
     {
         this.chebo_FinishesSubtask.IsEnabled = false;
     }
 }
Esempio n. 11
0
        /// <summary>
        /// Initializes a new instance of Extension.
        /// </summary>
        public Extension()
            : base()
        {
            Title     = _title;
            IconKey   = _iconKey;
            SortOrder = 90;

            ResourceAssembly.Register();
            ResourceStringManager resourceStringManager = new ResourceStringManager(
                AssemblyNameConst,
                "Strings.Extension");

            _pageInfos = new List <PageInfo>
            {
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("About"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/About.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Skin",
                    IconKey          = _iconKey,
                    PartialClassName = "View/SkinConfig.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("Localization"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/LocalizationConfig.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "DPI",
                    IconKey          = _iconKey,
                    PartialClassName = "View/DpiScaling.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("Rendering"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/RenderingConfig.xaml"
                },
            };
            SkinManager.Current.LoadCurrentSkin();
        }
Esempio n. 12
0
        /// <summary>
        /// Initializes a new instance of Extension.
        /// </summary>
        public Extension()
            : base()
        {
            Title     = _title;
            IconKey   = _iconKey;
            SortOrder = 100;
            ResourceAssembly.Register();
            ResourceStringManager resourceStringManager = new ResourceStringManager(
                AssemblyNameConst,
                "Strings.Extension");

            _pageInfos = new List <PageInfo>
            {
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("Shapes"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/ShapeDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("Matrix"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/MatrixDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("RangeControls"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/RangeControlDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "BeePanel / BeeGrid",
                    IconKey          = _iconKey,
                    PartialClassName = "View/BeePanelDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("MayaEase"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/MayaEaseDemo.xaml"
                }
            };
        }
        public void StartStopTimer()
        {
            if (!timer.IsEnabled)
            {
                this.started = DateTime.Now;
                timer.Start();

                timer.Tick += Timer_Elapsed;
                this.btn_StartStop.Background = Brushes.DarkRed;
                this.btn_StartStop.Content    = ResourceStringManager.GetResourceByKey("ButtonTextStop");
            }
            else
            {
                timer.Tick -= Timer_Elapsed;
                timer.Stop();
                timer.IsEnabled               = false;
                this.btn_StartStop.Content    = ResourceStringManager.GetResourceByKey("ButtonTextStart");
                this.btn_StartStop.Background = Brushes.Green;
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Initializes a new instance of MainModel.
        /// </summary>
        public ExtensionModel()
        {
            Compose();

            Extensions = new List <Extension>();
            foreach (var extension in _mefExtensions)
            {
                Extensions.Add(extension);
            }
            if (Extensions.Count == 0)
            {
                ResourceStringManager resourceStringManager = new ResourceStringManager(
                    ResourceAssembly.AssemblyNameConst,
                    "Model.Strings.ExtensionModel");
                MessageBox.Show(resourceStringManager.GetString("NoMefModuleWarning"));
            }
            else
            {
                Extensions.Sort(CompareExtensions);
            }
        }
Esempio n. 15
0
        /// <summary>
        /// Initializes a new instance of Extension.
        /// </summary>
        public Extension()
            : base()
        {
            Title     = _title;
            IconKey   = _iconKey;
            SortOrder = 110;
            ResourceAssembly.Register();
            ResourceStringManager resourceStringManager = new ResourceStringManager(
                AssemblyNameConst,
                "Strings.Extension");

            _pageInfos = new List <PageInfo>
            {
                new PageInfo(this)
                {
                    Title            = "XyzAxis3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/XyzAxis3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Box3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Box3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Box3D + image",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Box3DImageDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("OpenBox3D"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/Box3DOpenDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Box3D + Transform3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Box3DTransformDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("Interactivity"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/InteractivityDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Square3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Square3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Square3D + animation",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Square3DAnimationDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Square3D + image",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Square3DImageDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Polygon3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Polygon3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Polygon3D + image",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Polygon3DImageDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Bar3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Bar3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("Cylinder"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/CylinderDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Bar3D + image",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Bar3DImageDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Conical3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Conical3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Conical3D + image",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Conical3DImageDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Ring3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Ring3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Spherical3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Spherical3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Spherical3D + image",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Spherical3DImageDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Spherical3D + Transform3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Spherical3DTransformDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("BubbleChart"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/BubbleChartDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Isocahedron3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Isocahedron3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "TruncatedIsocahedron3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/TruncatedIsocahedron3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Football3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Football3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("PieSlice"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/PieSliceDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Gyroscope3D.xaml",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Gyroscope3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Arrow3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Arrow3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("Range3D"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/ButtonFaderKnob3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("Mixer"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/MixerDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = resourceStringManager.GetString("CustomKnob3D"),
                    IconKey          = _iconKey,
                    PartialClassName = "View/CustomKnob3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "Matrix3D",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Matrix3DDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "House3D + Export",
                    IconKey          = _iconKey,
                    PartialClassName = "View/HouseDemo.xaml"
                },
                new PageInfo(this)
                {
                    Title            = "3D spaces",
                    IconKey          = _iconKey,
                    PartialClassName = "View/Space3DDemo.xaml"
                }
            };
        }