public Color GetFillColor(NoteView noteView) { var alt = noteView.Note.Note.direction > 0; if (noteView.Note.Note.is_forward) { alt = !alt; } if (noteView is ClickNoteView) { return(alt ? FillColorClick1 : FillColorClick2); } if (noteView is DragHeadNoteView) { return(alt ? FillColorDrag1 : FillColorDrag2); } if (noteView is DragChildNoteView) { return(alt ? RingColorDrag1 : RingColorDrag2); } if (noteView is LongHoldNoteView) { return(alt ? FillColorLongHold1 : FillColorLongHold2); } if (noteView is HoldNoteView) { return(alt ? FillColorHold1 : FillColorHold2); } if (noteView is FlickNoteView) { return(alt ? FillColorFlick1 : FillColorFlick2); } throw new NotImplementedException(); }
//public NoteBLL() //{ // try // { // } // catch (Exception ex) // { // MessageBox.Show(ex.InnerException.ToString()); // } //} public List <NoteView> GetUserNotes(int ID) { List <NoteView> noteList = new List <NoteView>(); try { using (ClassRoomEntities entities = new ClassRoomEntities()) { var notes = from m in entities.Notes where m.NUserID == ID select m; List <Note> list = notes.ToList(); list.ForEach(m => { NoteView view = new NoteView(); Note entityInfo = view.Clone(m); view.Clone(m); noteList.Add(view); }); } } catch (Exception ex) { MessageBox.Show(ex.InnerException.ToString()); } return(noteList); }
public float GetSize(NoteView noteView) { if (noteView is ClickNoteView) { return(ClickSize * SizeMultiplier); } if (noteView is DragHeadNoteView) { return(DragHeadSize * SizeMultiplier); } if (noteView is DragChildNoteView) { return(DragChildSize * SizeMultiplier); } if (noteView is LongHoldNoteView) { return(LongHoldSize * SizeMultiplier); } if (noteView is HoldNoteView) { return(HoldSize * SizeMultiplier); } if (noteView is FlickNoteView) { return(FlickSize * SizeMultiplier); } throw new NotImplementedException(); }
void AddNoteViewToList(NoteView noteView) { int index = notes.Count - 1; if (notes.Count == 0) { notes.Add(noteView); return; } float z = noteView.gameObject.transform.position.z; if (z > notes[index].GetStartZPosition()) { notes.Add(noteView); return; } else { for (int i = index; i > 0; i--) { if (z < notes[i].GetStartZPosition() && z > notes[i - 1].GetStartZPosition()) { notes.Insert(i, noteView); return; } } notes.Insert(0, noteView); return; } }
private void DrawMenu() { // Create the Grid myGrid = new Grid { ShowGridLines = true }; // show menuGrid lines //menuGrid.ShowGridLines = true; // Define all rows for mainGrid DefineRowMyGrid(); //Create the staves pv = new PianoView(myGrid, mPc); sv = new StaveView(myGrid, mPc); Content = pv.myGrid; //Draw the notes nv = new NoteView(sv); nv.DrawNotes(); bv = new ButtonView(myGrid, sv, nv); bv.pianoStateChanged += pianoStateChanged; metronome = bv.metronome; metronome.countdownFinished += countdownFinished; metronome.countDownTickElapsed += CountDownTickElapsed; }
public void Add_POST() { HttpContext.Current.Session["activeMI"] = "add_note"; dynamic view = new NoteView(); HttpRequest httprequest = HttpContext.Current.Request; presenter.SetViewModel(view); //handel checkbox value //TODO: refine presenter setview to handel this case internaly and return true or false for checkboxes => medium bool isPublic = false; if (view.IsPublic == null) { isPublic = false; } else if (view.IsPublic.ToLower() == "on") { isPublic = true; } if (WebNoteBiz.AdNote(WebShell.Utilities.User.Id, view.Title, isPublic, view.Tag, view.NoteText)) { //TODO: chnge url to MyNotes HttpContext.Current.Response.Redirect(AppData.GetBaseUrl()); } else { HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Url.AbsolutePath + "/security/login/?e=il"); } }
IResult Edit_POST() { IResult result = new Result(); dynamic view = new NoteView(); presenter.SetViewModel(view); //handel checkbox value //TODO: refine presenter setview to handel this case internaly and return true or false for checkboxes => medium bool isPublic = false; if (view.IsPublic == null) { isPublic = false; } else if (view.IsPublic.ToLower() == "on") { isPublic = true; } if (WebNoteBiz.EditNote(view.NoteId, WebShell.Utilities.User.Id, view.Title, isPublic, view.Tag, view.Note)) { result.Data = "1"; result.Success = true; } else { result.Data = "0"; result.Success = false; } return(result); }
public void NotesToPlay(List <MPTKEvent> notes) { System.Random rng = new System.Random(); //Debug.Log(midiFilePlayer.MPTK_PlayTime.ToString() + " count:" + notes.Count); foreach (MPTKEvent note in notes) { switch (note.Command) { case MPTKCommand.NoteOn: if (note.Value > 40 && note.Value < 100) // && note.Channel==1) { // Axis Z for the note value int random = rng.Next(0, 4); Vector3 position = new Vector3(ButtonLocation[random - 1], 10f, 0); NoteView n = Instantiate <NoteView>(NoteDisplay, position, Quaternion.identity); n.gameObject.SetActive(true); n.hideFlags = HideFlags.HideInHierarchy; n.midiStreamPlayer = midiStreamPlayer; n.note = note; n.gameObject.GetComponent <SpriteRenderer>().material = MatNewNote; // See noteview.cs: update() move the note along the plan until they fall out, then they are played PlaySound(); } break; } } }
private void NoteView_Click(object sender, EventArgs e) { NoteView noteView = sender as NoteView; CustomFileSystemCover cover = noteView.Tag as CustomFileSystemCover; ExplorerNet.MVVM.View.NoteWindow nw = new MVVM.View.NoteWindow(); nw.txtDescription.Text = noteView.Description; Point p = noteView.PointToScreen(new Point()); nw.Top = p.Y; nw.Left = p.X; // отобжараем окно заметок //nw.WindowStartupLocation = WindowStartupLocation.CenterScreen; nw.ShowDialog(); if (nw.DialogAnswer == true) { if (string.IsNullOrEmpty(nw.txtDescription.Text)) { cover.Description = null; } else { cover.Description = nw.txtDescription.Text; } noteView.Description = cover.Description; } //noteView.so }
private void EditNote(object parameter) { var view = new NoteView(); view.ViewModel.Set(Book, (Note)parameter, PdfPanel.GetCurrentPageNumber()); view.ViewModel.NoteChanged += _viewModel_NoteChanged; view.ShowDialog(); }
private void AddNote() { var view = new NoteView(); view.ViewModel.Set(Book, null, PdfPanel.GetCurrentPageNumber()); view.ViewModel.NoteChanged += _viewModel_NoteChanged; view.ShowDialog(); }
public ActionResult DeleteConfirmed(int id) { NoteView noteView = db.NoteViews.Find(id); db.NoteViews.Remove(noteView); db.SaveChanges(); return(RedirectToAction("Index")); }
private void AddNoteButton() { NoteV = new NoteView(); NoteVM = new NoteViewModel(); NoteV.DataContext = NoteVM; NoteVM.NoteClosed += OnNoteClosed; NoteV.Show(); }
public IResult Default_POST() { IResult result = new Result(); dynamic view = new NoteView(); presenter.SetViewModel(view, HttpContext.Current.Request); return(result); }
private void brdEdit_Tapped(object sender, TappedRoutedEventArgs e) { if (lvwDailyNotes.SelectedItems.Count > 0) { NoteView item = new NoteView(); item = (NoteView)lvwDailyNotes.SelectedItems[0]; Note nItem = GetNote(item); Frame.Navigate(typeof(NoteDetail), nItem); } }
public async static Task <AbMediaContent> takeNote(Card card, Page parentPage) { ContentPage editNotePage = new ContentPage(); NoteView noteCapture = new NoteView(card, editNotePage); editNotePage.Disappearing += (e, v) => { noteCapture.onDisappear(); }; // TODO should move to constructor editNotePage.Content = noteCapture; return(await getMediaResult(noteCapture, noteCapture, editNotePage, parentPage)); }
public ActionResult Edit([Bind(Include = "id,ShoppingListItemId,Body,CreatedUtc,ModifiedUtc")] NoteView noteView) { if (ModelState.IsValid) { db.Entry(noteView).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(noteView)); }
void rtbBody_TextChanged(object sender, TextChangedEventArgs e) { RichTextBox text = sender as RichTextBox; ContentControl control = text.TemplatedParent as ContentControl; NoteView note = control.Tag as NoteView; //TextRange range = new TextRange(text.Document.ContentStart, text.Document.ContentEnd); note.Body = text.RTF(); note.DataStatus = DataStatusEnum.Updated; }
private void ResizeThumb_DragDelta(object sender, DragDeltaEventArgs e) { if (this.designerItem != null) { double deltaVertical, deltaHorizontal; switch (VerticalAlignment) { case System.Windows.VerticalAlignment.Bottom: deltaVertical = Math.Min(-e.VerticalChange, this.designerItem.ActualHeight - this.designerItem.MinHeight); Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + (this.transformOrigin.Y * deltaVertical * (1 - Math.Cos(-this.angle)))); Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) - deltaVertical * this.transformOrigin.Y * Math.Sin(-this.angle)); this.designerItem.Height -= deltaVertical; break; case System.Windows.VerticalAlignment.Top: deltaVertical = Math.Min(e.VerticalChange, this.designerItem.ActualHeight - this.designerItem.MinHeight); Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + deltaVertical * Math.Cos(-this.angle) + (this.transformOrigin.Y * deltaVertical * (1 - Math.Cos(-this.angle)))); Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + deltaVertical * Math.Sin(-this.angle) - (this.transformOrigin.Y * deltaVertical * Math.Sin(-this.angle))); this.designerItem.Height -= deltaVertical; break; default: break; } switch (HorizontalAlignment) { case System.Windows.HorizontalAlignment.Left: deltaHorizontal = Math.Min(e.HorizontalChange, this.designerItem.ActualWidth - this.designerItem.MinWidth); Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) + deltaHorizontal * Math.Sin(this.angle) - this.transformOrigin.X * deltaHorizontal * Math.Sin(this.angle)); Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + deltaHorizontal * Math.Cos(this.angle) + (this.transformOrigin.X * deltaHorizontal * (1 - Math.Cos(this.angle)))); this.designerItem.Width -= deltaHorizontal; break; case System.Windows.HorizontalAlignment.Right: deltaHorizontal = Math.Min(-e.HorizontalChange, this.designerItem.ActualWidth - this.designerItem.MinWidth); Canvas.SetTop(this.designerItem, Canvas.GetTop(this.designerItem) - this.transformOrigin.X * deltaHorizontal * Math.Sin(this.angle)); Canvas.SetLeft(this.designerItem, Canvas.GetLeft(this.designerItem) + (deltaHorizontal * this.transformOrigin.X * (1 - Math.Cos(this.angle)))); this.designerItem.Width -= deltaHorizontal; break; default: break; } NoteView note = this.designerItem.Tag as NoteView; note.DataStatus = DataStatusEnum.Updated; note.X = Canvas.GetLeft(this.designerItem); note.Y = Canvas.GetTop(this.designerItem); note.Width = this.designerItem.Width; note.Height = this.designerItem.Height; } e.Handled = true; }
public void AddNote(Note note, GameObject prefab) { Vector3 notePosition = NewNotePosition(); GameObject newNote = Instantiate(prefab, spawnPoint); newNote.transform.position = notePosition; NoteView newNoteView = newNote.AddComponent <NoteView>(); newNoteView.note = note; notes.Add(newNoteView); }
public async Task <IActionResult> Create(NoteView model) { DTONote note = new DTONote { AddedDate = model.AddedDate, NoteText = model.NoteText }; var dtoNote = await db.AddNote(note); await hub.Clients.All.SendAsync("Send", dtoNote); return(RedirectToAction("ClientOne")); }
public ActionResult Create([Bind(Include = "id,ShoppingListItemId,Body,CreatedUtc,ModifiedUtc")] NoteView noteView) { if (ModelState.IsValid) { db.NoteViews.Add(noteView); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(noteView)); }
IResult Edit_GET() { IResult result = new Result(); dynamic view = new NoteView(); long id = long.Parse(HttpContext.Current.Request.QueryString["id"].ToString()); string strJsonData = WebNoteBiz.GetNote(id); result.Data = strJsonData; result.Success = true; return(result); }
void RotateThumb_DragCompleted(object sender, DragCompletedEventArgs e) { if (this.designerItem != null && this.canvas != null) { NoteView note = this.designerItem.Tag as NoteView; note.DataStatus = DataStatusEnum.Updated; note.RotateCenterX = rotateTransform.CenterX; note.RotateCenterY = rotateTransform.CenterY; note.RotateAngle = rotateTransform.Angle; } }
private void Button_Click(object sender, RoutedEventArgs e) { var viewWindow = new NoteView { DataContext = new NoteViewViewModel { NoteMd = (this.DataContext as NoteViewModel).Note.Content, NoteTitle = (this.DataContext as NoteViewModel).Note.Title } }; viewWindow.ShowDialog(); }
public void AddNote(Note note, GameObject prefab) { CleanListOfEmptyViews(); GameObject newNote = Instantiate(prefab, spawnPoint); SetNotePosition(newNote); NoteView newNoteView = newNote.AddComponent <NoteView>(); newNoteView.note = note; newNoteView.inEditing = true; newNoteView.editor = this; AddNoteViewToList(newNoteView); }
public ActionResult GetNote(int dayId) { var day = db.DayStatuses.First(d => d.DayStatusId == dayId); NoteView note = new NoteView { DayId = day.DayStatusId, Date = day.StatusDate, NoteText = day.Note == null ? "" : day.Note, Headline = day.NoteHeadline == null ? "Заголовок" : day.NoteHeadline }; string noteJSON = Newtonsoft.Json.JsonConvert.SerializeObject(note); return(Json(noteJSON, JsonRequestBehavior.AllowGet)); }
void btnClose_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; ContentControl control = btn.TemplatedParent as ContentControl; NoteView note = control.Tag as NoteView; MessageBoxResult result = MessageBox.Show("确定要删除", "删除留言", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { note.DataStatus = DataStatusEnum.Deleted; this.NoteCanvas.Children.Remove(control); } }
public void AllocView(IntPtr ObjectPtr) { if (Alloced) { Track_PitchView.setPartsObjectPtr(ObjectPtr); Track_NoteView.setPartsObjectPtr(ObjectPtr); Global_ActionView.setPartsObjectPtr(ObjectPtr); Param_PitchView.setPartsObjectPtr(ObjectPtr); Param_DynamicView.setPartsObjectPtr(ObjectPtr); Track_NoteView.setSingerDataFinder(SingerDataFinders); } else { Track_NoteView = new NoteView(ObjectPtr, this.PianoWindow); Track_NoteView.setSingerDataFinder(SingerDataFinders); Track_PitchView = new PitchView(ObjectPtr, this.PianoWindow); Param_PitchView = new PITParamView(ObjectPtr, this.ParamWindow); Param_DynamicView = new DYNParamView(ObjectPtr, this.ParamWindow); Global_ActionView = new ActionView(ObjectPtr, this.PianoWindow, this.ParamWindow); CopyPasteController = new CopyPaste(ref Track_NoteView, ref Track_PitchView); CopyPasteController.NoteCopyMemoryChanged += CopyPasteController_NoteCopyMemoryChanged; Track_NoteView.NoteActionBegin += Track_NoteView_NoteActionBegin; Track_NoteView.NoteActionEnd += Track_NoteView_NoteActionEnd; Track_NoteView.NoteSelecting += Track_NoteView_NoteSelecting; Track_PitchView.PitchActionBegin += Track_PitchView_PitchActionBegin; Track_PitchView.PitchActionEnd += Track_PitchView_PitchActionEnd; Param_DynamicView.DynActionBegin += Param_DynamicView_DynActionBegin; Param_DynamicView.DynActionEnd += Param_DynamicView_DynActionEnd; Param_PitchView.PitchActionBegin += Param_PitchView_PitchActionBegin; Param_PitchView.PitchActionEnd += Param_PitchView_PitchActionEnd; Global_ActionView.TickPosChange += Global_ActionView_TickPosChange; Track_NoteView.NoteSelectListChange += Track_NoteView_NoteSelectListChange; Alloced = true; SetNoteViewTool(NoteView.NoteToolsType.Select); SetParamGraphicTool(PitchView.PitchDragingType.DrawGraphS); SwitchParamView(ParamViewType.Dynamic); } try { ParamWindow.RedrawPiano(); PianoWindow.RedrawPiano(); LastSelectIndex = -1; } catch {; } }
public void Add(NoteView noteView) { var lane = _lanes.Find(l => l.Pitch == noteView.Pitch); if (lane != null) { lane.Add(noteView); noteView.transform.SetParent(lane.transform, false); } else { Debug.LogWarning($"Failed to add note to LaneManager. No lane for pitch {noteView.Pitch} found"); } }
private void EditNote(object parameter) { var view = new NoteView(); view.ViewModel.Set(Book, (Note) parameter, PdfPanel.GetCurrentPageNumber()); view.ViewModel.NoteChanged += _viewModel_NoteChanged; view.ShowDialog(); }
public NextNote(NoteView notes) { this.notes = notes; this.MenuText = "Next Note"; this.Shortcut = Application.Instance.CommonModifier | Keys.Alt | Keys.Down; }
public PreviousNote(NoteView notes) { this.notes = notes; this.MenuText = "Previous Note"; this.Shortcut = Application.Instance.CommonModifier | Keys.Alt | Keys.Up; }