コード例 #1
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void radPageViewOptions_SelectedPageChanging(object sender, RadPageViewCancelEventArgs e)
        {
            switch (e.Page.Text)
            {
            case "Settings":

                GetSettingPageConfig();

                break;

            case "Client Configuration":

                DisableRadPageViews();
                NetworkFunction.GetClientConfig();

                break;

            case "Tile Configuration":

                DisableRadPageViews();
                NetworkFunction.GetConfigSet();

                break;

            case "Key Generation":

                DisableRadPageViews();
                NetworkFunction.GetKey();

                break;

            default:
                break;
            }
        }
コード例 #2
0
        private void radButtonHelpMarkProvided_Click(object sender, EventArgs e)
        {
            string msg;

            if (_liveClientStatus.ClientStatus == Enums.LiveClientStatus.GAMEOVER_FOR_CLEANING)
            {
                msg = "Are you sure you want to mark as \"Cleaned\"?";
            }
            else
            {
                msg = "Are you sure you want to mark as help provided?";
            }


            DialogResult dr = RadMessageBox.Show(this, string.Format(msg), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

            if (dr == DialogResult.Yes)
            {
                List <ClientParm> clientParm = new List <ClientParm>();

                clientParm.Add(new ClientParm(_liveClientStatus.ClientID));

                if (_liveClientStatus.ClientStatus == Enums.LiveClientStatus.GAMEOVER_FOR_CLEANING)
                {
                    NetworkFunction.TurnOffCleaningFlag(clientParm);
                }
                else
                {
                    NetworkFunction.TurnOffAssistingFlag(clientParm);
                }

                this.Close();
            }
        }
コード例 #3
0
        private void radButtonMarkClean_Click(object sender, EventArgs e)
        {
            if (radListViewClientList.CheckedItems.Count > 0)
            {
                DialogResult dr = RadMessageBox.Show(this, string.Format("Are you sure you want to mark ({0}) machines as \"Cleaned\"?", radListViewClientList.CheckedItems.Count), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

                if (dr == DialogResult.Yes)
                {
                    List <ClientParm> clientParm = new List <ClientParm>();

                    foreach (ListViewDataItem lv in radListViewClientList.CheckedItems)
                    {
                        LiveClientStatus lcs = (LiveClientStatus)lv.Value;

                        clientParm.Add(new ClientParm(lcs.ClientID));
                    }

                    NetworkFunction.TurnOffCleaningFlag(clientParm);

                    this.Close();
                }
            }
            else
            {
                this.ShowAlertBox("Manager Features", "Please select at least one client machine to continue!");
            }
        }
コード例 #4
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void radButtonDelete_Click(object sender, EventArgs e)
        {
            List <TileConfig> lTileConfig = _lTileConfig != null ? _lTileConfig : new List <TileConfig>();

            if (this.radGridViewTileConfig.CurrentRow is GridViewDataRowInfo)
            {
                TileConfig targetTileConfig = (TileConfig)radGridViewTileConfig.CurrentRow.DataBoundItem;

                if (lTileConfig.Count(x => x.TileconfigID == targetTileConfig.ID) > 0)
                {
                    System.Diagnostics.Debug.WriteLine("Cannot delete ID: {0}, since sub tiles exist", targetTileConfig.ID);

                    this.ShowAlertBox("Options", "Sub tiles exist under parent tile, cannot delete parent tile!");
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Delete ID: {0}", targetTileConfig.ID);
                    DialogResult dr = RadMessageBox.Show(this, "Are you sure delete the tile? This operation cannot be undone!", "Delete Tile", MessageBoxButtons.YesNo, RadMessageIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        SetCurrentSelectionIndex();
                        NetworkFunction.DeleteTileConfig(targetTileConfig);
                    }
                }
            }
        }
コード例 #5
0
        private void radButtonDeleteWaiver_Click(object sender, EventArgs e)
        {
            if (radListViewClientList.CheckedItems.Count > 0)
            {
                DialogResult dr = RadMessageBox.Show(this, string.Format("Are you sure you want to archive ({0}) pending waiver? (Normally this is done for friends of the participant)", radListViewClientList.CheckedItems.Count), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

                if (dr == DialogResult.Yes)
                {
                    List <WaiverInfo> listWaiverInfo = new List <WaiverInfo>();

                    foreach (ListViewDataItem item in radListViewClientList.CheckedItems)
                    {
                        DataRowView drv = (DataRowView)item.DataBoundItem;

                        listWaiverInfo.Add(new WaiverInfo()
                        {
                            ID = (int)drv["ID"]
                        });
                    }

                    NetworkFunction.DeletePendingWaiver(listWaiverInfo);
                    this.Close();
                }
            }
            else
            {
                this.ShowAlertBox("Waiver Process", "Please select at least one client to continue!");
            }
        }
コード例 #6
0
        private void radButtonStartSessionTimed_Click(object sender, EventArgs e)
        {
            if (radListViewClientList.CheckedItems.Count > 0)
            {
                DialogResult dr = RadMessageBox.Show(this, string.Format("Are you sure you want to start timed session on ({0}) machines for ({1}) minutes of each?", radListViewClientList.CheckedItems.Count, radSpinEditorSessionTime.Value), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

                if (dr == DialogResult.Yes)
                {
                    List <ClientParm> clientParm = new List <ClientParm>();

                    foreach (ListViewDataItem lv in radListViewClientList.CheckedItems)
                    {
                        LiveClientStatus            lcs   = (LiveClientStatus)lv.Value;
                        Dictionary <string, string> dParm = new Dictionary <string, string>();

                        dParm.Add("Duration", radSpinEditorSessionTime.Value.ToString());
                        clientParm.Add(new ClientParm(lcs.ClientID, dParm));
                    }

                    NetworkFunction.SendStartTiming(clientParm);

                    this.Close();
                }
            }
            else
            {
                this.ShowAlertBox("Manager Features", "Please select at least one client machine to continue!");
            }
        }
コード例 #7
0
        private void OnTimer1sEvent(object sender, ElapsedEventArgs e)
        {
            this.InvokeUI(() =>
            {
                radLabelElementCurrTime.Text = DateTime.Now.ToString("MMMM dd, yyyy - HH:mm:ss");

                if (NetworkFunction.GetSecondsSinceLastRefresh() >= 0)
                {
                    radCardViewMain.Enabled     = true;
                    radLabelElementRefresh.Text = "Last Refreshed in " + NetworkFunction.GetSecondsSinceLastRefresh().ToString("0.0") + " Seconds";
                }
                else
                {
                    radCardViewMain.Enabled        = false;
                    radLabelElementRefresh.Text    = "Server is Not Connected";
                    radButtonPrintBarcode.Visible  = false;
                    radButtonWaiverProcess.Visible = false;
                    _uiInitNeeded = true;
                }

                if (_uiInitNeeded)
                {
                    NetworkFunction.GetSystemConfig(new SystemConfig(Enums.SysConfigType.LCD_BARCODE_MODULE, ""));
                    _uiInitNeeded = false;
                }
            });
        }
コード例 #8
0
        private void radButtonEndSession_Click(object sender, EventArgs e)
        {
            if (radListViewClientList.CheckedItems.Count > 0)
            {
                DialogResult dr = RadMessageBox.Show(this, string.Format("Are you sure you want to *MANUALLY* end session on ({0}) machines?", radListViewClientList.CheckedItems.Count), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

                if (dr == DialogResult.Yes)
                {
                    List <ClientParm> clientParm = new List <ClientParm>();

                    foreach (ListViewDataItem lv in radListViewClientList.CheckedItems)
                    {
                        LiveClientStatus            lcs   = (LiveClientStatus)lv.Value;
                        Dictionary <string, string> dParm = new Dictionary <string, string>();

                        dParm.Add("EndMode", "Manual");

                        clientParm.Add(new ClientParm(lcs.ClientID, dParm));
                    }

                    NetworkFunction.SendEndNow(clientParm);

                    this.Close();
                }
            }
            else
            {
                this.ShowAlertBox("Manager Features", "Please select at least one client machine to continue!");
            }
        }
コード例 #9
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            NetworkFunction.Init();

            InitData();

            _uiInitNeeded = true;
        }
コード例 #10
0
        private void ManagerFeatures_Load(object sender, EventArgs e)
        {
            InitData();

            _requireRefresh = true;
            NetworkFunction.GetLiveSystemInfo();
            NetworkFunction.GetSystemConfig(new SystemConfig(Enums.SysConfigType.DEFAULT_TIMED_SESSION_LENGTH));
        }
コード例 #11
0
 private void BarcodeGeneration_Load(object sender, EventArgs e)
 {
     NetworkFunction.OnIncommingSystemConfig += NetworkFunction_OnIncommingSystemConfig;
     NetworkFunction.GetSystemConfig(new List <SystemConfig>()
     {
         new SystemConfig(Enums.SysConfigType.DEFAULT_TIMED_SESSION_LENGTH)
     });
 }
コード例 #12
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void radButtonSyncTileConfig_Click(object sender, EventArgs e)
        {
            DialogResult dr = RadMessageBox.Show(this, "Do you want to send tile config to all client? (Please do not send config more than once per minutes to avoid pipeline jamming)", "Info", MessageBoxButtons.YesNo, RadMessageIcon.Question);

            if (dr == DialogResult.Yes)
            {
                NetworkFunction.SyncTileConfig();
            }
        }
コード例 #13
0
 private void radButtonMoreConfig_Click(object sender, EventArgs e)
 {
     NetworkFunction.GetSystemConfig(new List <SystemConfig>()
     {
         new SystemConfig(Enums.SysConfigType.MANAGER_PASSWORD),
         new SystemConfig(Enums.SysConfigType.DEFAULT_TIMED_SESSION_LENGTH)
     });
     _moreConfigTrigged = true;
 }
コード例 #14
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void radButtonReInitClientConfig_Click(object sender, EventArgs e)
        {
            DialogResult dr = RadMessageBox.Show(this, "Do you want to re-initialize client setting? Normally this only used to fix client sync issue. This will effectively terminate any current session!", "Warning!", MessageBoxButtons.YesNo, RadMessageIcon.Exclamation);

            if (dr == DialogResult.Yes)
            {
                NetworkFunction.ReInitClientSetting();
            }
        }
コード例 #15
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void buttonConfigDelete_Click(object sender, EventArgs e)
        {
            RadListDataItem ldi = comboBoxTileConfig.SelectedItem;

            if (ldi != null)
            {
                ConfigSet cs = new ConfigSet((int)ldi.Value, "");
                NetworkFunction.DeleteConfigSet(cs);
            }
        }
コード例 #16
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void buttonTileConfigDown_Click(object sender, EventArgs e)
        {
            if (this.radGridViewTileConfig.CurrentRow is GridViewDataRowInfo)
            {
                TileConfig targetTileConfig = (TileConfig)radGridViewTileConfig.CurrentRow.DataBoundItem;

                SetCurrentSelectionIndex();

                NetworkFunction.ReOrderDownTileConfig(targetTileConfig);
            }
        }
コード例 #17
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void buttonConfigNew_Click(object sender, EventArgs e)
        {
            string sConfigSetName = "";

            this.InputBox("Create New Config Set", "Please enter the name of the new config set:", ref sConfigSetName);

            if (sConfigSetName.Length > 0)
            {
                ConfigSet cs = new ConfigSet(0, sConfigSetName);
                NetworkFunction.AddConfigSet(cs);
            }
        }
コード例 #18
0
        private void ManagerFeatures_Load(object sender, EventArgs e)
        {
            InitData();

            NetworkFunction.GetSystemConfig(new SystemConfig(Enums.SysConfigType.DEFAULT_TIMED_SESSION_LENGTH));

            NetworkFunction.GetPendingWaiver();

            _timerListRefresher          = new System.Timers.Timer();
            _timerListRefresher.Elapsed += new ElapsedEventHandler(OntimerListRefresher);
            _timerListRefresher.Interval = 4000;
            _timerListRefresher.Enabled  = true;
        }
コード例 #19
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void buttonDeleteClient_Click(object sender, EventArgs e)
        {
            if (listViewClient.SelectedItems.Count == 1)
            {
                Client c   = new Client();
                int    cid = 0;

                Int32.TryParse(listViewClient.SelectedItems[0].Name, out cid);
                c.ClientID = cid;

                NetworkFunction.DeleteClientConfig(c);
            }
        }
コード例 #20
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void radButtonConfigModify_Click(object sender, EventArgs e)
        {
            RadListDataItem ldi = comboBoxTileConfig.SelectedItem;

            if (ldi != null)
            {
                string sConfigSetName = ldi.Text;
                this.InputBox("Modify Config Set", "Please enter the new name of the config set:", ref sConfigSetName);

                ConfigSet cs = new ConfigSet((int)ldi.Value, sConfigSetName);
                NetworkFunction.ModifyConfigSet(cs);
            }
        }
コード例 #21
0
        private void _dtClientList_RowChanged(object sender, DataRowChangeEventArgs e)
        {
            if ((bool)e.Row["UPD_REQ"] == true)
            {
                BookingReference br = new BookingReference()
                {
                    ID        = (int)e.Row["ID"],
                    Reference = (string)e.Row["Reference"],
                    Duration  = _sessionLength
                };

                NetworkFunction.GetBookingReferenceSetting(br);
            }
        }
コード例 #22
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void comboBoxTileConfig_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
            RadDropDownList ddl = (RadDropDownList)sender;

            if (ddl.SelectedItem != null)
            {
                NetworkFunction.GetTileConfig((int)ddl.SelectedItem.Value);
                buttonConfigDelete.Enabled = false;
            }
            else
            {
                radButtonConfigModify.Enabled = false;
            }
        }
コード例 #23
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void radButtonDeleteKey_Click(object sender, EventArgs e)
        {
            if (listViewKeyGen.SelectedItems.Count == 1)
            {
                List <KeyInfo> listKeyInfo = new List <KeyInfo>();

                listKeyInfo.Add(new KeyInfo()
                {
                    Key = (string)listViewKeyGen.SelectedItems[0].Tag
                });

                NetworkFunction.DeleteKey(listKeyInfo);
            }
        }
コード例 #24
0
ファイル: Options.cs プロジェクト: vr-bits/VRArcadeSoftware
        private void GetSettingPageConfig()
        {
            List <SystemConfig> lsc = new List <SystemConfig>()
            {
                new SystemConfig(Enums.SysConfigType.TIMES_UP_MESSAGE),
                new SystemConfig(Enums.SysConfigType.MANUAL_END_MESSAGE),
                new SystemConfig(Enums.SysConfigType.EMERGENCY_MESSAGE),
                new SystemConfig(Enums.SysConfigType.DEFAULT_TIMED_SESSION_LENGTH),
                new SystemConfig(Enums.SysConfigType.DISABLE_KMU_BY_DEFAULT),
                new SystemConfig(Enums.SysConfigType.RE_DISABLE_KMU_AFTER_20_MIN),
                new SystemConfig(Enums.SysConfigType.LCD_BARCODE_MODULE)
            };

            NetworkFunction.GetSystemConfig(lsc);
        }
コード例 #25
0
        private void radButtonUSBOn_Click(object sender, EventArgs e)
        {
            DialogResult dr = RadMessageBox.Show(this, string.Format("Are you sure you want to turn on Keyboard / Mouse / USB storage device on this machines?"), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

            if (dr == DialogResult.Yes)
            {
                List <ClientParm> clientParm = new List <ClientParm>();

                clientParm.Add(new ClientParm(_liveClientStatus.ClientID));

                NetworkFunction.SendTurnOnKMU(clientParm);

                this.Close();
            }
        }
コード例 #26
0
        private void radButtonComputerReboot_Click(object sender, EventArgs e)
        {
            DialogResult dr = RadMessageBox.Show(this, string.Format("Are you sure you want to re-boot this machines?"), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

            if (dr == DialogResult.Yes)
            {
                List <ClientParm> clientParm = new List <ClientParm>();

                clientParm.Add(new ClientParm(_liveClientStatus.ClientID));

                NetworkFunction.SendReboot(clientParm);

                this.Close();
            }
        }
コード例 #27
0
ファイル: KeyAdd.cs プロジェクト: vivalite/VRArcadeSoftware
        private void buttonOK_Click(object sender, EventArgs e)
        {
            List <KeyInfo> lKeyInfo = new List <KeyInfo>();

            lKeyInfo.Add(new KeyInfo()
            {
                KeyTypeName = (comboBoxKeyType.SelectedItem != null) ? comboBoxKeyType.SelectedItem.Text : "",
                KeyTypeID   = (comboBoxKeyType.SelectedItem != null) ? (int)comboBoxKeyType.SelectedItem.Value : 0,
                Minutes     = (int)radSpinEditorSessionTime.Value
            });

            NetworkFunction.AddKey(lKeyInfo);

            this.Close();
        }
コード例 #28
0
        private void radButtonStartSessionNonTimed_Click(object sender, EventArgs e)
        {
            DialogResult dr = RadMessageBox.Show(this, string.Format("Are you sure you want to *MANUALLY* start session on this machines?"), "Confirm", MessageBoxButtons.YesNo, RadMessageIcon.Question);

            if (dr == DialogResult.Yes)
            {
                List <ClientParm> clientParm = new List <ClientParm>();

                clientParm.Add(new ClientParm(_liveClientStatus.ClientID));

                NetworkFunction.SendStartNow(clientParm);

                this.Close();
            }
        }
コード例 #29
0
        private void ClientDetail_Load(object sender, EventArgs e)
        {
            InitData();
            NetworkFunction.GetConfigSet();

            if (_client != null)
            {
                textBoxIPAddress.Text         = _client.IPAddress;
                textBoxDashboardModuleIP.Text = _client.DashboardModuleIP;
                textBoxMachineName.Text       = _client.MachineName;
            }
            else
            {
                _client = new Client();
            }
        }
コード例 #30
0
ファイル: Program.cs プロジェクト: vr-bits/VRArcadeSoftware
        static void Main()
        {
            try
            {
                SystemEvents.PowerModeChanged += OnPowerChange;

                if (mutex.WaitOne(TimeSpan.Zero, true))
                {
                    // enable multi-core JIT
                    ProfileOptimization.SetProfileRoot(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\VRArcade\ManagingSystem");
                    ProfileOptimization.StartProfile("Startup.Profile");

                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);

                    LoadTheme();

#if DEBUG
                    try
                    {
                        Application.Run(new MainWindow());
                        //Application.Run(new HardwareCode());
                    }
                    catch { }
#else
                    try{
                        if (Utility.IsValidLicenseAvailable())
                        {
                            Application.Run(new MainWindow());
                        }
                        else
                        {
                            Application.Run(new HardwareCode());
                        }
                    }catch {}
#endif
                }
                else
                {
                    MessageBox.Show("Only one instance is allowed!");
                }
            }
            finally
            {
                NetworkFunction.ShutDown();
            }
        }