Пример #1
0
        public void ClientPanel()
        {
            FillInterface fill    = new FillLibrary(30);
            ILibrary      library = new Library();

            library.fillBooks(fill);
            UserPanel   userPanel   = new UserPanel(library);
            Client      tomek       = new Client(0, "tomek", "elo", "warszawa");
            Book        LOTR        = new Book(31, "J.R.R", "LOTR", DateTime.Now);
            Book        starwars    = new Book(32, "J.L.", "Star wars", DateTime.Now);
            Book        LOTR2       = new Book(33, "J.R.R2", "LOTR2", DateTime.Now);
            Book        starwars2   = new Book(34, "J.K.", "Star wars2", DateTime.Now);
            WorkerPanel workerPanel = new WorkerPanel(library);

            workerPanel.addClient(tomek);
            workerPanel.addBook(LOTR);
            workerPanel.addBook(LOTR2);
            workerPanel.addBook(starwars);
            workerPanel.addBook(starwars2);
            Assert.AreEqual(true, userPanel.rentaBook(LOTR, tomek));
            Assert.AreEqual(true, userPanel.rentaBook(LOTR2, tomek));
            Assert.AreEqual(true, userPanel.rentaBook(starwars, tomek));
            Assert.AreEqual(false, userPanel.rentaBook(starwars2, tomek));
            Assert.AreEqual(true, userPanel.giveBackBook(LOTR, tomek));
            Assert.AreEqual(false, userPanel.giveBackBook(LOTR, tomek));
        }
Пример #2
0
    //This method hides the main panel and reveals and makes ready the panel for
    //each user by assigning values to all of the labels and buttons
    public void UserButtonClicked(int id)
    {
        MainPanel.SetActive(false);
        UserPanel.SetActive(true);
        Debug.Log("Button clicked = " + id);
        if (id == 0)
        {
            UserTitleText.text = "All Players";
        }
        else
        {
            UserTitleText.text = id.ToString();
        }

        VideoTransmitter video_transmitter = new VideoTransmitter();

        Button temp_launch_button = LaunchButton.GetComponent <Button>();

        temp_launch_button.onClick.AddListener(() => LaunchButtonClicked(id));
        Button temp_play_button = PlayButton.GetComponent <Button>();

        temp_play_button.onClick.AddListener(() => video_transmitter.Play(id));
        Button temp_pause_button = PauseButton.GetComponent <Button>();

        temp_pause_button.onClick.AddListener(() => video_transmitter.Pause(id));
    }
Пример #3
0
        private void BackToUserPanel()
        {
            UserPanel newMainWindow = new UserPanel();

            newMainWindow.Show();
            Close();
        }
Пример #4
0
    public override IEnumerator ExecuteAsCoroutine()
    {
        Button btn = (Button)this.gameObject.GetComponent(typeof(Button));

        btn.interactable = false;
        if (Login.text.Length < 3 || Login.text.Length > 30)
        {
            MessageDialogManager.ShowDialog("Por favor, preencha seu login!");
            EventSystem.current.SetSelectedGameObject(Login.gameObject);
            btn.interactable = true;
            yield break;
        }
        if (Password.text.Length < 5)
        {
            MessageDialogManager.ShowDialog("Por favor, digite sua senha!");
            EventSystem.current.SetSelectedGameObject(Password.gameObject);
            btn.interactable = true;
            yield break;
        }
        yield return(StartCoroutine(server.Login(Login.text, Password.text, HttpMethodType.Get)));

        if (ServerManager.LoggedUserID > 0)
        {
            UserPanel.Login();
            UserPanel.instance.Show();
            SpeedClickDirector.instance.ShowScreenByType(Screens.MainScreen);
        }
        btn.interactable = true;
    }
Пример #5
0
 public AccountDeletePanel(Form form, LoggedUser user, UserPanel userPanel)
     : base(form, user)
 {
     this.InitializeComponent();
     this.userPanel = userPanel;
     this.deleteButton.UseSelectable = false;
 }
