public void SaveNote() { // don't allow save empty note if (string.IsNullOrEmpty(_noteInput.text)) { return; } // if we didn't edit existing note if (_selectedNoteData == null) { // add new one NoteData data = new NoteData(DateTime.Now); data.EditNote(_noteInput.text); NotesManager.AddNote(data); } else { // edit existing _selectedNoteData.EditNote(_noteInput.text); } // remove selection _selectedNoteData = null; CloseEditNoteScreen(); }
// Start is called before the first frame update void Start() { notesManager = GetComponent <NotesManager>(); music = GetComponent <AudioSource>(); // LoadScoreFile("Tutorial1"); }
public MainWindow() { NotesManager = new NotesManager(Settings.Default.NotesFolderPath); TrySettingCulture(); InitializeComponent(); NotesManager.LoadNotes(); }
void Start() { NotesManager m = FindObjectOfType <NotesManager>(); m.OnFailed.AddListener(Shake); impulseSource = GetComponent <CinemachineImpulseSource>(); }
private Mock <NotesController> GetNoteController(Mock <DefaultContext> db, User user) { var httpContext = MockHelper.GetHttpContextWithUserId(user.Id); var userManager = MockHelper.GetUserManagerWithUser(db.Object); userManager.Setup(um => um.GetUserAsync(It.Is <ClaimsPrincipal>(t => true))).ReturnsAsync(user); var signInManager = new Mock <SignInManager <User> >(userManager.Object, new HttpContextAccessor { HttpContext = httpContext.Object }, new Mock <IUserClaimsPrincipalFactory <User> >().Object, null, null, null ); Func <object, JsonResult> toJson = (data) => { return(new JsonResult(data)); }; var manager = new CryptographManager(); var modelsFactory = new ModelsFactory(); var outputFactory = new OutputFactory(manager); var notesManager = new NotesManager(db.Object, manager, modelsFactory, userManager.Object); var notesValidator = new NotesViewModelValidator(db.Object, manager, modelsFactory); var ctrlNotes = new Mock <NotesController>(userManager.Object, outputFactory, notesManager, notesValidator); ctrlNotes.Setup(ctrl => ctrl.Json(It.IsAny <object>())).Returns(toJson); ctrlNotes.Object.ControllerContext = new ControllerContext() { HttpContext = httpContext.Object }; return(ctrlNotes); }
public void InsertPatientNote_Test() { PatientNote note = new PatientNote { ContactedOn = DateTime.UtcNow, CreatedById = "5325c821072ef705080d3488", CreatedOn = DateTime.UtcNow, Duration = 15, MethodId = "540f1da7d4332319883f3e8c", OutcomeId = "540f1f10d4332319883f3e92", PatientId = "5325db71d6a4850adcbba94a", SourceId = "540f208ed4332319883f3e9b", Text = "HEllo Hello", TypeId = "54909992d43323251c0a1dfd", ValidatedIdentity = true, WhoId = "540f1fc7d4332319883f3e99" }; PostPatientNoteRequest request = new PostPatientNoteRequest(); request.ContractNumber = "InHealth001"; request.UserId = "5325c821072ef705080d3488"; request.Version = 1; request.PatientId = "5325db71d6a4850adcbba94a"; request.Token = "5307bcf5d6a4850cd4abe0dd"; request.Note = note; NotesManager nManager = new NotesManager(); PostPatientNoteResponse response = nManager.InsertPatientNote(request); Assert.IsNotNull(response); }
public void Decode(string midiFile, int keyNoteOctave) { try { DecoderDic ddic = new DecoderDic(keyNoteOctave); MidiFile midi = MidiFile.Read(midiFile); List <TrackChunk> trackList = midi.GetTrackChunks().ToList(); string result = ""; TrackChunk track = trackList[0]; NotesManager noteManager = track.ManageNotes(); foreach (Note note in noteManager.Notes) { result += ddic.GetChar(note.NoteName, note.Octave); } Console.WriteLine("-----------------------------------------"); Console.WriteLine("DECODED MIDI FILE MESSAGE: " + result); Console.WriteLine("-----------------------------------------"); } catch (IOException) { Console.WriteLine("[ERROR] Cannot read " + midiFile + "! Maybe is already used by another process?"); Environment.Exit(-1); } catch (Exception e) { Console.WriteLine("[ERROR] Something goes wrong here: " + e.Message); Environment.Exit(-1); } }
/* --------------------- */ /* Used in Course Section */ /* --------------------- */ void Awake() { note = ""; notesManager = gameObject.GetComponentInParent <NotesManager>(); exportAsTxt = transform.parent.transform.parent.transform.parent.transform.parent.transform. Find("InfoPanelForHeaders").transform.Find("ExportButton").GetComponent <ExportAsTxt> (); }
public void Init() { notesManager = (NotesManager)FindObjectOfType(typeof(NotesManager)); haba = notesManager.haba; notesParent = (NotesParent)FindObjectOfType(typeof(NotesParent)); standPos = notesParent.transform.localPosition; source = GetComponent <AudioSource>(); }
public App() { InitializeComponent(); NotesManager = new NotesManager(new RestService()); Notes = new ObservableCollection <Note>(); MainPage = new NavigationPage(new MainPage()); }
/// <summary> /// Init and message registration /// </summary> /// <param name="messenger">Message</param> public NotesVM(Messenger messenger) : base(messenger, new SecondaryTile("NoteSecTile", "Notes", "Notes", new Uri("ms-appx:///Assets/Square150x150Logo.scale-200.png"), TileSize.Square150x150), ItemTypeEnum.Note) { var noMan = new NotesManager(); App.ManaLoc.AddManager(noMan, noMan.ID); DeleteItems = new DeleteItemsCommand(messenger); }
public override void OnImportAsset(AssetImportContext ctx) { MIDIChart chart = ScriptableObject.CreateInstance <MIDIChart>(); MidiFile midi = MidiFile.Read(ctx.assetPath); float beatTicks = ((TicksPerQuarterNoteTimeDivision)midi.TimeDivision).TicksPerQuarterNote; var trackList = new List <MIDIChart.Track>(); foreach (var chunk in midi.Chunks) { var trackChunk = chunk as TrackChunk; if (trackChunk == null) { continue; } var noteList = new List <MIDIChart.Note>(); var notesManager = new NotesManager(trackChunk.Events); foreach (var midiNote in notesManager.Notes) { float noteBeginBeat = midiNote.Time / beatTicks; float noteEndBeat = noteBeginBeat + midiNote.Length / beatTicks; noteList.Add(new MIDIChart.Note { noteNum = midiNote.NoteNumber, beginBeat = noteBeginBeat, endBeat = noteEndBeat, audioEndBeat = float.PositiveInfinity }); } noteList.Sort((MIDIChart.Note x, MIDIChart.Note y) => x.beginBeat.CompareTo(y.beginBeat)); for (int i = 0; i < noteList.Count; ++i) { for (int j = i + 1; j < noteList.Count; ++j) { if (noteList[j].beginBeat >= noteList[i].endBeat) { noteList[i].audioEndBeat = noteList[j].beginBeat; break; } } } trackList.Add(new MIDIChart.Track { notes = noteList }); } chart.tracks = trackList; ctx.AddObjectToAsset("chart", chart); ctx.SetMainObject(chart); }
public void GetFullName_Song_AbbreviationInNameMap_ReturnsFullName() { foreach (var song in SongNames.SongNameMaps) { var result = NotesManager.GetFullName(song.Key); result.Should().Be(song.Value); } }
public void GetFullName_Item_AbbreviationInNameMap_ReturnsFullName() { foreach (var item in ItemNames.ItemNameMaps) { var result = NotesManager.GetFullName(item.Key); result.Should().Be(item.Value); } }
public void GetFullName_Location_AbbreviationInNameMap_ReturnsFullName() { foreach (var location in LocationNames.LocationNameMaps) { var result = NotesManager.GetFullName(location.Key); result.Should().Be(location.Value); } }
public SpectrumView() { graphics = new GraphicsDeviceManager(this); graphics.PreferredBackBufferWidth = WIDOW_WIDTH; graphics.PreferredBackBufferHeight = WINDOW_HEIGHT; Content.RootDirectory = "Content"; camera = new Camera2D(); m_paused = false; NotesManager.Initialize(); }
private void Start() { IsoCam = Singletons.Instance.Isocam; NoteScript = Singletons.Instance.Notescript; DialogueBoxUI = Singletons.Instance.DialogueUI; CurrentDialoguetextTEXT = Singletons.Instance.DialogueTEXT; dialogueSript = Singletons.Instance.dialoguescript; Notebook = Singletons.Instance.Notebook; NotedownAnimation = Singletons.Instance.DropDownAnimObj.GetComponent <Animation>(); NotesPopTEXT = Singletons.Instance.NotesPopTMProTEXT; }
//[HideInInspector] //public List<GameObject> _container; // Use this for initialization void Awake() { #region SINGLETON PATTERN if (Instance != null && Instance != this) { Destroy(gameObject); } Instance = this; DontDestroyOnLoad(gameObject); #endregion }
public static void DeleteLogs() { string dir = Path.Combine(Helper.GetDataPath(), LOGS_FOLDER); if (Directory.Exists(dir)) { Directory.Delete(dir, true); } NotesManager.DeleteLogs(); }
public void Execute(object parameter) { if (parameter is AdaptiveGridView noList) { while (noList.SelectedItems.Count != 0) { NotesManager noMan = (NotesManager)App.ManaLoc.GetManager(((Note)noList.SelectedItems[0]).ManagerID); noMan.Delete((Note)noList.SelectedItems[0]); } } }
/// <summary> /// Create the QCL record. /// </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { var mgr = new NotesManager { PM = PM }; int noteId = mgr.CreateNote(PatId1.Get(context), NoteType.Get(context), Subject.Get(context), Note.Get(context)); NoteId.Set(context, noteId); }
/// <summary> /// Loadout showing just particular date notes. /// </summary> /// <param name="date"></param> public void LoadData(DateTime date) { _targetDate = date; _data = NotesManager.GetNoteData(_targetDate); _topBarTitle.text = date.ToString("d MMMM, yyyy"); SetScroller(_data); SetState(State.Default); }
/// <summary> /// Default loadout showing all the list of the notes. /// </summary> public void LoadData() { _targetDate = DateTime.MinValue; _data = NotesManager.GetNoteData(); _topBarTitle.text = "Notes"; SetScroller(_data); SetState(State.Default); }
private NotesController CreateDealNotesController(HttpRequestMessage httpRequest, INotesRepository dealNotesRepository) { NotesManager dealNotesManager = new NotesManager(userManager.Object, cacheStoreManager.Object, mockLogManager.Object, dealNotesRepository, transformationManager, new Mock <ITbDealNotesRepository>().Object); DealAPIManager dealAPIManager = new DealAPIManager(userManager.Object, cacheStoreManager.Object, mockLogManager.Object, dealNotesManager); NotesController dealNotesController = new NotesController(userManager.Object, dealAPIManager) { Request = httpRequest, Configuration = new HttpConfiguration() }; return(dealNotesController); }
public Note GetEventualPitch() { var master = GetMasterFrequency().Frequency; if (master != NullFrequency) { return(NotesManager.GetNoteByFrequency(master)); } else { return(null); } }
void Start() { clapObject = GameObject.Find("Clap"); clap = clapObject.GetComponent <AudioSource>(); notesManager = NotesManager.Instance; notesLineEffects = new NotesLineEffect[5]; notesLineEffects[0] = line1.GetComponent <NotesLineEffect>(); notesLineEffects[1] = line2.GetComponent <NotesLineEffect>(); notesLineEffects[2] = line3.GetComponent <NotesLineEffect>(); notesLineEffects[3] = line4.GetComponent <NotesLineEffect>(); notesLineEffects[4] = line5.GetComponent <NotesLineEffect>(); }
public void NotesController_Get_Returns_BadResponse(NotesSearchCriteria criteria) { #region Arrange SetupUserIdentity(); //Build response var dealNotesRepository = new Mock <INotesRepository>(); //Build response IList <Data.Models.grs_VGrsNote> dealDbData = new List <Data.Models.grs_VGrsNote> { new Data.Models.grs_VGrsNote { Notenum = 698, Dealnum = 233, Notedate = Convert.ToDateTime("2001-06-19 00:00:00.000"), Notes = "Left message for John Kenney to let him no that we would most likely not be able to quote on the submission due the relatively small size of the deal, and the amount of risk transfer that appeared that they were looking for (in the slip: winner take all w/ no agg limit)", Notetype = 22, Whoentered = 8069, Name = "Chris Downey", FirstName = "Chris", MiddleName = null, LastName = "Downey" } }; // Search method dealNotesRepository.Setup(p => p.GetMany(It.IsAny <Expression <Func <grs_VGrsNote, bool> > >())).Returns(dealDbData); //Manager //DealNotesManager dealNotesManager = new DealNotesManager(userManager.Object, cacheStoreManager.Object, mockLogManager.Object, dealNotesRepository.Object,transformationManager, new Mock<IPersonProfileManager>().Object); NotesManager dealNotesManager = new NotesManager(userManager.Object, cacheStoreManager.Object, mockLogManager.Object, dealNotesRepository.Object, transformationManager, new Mock <ITbDealNotesRepository>().Object); var httpRequest = new HttpRequestMessage(new HttpMethod(AppSettings.HTTPGET), $"{AppSettings.BASEURL}{RouteHelper.NotesRoutePrefix}"); NotesController dealNotesController = CreateDealNotesController(httpRequest, new Mock <INotesRepository>().Object); #endregion #region Act var response = dealNotesController.Get(criteria) as BadRequestErrorMessageResult; #endregion #region Assert string expectedMessage = "No Parameter found"; Assert.IsInstanceOf <BadRequestErrorMessageResult>(response); Assert.AreEqual(expectedMessage, response.Message); #endregion }
// GET: Home public ActionResult Index() { //TempData //if (TempData["modelCat"] != null) //{ // return View(TempData["modelCat"] as List<Note>); //} NotesManager NoteMan = new NotesManager(); return(View(NoteMan.GetAllNotes().OrderByDescending(x => x.ModifiedOn).ToList())); // return View(NoteMan.GetAllNotesQueryable().OrderByDescending(x => x.ModifiedOn).ToList()); }
public void GetPaitentNote_Test() { GetPatientNoteRequest request = new GetPatientNoteRequest(); request.ContractNumber = "InHealth001"; request.UserId = "AD_TestHarness"; request.Version = 1; request.Id = "5307b27fd433232ed88e5020"; request.PatientId = "52f55877072ef709f84e69b0"; request.UserId = "Snehal"; NotesManager gManager = new NotesManager(); PatientNote response = gManager.GetPatientNote(request); Assert.IsNotNull(response); }
public void Load(MusicNames MusicName, Levels level) { NotesManager notesManager = (NotesManager)FindObjectOfType(typeof(NotesManager)); MoveManager moveManager = (MoveManager)FindObjectOfType(typeof(MoveManager)); JudgeScript judgeScript = (JudgeScript)FindObjectOfType(typeof(JudgeScript)); string folderName = "Data/" + MusicName.ToString() + "/"; TextAsset musicData = Resources.Load <TextAsset>(folderName + tuneData); StringReader sr = new StringReader(musicData.text); while (sr.Peek() != -1) { string _str = sr.ReadLine(); string[] str = _str.Split(','); TuneDataIndex tuneDataIndex; Enum.TryParse <TuneDataIndex>(str[0], out tuneDataIndex); switch (tuneDataIndex) { case TuneDataIndex.NAME: musicName = str[1]; break; case TuneDataIndex.BPM: bpm = float.Parse(str[1]); break; case TuneDataIndex.OFFSET: offset = float.Parse(str[1]); break; } } notesManager.SetBPM(bpm); notesManager.SetOffset(offset); TextAsset notesData = Resources.Load <TextAsset>(folderName + level.ToString() + "NotesData"); notesManager.Load(notesData); AudioClip clip = Resources.Load <AudioClip>(folderName + clipName); moveManager.Init(); moveManager.SetClip(clip); judgeScript.Init(); moveManager.MusicStart(); }
void Start () { //BGM Start AudioManager.Instance.PlaySE (AUDIO.SE_BIRD); AudioManager.Instance.PlayBGM (AUDIO.BGM_ONTHEEARTH, AudioManager.BGM_FADE_SPEED_RATE_HIGH); //Bar management barmanager = GameObject.Find("MusicBar"); BarManager = barmanager.GetComponent<BarManager>(); //ScoreManager UIManager = new UIManager(); if (Application.loadedLevelName == "circle_music") { //Notes management NotesManager = new NotesManager(); NotesManager.Init(); NotesManager.CreateNotes(); } else if(Application.loadedLevelName == "create_notes"){ AutoNotes = new AutoNotes(); AutoNotes.Init(); } }
protected void NoteCreatioFacebookWallPost() { // common YT url-handling stuff ... ugh! string tributeHome; string noteUrl; if (TributesPortal.Utilities.WebConfig.ApplicationMode.Equals("local")) { tributeHome = Session["APP_PATH"] + _tributeUrl; } else { tributeHome = "http://" + _tributeType.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + _tributeUrl; } tributeHome += "/"; tribute_base_url = tributeHome; noteUrl = tributeHome + "Note.aspx"; string query_string = string.Empty; if (TributesPortal.Utilities.WebConfig.ApplicationMode.Equals("local")) { query_string = "?TributeType=" + HttpUtility.UrlEncode(_tributeType); noteUrl = noteUrl + query_string; tributeHome = tributeHome + query_string; } aTributeHome.HRef = tributeHome; StateManager objStateManager = StateManager.Instance; if (Request.QueryString["post_on_facebook"] != null && Request.QueryString["post_on_facebook"].ToString().Equals("True")) { int _noteId=0; if (Request.QueryString["noteId"] != null) //to pick value of selected note from querystring { _noteId = int.Parse(Request.QueryString["noteId"].ToString()); objStateManager.Add("NoteSession", _noteId, StateManager.State.Session); } else if (objStateManager.Get("NoteSession", StateManager.State.Session) != null) { _noteId = int.Parse(objStateManager.Get("NoteSession", StateManager.State.Session).ToString()); } else if (objStateManager.Get("NoteSession", StateManager.State.Session) == null) return; noteUrl += (noteUrl.Contains("?") ? "&" : "?") + "noteId=" + _noteId.ToString(); Note objNote = new Note(); objNote.NotesId = _noteId; NotesManager mgr = new NotesManager(); Note objNoteDetails = mgr.GetNoteDetails(objNote); StringBuilder sb = new StringBuilder(); sb.Append("<script type=\"text/javascript\">\n"); sb.Append("$(document).addEvent('fb_connected', function() {\n"); sb.Append(" var attachments = {\n"); sb.Append(" name: '"); sb.Append(string.Format("{0} added a note to the: {1} {2} Tribute", objNoteDetails.UserName, _tributeName, _tributeType)); sb.Append("',\n"); sb.Append(" href: '"); sb.Append(noteUrl); sb.Append("',\n"); sb.Append(" caption: '<b>Website:</b> "); sb.Append(tributeHome); sb.Append("',\n"); sb.Append(" description: '<b>Note:</b> "); sb.Append(objNoteDetails.Title); sb.Append("',\n"); sb.Append(" media: [{\n"); sb.Append(" type: 'image',\n"); sb.Append(" src:'"); sb.Append(profile_prefix); sb.Append(_tributeImage); sb.Append("',\n"); sb.Append(" href: '"); sb.Append(noteUrl); sb.Append("'\n"); sb.Append(" }]\n"); sb.Append(" };\n"); sb.Append(" var action_link = [{\n"); sb.Append(" text: '"); sb.Append(string.Format("Visit {0} Tribute", _tributeType)); sb.Append("',\n"); sb.Append(" href: '"); sb.Append(tributeHome); sb.Append("'\n"); sb.Append(" }]\n"); sb.Append(" publish_stream('', attachments, action_link, null, null, function() {});"); sb.Append("});\n"); sb.Append("</script>"); ClientScript.RegisterStartupScript(GetType(), "facebook_wall_post", sb.ToString()); } }