Beispiel #1
0
        private void dispatcherTimer_Tick(object sender, EventArgs e)
        {
            // check for Stored Prints in Log
            if (Log.StoredPrints.Count > 0)
            {
                var sp = Log.StoredPrints.Last();
                Message.Content = "" + sp.msg;
                if (sp.color == Log.ColorBlack)
                {
                    Message.Background = Brushes.White;
                }
                if (sp.color == Log.ColorBlue)
                {
                    Message.Background = Brushes.LightBlue;
                }
                if (sp.color == Log.ColorRed)
                {
                    Message.Background = Brushes.Red;
                }
            }

            // check if Display/ Edit Control has some work to do ..
            try
            {
                if (DispEditEntityPanel != null && DispEditEntityPanel.WishForOutsideAction != null)
                {
                    while (DispEditEntityPanel.WishForOutsideAction.Count > 0)
                    {
                        var temp = DispEditEntityPanel.WishForOutsideAction[0];
                        DispEditEntityPanel.WishForOutsideAction.RemoveAt(0);

                        // what to do?
                        if (temp is ModifyRepo.LambdaActionRedrawAllElements)
                        {
                            var wish = temp as ModifyRepo.LambdaActionRedrawAllElements;
                            // edit mode affects the total element view
                            RedrawAllAasxElements();
                            // the selection will be shifted ..
                            if (wish.NextFocus != null)
                            {
                                var si = DisplayElements.SearchVisualElementOnMainDataObject(wish.NextFocus);
                                if (si != null)
                                {
                                    si.IsSelected = true;
                                    if (wish.IsExpanded == true)
                                    {
                                        // go upward the tree in order to expand, as well
                                        var sii = si;
                                        while (sii != null)
                                        {
                                            sii.IsExpanded = wish.IsExpanded == true;
                                            sii            = sii.Parent;
                                        }
                                    }
                                    if (wish.IsExpanded == false)
                                    {
                                        si.IsExpanded = wish.IsExpanded == true;
                                    }
                                    DisplayElements.Woodoo(si);
                                }
                            }
                            // fake selection
                            RedrawElementView();
                            DisplayElements.Refresh();
                            ContentTakeOver.IsEnabled = false;
                        }

                        if (temp is ModifyRepo.LambdaActionContentsChanged)
                        {
                            // enable button
                            ContentTakeOver.IsEnabled = true;
                        }

                        if (temp is ModifyRepo.LambdaActionContentsTakeOver)
                        {
                            // rework list
                            ContentTakeOver_Click(null, null);
                        }
                    }
                }
            } catch (Exception ex) {
                Log.Error(ex, "While responding to a user interaction");
            }
        }