示例#1
0
    /// <summary>
    /// This method reads the selected subjects from the <see cref="TreeView"/>
    /// with the current color from ColorizationParameters.SubjectColors into the 
    /// <see cref="selectedSubjects"/>field and recalculates the distances if applicable.
    /// </summary>
    private void ReReadSelectedSubjects()
    {
      this.selectedSubjects.Clear();
      foreach (TreeNode categoryNode in this.trvSubjects.Nodes)
      {
        foreach (TreeNode subjectNode in categoryNode.Nodes)
        {
          if (subjectNode.Checked)
          {
            string name = subjectNode.Text;
            if (!this.selectedSubjects.ContainsKey(name))
            {
              string scanpathString = string.Empty;

              if (this.calcDistances)
              {
                scanpathString = this.scanpathsPicture.CalcPathString(name);
              }

              ScanpathProperties props = new ScanpathProperties(
                name,
                categoryNode.Text,
                this.gazeColorParams.SubjectStyles[name],
                this.mouseColorParams.SubjectStyles[name],
                scanpathString);

              this.selectedSubjects.Add(name, props);
            }
          }
        }
      }

      this.RefillDistancesTable();
    }
示例#2
0
    /// <summary>
    /// This method adds the subject described by the <see cref="TreeViewEventArgs"/>
    /// and the given name to the list of selected subjects.
    /// </summary>
    /// <param name="node">An <see cref="TreeNode"/> with the selected 
    /// subject</param>
    /// <param name="name">A <see cref="String"/> with the subject name.</param>
    private void AddSubjectToList(TreeNode node, string name)
    {
      if (node.Checked)
      {
        if (!this.selectedSubjects.ContainsKey(name))
        {
          string scanpathString = string.Empty;

          if (this.calcDistances)
          {
            scanpathString = this.scanpathsPicture.CalcPathString(name);
          }

          ScanpathProperties props = new ScanpathProperties(
            name,
            node.Level == 0 ? node.Text : node.Parent.Text,
            this.gazeColorParams.SubjectStyles[name],
            this.mouseColorParams.SubjectStyles[name],
            scanpathString);

          this.selectedSubjects.Add(name, props);
        }
      }
      else
      {
        if (this.selectedSubjects.ContainsKey(name))
        {
          this.selectedSubjects.Remove(name);
        }
      }
    }