Пример #6
0
        private void load()
        {
            FillFlowContainer <UserPanel> usersFlow;

            InternalChild = new Container
            {
                RelativeSizeAxes = Axes.Both,
                Padding          = new MarginPadding {
                    Horizontal = SearchableListOverlay.WIDTH_PADDING
                },
                Children = new Drawable[]
                {
                    new OsuScrollContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Padding          = new MarginPadding {
                            Top = 10
                        },
                        Children = new Drawable[]
                        {
                            new ParticipantCountDisplay
                            {
                                Anchor = Anchor.TopRight,
                                Origin = Anchor.TopRight,
                            },
                            usersFlow = new FillFlowContainer <UserPanel>
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                                Spacing          = new Vector2(5),
                                Padding          = new MarginPadding {
                                    Top = 40
                                },
                                LayoutDuration = 200,
                                LayoutEasing   = Easing.OutQuint,
                            },
                        },
                    },
                },
            };

            Participants.BindValueChanged(participants =>
            {
                usersFlow.Children = participants.NewValue.Select(u =>
                {
                    var panel = new UserPanel(u)
                    {
                        Anchor = Anchor.TopCentre,
                        Origin = Anchor.TopCentre,
                        Width  = 300,
                    };

                    panel.OnLoadComplete += d => d.FadeInFromZero(60);

                    return(panel);
                }).ToList();
            }, true);
        }
Пример #7
0
    public void checkLose(string email)
    {
        UserPanel user = getUserPanel(email);

        if (user.userData.isLose)
        {
            user.lose();
        }
    }
Пример #8
0
    public void setTrun(int turnIndex)
    {
        UserGameData user = userList[turnIndex];

        foreach (GameObject obj in playUserList)
        {
            UserPanel userPanel = obj.GetComponent <UserPanel>();
            userPanel.setTurn(userPanel.userData.email.Equals(user.email));
        }
    }
Пример #9
0
    public MainWindow()
    {
        InitializeComponent();
        app              = App.Current;
        welcomeScreen    = new WelcomeScreen(this);
        registrationPage = new RegistrationPage(this);
        logInPage        = new LogInPage(this);
        userPanel        = new UserPanel(this);

        MainFrame.NavigationService.Navigate(welcomeScreen);
    }
Пример #10
0
 // Use this for initialization
 void Start()
 {
     if (instance == null && this.IsMainInstance)
     {
         instance = this;
     }
     if (this.canvas == null)
     {
         this.canvas = this.GetComponent <CanvasGroup>();
     }
     this.canvas.alpha = 0;
 }
Пример #11
0
 UserPanel getUserPanel(string email)
 {
     foreach (GameObject obj in playUserList)
     {
         UserPanel p = obj.GetComponent <UserPanel>();
         if (p.userData.email.Equals(email))
         {
             return(p);
         }
     }
     return(null);
 }
Пример #12
0
    internal void init()
    {
        Transform  parent = UIRootFinder.uiRootTran;
        GameObject asset  = (GameObject)AssetManager.Instance.LoadPrefab("userPanel");

        panel = Instantiate(asset) as GameObject;
        panel.transform.parent     = parent;
        panel.transform.localScale = Vector3.one;
        panelScript = panel.GetComponent <UserPanel>();
        UIEventListener.Get(panelScript.returnbtn).onClick = OnReturnClick;
        panelScript.msgSignal.AddListener(OnsubPanelMsg);
        panelScript.LogoutSignal.AddListener(OnLogOut);
    }
Пример #13
0
        public TestSceneUserPanel()
        {
            UserPanel flyte;
            UserPanel peppy;

            Add(new FillFlowContainer
            {
                Anchor       = Anchor.Centre,
                Origin       = Anchor.Centre,
                AutoSizeAxes = Axes.Both,
                Spacing      = new Vector2(10f),
                Children     = new[]
                {
                    flyte = new UserPanel(new User
                    {
                        Username = @"flyte",
                        Id       = 3103765,
                        Country  = new Country {
                            FlagName = @"JP"
                        },
                        CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
                    })
                    {
                        Width = 300
                    },
                    peppy = new UserPanel(new User
                    {
                        Username = @"peppy",
                        Id       = 2,
                        Country  = new Country {
                            FlagName = @"AU"
                        },
                        CoverUrl     = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
                        IsSupporter  = true,
                        SupportLevel = 3,
                    })
                    {
                        Width = 300
                    },
                },
            });

            flyte.Status.Value = new UserStatusOnline();
            peppy.Status.Value = new UserStatusSoloGame();

            AddStep(@"spectating", () => { flyte.Status.Value = new UserStatusSpectating(); });
            AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); });
            AddStep(@"modding", () => { flyte.Status.Value = new UserStatusModding(); });
            AddStep(@"offline", () => { flyte.Status.Value = new UserStatusOffline(); });
            AddStep(@"null status", () => { flyte.Status.Value = null; });
        }
Пример #14
0
    public void openCard(int turnIndex, int cardIndex, DavinciController.ActionCallback callback)
    {
        UserGameData user = userList[turnIndex];

        foreach (GameObject obj in playUserList)
        {
            UserPanel userPanel = obj.GetComponent <UserPanel>();
            if (userPanel.userData.email.Equals(user.email))
            {
                userPanel.openCard(cardIndex, callback);
                break;
            }
        }
    }
