Exemplo n.º 1
0
 static SyncAction()
 {
     SyncAction.defaultSyncAction = new SyncAction()
     {
         ReadOnly = true
     };
 }
Exemplo n.º 2
0
        private void ProcessSyncAction(XElement xmlNode, LocalTaxonomyItem taxonomyItem)
        {
            // If any of the attribute values is missing, preserve the setting from the
            // nearest ancestor
            SyncAction inheritedSyncAction = SyncAction.Default;

            if (taxonomyItem.ParentItem != null)
            {
                inheritedSyncAction = taxonomyItem.ParentItem.GetEffectiveSyncAction();
            }

            SyncAction syncAction = new SyncAction();

            syncAction.IfMissing = this.GetEnumAttributeValue <SyncActionIfMissing>(xmlNode,
                                                                                    TaxmlSpec.IfMissingToken, inheritedSyncAction.IfMissing);
            syncAction.IfPresent = this.GetEnumAttributeValue <SyncActionIfPresent>(xmlNode,
                                                                                    TaxmlSpec.IfPresentToken, inheritedSyncAction.IfPresent);
            syncAction.IfElsewhere = this.GetEnumAttributeValue <SyncActionIfElsewhere>(xmlNode,
                                                                                        TaxmlSpec.IfElsewhereToken, inheritedSyncAction.IfElsewhere);
            syncAction.DeleteExtraChildItems = this.GetBooleanAttributeValue(xmlNode,
                                                                             TaxmlSpec.DeleteExtraChildItemsToken) ?? inheritedSyncAction.DeleteExtraChildItems;

            taxonomyItem.SyncAction = syncAction;
        }