예제 #1
0
        private void ConnectEvents()
        {
            ServiceManager.SourceManager.ActiveSourceChanged += delegate(SourceEventArgs args) {
                Banshee.Base.ThreadAssist.ProxyToMain(ResetSelection);
            };

            ServiceManager.SourceManager.SourceUpdated += delegate(SourceEventArgs args) {
                Banshee.Base.ThreadAssist.ProxyToMain(delegate {
                    lock (args.Source) {
                        TreeIter iter = store.FindSource(args.Source);
                        if (!TreeIter.Zero.Equals(iter))
                        {
                            need_resort = true;
                            QueueDraw();
                        }
                    }
                });
            };

            ServiceManager.PlaybackController.NextSourceChanged += delegate {
                Banshee.Base.ThreadAssist.ProxyToMain(QueueDraw);
            };

            notify_stage.ActorStep += delegate(Actor <TreeIter> actor) {
                Banshee.Base.ThreadAssist.AssertInMainThread();
                if (!store.IterIsValid(actor.Target))
                {
                    return(false);
                }

                Gdk.Rectangle rect = GetBackgroundArea(store.GetPath(actor.Target), focus_column);
                QueueDrawArea(rect.X, rect.Y, rect.Width, rect.Height);
                return(true);
            };
        }
예제 #2
0
        private void ConnectEvents()
        {
            ServiceManager.SourceManager.ActiveSourceChanged += delegate(SourceEventArgs args) {
                ThreadAssist.ProxyToMain(ResetSelection);
            };

            ServiceManager.SourceManager.SourceUpdated += delegate(SourceEventArgs args) {
                ThreadAssist.ProxyToMain(delegate {
                    lock (args.Source) {
                        TreeIter iter = store.FindSource(args.Source);
                        if (!TreeIter.Zero.Equals(iter))
                        {
                            if (args.Source.Expanded)
                            {
                                Expand(args.Source);
                            }

                            need_resort = true;
                            QueueDraw();
                        }
                    }
                });
            };

            ServiceManager.PlaybackController.NextSourceChanged += delegate {
                ThreadAssist.ProxyToMain(QueueDraw);
            };

            notify_stage.ActorStep += delegate(Actor <TreeIter> actor) {
                ThreadAssist.AssertInMainThread();
                if (!store.IterIsValid(actor.Target))
                {
                    return(false);
                }

                using (var path = store.GetPath(actor.Target)) {
                    Gdk.Rectangle rect = GetBackgroundArea(path, source_column);
                    QueueDrawArea(rect.X, rect.Y, rect.Width, rect.Height);
                }
                return(true);
            };

            ServiceManager.Get <InterfaceActionService> ().SourceActions["OpenSourceSwitcher"].Activated += delegate {
                new SourceSwitcherEntry(this);
            };
        }