Пример #1
0
    // This function will draw UI components
    void OnGUI()
    {
        // Getting current view by active view name:
        ViewInterface currentView = (ViewInterface)viewByName[activeViewName];

        // Set blockUI for current view:
        currentView.setBlockUI(blockUI);

        // Rendering current view:
        currentView.render();

        // Show box with "Wait..." when UI is blocked:
        var screenWidth  = Screen.width;
        var screenHeight = Screen.height;

        if (blockUI)
        {
            GUI.Box(new Rect((screenWidth - 200) / 2, (screenHeight - 60) / 2, 200, 60), "Wait...");
        }

        if (asyncOp != null && !asyncOp.isDone)
        {
            GUIStyle style = new GUIStyle(GUI.skin.box);
            style.normal.background = MakeTex(2, 2, new Color(0f, 1f, 0f, 0.5f));
            GUI.Box(new Rect(0, Screen.height - 40, asyncOp.progress * Screen.width, 40), "", style);
        }
    }
Пример #2
0
 private void Instantiate()
 {
     int[] InitialBoard = BackgammonGame.DefaultGameBoard; // Board.TestBoard3;
     Board         = new Board(InitialBoard);
     Model         = new BackgammonGame(InitialBoard, new RealDice());
     ViewInterface = new ViewInterface(Model);
     Model.ConnectView(this);
     if (WhitePlayer == PlayerType.Online)
     {
         TCPManager.Instance.Instantiate(Model, White);
     }
     if (BlackPlayer == PlayerType.Online)
     {
         TCPManager.Instance.Instantiate(Model, Black);
     }
     if (OptionScreen.ShowPips.SwitchedOn)
     {
         WhitePips = new Image()
         {
             Text = "White: " + Model.GetGameBoardState().pip(White), Position = new Vector2(Board.midX, 700)
         };
         BlackPips = new Image()
         {
             Text = "Black: " + Model.GetGameBoardState().pip(Black), Position = new Vector2(Board.midX, 20)
         };
         WhitePips.LoadContent();
         BlackPips.LoadContent();
     }
 }
Пример #3
0
 /// <summary>
 /// Add View
 /// </summary>
 /// <param name="key_view"></param>
 /// <param name="view"></param>
 public void addAVCLANListener(String key_view, ViewInterface listener)
 {
     if ((key_view != null) && (listener != null))
     {
         AVCLAN_Listeners.Add(key_view, listener);
         listener.setCommunicationDelegate(new SendAVCLANMessage(sendBlueBoxMessage));
     }
 }
 public void AddItemToViewStruct()
 {
     ViewInterface.Remove_Button_Enabler(true);
     ModelInterface.AddItemToViewStruct(new ModelMVPDataBasePart.Common.EventDataCreator(ViewInterface.Namebox, ViewInterface.EventHappen, (int)ViewInterface.WhichTypeOfRemind, ViewInterface.EventDuration));
     ViewInterface.AdditemToView(new System.Windows.Forms.ListViewItem(new string[] { ViewInterface.EventHappen.ToString(ViewInterface.MaskFormat),
                                                                                      RadioCheckedInToTextValue((int)ViewInterface.WhichTypeOfRemind),
                                                                                      EventDurationToStringConverter(ViewInterface.EventDuration) }));
 }
Пример #5
0
        public void SetUp(ViewInterface view, FileModelInterface fileModel)
        {
            this.view      = view;
            this.fileModel = fileModel;
            this.quiz      = this.GetEmptyQuiz();

            this.LoadQuiz(quiz);
        }
 public override void Run(ArgDepositer <int, string> Arg)
 {
     switch (Arg.FirstDataHandler)
     {
     case 0:
         ViewInterface.FirstPanelInitialization(Arg.FirstDataHandler, ModelInterface.GetEventNames(Controller.DBClass));
         ViewInterface.Show();
         break;
     }
 }
Пример #7
0
 public AppController(Model.AppContext model, ViewInterface view)
 {
     this.view         = view;
     this.model        = model;
     manageUser        = new ManageUsers(model, view);
     manageCars        = new ManageCars(model, view);
     manageReservation = new ManageReservation(model, view);
     view.SetController(this);
     view.GetCarData();
     startApp();
 }
Пример #8
0
        public override void Draw(ViewInterface view)
        {
            GraphicsPath path = new GraphicsPath();

            path.StartFigure(); // Start the first figure.
            path.AddEllipse((float)(Point.X) - 1, (float)view.Height - (float)Point.Y - 1, 2, 2);
            path.CloseFigure(); // Second figure is closed.

            view.SetPenColor(this.BrushColor);
            view.Path(path);
        }
Пример #9
0
 private void Login(string Username, string Pass)
 {
     if (ModelInterface.Login(Username, Pass, Controller.DBClass))
     {
         Controller.Run <MainInterfacePresenter>();
         ViewInterface.Close();
     }
     else
     {
         ; //Сообщение об ошибке
     }
 }
Пример #10
0
        public override void Draw(ViewInterface view)
        {
            view.SetPenColor(this.PenColor);

            GraphicsPath path = new GraphicsPath();

            path.StartFigure(); // Start the first figure.
            path.AddLine((float)(Edge.Org.X), (float)view.Height - (float)Edge.Org.Y, (float)Edge.Dest.X, (float)view.Height - (float)Edge.Dest.Y);
            path.CloseFigure(); // Second figure is closed.

            view.Path(path);
        }
Пример #11
0
        public override void Draw(ViewInterface view)
        {
            var points = new PointF[this.Polygon.Size()];

            for (int i = 0; i < this.Polygon.Size(); i++, this.Polygon.Advance(Rotation.CLOCKWISE))
            {
                points[i] = new PointF((float)this.Polygon.Point().X, (float)view.Height - (float)this.Polygon.Point().Y);
            }

            GraphicsPath path = new GraphicsPath();

            path.StartFigure(); // Start the first figure.
            path.AddLines(points);
            path.CloseFigure(); // Second figure is closed.

            view.SetPenColor(this.PenColor);
            view.Path(path);
        }
Пример #12
0
 public ManageReservation(Model.AppContext model, ViewInterface view)
 {
     this.model = model;
     this.view  = view;
 }
Пример #13
0
 public abstract void Draw(ViewInterface view);
Пример #14
0
 public ManageCars(Model.AppContext model, ViewInterface view)
 {
     this.model = model;
     this.view  = view;
 }
 public void RemoveSelectRemind(int arg)
 {
     ModelInterface.RemoveItemFromListStruct(arg);
     ViewInterface.RemoveSelectedItem_From_RemindersList(arg);
 }
Пример #16
0
 public void Run()
 {
     ViewInterface.Show();
 }
 public PointRelationPosController(ViewInterface view) : base(view)
 {
 }
Пример #18
0
 public void RemoveRangeItemsFromViewStruct(IEnumerable <int> ItemIndecies)
 {
     ModelInterface.RemoveRangeItemsFromViewStruct(ItemIndecies);
     ViewInterface.RemoveSelectedItemsFromView();
 }
Пример #19
0
 public Controller(ViewInterface view)
 {
     this.View = view;
 }
Пример #20
0
 protected SceneDrawController(ViewInterface view) : base(view)
 {
     this.scene = new List <ViewItemInterface>();
 }
Пример #21
0
 public IntersectDrawController(ViewInterface view) : base(view)
 {
 }