Ejemplo n.º 1
0
        public SpuriousConnectionError CreateBasicInfoError(string id, string familyName, string typeName, string errorMsg)
        {
            SpuriousConnectionError error = new SpuriousConnectionError();

            error.ID         = id;
            error.FamilyName = familyName;
            error.TypeName   = typeName;
            error.ErrorMsg   = errorMsg;
            return(error);
        }
 private void ExcludingItemClicked(object sender, RoutedEventArgs e)
 {
     if (SpuriousConnectionListView.SelectedItems.Count != 0)
     {
         foreach (var item in SpuriousConnectionListView.SelectedItems)
         {
             SpuriousConnectionError error = item as SpuriousConnectionError;
             removeEleDic.Add(error.ID, error);
         }
     }
     TaskDialog.Show("msg", "Item Click");
 }
Ejemplo n.º 3
0
        void AddListViewErrorData(Element ele, string errorType = null)
        {
            string famliyName             = MtCommon.GetElementFamilyName(m_uIDocument.Document, ele);
            string typeName               = MtCommon.GetElementType(m_uIDocument.Document, ele);
            string message                = MtCommon.GetStringValue(ErrorType.NoEndPipe) + errorType;
            SpuriousConnectionError error = CreateBasicInfoError(ele.Id.ToString(), famliyName, typeName, message);

            if (!m_dicErrorList.ContainsKey(ele.Id.ToString()))
            {
                m_dicErrorList.Add(ele.Id.ToString(), error);
            }
        }
        private void SpuriousConnectionListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.Source is System.Windows.Controls.ListView)
            {
                if (SpuriousConnectionListView.SelectedItems.Count == 1)
                {
                    SpuriousConnectionError error = SpuriousConnectionListView.SelectedItem as SpuriousConnectionError;

                    if (error != null && error is SpuriousConnectionError)
                    {
                        string  id      = error.ID;
                        Element element = MtCommon.GetElementById(m_uidoc.Document, id);
                        MtCommon.ElementCenterDisplay(m_uidoc, element);

                        IList <ElementId> list = new List <ElementId>();
                        list.Add(element.Id);
                        m_uidoc.Selection.SetElementIds(list);
                    }
                }
                else if (SpuriousConnectionListView.SelectedItems.Count > 1)
                {
                }
            }
        }