Exemplo n.º 1
0
 public void RaisePostBackEvent(string eventArgument)
 {
     bool flag = false;
     if (eventArgument.IndexOf("checkbox") > -1)
     {
         eventArgument = eventArgument.Replace(":checkbox", "");
         flag = true;
     }
     squishyWARE.WebComponents.squishyTREE.TreeNode n = (squishyWARE.WebComponents.squishyTREE.TreeNode) this.Page.FindControl(eventArgument);
     this.ViewState["selectednode"] = n;
     if (!flag)
     {
         n.IsExpanded = !n.IsExpanded;
         if (this.SelectedNodeChanged != null)
         {
             n.IsSelected = true;
             this.SelectedNodeChanged(this, new TreeViewNodeClickEventArgs(n));
         }
     }
     else
     {
         n.Check();
         if (n.Parent is squishyWARE.WebComponents.squishyTREE.TreeNode)
         {
             ((squishyWARE.WebComponents.squishyTREE.TreeNode) n.Parent).trackCheckedChildren();
         }
         if (this.TreeNodeChecked != null)
         {
             this.TreeNodeChecked(this, new TreeViewNodeClickEventArgs(n));
         }
     }
 }
Exemplo n.º 2
0
 public void ExpandAll()
 {
     foreach (Control control in this.Controls)
     {
         squishyWARE.WebComponents.squishyTREE.TreeNode node = control as squishyWARE.WebComponents.squishyTREE.TreeNode;
         if (node != null)
         {
             node.ExpandAll();
         }
     }
 }
Exemplo n.º 3
0
 public squishyWARE.WebComponents.squishyTREE.TreeNode FindTreeNode(string key)
 {
     foreach (squishyWARE.WebComponents.squishyTREE.TreeNode node in this.Controls)
     {
         if (node.Key == key)
         {
             return node;
         }
     }
     foreach (squishyWARE.WebComponents.squishyTREE.TreeNode node in this.Controls)
     {
         squishyWARE.WebComponents.squishyTREE.TreeNode node2 = node.FindTreeNode(key);
         if (node2 != null)
         {
             return node2;
         }
     }
     return null;
 }
Exemplo n.º 4
0
 private void addChildNode(XmlNode node, string textAttribute, string keyAttribute, squishyWARE.WebComponents.squishyTREE.TreeNode tNode, string checkAttribute, string checkDefaultsAttribute)
 {
     squishyWARE.WebComponents.squishyTREE.TreeNode node2;
     string key = "";
     bool showCheckbox = false;
     bool isChecked = false;
     string text = node.Attributes[textAttribute].Value;
     if (node.Attributes[keyAttribute] != null)
     {
         key = node.Attributes[keyAttribute].Value;
     }
     if (node.Attributes[checkAttribute] != null)
     {
         showCheckbox = Convert.ToBoolean(node.Attributes[checkAttribute].Value);
     }
     if (node.Attributes[checkDefaultsAttribute] != null)
     {
         isChecked = Convert.ToBoolean(node.Attributes[checkDefaultsAttribute].Value);
     }
     if (tNode == null)
     {
         node2 = this.AddNode(text, key, showCheckbox);
     }
     else
     {
         node2 = tNode.AddNode(text, key, showCheckbox);
     }
     XmlNodeList list = node.SelectNodes("taggedValue");
     int num = 0;
     foreach (XmlNode node3 in list)
     {
         num++;
         string tagName = node3.Attributes["tagName"].Value;
         string text4 = node3.Attributes["tagValue"].Value;
         node2.AddTaggedValue(tagName, text4);
     }
     if ((node.ChildNodes.Count - num) > 0)
     {
         foreach (XmlNode node4 in node.ChildNodes)
         {
             if (node4.Name != "taggedValue")
             {
                 this.addChildNode(node4, textAttribute, keyAttribute, node2, checkAttribute, checkDefaultsAttribute);
             }
         }
     }
     if ((((checkDefaultsAttribute != "") && (node.Attributes[checkDefaultsAttribute] != null)) && (node.Attributes[checkDefaultsAttribute].Value.Trim() != "")) && !this.Page.IsPostBack)
     {
         node2.Check(isChecked);
     }
 }
Exemplo n.º 5
0
 public squishyWARE.WebComponents.squishyTREE.TreeNode AddNode(string text, string key, bool showCheckbox)
 {
     squishyWARE.WebComponents.squishyTREE.TreeNode child = new squishyWARE.WebComponents.squishyTREE.TreeNode(text, 1, key, showCheckbox);
     this.Controls.Add(child);
     return child;
 }
Exemplo n.º 6
0
 private void AddChildNode(DataRow row, string textColumn, string keyColumn, string checkColumn, string checkDefaultsColumn, squishyWARE.WebComponents.squishyTREE.TreeNode node)
 {
     squishyWARE.WebComponents.squishyTREE.TreeNode node2;
     bool showCheckbox = false;
     bool isChecked = false;
     string text = row[textColumn].ToString();
     string key = row[keyColumn].ToString();
     if (checkColumn != "")
     {
         if (row[checkColumn] != DBNull.Value)
         {
             showCheckbox = Convert.ToBoolean(row[checkColumn]);
         }
         if (row[checkDefaultsColumn] != DBNull.Value)
         {
             isChecked = Convert.ToBoolean(row[checkDefaultsColumn]);
         }
     }
     if (node == null)
     {
         node2 = this.AddNode(text, key, showCheckbox);
     }
     else
     {
         node2 = node.AddNode(text, key, showCheckbox);
     }
     if (this.headers.Count != 0)
     {
         foreach (object[] objArray in this.headers)
         {
             if (row.Table.Columns.Contains(objArray[0].ToString()))
             {
                 node2.AddTaggedValue(objArray[0].ToString(), row[objArray[0].ToString()].ToString());
             }
         }
     }
     if (row.Table.ChildRelations.Count > 0)
     {
         foreach (DataRelation relation in row.Table.ChildRelations)
         {
             DataRow[] childRows = row.GetChildRows(relation);
             foreach (DataRow row2 in childRows)
             {
                 this.AddChildNode(row2, textColumn, keyColumn, checkColumn, checkDefaultsColumn, node2);
             }
         }
     }
     if (showCheckbox && !this.Page.IsPostBack)
     {
         node2.Check(isChecked);
     }
 }