Пример #15
0
    // Use this for initialization
    void Start()
    {
        SoundManager.GetInstance().StopAllLoopingSoundEffects();

        remoteUserPanel = transform.Find("Panel").gameObject;
        remoteUserPanel.transform.Find("Callee").GetComponent <Image>().sprite = Resources.Load <Sprite>("Textures/Photos/Profile/" + UserDataController.GetInstance().CalleeImage);
        transform.Find("BottomBar/Tab/Name").GetComponent <Text>().text        = UserDataController.GetInstance().CalleeUserName;

        if (UserDataController.GetInstance().ActiveUserType == UserDataController.UserType.Senior)
        {
            transform.Find("BottomBar/InCall/Mic").gameObject.SetActive(false);
            transform.Find("BottomBar/InCall/Sound").gameObject.SetActive(false);
        }

        CalleeCanvasZoom   = remoteUserPanel.GetComponent <RectTransform>();
        calleeCanvas       = remoteUserPanel.transform.Find("VideoCallee").GetComponent <CanvasRenderer>();
        CalleeOriginalSize = remoteUserPanel.transform.Find("VideoCallee").GetComponent <RectTransform>().sizeDelta;
        CallTime           = transform.Find("BottomBar/Tab/Calling").GetComponent <Text>();

        if (UserDataController.GetInstance().ActiveUserType == UserDataController.UserType.Senior)
        {
            transform.Find("BottomBar/InCall/Sound").gameObject.SetActive(false);
            transform.Find("BottomBar/InCall/Mic").gameObject.SetActive(false);
        }

        StartCoroutine(CallTimer());

        localUserPanel = transform.Find("UserPanel").gameObject;
        UserPanelRef   = localUserPanel.AddComponent <UserPanel>();
        endCall        = transform.Find("BottomBar/InCall/EndCall").GetComponent <Button>();

        endCall.onClick.AddListener(() =>
        {
            SoundManager.GetInstance().PlaySingle("SoundFX/pop_drip");
            videoCall.GetComponent <VideoCall>().Restart();
        });

        GameObject videoCallPrefab = Resources.Load <GameObject>("Prefabs/SeniorCall/VideoCall");

        videoCall = GameObject.Instantiate <GameObject>(videoCallPrefab);
        videoCall.transform.SetParent(this.transform);
        videoCall.transform.localPosition = Vector3.zero;

        StartCoroutine(videoCall.GetComponent <VideoCall>().SetupVideo(OnVideoStart));
        DragSlot dragComponent = transform.Find("SharedPhoto/DragSlot").gameObject.AddComponent <DragSlot>();

        dragComponent.method += PhotoDragHandler;
        NetworkController.GetInstance().OnPhotoReceived += ReceivedNetworkPhoto;
    }
Пример #16
0
 public void reload()
 {
     foreach (UserGameData data in userList)
     {
         foreach (GameObject obj in playUserList)
         {
             UserPanel panelData = obj.GetComponent <UserPanel>();
             if (panelData.userData.email.Equals(data.email))
             {
                 panelData.setData(data);
                 panelData.reload();
             }
         }
     }
 }
Пример #17
0
 public void setEnableClick(bool isEnable, string playerEmail)
 {
     foreach (GameObject obj in playUserList)
     {
         UserPanel p   = obj.GetComponent <UserPanel>();
         UIButton  btn = p.GetComponent <UIButton>();
         if (!playerEmail.Equals(p.userData.email) && !p.userData.isLose)
         {
             btn.enabled = isEnable;
         }
         else
         {
             btn.enabled = false;
         }
     }
 }
        private void btnShowPassword_Click(object sender, EventArgs e)
        {
            string enteredEmail = txtWriteEmail.Text.Trim().ToLower();



            findEmail = db.UserPanels.Where(w => w.E_mail == enteredEmail).FirstOrDefault();
            if (findEmail == null)
            {
                MessageBox.Show("This email doesn't exist");
            }
            else
            {
                MessageBox.Show("UserName: "******"\n" + "Password: "******"UserName and Password");
            }
        }
Пример #19
0
 public static void Stop()
 {
     Car.Clear();
     Deleter.Clear();
     MoveTimer.Stop();
     LightsTimer.Stop();
     GenCarTimer.Stop();
     WorkTimer.Stop();
     CarCount.Text          = "0";
     CurrentlyCarCount.Text = "0";
     WorkTime.Text          = "0 c";
     Cpm.Text = "0";
     WorkTm   = 0;
     UserPanel.ResetBackColor();
     UserPanel.Invalidate();
 }
