public SetAttributeCommand(AbstractReferenceHandler abstractReferenceHandler, ConfiguredProject selectedConfiguredProject, string itemSpecification)
     : base(abstractReferenceHandler, selectedConfiguredProject, itemSpecification)
 {
     UnsetValue = PropertySerializer.SimpleTypes.ToString(true);
     SetValue   = PropertySerializer.SimpleTypes.ToString(false);
 }
 public SetTreatAsUsedAttributeCommand(AbstractReferenceHandler abstractReferenceHandler, ConfiguredProject selectedConfiguredProject, string itemSpecification)
 {
     _referenceHandler          = abstractReferenceHandler;
     _selectedConfiguredProject = selectedConfiguredProject;
     _itemSpecification         = itemSpecification;
 }
Exemple #3
0
 private static IProjectSystemUpdateReferenceOperation?CreateCommand(ProjectSystemReferenceUpdate referenceUpdate,
                                                                     AbstractReferenceHandler referenceHandler,
                                                                     ConfiguredProject selectedConfiguredProject, CancellationToken cancellationToken) =>
 referenceUpdate.Action switch
 {
Exemple #4
0
 public RemoveReferenceCommand(AbstractReferenceHandler abstractReferenceHandler, ConfiguredProject selectedConfiguredProject, ProjectSystemReferenceUpdate referenceUpdate)
 {
     _referenceHandler          = abstractReferenceHandler;
     _selectedConfiguredProject = selectedConfiguredProject;
     _itemSpecification         = referenceUpdate.ReferenceInfo.ItemSpecification;
 }
Exemple #5
0
        private static async Task <bool> ApplyActionAsync(ProjectSystemReferenceUpdate referenceUpdate, AbstractReferenceHandler referenceHandler,
                                                          ConfiguredProject selectedConfiguredProject, CancellationToken cancellationToken)
        {
            bool wasUpdated = false;

            cancellationToken.ThrowIfCancellationRequested();

            if (referenceUpdate.Action == ProjectSystemUpdateAction.SetTreatAsUsed ||
                referenceUpdate.Action == ProjectSystemUpdateAction.UnsetTreatAsUsed)
            {
                wasUpdated =
                    await referenceHandler.UpdateReferenceAsync(selectedConfiguredProject, referenceUpdate, cancellationToken);
            }
            else
            {
                if (await referenceHandler.CanRemoveReferenceAsync(selectedConfiguredProject, referenceUpdate, cancellationToken))
                {
                    await referenceHandler.RemoveReferenceAsync(selectedConfiguredProject, referenceUpdate.ReferenceInfo);

                    wasUpdated = true;
                }
            }

            return(wasUpdated);
        }