示例#1
0
        public static void CreateAndRegister(AddInId addinId)
        {
            var updater = new CO2eFieldUpdater(addinId);

            if (UpdaterRegistry.IsUpdaterRegistered(updater.GetUpdaterId()))
            {
                UpdaterRegistry.UnregisterUpdater(updater.GetUpdaterId());
            }
            UpdaterRegistry.RegisterUpdater(updater);

            var filter = Settings.CreateFilterForElementsWithCO2eParameter();

            UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeGeometry());
            UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeElementDeletion());
        }