/// <summary>
    /// Fills the details node view with detailed settings if available.
    /// </summary>
    private void FillDetailsNodeView()
    {
      Gtk.TreeIter selectedNodeIter;

      this.detailedSettingsStore.Clear();

      if (this.rulesTreeView.Selection.GetSelected(out selectedNodeIter))
      {
        StyleCopAddIn addIn = this.rulesStore.GetValue(selectedNodeIter, (int)TreeStoreColumns.Object) as StyleCopAddIn;
        if (addIn != null)
        {
          // Get the properties for this addin.
          ICollection<BooleanProperty> addInProperties = null;
          if (this.properties.TryGetValue(addIn, out addInProperties))
          {
            foreach (BooleanProperty property in addInProperties)
            {
              PropertyAddInPair propertyAddInPair = new PropertyAddInPair();
              propertyAddInPair.Property = property;
              propertyAddInPair.AddIn = addIn;

              string propertyFriendlyName = this.DetectDetailsSettingsBoldState(selectedNodeIter, propertyAddInPair, property.Value);
              this.detailedSettingsStore.AppendValues(property.Value, propertyFriendlyName, propertyAddInPair);
            }
          }
        }
      }
    }
Ejemplo n.º 2
0
        /// <summary>
        /// Fills the contents of the details tree.
        /// </summary>
        private void FillDetailsTree()
        {
            this.detailsTree.Nodes.Clear();

            // Get the selected item in the analyzer tree.
            if (this.analyzeTree.SelectedNode != null)
            {
                StyleCopAddIn addIn = this.analyzeTree.SelectedNode.Tag as StyleCopAddIn;
                if (addIn != null)
                {
                    // Get the properties for this addin.
                    ICollection<BooleanProperty> addInProperties = null;
                    if (this.properties.TryGetValue(addIn, out addInProperties))
                    {
                        foreach (BooleanProperty property in addInProperties)
                        {
                            PropertyAddInPair propertyAddInPair = new PropertyAddInPair();
                            propertyAddInPair.Property = property;
                            propertyAddInPair.AddIn = addIn;

                            TreeNode propertyNode = new TreeNode(property.FriendlyName);
                            propertyNode.Checked = property.Value;
                            propertyNode.Tag = propertyAddInPair;
                            this.detailsTree.Nodes.Add(propertyNode);

                            this.DetectBoldStateForDetails(propertyNode);
                        }
                    }
                }
            }
        }
    /// <summary>
    /// Checks if the given detailed settings property is overridden 
    /// </summary>
    /// <param name="iter">Tree iterator to use.</param>
    /// <param name="propertyAddInPair">Property addin pair to check.</param>
    /// <param name="isChecked">Is checked value.</param>
    /// <returns>Property friendly name with appropriate markup.</returns>
    private string DetectDetailsSettingsBoldState(Gtk.TreeIter iter, PropertyAddInPair propertyAddInPair, bool isChecked)
    {
      // Create a property representing the current value of the selection.
      BooleanProperty localValue = new BooleanProperty((PropertyDescriptor<bool>)propertyAddInPair.Property.PropertyDescriptor, isChecked);

      // Compare this with the parent value.
      bool overridden = this.SettingsHandler.SettingsComparer.IsAddInSettingOverwritten(propertyAddInPair.AddIn, propertyAddInPair.Property.PropertyName, localValue);

      return GetBoldMarkup(propertyAddInPair.Property.FriendlyName, overridden);
    }
Ejemplo n.º 4
0
 private void FillDetailsTree()
 {
     this.detailsTree.Nodes.Clear();
     if (this.analyzeTree.SelectedNode != null)
     {
         StyleCopAddIn tag = this.analyzeTree.SelectedNode.Tag as StyleCopAddIn;
         if (tag != null)
         {
             ICollection<BooleanProperty> is2 = null;
             if (this.properties.TryGetValue(tag, out is2))
             {
                 foreach (BooleanProperty property in is2)
                 {
                     PropertyAddInPair pair = new PropertyAddInPair();
                     pair.Property = property;
                     pair.AddIn = tag;
                     TreeNode node = new TreeNode(property.FriendlyName);
                     node.Checked = property.Value;
                     node.Tag = pair;
                     this.detailsTree.Nodes.Add(node);
                     this.DetectBoldStateForDetails(node);
                 }
             }
         }
     }
 }