private void BackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { List <string> existingIds = new List <string>(); foreach (ItemObject existingItem in this.ItemList) { existingIds.Add(existingItem.ItemId); } foreach (ItemObject item in (ObservableCollection <ItemObject>)e.Result) { if (!existingIds.Contains(item.ItemId)) { this.ItemList.Add(item); existingIds.Add(item.ItemId); } } this.ButtonVisibility = "True"; this.ProgressText = "Item Load Complete"; if (this.ItemIdAbsentList.Count > 0) { AlertView window = new AlertView() { DataContext = new AlertViewModel(this.ItemIdAbsentList, "Alert", "The following items were not found in the database.") }; window.ShowDialog(); } }
public ActionResult Create(BorrowerAndCategories baci) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { baci.Categories = CategoryService.GetCategories(); if (ModelState.IsValid && (baci.CatergoryId == 1 || baci.CatergoryId == 2 || baci.CatergoryId == 3 || baci.CatergoryId == 4)) { if (!BorrowerService.BorrowerExists(baci.Borrower.PersonId)) { borrower b = new borrower(); b = baci.Borrower; b.CategoryId = baci.CatergoryId; BorrowerService.StoreBorrower(b); TempData["Alert"] = AlertView.Build("Låntagare " + baci.Borrower.FirstName + " " + baci.Borrower.LastName + " skapad.", AlertType.Success); return(Redirect("Start")); } baci.PushAlert(AlertView.Build("Detta personnumret är redan registrerat hos oss", AlertType.Danger)); return(View(baci)); } return(View(baci)); } return(Redirect("/Error/Code/403")); }
public ActionResult Borrower(BorrowerWithUser BorrowerWithUser) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { if (ModelState.IsValid && (BorrowerWithUser.Borrower.CategoryId == 1 || BorrowerWithUser.Borrower.CategoryId == 2 || BorrowerWithUser.Borrower.CategoryId == 3 || BorrowerWithUser.Borrower.CategoryId == 4)) { user tempU = AuthService.GetUserByPersonId(BorrowerWithUser.Borrower.PersonId); if (BorrowerWithUser.User != null && !(UserService.EmailExists(BorrowerWithUser.User.Email) && BorrowerWithUser.User.Email != tempU.Email)) { UserService.Update(BorrowerWithUser, null); } else { BorrowerService.UpdateBorrower(BorrowerWithUser.Borrower); } TempData["Alert"] = AlertView.Build("Du har uppdaterat låntagaren.", AlertType.Success); return(RedirectToAction("/Borrower/" + BorrowerWithUser.Borrower.PersonId)); } return(View(BorrowerService.GetBorrowerWithBorrows(BorrowerWithUser.Borrower.PersonId))); } return(Redirect("/Error/Code/403")); }
/// <summary> /// 0=メイン 1=サブ 2=ロビー 3=CPU対戦 /// </summary> /// <param name="_num">Number.</param> public void MainNotifi(int _num) { int count = DataManager.Deck.GetDeckCardCount(); Debug.Log(count); if (count != 30) { AlertView.Make(-1, "エラー", "デッキは30枚で構成してください", new string[] { "OK" }, gameObject, 1); return; } switch (_num) { case 0: //メインアリーナ case 1: //さぶアリーナ { AlertView.Make(_num, "オンライン対戦", "対戦相手を探します。", new string[] { "OK", "Cancel" }, gameObject, 1); } break; case 3: { AlertView.Make(3, "テストマッチ", "対戦相手を選択してください", new string[] { "サンドバッグ", "初心者向け", "暗黒使い", "光明使い", "大雨使い", "おまけ" }, gameObject, 1); // SceneManager.Instance.ToBattle (1); } break; case 4: { AlertView.Make(4, "ルームマッチ", "特定のプレイヤーと対戦します", new string[] { "ルームを作る", "ルームに入る" }, gameObject, 1); } break; } }
public ActionResult GetAcountInfo(user user, borrower borrower, string newpassword = null) { //Knyter samman user och borrower -objekten BorrowerWithUser borrowerWithUser = new BorrowerWithUser() { User = user, Borrower = borrower }; Auth _auth = new Auth((BorrowerWithUser)Session["User"]); if (_auth.HasUserPermission()) { if (ModelState.IsValid) { if (user.Password != null && PasswordService.VerifyPassword(user.Password, _auth.LoggedInUser.User.Password)) { if (UserService.EmailExists(user.Email) && _auth.LoggedInUser.User.Email != user.Email) { borrowerWithUser.PushAlert(AlertView.Build("Email existerar. Försök igen!", AlertType.Danger)); return(View(borrowerWithUser)); } if (!_auth.IsSameAs(borrowerWithUser, newpassword)) { if (newpassword == "") { UserService.Update(borrowerWithUser, user.Password); } else { if (!PasswordValidaton.IsValid(newpassword)) { borrowerWithUser.PushAlert(AlertView.Build(PasswordValidaton.ErrorMessage, AlertType.Danger)); return(View(borrowerWithUser)); } UserService.Update(borrowerWithUser, newpassword); } borrowerWithUser.PushAlert(AlertView.Build("Du har uppdaterat ditt konto.", AlertType.Success)); Session["User"] = BorrowerService.GetBorrowerWithUserByPersonId(user.PersonId); return(View(borrowerWithUser)); } else { borrowerWithUser.PushAlert(AlertView.Build("Inget har uppdaterats.", AlertType.Info)); return(View(borrowerWithUser)); } } borrowerWithUser.PushAlert(AlertView.Build("Du måste ange ditt eget lösenord.", AlertType.Danger)); return(View(borrowerWithUser)); } return(View(borrowerWithUser)); } return(Redirect("/Error/Code/403")); }
// Lägger till användarkonto till en borrower public ActionResult AddUser(user u) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { BorrowerWithBorrows b = BorrowerService.GetBorrowerWithBorrows(u.PersonId); if (ModelState.IsValid) { if (PasswordValidaton.IsValid(u.Password)) { if (!UserService.EmailExists(u.Email)) { AuthService.CreateUser(u); TempData["Alert"] = AlertView.Build("Du har skapat ett användarkonto till låntagaren.", AlertType.Success); return(RedirectToAction("Borrower", new { id = u.PersonId })); } TempData["Alert"] = AlertView.Build("Konto med emailen " + u.Email + " existerar. Ange en annan!", AlertType.Danger); return(View("Borrower", b)); } TempData["Alert"] = AlertView.Build(PasswordValidaton.ErrorMessage, AlertType.Danger); return(RedirectToAction("Borrower", new { id = u.PersonId })); } TempData["Alert"] = AlertView.BuildErrors(ViewData); return(RedirectToAction("Borrower", new { id = u.PersonId })); } return(Redirect("/Error/Code/403")); }
//セルをタップしたときの処理 public void ButtonNotify(int rank, int order) { selectRank = rank; selectOrder = order; var paramList = DataManager.Instance.xls_ArenaData.sheets[0].list; for (int i = 0; i < paramList.Count; i++) { var param = paramList [i]; if (param.rank == rank && param.order == order) { selectRanker = param; break; } } List <string> selection = new List <string> (); int nowProgress = Datas [rank] [order]; for (int i = 0; i < 3; i++) { if (i <= nowProgress) { selection.Add(Difficulty [i]); } } AlertView.Make(0, "難易度選択", string.Format("vs {0}", selectRanker.name), selection.ToArray(), gameObject, 1); }
public void RefineNotify() { List <int> indexes = new List <int> (); List <string> result = new List <string> (); //天候 result = new List <string>() { "なし", "灼熱天候", "大雨天候", "竜巻天候", "光明天候", "暗黒天候" }; indexes = new List <int> () { -1, 0, 1, 2, 3, 4 }; //グループ var groupParams = DataManager.Instance.xls_Groups.sheets [0].list; for (int i = 0; i < groupParams.Count; i++) { string groupName = groupParams [i].name; if (groupName != "") { result.Add(groupName); indexes.Add(i); } } GroupIndexes = indexes; AlertView.Make(3, "絞り込み", "天候/種族で絞り込み", result.ToArray(), gameObject, 1); }
public void ButtonNotify(int num) { switch (num) { case 0: //ヴァージョン { AlertView.Make(0, "バージョン確認", "v" + DataManager.Instance.AppVersion, new string[] { "OK" }, gameObject, 1); } break; // case 1://プレイヤー情報 // { // // } // break; // case 2://公式サイト // { // } // break; case 3: //著作権表記 { AlertView.Make(3, "著作権表記", "タップで外部サイトへ", Copyright, gameObject, 1); } break; // case 4://利用規約 // { // // } // break; // case 5://ヘルプ // { // AlertView.Make (0,"ヘルプ","現在作成中のコンテンツです。",new string[]{"OK"}, gameObject,1); // } // break; case 6: //お問い合わせ { AlertView.Make(0, "お問い合わせ", "*****@*****.**", new string[] { "OK" }, gameObject, 1); } break; // case 7://データ引き継ぎ // { // AlertView.Make (0,"データ引き継ぎ","現在作成中",new string[]{"OK"}, gameObject,1); // } // break; case 8: //バトルスピード { AlertView.Make(8, "バトルスピード", "ゲーム速度を設定します", new string[] { "高速", "普通", "低速" }, gameObject, 1); } break; default: { AlertView.Make(0, "製作中", "現在作成中のコンテンツです。", new string[] { "OK" }, gameObject, 1); } break; } }
public void OnLvup(int cid, int lv, string errmsg) { alert.OpenClose(false); alert = null; //エラー表示 if (errmsg != "") { alert = AlertView.Make(-1, "エラー", errmsg, new string[] { "確認" }, gameObject, 1); return; } //レベルアップ処理 DataManager.Box.LevelUp(cid); //ボックスデータ更新 Refresh(); //再タップ処理 OnCardTap(SelectingData[0], SelectingData[1]); //再取得 CardParam cp = GetBoxCardParam(SelectingCard.ID); //アラート表示 AlertView.Make(1, "強化成功", string.Format(cp.Name + ":LV.{0}\nパワー+1", cp.LV), new string[] { "OK" }, gameObject, 1); DataManager.Instance.SEPlay(10); }
public void ShowConfirm(int id, string content, string ok_name, string cancel_name, System.Action <eAlertBtnType> fun) { //layer Transform layer = UILayerUtils.GetLayer((int)eUILayer.TOP); if (layer == null) { Log.Warning("AlertManager::Show - not find layer:" + eUILayer.TOP); layer = UILayerUtils.RootLayer; } //构建 GameObject obj = UIManager.Instance.Show(id); if (obj == null) { return; } GameObjectUtils.SetLayer(obj, LayerMask.NameToLayer(SceneLayerID.UI)); m_AlertView = obj.GetComponent <AlertView>() as AlertView; if (m_AlertView == null) { m_AlertView = obj.AddComponent <AlertView>() as AlertView; } //更新数据 m_AlertView = obj.GetComponent <AlertView>(); m_AlertView.Content = content; m_AlertView.DicBtn.Add(eAlertBtnType.OK, ok_name); m_AlertView.DicBtn.Add(eAlertBtnType.CANCEL, cancel_name); m_AlertView.Fun = fun; m_AlertView.Show(); }
public void OnRecieve(int _num, int _tag) { if (_num == -1 || _tag == -1) { return; } if (_tag == 0 || _tag == 1) //ランクマッチ { if (_num == 0 && _tag != -1) { OnlineManager.Instance.Matching(OnlineManager.BattleMode.RANK, null); DataManager.Instance.TouchDisable(1); } } else if (_tag == 3) //テストマッチ { SceneManagerx.Instance.ToTestMatch(_num); } else if (_tag == 4) //ルームマッチ { if (_num == 0) { //ルーム作成 OnlineManager.Instance.Matching(OnlineManager.BattleMode.ROOM, null); DataManager.Instance.TouchDisable(1); } else { //ルーム入室 AlertView.MakeInput(0, "ルームマッチ", "5桁のルームIDを入力してください", gameObject, 1); } } }
/// <summary> /// Joinもしくはcreateする。 /// </summary> void JoinOrCreate() { //ルームオプション RoomOptions roomOptions = new RoomOptions(); roomOptions.MaxPlayers = 2; //部屋の最大人数 roomOptions.IsOpen = true; //入室許可する roomOptions.IsVisible = false; //ロビーから見えるようにする if (battleMode == BattleMode.RANK) { PhotonNetwork.JoinRandomRoom(); } else if (battleMode == BattleMode.ROOM) { if (roomKeyword == null) //ルーム作成 { roomKeyword = "" + Random.Range(10000, 99999); PhotonNetwork.CreateRoom("room:" + roomKeyword, roomOptions, null); alert = AlertView.Make(0, "待機中", "ルームID:" + roomKeyword, new string[] {}, gameObject, 1); } else //ルーム入室 { PhotonNetwork.JoinRoom("room:" + roomKeyword); } } }
public override void ViewDidLoad() { base.ViewDidLoad(); time = 0; timer = NSTimer.CreateRepeatingScheduledTimer(0.02, () => { if (ProgressBar.Superview != null) { //Console.WriteLine ("Something something"); ProgressBar.Progress = time / 100f; time++; if (time > 130) { time = -30; } return; } time++; AlertView.ProgressBar.Progress = time / 200f; if (time > 240) { View.AddSubview(ProgressBar); View.AddSubview(Loading); AlertView.Hide(); time = 0; } }); NSRunLoop.Current.AddTimer(timer, NSRunLoopMode.Default); }
public void Remove() { if (m_AlertView != null) { GameObject.Destroy(m_AlertView.gameObject); m_AlertView = null; } }
public void nextOrCreateCommand() { AlertViewViewModel.Button button = new AlertViewViewModel.Button { name = "Okay" }; if (string.IsNullOrWhiteSpace(_project_model_i.ProjectName) || string.IsNullOrWhiteSpace(_project_model_i.ProjectLocation) || _project_model_i.ProjectModel == null || _project_model_i.ProjectDate == DateTime.MinValue) { AlertView alertView = new AlertView("Not enough informations", "The informations you have provided to create a new project is not sufficient. Please fill essential fields.", AlertViewType.WARNING, button); alertView.ShowDialog(); } else { DateTime current_date_time = DateTime.Now; _project_model_i.ProjectCreationDate = current_date_time; if (_project_model_i.ProjectModel.client_id.value == _project_model_i.ClientModels[0].id.value) { try { this.nextButtonClicked(); } catch (AlreadyExistsError) { AlertView alertView = new AlertView("Project already exist", "The project you are trying to create is already exist, try a different project name.", AlertViewType.ERROR, button); alertView.ShowDialog(); } catch (DirectoryNotFoundException) { AlertView alertView = new AlertView("Invalid path", "The path you are trying to create the project is invalid, insert a correct path or explore a path.", AlertViewType.ERROR, button); alertView.ShowDialog(); } catch (Exception err) { Core.Reference.logger.logError(err); AlertView alertView = new AlertView("Unknown error", "Unknown error has occured while creating a project. Please try again.", AlertViewType.ERROR, button); alertView.ShowDialog(); } } else { try { ProjectModelI.ProjectModelApi.model.client_id.value = ProjectModelI.SelectedClient.id.value; CoreApp.getSingleton().createNewProject(ProjectModelI.ProjectModelApi, FolderBrowseCommand.FolderPath); CoreApp.getSingleton().setDefaultProjectPath(FolderBrowseCommand.FolderPath); NewProject.ProjectManager.closeWindow(); } catch (AlreadyExistsError) { AlertView alertView = new AlertView("Project already exist", "The project you are trying to create is already exist, try a different project name.", AlertViewType.ERROR, button); alertView.ShowDialog(); } catch (DirectoryNotFoundException) { AlertView alertView = new AlertView("Invalid path", "The path you are trying to create the project is invalid, insert a correct path or explore a path.", AlertViewType.ERROR, button); alertView.ShowDialog(); } catch (Exception err) { Core.Reference.logger.logError(err); AlertView alertView = new AlertView("Unknown error", "Unknown error has occured while creating a project. Please try again.", AlertViewType.ERROR, button); alertView.ShowDialog(); } } } }
public LoginViewModel() { LoginCommand = new RelayCommand(Login); SignupCommand = new RelayCommand(Signup); _alertView = new AlertView() { DataContext = new AlertViewModel() }; }
/// <summary> /// ランクマッチ用 /// </summary> void CreateRandomRoom() { RoomOptions roomOptions = new RoomOptions(); roomOptions.MaxPlayers = 2; //部屋の最大人数 roomOptions.IsOpen = true; //入室許可する roomOptions.IsVisible = true; //ロビーから見えるようにする PhotonNetwork.CreateRoom("rank:" + SystemScript.GeneratePassword(10), roomOptions, null); alert = AlertView.Make(1, "オンライン対戦", "対戦相手を探しています...", new string[] { }, gameObject, 1); }
/// <summary> /// Removes an author /// </summary> /// <param name="a"></param> /// <returns></returns> public ActionResult Remove(AuthorWithBooks a) { if (new Auth((BorrowerWithUser)Session["User"]).HasAdminPermission()) { AuthorService.DeleteAuthor(a.Author); TempData["Alert"] = AlertView.Build("Du har tagit bort författaren " + a.Author.FirstName + " " + a.Author.LastName, AlertType.Success); return(RedirectToAction("Start")); } return(Redirect("/Error/Code/403")); }
public void GetPacks() { string UsePointName = (useType == 0) ? "coin" : "dia"; //通信処理 TestScript.Instance.Delegate = gameObject; TestScript.Instance.Buy(UsePointName, useCount); //アラート alert = AlertView.Make(-1, "通信中...", "しばらくお待ちください", new string[] {}, gameObject, 1, true); }
public void CheckResources() { updateStatusData.Reset(); if (Application.isEditor && loadMode == LoadModeType.FromResources) { StartCoroutine(SkipCheckUpdateFiles()); } else { float time = Time.realtimeSinceStartup; float size = 0; List <DownloadFile> list = new List <DownloadFile>(); // list.Add(new DownloadFile("https://speed.hetzner.de/100MB.bin", Path.Combine(Application.persistentDataPath, "test1.bin"))); list.Add(new DownloadFile("https://image.baidu.com/search/down?tn=download&word=download&ie=utf8&fr=detail&url=https%3A%2F%2Ftimgsa.baidu.com%2Ftimg%3Fimage%26quality%3D80%26size%3Db9999_10000%26sec%3D1535005781611%26di%3Decfa16c783fec6a3eee60d0cb4eee654%26imgtype%3D0%26src%3Dhttp%253A%252F%252Fatt.bbs.duowan.com%252Fforum%252F201209%252F28%252F075324wcewb8zwgb1pgbg0.jpg&thumburl=https%3A%2F%2Fss1.bdstatic.com%2F70cFvXSh_Q1YnxGkpoWK1HF6hhy%2Fit%2Fu%3D3206931758%2C4276788165%26fm%3D26%26gp%3D0.jpg", Path.Combine(Application.persistentDataPath, "test.jpg"))); FileDownloader downloader = FileDownloader.DownloadFiles(list); downloader.timeout = 10; downloader.onDownloadStateChanged = (FileDownloader dl, DownloadState state) => { if (state == DownloadState.NetworkError) { AlertView.Show(dl.error, () => { Debug.Log("OnCliCked"); downloader.Resume(); }); } else if (state == DownloadState.HttpError) { AlertView.Show("responseCode:" + dl.responseCode); } else if (state == DownloadState.Finish) { updateStatusData.SetPercent(1.0f); SendNotification(NotificationDefine.CHECK_RESOURCES_STATUS_UPDATE, updateStatusData); Destroy(dl); } }; downloader.onDownloadedSizeChanged = (FileDownloader dl, float downloadedSize) => { float totalSize = 393; updateStatusData.SetPercent(downloadedSize / totalSize); if ((Time.realtimeSinceStartup - time) > 1.0f) { float speed = (downloader.downloadedSize - size) / (Time.realtimeSinceStartup - time); updateStatusData.SetSpeed(speed); time = Time.realtimeSinceStartup; size = downloader.downloadedSize; } SendNotification(NotificationDefine.CHECK_RESOURCES_STATUS_UPDATE, updateStatusData); }; } }
public DashboardViewModel() { AccountCommand = new RelayCommand(GotoAccounts); SettingsCommand = new RelayCommand(GotoSettings); LogoutCommand = new RelayCommand(Logout); ExitCommand = new RelayCommand(Exit); _alertView = new AlertView() { DataContext = new AlertViewModel() }; }
/// <summary> /// 文字入力用アラート _Scene Title/0 Menu/1 Battle/2 /// </summary> static public AlertView MakeInput(int _tag, string _Title, string _Description, GameObject _delegate, int _Scene, bool _CantCancel = false) { //タップ無効化 DataManager.Instance.TouchDisable(_Scene); //アラート生成 AlertView _alt = Instantiate(DataManager.Instance.InputAlertPrefab); _alt.transform.SetParent(DataManager.Instance.AlertParents[_Scene]); _alt.ShowInput(_delegate, _Title, _Description, _tag, _CantCancel); return(_alt); }
partial void ShowAlert(NSObject sender) { var alert = new AlertView("Alert Title", "This is an alert message"); alert.SetDestructiveButtonWithTitle("Cancel", null); alert.AddButtonWithTitle("OK", () => { this.ShowAlert(null); }); alert.Show(); }
public void BuyPack(int _num) { string UsePointName = (_num == 0) ? "Coin" : "Gold"; var reas = realities [_num]; List <string> ls = new List <string> (); for (int i = 0; i < Matomegai.Length; i++) { ls.Add(string.Format("{0}パック購入 : {1}{2}", Matomegai [i], Matomegai[i] * 300, UsePointName)); } AlertView.Make(_num, UsePointName + "で購入", "購入数を選択してください・", ls.ToArray(), gameObject, 1); }
void FindGameObjects() { // find var canvas = GameObject.Find("Canvas").transform; alertView = canvas.Find("AlertView").GetComponent <AlertView>(); loginView = canvas.Find("LoginView").GetComponent <LoginView>(); sharedData = ScriptableObject.CreateInstance <SharedScriptableObject>(); // set alertPresenter.InnerPresenter = new AlertPresenter(alertView); loginPresenter.InnerPresenter = new LoginPresenter(loginView); accountRepository.InnerRepository = new UserAccountRepository(sharedData); }
public async void BtnGetEvent(string id) { TsApiService t = new TsApiService(); AlertView result = await t.AlarmDetailPage(id); //TopSeries = new ObservableCollection<TaskView>(result); LabTitle.Text = result.Title; LabType.Text = result.Type; //Labbuild.Text = result.Build; //Labaddress.Text = result.Address; //ItemsListView.HeightRequest = 36*2 * result.Contacts.Count; //ItemsListView.ItemsSource = result.Contacts; }
/// <summary> /// Checks that collumn headers are correct and alerts user if any are misspelled /// </summary> /// <param name="fileName"></param> /// <returns></returns> private void CheckColumnHeaders(string fileName) { List <string> wrongHeaders = ItemService.ValidateHeaderCollumns(fileName); if (wrongHeaders.Count > 0) { AlertView window = new AlertView { DataContext = new AlertViewModel(wrongHeaders, "Alert", "The following columns did not match any existing values. Please adjust the header or remove this column before loading.") }; window.ShowDialog(); } }
public static void Show(string message, SimpleClickDelegate okDel = null) { GameObject alertGo = UIUtils.ShowUIView(PREFAB_RES_PATH); if (alertGo == null) { return; } AlertView view = alertGo.GetComponent <AlertView>(); view.SetClickDelegate(okDel); view.Message = message; }
public void ShowAlertView(GameObject prefab, GameObject target, Hashtable args) { GameObject alert_obj = Instantiate(prefab, Vector3.zero, Quaternion.identity) as GameObject; alert_obj.transform.SetParent(transform, false); alert_obj.GetComponent <Canvas> ().overrideSorting = true; AlertView alerView = alert_obj.GetComponent <AlertView>(); alerView.ShowAlertView(target, args); active_alert_views.Add(alert_obj); ShowOverlay(); }
private void Start_Click(object sender, RoutedEventArgs e) { if (fltdgStrategyStatus.SelectedItems == null || fltdgStrategyStatus.SelectedItems.Count == 0) { return; } Dictionary<string, List<string>> selectedStrategyAndSymbol = new Dictionary<string, List<string>>(); GetSelectedStrategyAndSymbol(selectedStrategyAndSymbol, ProcessType.START); string messageTextLine2 = CreateMessageText(selectedStrategyAndSymbol); AlertView view = new AlertView(AlertType.START, string.Empty, messageTextLine2, false); bool? status = view.ShowDialog(); if (status == true && AlertView.AlertReturnType == AlertActionReturnType.YES) { App.AppManager.Start(selectedStrategyAndSymbol, false); } else { ClearSelectedStrategyAndSymbol(); } }
private void lockUnLockRowButton_Click(object sender, RoutedEventArgs e) { App.AppManager.DataMgr.ClearProcessSelectionIndication(); AlertType alertType = AlertType.LOCK; if (dgAggregate.SelectedItem != null) { if (dgAggregate.SelectedItem is SummaryOrder) { SummaryOrder order = dgAggregate.SelectedItem as SummaryOrder; string key = order.StrategyId; if (order.Status.Equals("Lock")) { alertType = AlertType.UNLOCK; } Dictionary<string, List<string>> selectedStrategyAndSymbol = new Dictionary<string, List<string>>(); GetSelectedStrategyAndSymbol(key, selectedStrategyAndSymbol, alertType); string messageTextLine3 = CreateMessageText(selectedStrategyAndSymbol); string messageTextLine2 = string.Format("{0}", App.AppManager.DataMgr.StrategyList.Where(s => s.StrategyId == key).Select(s => s.StrategyName).FirstOrDefault()); AlertView view = new AlertView(alertType, messageTextLine2, messageTextLine3, true); bool? status = view.ShowDialog(); if (status == true && AlertView.AlertReturnType == AlertActionReturnType.YES) { if (alertType == AlertType.LOCK) { App.AppManager.Lock(selectedStrategyAndSymbol, true); } else { App.AppManager.Unlock(selectedStrategyAndSymbol, true); } } else { ClearSelectedStrategyAndSymbol(key); } } } }
private void SetTradingModeSell() { Dictionary<string, List<string>> selectedStrategyAndSymbol = new Dictionary<string, List<string>>(); GetSelectedStrategyAndSymbol(selectedStrategyAndSymbol, ProcessType.SELL); if (selectedStrategyAndSymbol.Count == 0) { return; } string messageTextLine2 = CreateMessageText(selectedStrategyAndSymbol); AlertView view = new AlertView(AlertType.SELL, string.Empty, messageTextLine2, false); bool? status = view.ShowDialog(); if (AlertView.AlertReturnType == AlertActionReturnType.YES) { string tradingMode = "Sell"; SetOrderTradingMode(selectedStrategyAndSymbol, tradingMode); App.AppManager.Sell(selectedStrategyAndSymbol, false); } else { ClearSelectedStrategyAndSymbol(); } }
private void mnuStop_Click(object sender, RoutedEventArgs e) { Dictionary<string, List<string>> selectedStrategyAndSymbol = new Dictionary<string, List<string>>(); GetSelectedStrategyAndSymbol(selectedStrategyAndSymbol, ProcessType.STOP); string messageTextLine2 = CreateMessageText(selectedStrategyAndSymbol); AlertView view = new AlertView(AlertType.STOP, string.Empty, messageTextLine2, false); bool? status = view.ShowDialog(); if (status == true && AlertView.AlertReturnType == AlertActionReturnType.YES) { App.AppManager.Stop(selectedStrategyAndSymbol, false); } else { ClearSelectedStrategyAndSymbol(); } }
private void startStopRowButton_Click(object sender, RoutedEventArgs e) { App.AppManager.DataMgr.ClearProcessSelectionIndication(); AlertType alertType = AlertType.START; if (dgAggregate.SelectedItem != null) { if (dgAggregate.SelectedItem is SummaryOrder) { SummaryOrder order = dgAggregate.SelectedItem as SummaryOrder; string key = order.StrategyId; string strategy = order.StrategyName; Dictionary<string, List<string>> selectedStrategyAndSymbol = new Dictionary<string, List<string>>(); bool? status = true; AlertView.AlertReturnType = AlertActionReturnType.YES; if (order.Status.Equals("Running")) { alertType = AlertType.STOP; GetSelectedStrategyAndSymbol(key, selectedStrategyAndSymbol, alertType); string messageTextLine3 = CreateMessageText(selectedStrategyAndSymbol); string messageTextLine2 = string.Format("{0}", App.AppManager.DataMgr.StrategyList.Where(s => s.StrategyId == key).Select(s => s.StrategyName).FirstOrDefault()); AlertView view = new AlertView(alertType, messageTextLine2, messageTextLine3, true); status = view.ShowDialog(); } else { GetSelectedStrategyAndSymbol(key, selectedStrategyAndSymbol, alertType); } if (status == true && AlertView.AlertReturnType == AlertActionReturnType.YES) { if (alertType == AlertType.START) { App.AppManager.Start(selectedStrategyAndSymbol, true); order.Status = App.AppManager.StgEngine.StrategyEngineStatus; } else { if (!string.IsNullOrEmpty(AlertView.AlertReturnSymbols)) { if (AlertView.AlertReturnSymbols.Equals("ALL")) { App.AppManager.Stop(selectedStrategyAndSymbol, true); order.Status = App.AppManager.StgEngine.StrategyEngineStatus; } else { selectedStrategyAndSymbol = new Dictionary<string, List<string>>(); selectedStrategyAndSymbol[key] = EZXWPFLibrary.Utils.StringUtils.StringTextToList(AlertView.AlertReturnSymbols, ','); App.AppManager.Stop(selectedStrategyAndSymbol, false); order.Status = App.AppManager.StgEngine.StrategyEngineStatus; } } else { MessageBox.Show("No symbol is selected"); } } } else { ClearSelectedStrategyAndSymbol(key); } } } }