Beispiel #1
0
            private void OnMenuRenameImpliedFactTypeSignatures(object sender, EventArgs e)
            {
                if (this.MonitorSelection.CurrentDocument is ORMDesignerDocData docData)
                {
                    Store store = docData.Store;
                    using (Transaction t = store.TransactionManager.BeginTransaction(ResourceStrings.RenameImpliedFactTypeSignaturesTransactionName))
                    {
                        // Rename the readings
                        foreach (Reading r in this.GetRenameableReadings())
                        {
                            // There are rules that will automatically rename the fact types and update the reading's signature
                            // The inverse reading will not be the primay for the fact type, so inverse = !r.IsPrimaryForFactType
                            r.Text = Reading.DetermineImplicitFactTypePredicateReading(r.ReadingOrder.FactType, !r.IsPrimaryForFactType);
                        }

                        if (t.HasPendingChanges)
                        {
                            t.Commit();
                        }
                    }
                }
            }