Пример #20
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public FolderManager(MenuManager menu, UserPanel userPanel, NotebookViewer nv)
        {
            this.userPanel      = userPanel;
            this.notebookViewer = nv;
            this.menuManager    = menu;

            // Network Viewer Displayed at Start...
            SetSensitiveGoUpMenu(false);
            SetSensitiveGoHomeMenu(false);

            // Add Event Handlers
            this.menuManager.Activated          += new EventHandler(OnMenuActivated);
            this.notebookViewer.SwitchPage      += new SwitchPageHandler(OnSwitchPage);
            this.notebookViewer.DirChanged      += new BoolEventHandler(OnBoolEventHandler);
            this.userPanel.FolderButton.Clicked += new EventHandler(OnMyFolderCliecked);
        }
Пример #21
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public FolderManager(GUI.Window window)
        {
            // Initialize Components
            this.menuManager    = window.Menu;
            this.userPanel      = window.UserPanel;
            this.notebookViewer = window.NotebookViewer;

            // Network Viewer Displayed at Start...
            SetSensitiveGoUpMenu(false);
            SetSensitiveGoHomeMenu(false);

            // Add Event Handlers
            this.menuManager.Activated          += new EventHandler(OnMenuActivated);
            this.notebookViewer.SwitchPage      += new SwitchPageHandler(OnSwitchPage);
            this.notebookViewer.DirChanged      += new BoolEventHandler(OnDirChanged);
            this.userPanel.FolderButton.Clicked += new EventHandler(OnMyFolderCliecked);
        }
Пример #22
0
    //public void updateData(List<UserGameData> userList, int turnUserIndex)
    //{
    //    this.userList = userList;
    //    isUpdate = true;
    //    this.turnUserIndex = turnUserIndex;
    //}

    public void setData(List <UserGameData> userList, int turnUserIndex)
    {
        this.userList      = userList;
        this.turnUserIndex = turnUserIndex;

        foreach (UserGameData data in userList)
        {
            foreach (GameObject obj in playUserList)
            {
                UserPanel panelData = obj.GetComponent <UserPanel>();
                if (panelData.userData.email.Equals(data.email))
                {
                    panelData.setData(data);
                }
            }
        }
    }
        // ============================================
        // PUBLIC Constructors
        // ============================================
        public NetworkManager(MenuManager menu, UserPanel userPanel, NotebookViewer nv)
        {
            this.userPanel      = userPanel;
            this.notebookViewer = nv;
            this.menuManager    = menu;

            // Initialize P2PManager & CMD Manager
            this.p2pManager = P2PManager.GetInstance();
            this.cmdManager = CmdManager.GetInstance();

            // Network
            SetSensitiveNetworkMenu(P2PManager.IsListening());

            // Add Event Handlers
            this.menuManager.Activated += new EventHandler(OnMenuActivated);
            notebookViewer.NetworkViewer.ItemRemoved += new PeerSelectedHandler(OnPeerRemove);
        }
Пример #24
0
        public void SetUp() => Schedule(() =>
        {
            UserPanel flyte;

            Child = new FillFlowContainer
            {
                Anchor       = Anchor.Centre,
                Origin       = Anchor.Centre,
                AutoSizeAxes = Axes.Both,
                Spacing      = new Vector2(10f),
                Children     = new[]
                {
                    flyte = new UserPanel(new User
                    {
                        Username = @"flyte",
                        Id       = 3103765,
                        Country  = new Country {
                            FlagName = @"JP"
                        },
                        CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c6.jpg"
                    })
                    {
                        Width = 300
                    },
                    peppy = new UserPanel(new User
                    {
                        Username = @"peppy",
                        Id       = 2,
                        Country  = new Country {
                            FlagName = @"AU"
                        },
                        CoverUrl     = @"https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
                        IsSupporter  = true,
                        SupportLevel = 3,
                    })
                    {
                        Width = 300
                    },
                },
            };

            flyte.Status.Value = new UserStatusOnline();
            peppy.Status.Value = null;
            peppy.Activity.BindTo(activity);
        });
Пример #25
0
        public void TestUserStory9()
        {
            try
            {
                const String INPUT_FILE = "User.xml";
                User         user       = XML.DeserializeObject <User>(FileUtils.CreateInputPath(INPUT_FILE));

                PropertiesCollection.OpenURL(Constants.START_URL);
                Panel.Log_Click();
                Authentication.Login(user);
                UserPanel.Contact_Click();
            }
            catch (Exception ex)
            {
                Assert.Fail();
                Logger.LogException("", ex);
            }
        }
