Exemplo n.º 1
0
 public Modification(TypeModification newTypeModif, String newNameUser, int newIdFiche, String newText, DateTime newDateModif, String newValue)
 {
     modification = newTypeModif;
     nameUser     = newNameUser;
     idFiche      = newIdFiche;
     text         = newText;
     dateModif    = newDateModif;
     valueModif   = newValue;
 }
Exemplo n.º 2
0
        public void TestDependencyMissingNestedType()
        {
            PatchInstaller   installer = new PatchInstaller(new MockModuleSource(module));
            StandardPatch    patch     = new StandardPatch("TestPatch");
            TypeModification type      = patch.Module(module.Name, ModificationKind.FailIfMissing, true).Type(ReadOnlyNamespace, NormalClass, ModificationKind.FailIfMissing);

            type.Attributes = TypeAttributes.BeforeFieldInit;
            type.NestedType(MissingMember, ModificationKind.FailIfMissing);
            installer.Add(patch);
            installer.Install();
        }
Exemplo n.º 3
0
        public void TestDependencyMissingProperty()
        {
            PatchInstaller   installer = new PatchInstaller(new MockModuleSource(module));
            StandardPatch    patch     = new StandardPatch("TestPatch");
            TypeModification type      = patch.Module(module.Name, ModificationKind.FailIfMissing, true).Type(ReadOnlyNamespace, NormalClass, ModificationKind.FailIfMissing);

            type.Attributes = TypeAttributes.BeforeFieldInit;
            type.Property(MissingMember, new PropertySignature(true, new CorLibTypeSignature(new TypeReference(patch.Module("System.Runtime", ModificationKind.FailIfMissing, true), "System", "String", new ModuleReference("System.Runtime")), ElementType.String)), ModificationKind.FailIfMissing);
            installer.Add(patch);
            installer.Install();
        }
Exemplo n.º 4
0
        public void TestDependencyMissingMethod()
        {
            PatchInstaller   installer = new PatchInstaller(new MockModuleSource(module));
            StandardPatch    patch     = new StandardPatch("TestPatch");
            TypeModification type      = patch.Module(module.Name, ModificationKind.FailIfMissing, true).Type(ReadOnlyNamespace, NormalClass, ModificationKind.FailIfMissing);

            type.Attributes = TypeAttributes.BeforeFieldInit;
            type.Method(MissingMember, new MethodSignature(CallingConvention.HasThis, 0u, new CorLibTypeSignature(new TypeReference(patch.Module("System.Runtime", ModificationKind.FailIfMissing, true), "System", "Void", new ModuleReference("System.Runtime")), ElementType.Void)), ModificationKind.FailIfMissing).Attributes = MethodAttributes.HideBySig;
            installer.Add(patch);
            installer.Install();
        }
Exemplo n.º 5
0
        public void TestDependencyExistingProperty()
        {
            PatchInstaller   installer = new PatchInstaller(new MockModuleSource(module));
            StandardPatch    patch     = new StandardPatch("TestPatch");
            TypeModification type      = patch.Module(module.Name, ModificationKind.FailIfMissing, true).Type(ReadOnlyNamespace, NormalClass, ModificationKind.FailIfMissing);

            type.Attributes = TypeAttributes.BeforeFieldInit;
            MethodModification propertyGet = type.Method("get_" + StringProperty, new MethodSignature(CallingConvention.HasThis, 0u, new CorLibTypeSignature(new TypeReference(patch.Module("System.Runtime", ModificationKind.FailIfMissing, true), "System", "String", new ModuleReference("System.Runtime")), ElementType.String)), ModificationKind.FailIfMissing);

            propertyGet.Attributes = MethodAttributes.HideBySig | MethodAttributes.SpecialName;
            type.Property(StringProperty, new PropertySignature(true, new CorLibTypeSignature(new TypeReference(patch.Module("System.Runtime", ModificationKind.FailIfMissing, true), "System", "String", new ModuleReference("System.Runtime")), ElementType.String)), ModificationKind.FailIfMissing).Get(propertyGet);
            installer.Add(patch);
            installer.Install();
        }
Exemplo n.º 6
0
 internal EventModification(TypeModification declaringType, UTF8String name, ITypeReference <ITypeDefOrRef> type, ModificationKind kind, bool readOnly) : base(declaringType, name, kind, readOnly) => Type = type;
Exemplo n.º 7
0
 internal PropertyModification(TypeModification declaringType, UTF8String name, PropertySignature signature, ModificationKind kind, bool readOnly) : base(declaringType, name, kind, readOnly) => Signature = signature;
Exemplo n.º 8
0
 private protected AccessibleModification(TypeModification declaringType, UTF8String name, ModificationKind kind, bool readOnly) : base(declaringType, name, kind, readOnly)
 {
 }
Exemplo n.º 9
0
 private protected MemberModification(TypeModification declaringType, UTF8String name, ModificationKind kind, bool readOnly) : base(kind, readOnly)
 {
     DeclaringType = declaringType;
     Name          = name;
 }
Exemplo n.º 10
0
        public TypeModification _modifOnSquare;                                       //not on square because typemodif is associate to a unit, not a square

        public ModifiedSquare(TypeModification typeModif, SquareBehavior squareToAdd) //Constructor
        {
            _square        = squareToAdd;
            _modifOnSquare = typeModif;
            _square.ChangeState(typeModif);
        }