private void add_topics(Dictionary <Guid, Topic> topics, BaseNote note = null) { foreach (Guid guid in topics.Keys) { if (!this.topics.ContainsKey(guid)) { this.topics[guid] = topics[guid]; } } this.populate_topic_rows(); if (note is not null) { if (note.topics.Count <= 0) { if (!this.topic_refs.ContainsKey(Guid.Empty)) { this.topic_refs[Guid.Empty] = 0; } this.topic_refs[Guid.Empty] += 1; } foreach (Guid guid in note.topics) { if (!this.topic_refs.ContainsKey(guid)) { this.topic_refs[guid] = 0; } this.topic_refs[guid] += 1; } } }
public void PopulatesFromNoteIfRelevantNoteIsNotNull() { // Arrange var note = new BaseNote { BlogName = _request.CharacterUrlIdentifier, Timestamp = _afterQueuedDate, BlogUrl = "http://www.test2.com/", PostId = "34567" }; _mockAdapter.Setup(a => a.GetMostRecentRelevantNote(_request.CharacterUrlIdentifier, _request.PartnerUrlIdentifier)) .Returns(note); // Act var dto = new ThreadStatusDto(_mockAdapter.Object, _request); // Assert dto.PostId.Should().Be(_request.PostId); dto.LastPostDate.Should().Be(_afterQueuedDate.ToUniversalTime()); dto.LastPostUrl.Should().Be("http://www.test2.com/post/34567"); dto.LastPosterUrlIdentifier.Should().Be(_request.CharacterUrlIdentifier); dto.IsCallingCharactersTurn.Should().BeFalse(); dto.IsQueued.Should().BeFalse(); }
public void addNote(BaseNote note, float duration) { currentBar.addNote(note, duration); if (currentBar.getDuration() >= duration) { newBar(); } }
public static void ToNote(NoteDTO t, BaseNote note) { note.SetParentId(t.ParentID); note.CorrespondenceType = t.CorrespondenceType; note.CorrespondenceName = t.CorrespondenceName; note.RequiresFollowup = t.RequiresFollowup; note.FollowupDate = t.FollowupDate; note.Comments = t.Comments; }
//A function which creates notes and allocates them their individual properties. These will later be added to Sequence private static BaseNote CreateNote(DirectionEnumerator.NoteDirections newDirection, TypeEnumerator.NoteTypes newType, int newSpeed, int newDamage, int newTarget) { BaseNote newNote = new BaseNote() { NoteDirection = newDirection, NoteType = newType, Speed = newSpeed, Damage = newDamage, Target = newTarget }; return(newNote); }
private void add_topics(Dictionary <Guid, Topic> topics, BaseNote note = null) { foreach (Guid guid in topics.Keys) { if (!this.topics.ContainsKey(guid)) { this.topics[guid] = topics[guid]; } } this.update_topic_refs(note); }
public async Task NoteConverter() { TumblrClient tc = new TumblrClientFactory().Create <TumblrClient>(_consumerKey, _consumerSecret, new Token(_accessKey, _accessSecret)); // find a post with notes PhotoPost notePost = null; bool findPostWithNotes = false; long currentID = 0; while (findPostWithNotes == false) { BasePost[] basePosts = await tc.GetDashboardPostsAsync(currentID, 0, 1, PostType.Photo, false, true); for (int i = 0; i < basePosts.Count(); i++) { PhotoPost basePost = basePosts[i] as PhotoPost; if (basePost.Notes?.Count() > 0) { findPostWithNotes = true; notePost = basePost; break; } currentID = basePost.Id; } } // convert post string json = JsonConvert.SerializeObject(notePost, Formatting.Indented); // deserialize post PhotoPost jsonPost = JsonConvert.DeserializeObject <PhotoPost>(json); //testing for (int i = 0; i < notePost.Notes.Count(); i++) { BaseNote baseNote = notePost.Notes[i]; BaseNote jsonNote = jsonPost.Notes[i]; Assert.AreEqual(baseNote.AvatarShape, jsonNote.AvatarShape); Assert.AreEqual(baseNote.BlogName, jsonNote.BlogName); Assert.AreEqual(baseNote.BlogUrl, jsonNote.BlogUrl); Assert.AreEqual(baseNote.BlogUuid, jsonNote.BlogUuid); Assert.AreEqual(baseNote.Followed, jsonNote.Followed); Assert.AreEqual(baseNote.PostId, jsonNote.PostId); Assert.AreEqual(baseNote.ReblogParentBlogName, jsonNote.ReblogParentBlogName); Assert.AreEqual(baseNote.ReplyText, jsonNote.ReplyText); Assert.AreEqual(baseNote.Timestamp, jsonNote.Timestamp); Assert.AreEqual(baseNote.Type, jsonNote.Type); } }
public static NoteDTO ToNoteDTO(BaseNote note, SourceType sourceType) { return(new NoteDTO(sourceType) { ID = note.ID, ParentID = note.GetParentID(), CorrespondenceType = note.CorrespondenceType, CorrespondenceName = note.CorrespondenceName, Comments = note.Comments, FollowupDate = note.FollowupDate, RequiresFollowup = note.RequiresFollowup, Tasks = note.GetTasks()?.Select(m => ToNoteTaskDTO(m, sourceType)) }); }
public static NoteDetailsDTO ToNoteDetailsDTO(BaseNote note, SourceType sourceType) { return(new NoteDetailsDTO(sourceType) { ID = note.ID, ParentID = note.GetParentID(), CorrespondenceType = note.CorrespondenceType, CorrespondenceName = note.CorrespondenceName, EntryDate = note.EntryDate, EnteredByUserID = note.EnteredByUserID, Comments = note.Comments, FollowupComments = note.FollowupComment, IsActive = note.RequiresFollowup && !note.FollowupComplete, TaskItems = note.GetTasks()?.Select(m => ToNoteTaskDTO(m, sourceType)) }); }
private void do_note_rem(object sender, RoutedEventArgs e) { EntityRow sel = this.entity_list.SelectedValue as EntityRow; if ((sel is null) || (sel.type is null) || (sel.guid is null)) { return; } BaseNote note = null; if (sel.type == EntityType.NOTE) { if (!this.state.notes.notes.ContainsKey(sel.guid.Value)) { return; } note = this.state.notes.notes[sel.guid.Value]; this.state.notes.remove_note(sel.guid.Value); this.actions.Add(new ActionNoteRemove(sel.guid.Value)); } else if (sel.type == EntityType.EXTERNAL_NOTE) { if (!this.notes.ContainsKey(sel.guid.Value)) { return; } note = this.notes[sel.guid.Value]; this.notes.Remove(sel.guid.Value); } else { return; } this.update_topic_refs(note, refcount: -1); this.topic_cache.Clear(); this.populate_topic_cache(); this.set_topic(this.guid); }
private void update_topic_refs(BaseNote note, int refcount = 1) { if (note is null) { return; } if (note.topics.Count <= 0) { if (!this.topic_refs.ContainsKey(Guid.Empty)) { this.topic_refs[Guid.Empty] = 0; } this.topic_refs[Guid.Empty] += refcount; } foreach (Guid guid in note.topics) { if (!this.topic_refs.ContainsKey(guid)) { this.topic_refs[guid] = 0; } this.topic_refs[guid] += refcount; } }
public void NoteDie(BaseNote note) { queues[(int)note.angle_deg / deg_perqueue].Dequeue(); }
public void createNote() { int noteNum = Random.Range(1, NoteList.Count - 1); BaseNote currentNote = NoteList[noteNum]; noteText.text = currentNote.NoteName; float pos = currentNote.NotePos; helperLineLowC.SetActive(false); helperLineLowA.SetActive(false); helperLineLowF.SetActive(false); helperLineHighA.SetActive(false); helperLineHighC.SetActive(false); helperLineHighE.SetActive(false); helperLineHighG.SetActive(false); Debug.Log("NoteValue: " + currentNote.NoteValue + " Note: " + currentNote.NoteName); if (currentNote.NoteValue > 5) { noteUp.SetActive(false); noteDown.SetActive(true); } else { noteUp.SetActive(true); noteDown.SetActive(false); } if (currentNote.NoteValue > 11) { if (currentNote.HelpLine == 1) { helperLineHighA.SetActive(true); } else if (currentNote.HelpLine == 2) { helperLineHighA.SetActive(true); helperLineHighC.SetActive(true); } else if (currentNote.HelpLine == 3) { helperLineHighA.SetActive(true); helperLineHighC.SetActive(true); helperLineHighE.SetActive(true); } else if (currentNote.HelpLine == 4) { helperLineHighA.SetActive(true); helperLineHighC.SetActive(true); helperLineHighE.SetActive(true); helperLineHighG.SetActive(true); } } else if (currentNote.NoteValue < 1) { if (currentNote.HelpLine == 1) { helperLineLowC.SetActive(true); } else if (currentNote.HelpLine == 2) { helperLineLowC.SetActive(true); helperLineLowA.SetActive(true); } else if (currentNote.HelpLine == 3) { helperLineLowC.SetActive(true); helperLineLowA.SetActive(true); helperLineLowF.SetActive(true); } } noteRect.localPosition = new Vector3(0, pos, 0); tabNote1.SetActive(false); tabNote2.SetActive(false); tabNote3.SetActive(false); tabNote4.SetActive(false); tabNote5.SetActive(false); tabNote6.SetActive(false); Debug.Log("String 6 Pos: " + nh.tabTranslator(currentNote.NoteValue, 6)); Debug.Log("String 5 Pos: " + nh.tabTranslator(currentNote.NoteValue, 5)); Debug.Log("String 4 Pos: " + nh.tabTranslator(currentNote.NoteValue, 4)); Debug.Log("String 3 Pos: " + nh.tabTranslator(currentNote.NoteValue, 3)); Debug.Log("String 2 Pos: " + nh.tabTranslator(currentNote.NoteValue, 2)); Debug.Log("String 1 Pos: " + nh.tabTranslator(currentNote.NoteValue, 1)); int string6 = nh.tabTranslator(currentNote.NoteValue, 6); if (string6 != -1) { tabNote6.transform.GetChild(0).GetComponent <Text>().text = string6.ToString(); tabNote6.SetActive(true); } int string5 = nh.tabTranslator(currentNote.NoteValue, 5); if (string5 != -1) { tabNote5.transform.GetChild(0).GetComponent <Text>().text = string5.ToString(); tabNote5.SetActive(true); } int string4 = nh.tabTranslator(currentNote.NoteValue, 4); if (string4 != -1) { tabNote4.transform.GetChild(0).GetComponent <Text>().text = string4.ToString(); tabNote4.SetActive(true); } int string3 = nh.tabTranslator(currentNote.NoteValue, 3); if (string3 != -1) { tabNote3.transform.GetChild(0).GetComponent <Text>().text = string3.ToString(); tabNote3.SetActive(true); } int string2 = nh.tabTranslator(currentNote.NoteValue, 2); if (string2 != -1) { tabNote2.transform.GetChild(0).GetComponent <Text>().text = string2.ToString(); tabNote2.SetActive(true); } int string1 = nh.tabTranslator(currentNote.NoteValue, 1); if (string1 != -1) { tabNote1.transform.GetChild(0).GetComponent <Text>().text = string1.ToString(); tabNote1.SetActive(true); } }
public static void loadNotes() { string path = "URI=file:" + Application.dataPath + "/Database/Database.s3db"; IDbConnection connection; connection = (IDbConnection)new SqliteConnection(path); connection.Open(); IDbCommand command = connection.CreateCommand(); string sqlQuery = "SELECT * FROM Items_Notes;"; command.CommandText = sqlQuery; IDataReader reader = command.ExecuteReader(); while (reader.Read()) { BaseNote one = new BaseNote(); one.ItemID = reader.GetInt32 (0); one.NoteText = reader.GetString (1); notesData[one.ItemID] = one; } reader.Close(); command.Dispose(); connection.Close(); }
internal Note(BaseNote note) : base(note) { this.NXOpenNote = note; }
public void visit(BaseNote baseNote) { }