Пример #26
0
    public void init(List <UserGameData> list, int roomNo)
    {
        this.roomNo = roomNo;
        attackGuide.gameObject.SetActive(false);
        UserGameData myData = new UserGameData();

        foreach (UserGameData data in list)
        {
            if (isMyData(data))
            {
                myData.setData(data);
                list.Remove(data);
                break;
            }
        }

        for (int i = 0; i < 4; i++)
        {
            GameObject itemObj = NGUITools.AddChild(grid.gameObject, userObj);
            userObjList.Add(itemObj);
            UserPanel data = itemObj.GetComponent <UserPanel>();

            if (i < list.Count)
            {
                data.setData(list[i]);
                data.reload();
                playUserList.Add(userObjList[i]);
            }
            else
            {
                if (i == 3)
                {
                    data.setData(myData);
                    data.reload();
                    playUserList.Add(userObjList[i]);
                }
                else
                {
                    //userObjList[i].SetActive(false);
                    data.offPanel();
                }
            }
        }
    }
Пример #27
0
 public static void Update()
 {
     CurrentlyCarCount.Text = Cars.Count.ToString();
     foreach (var c in Cars)
     {
         if (Car.Check(c))
         {
             c.Speed = 0;
         }
         else
         {
             c.Speed = Car.CanMove(c);
             if (c.Turn == CTurn.Right)
             {
                 RightTurn.StartTurn(c);
             }
             else if (c.Turn == CTurn.Left)
             {
                 LeftTurn.StartTurn(c);
             }
         }
         Move(c);
         if (c.X < -50 || c.X > UserPanel.Width + 50 || c.Y < -50 || c.Y > UserPanel.Height + 50)
         {
             Deleter.Add(c);
         }
     }
     if (Deleter.Count != 0)
     {
         foreach (var d in Deleter)
         {
             if (d is Car)
             {
                 Cars.Remove((Car)d);
             }
             else if (d is People)
             {
                 Peoples.Remove((People)d);
             }
         }
     }
     UserPanel.Invalidate();
 }
Пример #28
0
        public FrmSearch(UserPanel p)
        {
            InitializeComponent();
            searchPanel1.UserPanel = p;
            int x = Screen.PrimaryScreen.WorkingArea.Width;

            this.Left = ((x - this.Width) / 2) + 109;
            this.Top  = (p.label1.Location.X) + 90;

            searchPanel1.rdCitas.Visible = false;
            searchPanel1.rdCitas.Checked = false;

            searchPanel1.rdMedicos.Checked = false;
            searchPanel1.rdMedicos.Visible = false;

            searchPanel1.rdPacientes.Visible = false;
            searchPanel1.rdPacientes.Checked = false;
            searchPanel1.txtType.Text        = "Usuarios";
        }
Пример #29
0
        private void btnSubmitUser_Click(object sender, EventArgs e)
        {
            string FirstName   = txtFirstName.Text.Trim().ToLower();
            string Surname     = txtSurName.Text.Trim().ToLower();
            string Email       = txtNewEmail.Text.Trim().ToLower();
            string NewPassword = txtNewPassword.Text;

            if (String.IsNullOrEmpty(FirstName) || String.IsNullOrEmpty(Surname) || String.IsNullOrEmpty(Email) || String.IsNullOrEmpty(NewPassword))
            {
                MessageBox.Show("Please, Fill all inputs");
            }

            else
            {
                UserPanel newUser = new UserPanel
                {
                    FirstName         = FirstName,
                    LastName          = Surname,
                    E_mail            = Email,
                    Password          = Exception.Exception.HashPassword(NewPassword),
                    ForgetingPassword = NewPassword,
                };

                newUserName = db.UserPanels.Where(w => w.FirstName == newUser.FirstName).FirstOrDefault();

                if (newUserName == null)
                {
                    MessageBox.Show("You have registered", "Welcome");
                    db.UserPanels.Add(newUser);
                    db.SaveChanges();
                }

                else
                {
                    MessageBox.Show("This UserName existes");
                }
            }
        }
Пример #30
0
        private void StudentSignin()
        {
            string sql = "select * from UserTable where UserName = '******' and Password='******' ";

            try
            {
                this.Ds = this.Da.ExecuteQuery(sql);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            if (this.Ds != null && this.Ds.Tables.Count > 0 && this.Ds.Tables[0].Rows.Count > 0)
            {
                this.Login.Hide();
                UserPanel up = new UserPanel(Login, this.Login.textBoxUsername.Text);
                up.Show();
            }
            else
            {
                MessageBox.Show("Check Username and Password");
            }
        }