private void butSign_Click(object sender, EventArgs e) { if ((this.txtUsername.Text.Trim().Length <= 0 && (this.txtPass.Text.Trim().Length <= 0 || this.txtPass.Text == "Password")) || (this.txtUsername.Text == "Username" && (this.txtPass.Text.Trim().Length <= 0 || this.txtPass.Text == "Password"))) { this.errLogin.SetError(this.txtUsername, "Please,input username!!!"); this.errLogin.SetError(this.txtPass, "Please,input password!!!"); } //this.errLogin.Clear(); else { if (NoteControl.SignIn(txtUsername.Text, txtPass.Text) == true) { Program.GeneralName = txtUsername.Text; Program.GeneralID = NoteControl.GetIdLogin(txtUsername.Text); Program.Tags = true; this.Dispose(); fmNote fm = new fmNote(); fm.ShowDialog(); } else { MessageBox.Show("Login failed"); } } }
public void Delete() { Part.Delete(this); if (NoteControl != null) { NoteControl.Delete(); } }
private async Task MidiEngine_RenderCurrentNotesEventAsync(ConcurrentQueue <MarkablePlaybackEvent>[] markablePlaybackEvents) { this.RemoveOldNotes(); foreach (var markablePlaybackEvent in markablePlaybackEvents) { foreach (var currentMarkablePlaybackEvent in markablePlaybackEvent) { if (this.notesOnScreen.ContainsKey(currentMarkablePlaybackEvent.Id)) { continue; } var currentNoteOnEvent = currentMarkablePlaybackEvent.Event as NoteOnEvent; NoteControl noteControlNote = null; double noteLengthInPercent = 16; if (currentMarkablePlaybackEvent.RelatedEvents.Count > 0) { var noteOff = currentMarkablePlaybackEvent.RelatedEvents.Find(note => note?.Event?.EventType == MidiEventType.NoteOff); var noteOn = currentMarkablePlaybackEvent.RelatedEvents.Find(note => note?.Event?.EventType == MidiEventType.NoteOn); long firstNoteRawTime = -1; if (noteOff != null && noteOn != null) { firstNoteRawTime = noteOff.RawTime < noteOn.RawTime ? noteOff.RawTime : noteOn.RawTime; } else if (noteOff != null) { firstNoteRawTime = noteOff.RawTime; } else if (noteOn != null) { firstNoteRawTime = noteOn.RawTime; } if (firstNoteRawTime != -1) { noteLengthInPercent = 1 * (firstNoteRawTime - currentMarkablePlaybackEvent.RawTime) / 50D; } } var lane = ConvertToLane(currentNoteOnEvent); if (lane.HasValue) { await this.Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => noteControlNote = this.InputControl.PlayNote( lane.Value, TimeSpan.FromSeconds(5), noteLengthInPercent)); this.notesOnScreen[currentMarkablePlaybackEvent.Id] = new RenderedMarkablePlaybackEvent(currentMarkablePlaybackEvent, noteControlNote); } } } }
public void ShowNoteView() { var view = new NoteControl(this); var model = new NoteModel(session); var presenter = new NotePresenter(model, view); showView(view); centerActualView(); }
// 点击提醒文本框,弹浮层选择时间 private void TxtNoteTime_MouseClick(object sender, EventArgs e) { noteControl = new NoteControl(this.notes.Details); noteControl.VisibleChanged += NoteControl_SizeChanged; // 这个不能正常工作 Popup popup = new Popup(noteControl); popup.Show(txtNoteTime, false); }
private void NoteButton_Click(object sender, RoutedEventArgs e) { ToDoItem item = (sender as FrameworkElement).DataContext as ToDoItem; if (item != null) { NoteControl note = new NoteControl(item); SetPopupedControlEvent(note); PopupWindow.ShowWindow(note); } }
private void NoteControl_MouseDoubleClick(object sender, MouseButtonEventArgs e) { NoteControl noteControl = (sender as NoteControl); if (noteControl != null) { noteControl.Note.IsEditing = true; // MessageBox.Show("Note Title: " + noteControl.Note.Title, "Clicked on Note"); } }
public void SetNewLyric(string lyric) { ProcessLyric(lyric); if (Phonemes != string.Empty) { NoteControl.SetText(Lyric, Phonemes); } else { NoteControl.SetText(Lyric); } }
public void AddToNoteControls(Note note) { var ctrl = new NoteControl(note) { Margin = new System.Windows.Thickness(10), Height = 50, Width = 300 }; NoteControls.Add(ctrl); UpdateNotesScrollViewer(); }
private void fmEditAccount_Load(object sender, EventArgs e) { LoginUser login = NoteControl.getLogin(Program.GeneralID); txtFirst.Text = login.FullName; txtPass.Text = login.Password; txtUser.Text = login.Username; txtPhone.Text = login.PhoneNum; txtConfirm.Text = ""; dtpDOB.Value = login.DOB.Value; cbSex.Text = login.Gender; txtUser.ReadOnly = true; this.picava.Image = Image.FromFile(String.Format("{0}.jpg", Program.GeneralName)); }
private void butSubmit_Click(object sender, EventArgs e) { if (NoteControl.GetPassword(txtUsername.Text, txtPhone.Text) == null) { DialogResult result = MessageBox.Show("Sorry, Account is not exist", "Forgot password", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { DialogResult result = MessageBox.Show("Your password is " + NoteControl.GetPassword(txtUsername.Text, txtPhone.Text), "Forgot password", MessageBoxButtons.OK, MessageBoxIcon.Information); if (result == DialogResult.OK) { this.Dispose(); } } }
void colliderCheck(RaycastHit hit, int offset) { if (hit.collider.tag.Equals("SingleNoteCyan")) { GameObject hitSingleNote = hit.transform.gameObject; try { NoteControl noteControl = hitSingleNote.GetComponent(typeof(NoteControl)) as NoteControl; noteControl.Hit(); } catch (Exception ex) { Debug.Log(ex.Message); } } }
/// <summary> /// method returns the /// </summary> public Point Add(NoteControl noteControl, PriorityEnum priority) { // initial value Point point = new Point(0, 0); // Determine the action by the priority switch (priority) { case PriorityEnum.High: // Add this item this.HighPriorityItems.Add(noteControl); // set the x and y point.X = LeftStart + ((HighPriorityItems.Count - 1) * ControlSpacing); point.Y = HighPrioirityRow; // required break; case PriorityEnum.Normal: // Add to NormalPriorityItems NormalPriorityItems.Add(noteControl); // set the x and y point.X = LeftStart + ((NormalPriorityItems.Count - 1) * ControlSpacing); point.Y = NormalPrioirityRow; // required break; case PriorityEnum.Low: // Add to LowPriorityItems LowPriorityItems.Add(noteControl); // set the x and y point.X = LeftStart + ((LowPriorityItems.Count - 1) * ControlSpacing); point.Y = LowPrioirityRow; // required break; } // return value return(point); }
void NotePress(NoteCategory type) { GameObject note; switch (type) { case NoteCategory.purple: note = singleNotePurple; break; case NoteCategory.orange: note = singleNoteOrange; break; case NoteCategory.cyan: note = singleNoteCyan; break; case NoteCategory.green: note = singleNoteGreen; break; case NoteCategory.yellow: note = singleNoteYellow; break; case NoteCategory.red: note = singleNoteRed; break; case NoteCategory.pink: note = singleNotePink; break; default: note = singleNotePurple; break; } note = Instantiate(note, note.transform.position, note.transform.rotation); NoteControl noteSpeed = note.GetComponent(typeof(NoteControl)) as NoteControl; noteSpeed.speed = 7 * songSpeed; if (isRecording) { RecordNote(type); } }
public NoteAdorner(NoteControl adornedElement) : base(adornedElement) { AdornedElement.MouseEnter += OnMouseEnter; AdornedElement.MouseLeave += OnMouseLeave; this.MouseLeave += OnMouseLeave; visualChildren = new VisualCollection(this); // Call a helper method to initialize the Thumbs // with a customized cursors. BuildAdornerCorner(ref bottomRight, Cursors.SizeNWSE); // Add handlers for resizing. bottomRight.DragDelta += new DragDeltaEventHandler(HandleBottomRight); adornedElement.MoveThumb.DragDelta += HandleTop; }
private void butSubmit_Click(object sender, EventArgs e) { LoginUser login = NoteControl.getLogin(Program.GeneralID); login.PhoneNum = txtPhone.Text; login.Password = txtPass.Text; login.FullName = txtFirst.Text; login.DOB = dtpDOB.Value; login.Gender = cbSex.Text; this.picava.Image.Save(String.Format("{0}.jpg", Program.GeneralName)); if (NoteControl.UpdateAccount(login) == false) { MessageBox.Show("Sorry, you need to fill full your information"); } else { this.Dispose(); } }
/// <summary> /// This method Show Hover Control /// </summary> public void ShowHoverControl(NoteControl noteControl) { // if the Settings control exists and DisableHoverControl is false if ((HasSettings) && (!Settings.DisableHoverControl)) { // set the top int hoverTop = 0; int hoverLeft = 0; Note note = null; // If the note object exists if ((NullHelper.Exists(noteControl)) && (noteControl.HasNote)) { // set the note note = noteControl.Note; // Set the panel to the high panel at first hoverTop = HighPriorityButton.Top + 240; hoverLeft = noteControl.Left + 88; // determine where to show the note if (note.Priority == PriorityEnum.Low) { // Go above the control for the low panel hoverTop = LowPriorityButton.Top - 160; } else if (note.Priority == PriorityEnum.Normal) { // use the NormalPanel hoverTop = NormalPriorityButton.Top + 240; } // Display the Note Description this.NoteHoverControl.Top = hoverTop; this.NoteHoverControl.Left = hoverLeft; this.NoteHoverControl.DisplayNoteDescription(note.Description); this.NoteHoverControl.Visible = true; } // refresh everything this.Refresh(); } }
private async Task MidiEngine_RenderCurrentNotesEventAsync(ConcurrentQueue <MarkablePlaybackEvent>[] markablePlaybackEvents, TimeSpan currentTime) { this.RemoveOldNotes(); this.RenderTimeToNextNote(currentTime); foreach (var markablePlaybackEvent in markablePlaybackEvents) { foreach (var currentMarkablePlaybackEvent in markablePlaybackEvent) { if (this.notesOnScreen.ContainsKey(currentMarkablePlaybackEvent.Id)) { continue; } var currentNoteOnEvent = currentMarkablePlaybackEvent.Event as NoteOnEvent; NoteControl noteControlNote = null; double noteLengthInPercent = 16; long firstNoteLength = this.GetNoteLengthInRawTime(currentMarkablePlaybackEvent); if (firstNoteLength != -1) { noteLengthInPercent = 1 * firstNoteLength / 50D; } var lane = ConvertToLane(currentNoteOnEvent); if (lane.HasValue) { await this.Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => noteControlNote = this.InputControl.PlayNote( lane.Value, noteDuration, noteLengthInPercent)); this.notesOnScreen[currentMarkablePlaybackEvent.Id] = new RenderedMarkablePlaybackEvent(currentMarkablePlaybackEvent, noteControlNote); } } } }
private void Awake() { if (_instance == null) { _instance = this; } else if (_instance != this) { Destroy(gameObject); } noteControl = FindObjectOfType <NoteControl> (); uiControl = FindObjectOfType <UIControl_Battle> (); setPlayerData(FindObjectOfType <PlayerData_Battle> ().GetPlayerData()); FindObjectOfType <LevelController> ().SetEnemy(); OnBattleStart += SetNewTurn; OnBattleStart += CallOnGetPhase; OnBattleStart += BattleStart; onBattleDone += BattleEnd; OnEnemyDeath += SetNewTurn; }
private void butSubmit_Click(object sender, EventArgs e) { bool te1 = true; bool te2 = true; bool te3 = true; int count = 1; List <LoginUser> loginUsers = NoteControl.getListLogin(); if (NoteControl.getListLogin().Count == 1) { count = 1; } else { count = NoteControl.getListLogin().Count; } for (int i = 0; i < loginUsers.Count; i++) { if (count == loginUsers[i].UserID) { count++; } } loginUser.UserID = count; loginUser.FullName = this.txtFirst.Text + " " + this.txtLast.Text; loginUser.DOB = this.dtpDOB.Value; loginUser.Gender = this.cbSex.Text.Trim(); loginUser.PhoneNum = this.txtPhone.Text.Trim(); for (int i = 0; i < loginUsers.Count; i++) { if (txtUser.Text == loginUsers[i].Username) { DialogResult dialog = MessageBox.Show("Username has existed", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); if (dialog == DialogResult.OK) { txtUser.Focus(); te1 = false; } } else { loginUser.Username = txtUser.Text; te1 = true; } } if (txtPass.Text == textBox5.Text && txtPass.Text != "") { loginUser.Password = this.txtPass.Text.Trim(); te2 = true; } else { DialogResult dialog = MessageBox.Show("You can confirm password again!!!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); if (dialog == DialogResult.OK) { textBox5.Focus(); te2 = false; } } if (pictureBox1.Image == Properties.Resources.login__5_3) { te3 = false; } if (te3 == true && te1 == true && te2 == true) { if (NoteControl.RegisterUser(loginUser) == true) { this.pictureBox1.Image.Save(String.Format("{0}.jpg", loginUser.Username)); MessageBox.Show("Finish, you can login to use Easynote!!!"); this.Dispose(); } else { MessageBox.Show("Sorry, you need to fill full your information"); } } }
/// <summary> /// Initializes a new instance of the <see cref="RenderedMarkablePlaybackEvent"/> class. /// </summary> /// <param name="markablePlaybackEvent">The markable playback event.</param> /// <param name="noteControl">The note control.</param> public RenderedMarkablePlaybackEvent(MarkablePlaybackEvent markablePlaybackEvent, NoteControl noteControl) { this.MarkablePlaybackEvent = markablePlaybackEvent; this.NoteControl = noteControl; }
private void Awake() { noteControl = FindObjectOfType <NoteControl> (); }
public void SetNoteControl(NoteControl noteControl) { noteControl.note = this; NoteControl = noteControl; SetNewLyric(Lyric); }
public static Serializable FromNote( NoteControl note ) { return new Serializable() { Color = note.color, Text = note.Text, Object = note.GameObject == null ? "" : note.GameObject.name, Visible = note.showSpatialNote }; }
/// <summary> /// This method Display Notes /// </summary> public void DisplayNotes() { // Suspend updates this.SuspendLayout(); // RemoveNoteControls RemoveNoteControls(); // Create a new instance of a 'LayoutManager' object. this.LayoutManager = new LayoutManager(); // Create a new instance of a 'Point' object. Point point = new Point(); // Create a new instance of a 'NoteControl' object. NoteControl noteControl = null; // if the value for HasNotes is true if (HasNotes) { // order by priority in descending order List <Note> notes = Notes.OrderBy(x => x.Priority).OrderBy(x => x.Id).ToList(); // Iterate the collection of Note objects foreach (Note note in Notes) { // Create a new instance of a 'NoteControl' object. noteControl = new NoteControl(); // set the note noteControl.Note = note; noteControl.Dock = DockStyle.None; // Add this control this.Controls.Add(noteControl); // determine which panel to add this to switch (note.Priority) { case PriorityEnum.Low: // get the point point = layoutManager.Add(noteControl, PriorityEnum.Low); // required break; case PriorityEnum.Normal: // get the point point = layoutManager.Add(noteControl, PriorityEnum.Normal); // required break; case PriorityEnum.High: // get the point point = layoutManager.Add(noteControl, PriorityEnum.High); // required break; } // set the location noteControl.Location = point; } // resume updates this.ResumeLayout(); // refresh everything this.Refresh(); } }
void loadLevel(SongLevel level) { foreach (var singleNote in level.LevelNotes) { GameObject note = singleNotePurple; if (songStart > singleNote.Timing) { continue; } switch (singleNote.NoteType) { case NoteCategory.purple: note = Instantiate(singleNotePurple, singleNotePurple.transform.position, singleNotePurple.transform.rotation); break; case NoteCategory.orange: note = Instantiate(singleNoteOrange, singleNoteOrange.transform.position, singleNoteOrange.transform.rotation); break; case NoteCategory.cyan: note = Instantiate(singleNoteCyan, singleNoteCyan.transform.position, singleNoteCyan.transform.rotation); break; case NoteCategory.green: note = Instantiate(singleNoteGreen, singleNoteGreen.transform.position, singleNoteGreen.transform.rotation); break; case NoteCategory.yellow: note = Instantiate(singleNoteYellow, singleNoteYellow.transform.position, singleNoteYellow.transform.rotation); break; case NoteCategory.red: note = Instantiate(singleNoteRed, singleNoteRed.transform.position, singleNoteRed.transform.rotation); break; case NoteCategory.pink: note = Instantiate(singleNotePink, singleNotePink.transform.position, singleNotePink.transform.rotation); break; default: break; } NoteControl noteSpeed = note.GetComponent(typeof(NoteControl)) as NoteControl; noteSpeed.speed = 7 * songSpeed; noteSpeed.noteDelay = singleNote.Timing; } StartCoroutine(audioControl.LoadClipDelay(level.AudioPath, level.SongDelay, songStart)); levelEnd = level.LevelLength; levelPlaying = true; countdownLevel = true; if (debugMode) { gameClock.GameTimer = songStart; gameClock.debugTimer = songStart; gameClock.ActivateDebugTimer(); } }