예제 #1
0
        public void Execute(ISolution solution, IProgressIndicator progress)
        {
            // 1. Generate class that implements current interface or abstract class
            // 2. Add to the current type attribute ContractClass(typeof(NewlyGeneratedClass))
            // 3. Add to the new class attribute ContractClassFor(typeof(CurrentAbstractClassOrInterface))
            // 4.1 For interface: implement all members with throw new NotImplementedException()
            // 4.2 For abstract class: override all abstract members with throw new NotImplementedException();

            string contractClassName = CreateContractClassName();

            AddContractClassAttributeForCurrentType(contractClassName);

            var contractClass = GenerateContractClassDeclaration(contractClassName);

            ImplementInterfaceOrBaseClass(contractClass, progress);

            _currentFile.AddTypeDeclarationAfter(contractClass, _addContractForAvailability.TypeDeclaration);
        }
예제 #2
0
 public ICSharpTypeDeclaration AddTypeDeclarationAfter(ICSharpTypeDeclaration param, ICSharpTypeDeclaration anchor)
 {
     return(_file.AddTypeDeclarationAfter(param, anchor));
 }