Ejemplo n.º 1
0
 public void AllignPanel(NotePanel sip)
 {
     if (notePanels.Count > 1)
     {
         sip.transform.localPosition = notePanels[notePanels.IndexOf(sip) - 1].transform.localPosition;
     }
 }
Ejemplo n.º 2
0
 private StackWindow GetStackWindow(NotePanel panel)
 {
     if (StackWindows.Count == 0)
     {
         StackWindows.Add(new StackWindow());
     }
     return(StackWindows[0]);
 }
Ejemplo n.º 3
0
 public void SelectPanel(NotePanel sip)
 {
     if (selectedPanel)
     {
         selectedPanel.ChangeColor(Color.white);
     }
     selectedPanel = sip;
     selectedPanel.ChangeColor(Color.green);
 }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
    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();
    }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 public void RemoveSelectedPanel()
 {
     if (selectedPanel)
     {
         notePanels.Remove(selectedPanel);
         Destroy(selectedPanel.gameObject);
         selectedPanel = null;
         UpdateNoteCounter();
     }
     else
     {
         DisplayMessage("התראה", "לא נבחר פאנל להסרה");
     }
 }
Ejemplo n.º 9
0
 public void AddPanel(NotePanel panel)
 {
     NotePanels.Add(panel);
 }
Ejemplo n.º 10
0
        public void AddNotePanel(NotePanel panel)
        {
            StackWindow win = GetStackWindow(panel);

            win.AddPanel(panel);
        }
Ejemplo n.º 11
0
        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);
        }
Ejemplo n.º 12
0
 public void PopulatePanelFields(NotePanel sip, Note si)
 {
     sip.note = si;
     sip.DisplayInfo();
 }