public void AllignPanel(NotePanel sip) { if (notePanels.Count > 1) { sip.transform.localPosition = notePanels[notePanels.IndexOf(sip) - 1].transform.localPosition; } }
private StackWindow GetStackWindow(NotePanel panel) { if (StackWindows.Count == 0) { StackWindows.Add(new StackWindow()); } return(StackWindows[0]); }
public void SelectPanel(NotePanel sip) { if (selectedPanel) { selectedPanel.ChangeColor(Color.white); } selectedPanel = sip; selectedPanel.ChangeColor(Color.green); }
internal static void ApplyNewFont(Form1 form, Font newFont) { NotePanel notePanel = form.notePanel; CalculatorPanel calculatorPanel = form.calculatorPanel; notePanel.nodeTextTextBox.Font = newFont; notePanel.noteTitleTextBox.Font = newFont; calculatorPanel.calcTextBox.Font = newFont; calculatorPanel.calculationTextBox.Font = newFont; }
public void AddPanel() { GameObject newPanel = Instantiate(NotePanelPrefab, _listContent.position, Quaternion.identity, _listContent); Vector3 wantedPos = _listContent.position; newPanel.transform.localPosition = wantedPos; NotePanel sip = newPanel.GetComponent <NotePanel>(); notePanels.Add(sip); notePanels[notePanels.Count - 1].index = notePanels.IndexOf(sip); UpdateNoteCounter(); }
public void DisplayLoadedSong() { songMaxScoreInputField.text = song.maxScore.ToString(); foreach (Note si in song.notes) { AddPanel(); NotePanel sip = notePanels[notePanels.Count - 1]; PopulatePanelFields(sip, si); sip.DisplayInfo(); } Debug.Log("notePanels.Count: " + notePanels.Count); }
public void ShowPanel(NotePanel panel) { this.SuspendLayout(); pnlDocumentFrame.Controls.Clear(); //panel.Location = new System.Drawing.Point(10, 10); //panel.Size = new System.Drawing.Size(300, 300); panel.Dock = System.Windows.Forms.DockStyle.Fill; panel.Name = "ContentPanel"; panel.TabIndex = 0; //panel.Visible = true; this.pnlDocumentFrame.Controls.Add(panel); this.ResumeLayout(false); }
public void RemoveSelectedPanel() { if (selectedPanel) { notePanels.Remove(selectedPanel); Destroy(selectedPanel.gameObject); selectedPanel = null; UpdateNoteCounter(); } else { DisplayMessage("התראה", "לא נבחר פאנל להסרה"); } }
public void AddPanel(NotePanel panel) { NotePanels.Add(panel); }
public void AddNotePanel(NotePanel panel) { StackWindow win = GetStackWindow(panel); win.AddPanel(panel); }
public static void SerializeNote(NotePanel notePanel) { if (notePanel == null) { return; } var todoIndex = 0; var fileIndex = 0; var filePath = directory + $"{notePanel.Note.Name}"; var sanitizedPath = Path.Combine(Path.GetDirectoryName(filePath), Path.GetFileName(filePath).Trim(Path.GetInvalidFileNameChars())); if (!Directory.Exists(sanitizedPath)) { Directory.CreateDirectory(sanitizedPath); } else { foreach (var file in Directory.GetFiles(sanitizedPath)) { File.Delete(file); } } notePanel.Note.FileNames.Clear(); notePanel.Note.Todos.Clear(); for (int i = 0; i < notePanel.Items.Count; i++) { var item = notePanel.Items[i]; string path; if (!(item is IExtendedTextBoxControl extendedTextBoxControl)) { continue; } if (extendedTextBoxControl is TodoControl todoControl) { path = $"{sanitizedPath}\\{todoIndex}_{notePanel.Note.Name.ToLower()}{todoSuffix}"; notePanel.Note.Todos.Add(SerializeTodo(todoControl, path, todoIndex)); notePanel.Note.Todos.Last().Index = i; todoIndex++; } if (extendedTextBoxControl is ExtendedRichTextBox rtb) { path = $"{sanitizedPath}\\{fileIndex}_{notePanel.Note.Name.ToLower()}"; SerializeTextRange(rtb.TextRange, path); notePanel.Note.FileNames.Add(path); fileIndex++; } } var serializedNote = JsonConvert.SerializeObject(notePanel.Note); var metadataFile = directory + $"{notePanel.Note.Name.ToLower()}{metadataSuffix}"; File.WriteAllText(metadataFile, serializedNote); }
public void PopulatePanelFields(NotePanel sip, Note si) { sip.note = si; sip.DisplayInfo(); }