Пример #1
0
        public void UpdateContent(string name)
        {
            if (name.Equals(Common.LABEL_NOTES_NAME))
            {
                panel_body.Controls.Clear();

                NotesControl noteControl = new NotesControl(_db.GetNotes(), panel_body);

                panel_body.Controls.Add(noteControl);
            }
        }
Пример #2
0
        public FormApplicationProperties(InstalledApplication application)
        {
            notesControl     = new NotesControl(application);
            documentsControl = new DocumentsControl(application);
            InitializeComponent();
            _installedApplication = application;

            // Populate the tabs
            InitializeGeneralTab();
            InitializeNotesTab();
            InitializeDocumentsTab();

            // Initialize User Defined Data Tabe for this application
            InitializeUserDefinedData();
        }
Пример #3
0
        private async void BtnBuildGfi_Click(object sender, RoutedEventArgs e)
        {
            var selectedCompanies = LbDirectories.SelectedItems.Cast <Company>().ToList();
            var validCompanies    = new DirectoryService(Settings.Default.RootDir).GetCompaniesWithoutNewGfi().Intersect(selectedCompanies);

            var skipCompanies = selectedCompanies.Except(validCompanies).Select(c => c.DisplayName);

            if (skipCompanies.Any())
            {
                var msg = $"Preskačem sljedeće firme jer nedostaje datoteka ili imaju već izrađen GFI: {string.Join(", ", skipCompanies)}";
                await ShowInfoDialog(msg, "Neispravne firme označene");
            }

            var service = new GfiBuilderService(validCompanies);

            Loader.Visibility = Visibility.Visible;

            var sw = Stopwatch.StartNew();
            var dispatcherTimer = PrepareTimer(sw);

            dispatcherTimer.Start();
            try
            {
                await Task.Run(() => service.BuildGfis()).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }

            sw.Stop();
            dispatcherTimer.Stop();

            _ = Dispatcher.Invoke(async() =>
            {
                Loader.Visibility = Visibility.Hidden;
                var sb            = new StringBuilder();
                sb.AppendLine("Obrada završena");
                sb.Append($"Proteklo vremena: {sw.ElapsedMilliseconds / 1000f}s");
                await ShowInfoDialog(sb.ToString(), "Završeno");
                LoadCompanies();

                await NotesControl.RefreshCompaniesAsync();
            });
        }
Пример #4
0
        public override void OnApplyTemplate()
        {
            Content = new NotesControl
            {
                DisplayMemberPath = DisplayMemberPath,
                ItemsSource       = ItemsSource
            };

            this.WhenAnyValue(a => a.ItemsSource)
            .WhereNotNull()
            .CombineLatest(this.WhenAnyValue(a => a.DisplayMemberPath))
            .Subscribe(a =>
            {
                Dispatcher.InvokeAsync(() =>
                {
                    switch (Content)
                    {
                    case null:
                        Content = new NotesControl
                        {
                            DisplayMemberPath = DisplayMemberPath,
                            ItemsSource       = ItemsSource
                        };
                        break;

                    case NotesControl msn:
                        msn.ItemsSource       = ItemsSource;
                        msn.DisplayMemberPath = DisplayMemberPath;
                        break;

                    default:
                        throw new ApplicationException("Expected Content to be MasterNotesItemsControl");
                    }

                    //DoubleAnimation oLabelAngleAnimation    = new DoubleAnimation();
                    //oLabelAngleAnimation.From = 0;
                    //oLabelAngleAnimation.To = this?.ActualHeight??0;
                    //oLabelAngleAnimation.Duration                    = new Duration(new TimeSpan(0, 0, 0, 0, 500));
                    //oLabelAngleAnimation.RepeatBehavior = new RepeatBehavior(4);
                    //this.BeginAnimation(MasterBindableControl.HeightProperty,                    oLabelAngleAnimation);
                }, System.Windows.Threading.DispatcherPriority.Background);
            });

            base.OnApplyTemplate();
        }
Пример #5
0
 private async void BtnSettings_Click(object sender, RoutedEventArgs e)
 {
     ShowChooseFolderDialog();
     LoadCompanies();
     await NotesControl.RefreshCompaniesAsync();
 }