Esempio n. 1
0
        public override void OnDataChanged()
        {
            base.OnDataChanged();
            this.AdjustAnchoring();
            MiniMapPresenter presenter = base.GetPresenter <MiniMapPresenter>();

            base.style.width  = presenter.maxWidth;
            base.style.height = presenter.maxHeight;
            this.Resize();
            this.UpdatePresenterPosition();
        }
Esempio n. 2
0
 private void ToggleAnchorState(EventBase e)
 {
     if (base.dependsOnPresenter)
     {
         MiniMapPresenter presenter = base.GetPresenter <MiniMapPresenter>();
         presenter.anchored = !presenter.anchored;
     }
     else
     {
         this.anchored = !this.anchored;
     }
 }
Esempio n. 3
0
        private void AdjustAnchoring()
        {
            MiniMapPresenter presenter = base.GetPresenter <MiniMapPresenter>();

            if (!(presenter == null))
            {
                if (presenter.anchored)
                {
                    presenter.capabilities &= ~Capabilities.Movable;
                    base.ResetPositionProperties();
                    base.AddToClassList("anchored");
                }
                else
                {
                    base.presenter.capabilities |= Capabilities.Movable;
                    base.RemoveFromClassList("anchored");
                }
            }
        }
Esempio n. 4
0
        public virtual void BuildContextualMenu(ContextualMenuPopulateEvent evt)
        {
            bool anchored;

            if (base.dependsOnPresenter)
            {
                MiniMapPresenter presenter = base.GetPresenter <MiniMapPresenter>();
                anchored = presenter.anchored;
            }
            else
            {
                anchored = this.anchored;
            }
            ContextualMenu     arg_6E_0 = evt.menu;
            string             arg_6E_1 = (!anchored) ? "Anchor" : "Make floating";
            Action <EventBase> arg_6E_2 = new Action <EventBase>(this.ToggleAnchorState);

            if (MiniMap.< > f__mg$cache0 == null)
            {
                MiniMap.< > f__mg$cache0 = new Func <EventBase, ContextualMenu.MenuAction.StatusFlags>(ContextualMenu.MenuAction.AlwaysEnabled);
            }
            arg_6E_0.AppendAction(arg_6E_1, arg_6E_2, MiniMap.< > f__mg$cache0);
        }