示例#1
0
文件: List.cs 项目: me-hungry/PDMS
 private void button1_Click(object sender, EventArgs e)
 {
     if (_toogleValue)
     {
         var elements = DesignProxy.GetHashtable("MEMBERS");
         //
         foreach (DictionaryEntry i in elements)
         {
             //string tt = "$p" + i.Key.ToString() + i.Value.ToString();
             string tt = "$p" + i.Value.ToString();
             Aveva.Pdms.Utilities.CommandLine.Command.CreateCommand(tt).RunInPdms();
         }
     }
     textBox1.Text = CurrentElement.Element.ToString();
     //заполнить лист
     listBox1.Items.Clear();
     //если се бран
     if (CurrentElement.Element.GetElementType().Equals(DbElementTypeInstance.BRANCH))
     {
         //AttributeRefFilter ownerfilter = new AttributeRefFilter(DbAttributeInstance.OWNER, DbElement.GetElement("/" + branmembers.ToString()));
         AttributeRefFilter ownerfilter = new AttributeRefFilter(DbAttributeInstance.OWNER, DbElement.GetElement(CurrentElement.Element.RefNo()));
         var collection = new DBElementCollection(CurrentElement.Element, ownerfilter);
         foreach (DbElement element in collection)
         {
             //if (element.GetElementType().Equals(DbElementTypeInstance.TUBING))
             //{
             //    listBox1.Items.Add(element);
             //}
             listBox1.Items.Add(element);
         }
     }
     else
     {
         //филтр по имени владельца
         TypeFilter BranFilt = new TypeFilter(DbElementTypeInstance.BRANCH);
         var        BraColl  = new DBElementCollection(CurrentElement.Element, BranFilt);
         foreach (DbElement branmembers in BraColl)
         {
             listBox1.Items.Add("BRAN: " + branmembers);
             //AttributeRefFilter ownerfilter = new AttributeRefFilter(DbAttributeInstance.OWNER, DbElement.GetElement("/" + branmembers.ToString()));
             AttributeRefFilter ownerfilter = new AttributeRefFilter(DbAttributeInstance.OWNER, DbElement.GetElement(branmembers.RefNo()));
             var collection = new DBElementCollection(branmembers, ownerfilter);
             foreach (DbElement element in collection)
             {
                 //if (element.GetElementType().Equals(DbElementTypeInstance.TUBING))
                 //{
                 //    listBox1.Items.Add(element);
                 //}
                 listBox1.Items.Add(element);
             }
         }
     }
     //////////////////
 }
示例#2
0
 public void ReceiveFromPMLHashtable(Hashtable hashTable)
 {
     DesignProxy.ReceiveFromPMLHashtable(hashTable);
 }