public override bool Compatible(ConfigurationAction action)
        {
            if (!action.ModifyingContainer.Name.Equals(this.ConstrainedContainer.Name) || !action.ServerName.Equals(this.ServerName))
            {
                return(true);
            }

            if (Type == LocationConstraintType.Replicate && action.GetType() == typeof(RemoveSecondaryServer))
            {
                return(false);
            }
            else if (Type == LocationConstraintType.DoNotReplicate && (action.GetType() == typeof(AddPrimaryServer) || action.GetType() == typeof(AddSecondaryServer) || action.GetType() == typeof(MakeSoloPrimaryServer)))
            {
                return(false);
            }

            return(true);
        }
示例#2
0
        private static string ReconfigActionText(ConfigurationAction act)
        {
            string text;

            switch (act.GetType().Name)
            {
            case "MakeSoloPrimaryServer": text = "Move the primary site to " + SiteName(act.ServerName); break;

            case "AddPrimaryServer": text = "Add a primary replica in " + SiteName(act.ServerName); break;

            case "AddSecondaryServer": text = "Add a secondary replica in " + SiteName(act.ServerName); break;

            case "AdjustSyncPeriod": text = "Reduce the sync period for site " + SiteName(act.ServerName); break;

            case "DowngradePrimary": text = "Downgrade from primary to secondary site " + SiteName(act.ServerName); break;

            case "RemoveSecondaryServer": text = "Remove the secondary replica in " + SiteName(act.ServerName); break;

            default: text = act.GetType().Name + " " + SiteName(act.ServerName); break;
            }
            return(text);
        }