public ComboEnsuresExecutor(ICSharpContextActionDataProvider provider, 
            AddContractClassAvailability addContractAvailability,
            ICSharpFunctionDeclaration selectedFunctionDeclaration)
            : base(provider)
        {
            Contract.Requires(provider != null);
            Contract.Requires(addContractAvailability != null);
            Contract.Requires(addContractAvailability.IsAvailable);

            Contract.Requires(selectedFunctionDeclaration != null);

            _provider = provider;
            _addContractAvailability = addContractAvailability;
            _selectedFunctionDeclaration = selectedFunctionDeclaration;
        }
        public AddContractClassExecutor(ICSharpContextActionDataProvider provider, AddContractClassAvailability addContractForAvailability, 
            ICSharpFunctionDeclaration requiredFunction = null)
        {
            Contract.Requires(provider != null);
            Contract.Requires(addContractForAvailability != null);
            Contract.Requires(addContractForAvailability.IsAvailable);

            _addContractForAvailability = addContractForAvailability;
            _provider = provider;
            _requiredFunction = requiredFunction;

            _factory = _provider.ElementFactory;
            // TODO: look at this class CSharpStatementNavigator

            Contract.Assert(provider.SelectedElement != null);
            
            _currentFile = (ICSharpFile)provider.SelectedElement.GetContainingFile();
        }
        public AddContractClassExecutor(ICSharpContextActionDataProvider provider, AddContractClassAvailability addContractForAvailability,
                                        ICSharpFunctionDeclaration requiredFunction = null)
        {
            Contract.Requires(provider != null);
            Contract.Requires(addContractForAvailability != null);
            Contract.Requires(addContractForAvailability.IsAvailable);

            _addContractForAvailability = addContractForAvailability;
            _provider         = provider;
            _requiredFunction = requiredFunction;

            _factory = _provider.ElementFactory;
            // TODO: look at this class CSharpStatementNavigator

            Contract.Assert(provider.SelectedElement != null);

            _currentFile = (ICSharpFile)provider.SelectedElement.GetContainingFile();
        }
 private bool CanAddContractForSelectedMethod(out AddContractClassAvailability addContractAvailability, 
     ICSharpFunctionDeclaration selectedFunction)
 {
     addContractAvailability = AddContractClassAvailability.IsAvailableForSelectedMethod(_provider, selectedFunction);
     return addContractAvailability.IsAvailable;
 }
 protected override bool DoIsAvailable()
 {
     _addContractForAvailability = AddContractClassAvailability.IsAvailableForSelectedType(_provider);
     return _addContractForAvailability.IsAvailable;
 }
 protected override bool DoIsAvailable()
 {
     _addContractForAvailability = AddContractClassAvailability.IsAvailableForSelectedType(_provider);
     return(_addContractForAvailability.IsAvailable);
 }