예제 #1
0
        private void RunCategoryActionItems(string centralPath, UpdaterData data, Element element)
        {
            try
            {
                ReportingElementInfo reportingInfo = null;
                Document             doc           = data.GetDocument();
                var infoFound = from info in reportingElements where info.CentralPath == centralPath && info.ReportingUniqueId == element.UniqueId select info;
                if (infoFound.Count() > 0)
                {
                    reportingInfo = infoFound.First();
                }

                BuiltInCategory bltCategory = (BuiltInCategory)element.Category.Id.IntegerValue;
                switch (bltCategory)
                {
                case BuiltInCategory.OST_Grids:
                    Grid grid = element as Grid;
                    if (GridUtils.ExtentGeometryChanged(centralPath, grid.Id, grid.GetExtents()))
                    {
                        if (null != reportingInfo)
                        {
                            ReportFailure(doc, reportingInfo);
                        }
                    }
                    else if (GridUtils.gridParameters.ContainsKey(centralPath))
                    {
                        //parameter changed
                        foreach (ElementId paramId in GridUtils.gridParameters[centralPath])
                        {
                            if (data.IsChangeTriggered(grid.Id, Element.GetChangeTypeParameter(paramId)))
                            {
                                if (null != reportingInfo)
                                {
                                    ReportFailure(doc, reportingInfo);
                                }
                            }
                        }
                    }
                    break;

                default:
                    if (null != reportingInfo)
                    {
                        ReportFailure(doc, reportingInfo);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                LogUtil.AppendLog("DTMUpdater-RunCategoryActionItems:" + ex.Message);
            }
        }
예제 #2
0
        private void RunCategoryActionItems(Guid docId, UpdaterData data, Element element)
        {
            try
            {
                ReportingElementInfo reportingInfo = null;
                var infoFound = from info in reportingElements where info.DocId == docId && info.ReportingUniqueId == element.UniqueId select info;
                if (infoFound.Count() > 0)
                {
                    reportingInfo = infoFound.First();
                }

                BuiltInCategory bltCategory = (BuiltInCategory)element.Category.Id.IntegerValue;
                switch (bltCategory)
                {
                case BuiltInCategory.OST_Grids:
                    Grid grid = element as Grid;
                    if (GridUtils.ExtentGeometryChanged(docId, grid.Id, grid.GetExtents()))
                    {
                        if (null != reportingInfo)
                        {
                            ReportFailure(reportingInfo);
                        }
                    }
                    else if (GridUtils.gridParameters.ContainsKey(docId))
                    {
                        foreach (ElementId paramId in GridUtils.gridParameters[docId])
                        {
                            if (data.IsChangeTriggered(grid.Id, Element.GetChangeTypeParameter(paramId)))
                            {
                                if (null != reportingInfo)
                                {
                                    ReportFailure(reportingInfo);
                                }
                            }
                        }
                    }
                    break;

                default:
                    if (null != reportingInfo)
                    {
                        ReportFailure(reportingInfo);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                MessageBox.Show("Failed to run category action items.\n" + ex.Message, "DTM Updater", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="centralPath"></param>
        /// <param name="data"></param>
        /// <param name="element"></param>
        /// <param name="reportingInfo"></param>
        private static void RunCategoryActionItems(string centralPath, UpdaterData data, Element element, ReportingElementInfo reportingInfo)
        {
            try
            {
                var doc         = data.GetDocument();
                var bltCategory = (BuiltInCategory)element.Category.Id.IntegerValue;
                switch (bltCategory)
                {
                case BuiltInCategory.OST_Grids:
                    var grid = (Grid)element;
                    if (GridUtils.ExtentGeometryChanged(centralPath, grid.Id, grid.GetExtents()))
                    {
                        ReportFailure(doc, reportingInfo);
                    }
                    else if (GridUtils.gridParameters.ContainsKey(centralPath))
                    {
                        //parameter changed
                        foreach (var paramId in GridUtils.gridParameters[centralPath])
                        {
                            if (!data.IsChangeTriggered(grid.Id, Element.GetChangeTypeParameter(paramId)))
                            {
                                continue;
                            }
                            ReportFailure(doc, reportingInfo);
                        }
                    }
                    break;

                default:
                    ReportFailure(doc, reportingInfo);
                    break;
                }
            }
            catch (Exception ex)
            {
                Log.AppendLog(LogMessageType.EXCEPTION, ex.Message);
            }
        }