public virtual bool IsTheSame(BaseConstruct comparisonObject, ComparisonDepth depth) { if (Name != comparisonObject.Name) { ComparisonDifference += comparisonObject.GetType().Name + ".Name"; return(false); } if (depth == ComparisonDepth.Signature) { return(true); } Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(_Attributes.ToArray(), comparisonObject._Attributes.ToArray(), comparer)) { ComparisonDifference += comparisonObject.GetType().Name + ".Attributes"; return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.StringCollectionsAreTheSame(XmlComments, comparisonObject.XmlComments)) { ComparisonDifference += comparisonObject.GetType().Name + ".XmlComments"; return(false); } if (Comments.IsTheSame(comparisonObject.Comments) == false) { ComparisonDifference += comparisonObject.GetType().Name + ".Comments"; return(false); } return(true); }
private bool IsTheSame(Parameter comparisonParameter, ComparisonDepth depth) { if (comparisonParameter == null) { return(false); } if (Name != comparisonParameter.Name) { ComparisonDifference += GetType().Name + ".Name"; return(false); } if (depth == ComparisonDepth.Signature) { return(true); } if (DataType != comparisonParameter.DataType) { ComparisonDifference += GetType().Name + ".DataType"; return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Attributes.ToArray(), comparisonParameter.Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return(false); } return(true); }
private bool IsTheSame(InterfaceAccessor comparisonInterfaceAccessor, ComparisonDepth depth) { if (comparisonInterfaceAccessor == null) { return(false); } if (AccessorType == comparisonInterfaceAccessor.AccessorType) { // Function names are the same, so now compare the class names // TODO: Parent Comparison // if (ParentObject.IsTheSame(comparisonInterfaceAccessor.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonInterfaceAccessor, depth)) { return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.StringCollectionsAreTheSame(Modifiers, comparisonInterfaceAccessor.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } return(true); } } return(false); }
private bool IsTheSame(RegionStart comparisonObject, ComparisonDepth depth) { if (comparisonObject == null) { return(false); } return(base.IsTheSame(comparisonObject, depth)); }
private bool IsTheSame(Constructor comparisonConstructor, ComparisonDepth depth) { if (comparisonConstructor == null) { return(false); } if (Name == comparisonConstructor.Name) { if (ParametersAreTheSame(comparisonConstructor, depth) == false) { return(false); } // Function names are the same, so now compare the class names if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonConstructor, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonConstructor.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } if (depth == ComparisonDepth.Outer) { return(true); } if (BodyText != comparisonConstructor.BodyText) { ComparisonDifference += GetType().Name + ".Body"; return(false); } if (!ParentObject.IsTheSame(comparisonConstructor.ParentObject)) { ComparisonDifference += GetType().Name + ".Parent"; return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Attributes.ToArray(), comparisonConstructor.Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return(false); } return(true); } return(false); }
private bool IsTheSame(Constant comparisonConstant, ComparisonDepth depth) { if (comparisonConstant == null) { return(false); } if (Name == comparisonConstant.Name) { // Function names are the same, so now compare the class names //bool parentClassesTheSame = false; //if (ParentObject == null) //{ // parentClassesTheSame = comparisonConstant.ParentObject == null; //} //else if (comparisonConstant.ParentObject == null) //{ // // thisParentClass is obviously not null, because we checked above, so the classes are different //} //else //{ // parentClassesTheSame = ParentObject.IsTheSame(comparisonConstant.ParentObject); //} //if (parentClassesTheSame) //{ if (depth == ComparisonDepth.Signature) { return(true); } if (DataType != comparisonConstant.DataType) { return(false); } if (!base.IsTheSame(comparisonConstant, depth)) { return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.StringCollectionsAreTheSame(Modifiers, comparisonConstant.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Attributes.ToArray(), comparisonConstant.Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return(false); } //} return(true); } return(false); }
private bool IsTheSame(Interface comparisonInterface, ComparisonDepth depth) { if (comparisonInterface == null) { return(false); } if (Name == comparisonInterface.Name) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonInterface, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonInterface.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } if (depth == ComparisonDepth.Outer) { return(true); } // Now check all child objects Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Events.ToArray(), comparisonInterface.Events.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Events"; return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Indexers.ToArray(), comparisonInterface.Indexers.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Indexers"; return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Methods.ToArray(), comparisonInterface.Methods.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Methods"; return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Properties.ToArray(), comparisonInterface.Properties.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Properties"; return(false); } return(true); } return(false); }
private bool IsTheSame(InterfaceIndexer comparisonIndexer, ComparisonDepth depth) { if (comparisonIndexer == null) { return(false); } if (Name == comparisonIndexer.Name) { if (ParametersAreTheSame(comparisonIndexer, depth) == false) { return(false); } // Function names are the same, so now compare the class names if (ParentObject.IsTheSame(comparisonIndexer.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (dataType != comparisonIndexer.dataType) { return(false); } if (hasNewKeyword != comparisonIndexer.hasNewKeyword) { ComparisonDifference += GetType().Name + ".HasNewKeyword"; return(false); } if (depth == ComparisonDepth.Outer) { return(true); } if (!base.IsTheSame(comparisonIndexer, depth)) { return(false); } if (!GetAccessor.IsTheSame(comparisonIndexer.GetAccessor)) { ComparisonDifference += GetType().Name + ".GetAccessor"; return(false); } if (!SetAccessor.IsTheSame(comparisonIndexer.SetAccessor)) { ComparisonDifference += GetType().Name + ".SetAccessor"; return(false); } return(true); } } return(false); }
/// <summary> /// Determines if two code roots are the same. /// </summary> /// <param name="comparisonCodeRoot">The CodeRoot to compare against.</param> /// <param name="depth">The depth to which we should compare. Signature will always /// return true, as CodeRoots have no signature. Outer will return true if the UsingStatements /// are the same, and complete will compare all children.</param> /// <returns>true if the given CodeRoot matches this one to the specified depth.</returns> private bool IsTheSame(CodeRoot comparisonCodeRoot, ComparisonDepth depth) { if (comparisonCodeRoot == null) { return(false); } //Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (UsingStatementsTextBlock != comparisonCodeRoot.UsingStatementsTextBlock) { BaseConstruct.ComparisonDifference += GetType().Name + ".UsingStatements"; return(false); } if (depth == ComparisonDepth.Signature || depth == ComparisonDepth.Outer) { return(true); } if (!Utility.BaseContructCollectionsAreTheSame(Classes.ToArray(), comparisonCodeRoot.Classes.ToArray())) { BaseConstruct.ComparisonDifference += GetType().Name + ".Classes"; return(false); } if ( !Utility.BaseContructCollectionsAreTheSame(Namespaces.ToArray(), comparisonCodeRoot.Namespaces.ToArray())) { BaseConstruct.ComparisonDifference += GetType().Name + ".Namespaces"; return(false); } if (!Utility.BaseContructCollectionsAreTheSame(Structs.ToArray(), comparisonCodeRoot.Structs.ToArray())) { BaseConstruct.ComparisonDifference += GetType().Name + ".Structs"; return(false); } if ( !Utility.BaseContructCollectionsAreTheSame(Interfaces.ToArray(), comparisonCodeRoot.Interfaces.ToArray())) { BaseConstruct.ComparisonDifference += GetType().Name + ".Interfaces"; return(false); } if (!Utility.BaseContructCollectionsAreTheSame(Enums.ToArray(), comparisonCodeRoot.Enums.ToArray())) { BaseConstruct.ComparisonDifference += GetType().Name + ".Enums"; return(false); } if (!Utility.BaseContructCollectionsAreTheSame(UsingStatements.ToArray(), comparisonCodeRoot.UsingStatements.ToArray())) { BaseConstruct.ComparisonDifference += GetType().Name + ".UsingStatements"; return(false); } return(true); }
private bool IsTheSame(Indexer comparisonIndexer, ComparisonDepth depth) { if (comparisonIndexer == null) { return(false); } if (Name == comparisonIndexer.Name && DataType == comparisonIndexer.DataType && Parameters.Count == comparisonIndexer.Parameters.Count) { for (int i = 0; i < Parameters.Count; i++) { if (Parameters[i].Name != comparisonIndexer.Parameters[i].Name || Parameters[i].DataType != comparisonIndexer.Parameters[i].DataType) { return(false); } } // Function names are the same, so now compare the class names // TODO: Parent object comparison //if (ParentObject.IsTheSame(comparisonIndexer.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonIndexer, depth)) { return(false); } if (depth == ComparisonDepth.Outer) { return(true); } if (!GetAccessor.IsTheSame(comparisonIndexer.GetAccessor)) { ComparisonDifference += GetType().Name + ".GetAccessor"; return(false); } if (!SetAccessor.IsTheSame(comparisonIndexer.SetAccessor)) { ComparisonDifference += GetType().Name + ".SetAccessor"; return(false); } return(true); } } return(false); }
private bool IsTheSame(Enumeration comparisonEnum, ComparisonDepth depth) { if (comparisonEnum == null) { return(false); } if (Name == comparisonEnum.Name) { if ((ParentObject == null && comparisonEnum.ParentObject == null) || (ParentObject.GetType() == comparisonEnum.ParentObject.GetType() && ParentObject.Name == comparisonEnum.ParentObject.Name)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonEnum, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonEnum.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } if (depth == ComparisonDepth.Outer) { return(true); } // Now check all child objects Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (EnumBase != comparisonEnum.EnumBase) { return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Members.ToArray(), comparisonEnum.Members.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Members"; return(false); } return(true); } } return(false); }
/// <summary> /// Compares this IBaseConstruct against the one provided, and returns true if they are the same. /// </summary> /// <param name="depth">The depth of the comparison we do.</param> /// <param name="comparisonObject">The object to compare against.</param> /// <returns>True if the objects are the same, false if they are different.</returns> public bool IsTheSame(IBaseConstruct comparisonObject, ComparisonDepth depth) { if (comparisonObject is BaseConstruct) { if (depth == ComparisonDepth.Complete && !Utility.BaseContructCollectionsAreTheSame(_Attributes.ToArray(), ((BaseConstruct)comparisonObject)._Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return(false); } return(IsTheSame(comparisonObject as BaseConstruct, depth)); } return(false); }
private bool IsTheSame(InterfaceProperty comparisonProperty, ComparisonDepth depth) { if (comparisonProperty == null) { return(false); } if (Name == comparisonProperty.Name) { // TODO: Parent Object Comparison // if (ParentObject.IsTheSame(comparisonProperty.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonProperty, depth)) { return(false); } if (DataType != comparisonProperty.DataType) { return(false); } if (depth == ComparisonDepth.Outer) { return(true); } if (!GetAccessor.IsTheSame(comparisonProperty.GetAccessor)) { ComparisonDifference += GetType().Name + ".GetAccessor"; return(false); } if (!SetAccessor.IsTheSame(comparisonProperty.SetAccessor)) { ComparisonDifference += GetType().Name + ".SetAccessor"; return(false); } return(true); } } return(false); }
private bool IsTheSame(Field comparisonField, ComparisonDepth depth) { if (comparisonField == null) { return(false); } if (Name == comparisonField.Name) { // TODO: Why are these checks on parents here? // if (ParentObject.IsTheSame(comparisonField.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonField, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonField.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } if (DataType != comparisonField.DataType) { return(false); } if (depth == ComparisonDepth.Outer) { return(true); } if (InitialValue != comparisonField.InitialValue) { ComparisonDifference += GetType().Name + ".InitialValue"; return(false); } return(true); } } return(false); }
private bool IsTheSame(Property comparisonProperty, ComparisonDepth depth) { if (comparisonProperty == null) { return(false); } if (Name == comparisonProperty.Name) { if (depth == ComparisonDepth.Signature) { return(true); } if (DataType != comparisonProperty.DataType) { return(false); } if (!base.IsTheSame(comparisonProperty, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonProperty.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } if (depth == ComparisonDepth.Outer) { return(true); } if (!GetAccessor.IsTheSame(comparisonProperty.GetAccessor)) { ComparisonDifference += GetType().Name + ".GetAccessor"; return(false); } if (!SetAccessor.IsTheSame(comparisonProperty.SetAccessor)) { ComparisonDifference += GetType().Name + ".SetAccessor"; return(false); } return(true); } return(false); }
private bool IsTheSame(InterfaceMethod comparisonFunction, ComparisonDepth depth) { if (comparisonFunction == null) { return(false); } if (Name == comparisonFunction.Name) { if (ParametersAreTheSame(comparisonFunction, depth) == false) { return(false); } // Function names are the same, so now compare the class names Interface thisParentClass = (Interface)ParentObject; Interface comparisonParentClass = (Interface)comparisonFunction.ParentObject; if (thisParentClass.IsTheSame(comparisonParentClass)) { if (depth == ComparisonDepth.Signature) { return(true); } if (returnType != comparisonFunction.returnType) { return(false); } if (hasNewKeyword != comparisonFunction.hasNewKeyword) { ComparisonDifference += GetType().Name + ".HasNewKeyword"; return(false); } if (!base.IsTheSame(comparisonFunction, depth)) { return(false); } return(true); } } return(false); }
private bool IsTheSame(Operator comparisonOperator, ComparisonDepth depth) { if (comparisonOperator == null) { return(false); } if (Name == comparisonOperator.Name) { // Function names are the same, so now compare the class names if (ParametersAreTheSame(comparisonOperator, depth) == false) { return(false); } // TODO: Parent object comparison // if (ParentObject.IsTheSame(comparisonOperator.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (DataType != comparisonOperator.DataType) { return(false); } if (!base.IsTheSame(comparisonOperator, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonOperator.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } return(true); } } return(false); }
private bool IsTheSame(Class comparisonClass, ComparisonDepth depth) { if (comparisonClass == null) { return(false); } if (Name == comparisonClass.Name) { //if ((ParentObject == null && comparisonClass.ParentObject == null) || // (ParentObject.GetType() == comparisonClass.ParentObject.GetType() && // ParentObject.Name == comparisonClass.ParentObject.Name)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonClass, depth)) { return(false); } if (BaseNames != comparisonClass.BaseNames && IsPartial != comparisonClass.IsPartial) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonClass.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } if (!Utility.StringCollectionsAreTheSame(GenericTypes, comparisonClass.GenericTypes)) { ComparisonDifference += GetType().Name + ".GenericTypes"; return(false); } return(true); } } return(false); }
private bool IsTheSame(Event comparisonEvent, ComparisonDepth depth) { if (comparisonEvent == null) { return(false); } if (Name == comparisonEvent.Name) { // Function names are the same, so now compare the class names { if (depth == ComparisonDepth.Signature) { return(true); } if (DataType != comparisonEvent.DataType) { return(false); } if (!base.IsTheSame(comparisonEvent, depth)) { return(false); } if (InitialValue != comparisonEvent.InitialValue) { ComparisonDifference += GetType().Name + ".InitialValue"; return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonEvent.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } // Why are these checks on parents here? //if (!ParentObject.IsTheSame(comparisonEvent.ParentObject)) //{ //} return(true); } } return(false); }
public bool IsTheSame(Region comparisonRegion, ComparisonDepth depth) { if (comparisonRegion == null) { return(false); } if (Name == comparisonRegion.Name) { if (depth == ComparisonDepth.Signature) { return(true); } return(base.IsTheSame(comparisonRegion, depth)); } return(false); }
private bool IsTheSame(Function comparisonFunction, ComparisonDepth depth) { if (comparisonFunction == null) { return(false); } if (Name == comparisonFunction.Name) { if (!ParametersAreTheSame(comparisonFunction, depth)) { return(false); } // Function names are the same, so now compare the class names // TODO: Parent comparison // if (ParentObject.IsTheSame(comparisonFunction.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (ReturnType != comparisonFunction.ReturnType) { return(false); } if (!base.IsTheSame(comparisonFunction, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonFunction.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } return(true); } } return(false); }
private bool IsTheSame(Attribute comparisonAttribute, ComparisonDepth depth) { if (comparisonAttribute == null) { return(false); } if (Name == comparisonAttribute.Name) { if (depth == ComparisonDepth.Signature) { return(true); } if (!Utility.StringCollectionsAreTheSame(PositionalArguments, comparisonAttribute.PositionalArguments)) { ComparisonDifference += GetType().Name + ".PositionalArguments"; return(false); } if (NamedArguments.Count != comparisonAttribute.NamedArguments.Count) { return(false); } for (int i = 0; i < NamedArguments.Count; i++) { if (NamedArguments[i].Name != comparisonAttribute.NamedArguments[i].Name || NamedArguments[i].Value != comparisonAttribute.NamedArguments[i].Value) { return(false); } } if (!base.IsTheSame(comparisonAttribute, depth)) { return(false); } return(true); } return(false); }
protected bool ParametersAreTheSame(ParameterBase comparisonFunction, ComparisonDepth depth) { if (Parameters.Count != comparisonFunction.Parameters.Count) { return(false); } for (int i = 0; i < Parameters.Count; i++) { if (depth != ComparisonDepth.Signature && Parameters[i].Name != comparisonFunction.Parameters[i].Name) { return(false); } if (Parameters[i].DataType != comparisonFunction.Parameters[i].DataType) { return(false); } } return(true); }
private bool IsTheSame(EnumMember comparisonEnumMember, ComparisonDepth depth) { if (Name == comparisonEnumMember.Name) { if ((ParentObject == null && comparisonEnumMember.ParentObject == null) || (ParentObject.GetType() == comparisonEnumMember.ParentObject.GetType() && ParentObject.Name == comparisonEnumMember.ParentObject.Name)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonEnumMember, depth)) { return(false); } return(true); } } return(false); }
/// <summary> /// This is private so that the IsTheSameMethod in BaseConstruct is always called first. /// </summary> /// <param name="comparisonDelegate"></param> /// <param name="depth"></param> /// <returns></returns> private bool IsTheSame(Delegate comparisonDelegate, ComparisonDepth depth) { if (comparisonDelegate == null) { return(false); } if (Name == comparisonDelegate.Name) { if (ParametersAreTheSame(comparisonDelegate, depth) == false) { return(false); } if (depth == ComparisonDepth.Signature) { return(true); } if (ReturnType != comparisonDelegate.ReturnType) { return(false); } if (!base.IsTheSame(comparisonDelegate, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonDelegate.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } return(true); } return(false); }
private bool IsTheSame(Struct comparisonStruct, ComparisonDepth depth) { if (comparisonStruct == null) { return(false); } if (Name == comparisonStruct.Name) { // Function names are the same, so now compare the class names //Class thisParentClass = (Class)this.ParentObject; //Class comparisonParentClass = (Class)comparisonStruct.ParentObject; //if (thisParentClass.IsTheSame(comparisonParentClass)) if ((ParentObject == null && comparisonStruct.ParentObject == null) || (ParentObject.GetType() == comparisonStruct.ParentObject.GetType() && ParentObject.Name == comparisonStruct.ParentObject.Name)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonStruct, depth)) { return(false); } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonStruct.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return(false); } return(true); } } return(false); }
private bool IsTheSame(PropertyAccessor comparisonInterfaceAccessor, ComparisonDepth depth) { if (comparisonInterfaceAccessor == null) { return(false); } if (AccessorType == comparisonInterfaceAccessor.AccessorType) { // Function names are the same, so now compare the class names // TODO: Parent comparison //if (ParentObject.IsTheSame(comparisonInterfaceAccessor.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonInterfaceAccessor, depth)) { return(false); } if (depth == ComparisonDepth.Outer) { return(true); } if (Text != comparisonInterfaceAccessor.Text) { ComparisonDifference += GetType().Name + ".Text"; return(false); } return(true); } } return(false); }
private bool IsTheSame(InterfaceEvent comparisonEvent, ComparisonDepth depth) { if (comparisonEvent == null) { return(false); } if (Name == comparisonEvent.Name) { // Function names are the same, so now compare the class names // TODO: Parent Comparison //if (ParentObject.IsTheSame(comparisonEvent.ParentObject)) { if (depth == ComparisonDepth.Signature) { return(true); } if (DataType != comparisonEvent.DataType) { return(false); } if (HasNewKeyword != comparisonEvent.HasNewKeyword) { ComparisonDifference += GetType().Name + ".HasNewKeyword"; return(false); } if (!base.IsTheSame(comparisonEvent, depth)) { return(false); } return(true); } } return(false); }
private bool IsTheSame(AttributeSection comparisonAttribute, ComparisonDepth depth) { if (comparisonAttribute == null) { return(false); } if (Name == comparisonAttribute.Name && singleAttributes.Count == comparisonAttribute.singleAttributes.Count) { Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(singleAttributes.ToArray(), comparisonAttribute.singleAttributes.ToArray(), comparer, depth)) { ComparisonDifference += GetType().Name + ".SingleAttributes"; return(false); } if (depth == ComparisonDepth.Signature) { return(true); } if (!base.IsTheSame(comparisonAttribute, depth)) { return(false); } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Attributes.ToArray(), comparisonAttribute.Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return(false); } return(true); } return(false); }
private bool IsTheSame(UsingStatement comparisonObject, ComparisonDepth depth) { if (comparisonObject == null) { return(false); } if (!base.IsTheSame(comparisonObject, depth)) { return(false); } if (Alias != comparisonObject.Alias) { ComparisonDifference += ".Alias"; return(false); } if (Value != comparisonObject.Value) { ComparisonDifference += ".Value"; return(false); } return(true); }
public override bool IsTheSame(BaseConstruct comparisonStruct, ComparisonDepth depth) { return IsTheSame(comparisonStruct as PropertyAccessor, depth); }
public override bool IsTheSame(BaseBaseConstruct comparisonObject, ComparisonDepth depth) { throw new System.NotImplementedException(); }
private bool IsTheSame(Constant comparisonConstant, ComparisonDepth depth) { if (comparisonConstant == null) return false; if (Name == comparisonConstant.Name) { // Function names are the same, so now compare the class names //bool parentClassesTheSame = false; //if (ParentObject == null) //{ // parentClassesTheSame = comparisonConstant.ParentObject == null; //} //else if (comparisonConstant.ParentObject == null) //{ // // thisParentClass is obviously not null, because we checked above, so the classes are different //} //else //{ // parentClassesTheSame = ParentObject.IsTheSame(comparisonConstant.ParentObject); //} //if (parentClassesTheSame) //{ if (depth == ComparisonDepth.Signature) { return true; } if (DataType != comparisonConstant.DataType) return false; if (!base.IsTheSame(comparisonConstant, depth)) { return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.StringCollectionsAreTheSame(Modifiers, comparisonConstant.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Attributes.ToArray(), comparisonConstant.Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return false; } //} return true; } return false; }
/// <summary> /// This is private so that the IsTheSameMethod in BaseConstruct is always called first. /// </summary> /// <param name="comparisonDelegate"></param> /// <param name="depth"></param> /// <returns></returns> private bool IsTheSame(Delegate comparisonDelegate, ComparisonDepth depth) { if (comparisonDelegate == null) return false; if (Name == comparisonDelegate.Name) { if (ParametersAreTheSame(comparisonDelegate, depth) == false) return false; if (depth == ComparisonDepth.Signature) { return true; } if (ReturnType != comparisonDelegate.ReturnType) { return false; } if (!base.IsTheSame(comparisonDelegate, depth)) { return false; } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonDelegate.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } return true; } return false; }
public override bool IsTheSame(BaseConstruct comparisonStruct, ComparisonDepth depth) { return IsTheSame(comparisonStruct as Event, depth); }
private bool IsTheSame(EnumMember comparisonEnumMember, ComparisonDepth depth) { if (Name == comparisonEnumMember.Name) { if ((ParentObject == null && comparisonEnumMember.ParentObject == null) || (ParentObject.GetType() == comparisonEnumMember.ParentObject.GetType() && ParentObject.Name == comparisonEnumMember.ParentObject.Name)) { if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonEnumMember, depth)) { return false; } return true; } } return false; }
private bool IsTheSame(AttributeSection comparisonAttribute, ComparisonDepth depth) { if (comparisonAttribute == null) return false; if (Name == comparisonAttribute.Name && singleAttributes.Count == comparisonAttribute.singleAttributes.Count) { Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(singleAttributes.ToArray(), comparisonAttribute.singleAttributes.ToArray(), comparer, depth)) { ComparisonDifference += GetType().Name + ".SingleAttributes"; return false; } if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonAttribute, depth)) { return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Attributes.ToArray(), comparisonAttribute.Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return false; } return true; } return false; }
public override bool IsTheSame(BaseConstruct comparisonOperator, ComparisonDepth depth) { return IsTheSame(comparisonOperator as Operator, depth); }
private bool IsTheSame(Indexer comparisonIndexer, ComparisonDepth depth) { if (comparisonIndexer == null) return false; if (Name == comparisonIndexer.Name && DataType == comparisonIndexer.DataType && Parameters.Count == comparisonIndexer.Parameters.Count) { for (int i = 0; i < Parameters.Count; i++) { if (Parameters[i].Name != comparisonIndexer.Parameters[i].Name || Parameters[i].DataType != comparisonIndexer.Parameters[i].DataType) { return false; } } // Function names are the same, so now compare the class names // TODO: Parent object comparison //if (ParentObject.IsTheSame(comparisonIndexer.ParentObject)) { if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonIndexer, depth)) { return false; } if (depth == ComparisonDepth.Outer) { return true; } if (!GetAccessor.IsTheSame(comparisonIndexer.GetAccessor)) { ComparisonDifference += GetType().Name + ".GetAccessor"; return false; } if (!SetAccessor.IsTheSame(comparisonIndexer.SetAccessor)) { ComparisonDifference += GetType().Name + ".SetAccessor"; return false; } return true; } } return false; }
private bool IsTheSame(Parameter comparisonParameter, ComparisonDepth depth) { if (comparisonParameter == null) return false; if (Name != comparisonParameter.Name) { ComparisonDifference += GetType().Name + ".Name"; return false; } if (depth == ComparisonDepth.Signature) return true; if (DataType != comparisonParameter.DataType) { ComparisonDifference += GetType().Name + ".DataType"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Attributes.ToArray(), comparisonParameter.Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return false; } return true; }
private bool IsTheSame(Operator comparisonOperator, ComparisonDepth depth) { if (comparisonOperator == null) return false; if (Name == comparisonOperator.Name) { // Function names are the same, so now compare the class names if (ParametersAreTheSame(comparisonOperator, depth) == false) return false; // TODO: Parent object comparison // if (ParentObject.IsTheSame(comparisonOperator.ParentObject)) { if (depth == ComparisonDepth.Signature) { return true; } if (DataType != comparisonOperator.DataType) return false; if (!base.IsTheSame(comparisonOperator, depth)) { return false; } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonOperator.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } return true; } } return false; }
private bool IsTheSame(Constructor comparisonConstructor, ComparisonDepth depth) { if (comparisonConstructor == null) return false; if (Name == comparisonConstructor.Name) { if (ParametersAreTheSame(comparisonConstructor, depth) == false) return false; // Function names are the same, so now compare the class names if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonConstructor, depth)) { return false; } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonConstructor.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } if (depth == ComparisonDepth.Outer) { return true; } if (BodyText != comparisonConstructor.BodyText) { ComparisonDifference += GetType().Name + ".Body"; return false; } if (!ParentObject.IsTheSame(comparisonConstructor.ParentObject)) { ComparisonDifference += GetType().Name + ".Parent"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Attributes.ToArray(), comparisonConstructor.Attributes.ToArray())) { ComparisonDifference += GetType().Name + ".Attributes"; return false; } return true; } return false; }
private bool IsTheSame(RegionStart comparisonObject, ComparisonDepth depth) { if (comparisonObject == null) return false; return base.IsTheSame(comparisonObject, depth); }
public override bool IsTheSame(BaseConstruct comparisonStruct, ComparisonDepth depth) { return IsTheSame(comparisonStruct as AttributeSection, depth); }
private bool IsTheSame(Field comparisonField, ComparisonDepth depth) { if (comparisonField == null) return false; if (Name == comparisonField.Name) { // TODO: Why are these checks on parents here? // if (ParentObject.IsTheSame(comparisonField.ParentObject)) { if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonField, depth)) { return false; } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonField.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } if (DataType != comparisonField.DataType) return false; if (depth == ComparisonDepth.Outer) { return true; } if (InitialValue != comparisonField.InitialValue) { ComparisonDifference += GetType().Name + ".InitialValue"; return false; } return true; } } return false; }
public override bool IsTheSame(BaseConstruct comparisonEnumMember, ComparisonDepth depth) { return IsTheSame((EnumMember)comparisonEnumMember, depth); }
private bool IsTheSame(Event comparisonEvent, ComparisonDepth depth) { if (comparisonEvent == null) { return false; } if (Name == comparisonEvent.Name) { // Function names are the same, so now compare the class names { if (depth == ComparisonDepth.Signature) { return true; } if (DataType != comparisonEvent.DataType) { return false; } if (!base.IsTheSame(comparisonEvent, depth)) { return false; } if (InitialValue != comparisonEvent.InitialValue) { ComparisonDifference += GetType().Name + ".InitialValue"; return false; } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonEvent.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } // Why are these checks on parents here? //if (!ParentObject.IsTheSame(comparisonEvent.ParentObject)) //{ //} return true; } } return false; }
private bool IsTheSame(Enumeration comparisonEnum, ComparisonDepth depth) { if (comparisonEnum == null) return false; if (Name == comparisonEnum.Name) { if ((ParentObject == null && comparisonEnum.ParentObject == null) || (ParentObject.GetType() == comparisonEnum.ParentObject.GetType() && ParentObject.Name == comparisonEnum.ParentObject.Name)) { if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonEnum, depth)) { return false; } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonEnum.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } if (depth == ComparisonDepth.Outer) { return true; } // Now check all child objects Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (EnumBase != comparisonEnum.EnumBase) { return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Members.ToArray(), comparisonEnum.Members.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Members"; return false; } return true; } } return false; }
public override bool IsTheSame(BaseConstruct comparisonObject, ComparisonDepth depth) { return comparisonObject is EmptyPlaceholder; }
public override bool IsTheSame(BaseConstruct comparisonEnum, ComparisonDepth depth) { return IsTheSame(comparisonEnum as Enumeration, depth); }
protected internal bool ParametersAreTheSame(ParameterBase comparisonFunction, ComparisonDepth depth) { if (Parameters.Count != comparisonFunction.Parameters.Count) return false; for (int i = 0; i < Parameters.Count; i++) { if (depth != ComparisonDepth.Signature && Parameters[i].Name != comparisonFunction.Parameters[i].Name) return false; if (Parameters[i].DataType != comparisonFunction.Parameters[i].DataType) { return false; } } return true; }
private bool IsTheSame(Property comparisonProperty, ComparisonDepth depth) { if (comparisonProperty == null) return false; if (Name == comparisonProperty.Name) { if (depth == ComparisonDepth.Signature) { return true; } if (DataType != comparisonProperty.DataType) return false; if (!base.IsTheSame(comparisonProperty, depth)) { return false; } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonProperty.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } if (depth == ComparisonDepth.Outer) { return true; } if (!GetAccessor.IsTheSame(comparisonProperty.GetAccessor)) { ComparisonDifference += GetType().Name + ".GetAccessor"; return false; } if (!SetAccessor.IsTheSame(comparisonProperty.SetAccessor)) { ComparisonDifference += GetType().Name + ".SetAccessor"; return false; } return true; } return false; }
private bool IsTheSame(Namespace comparisonNamespace, ComparisonDepth depth) { if (comparisonNamespace == null) return false; if (Name == comparisonNamespace.Name) { if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonNamespace, depth)) { return false; } if (depth == ComparisonDepth.Outer) { return true; } if (!Utility.CollectionsAreTheSame(UsingStatements, comparisonNamespace.UsingStatements, new Comparers.UsingStatementComparer())) { ComparisonDifference += GetType().Name + ".UsingStatements"; return false; } Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Classes.ToArray(), comparisonNamespace.Classes.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Classes"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Structs.ToArray(), comparisonNamespace.Structs.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Structs"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Interfaces.ToArray(), comparisonNamespace.Interfaces.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Interfaces"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Enums.ToArray(), comparisonNamespace.Enums.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Enums"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Delegates.ToArray(), comparisonNamespace.Delegates.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Delegates"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(InnerNamespaces.ToArray(), comparisonNamespace.InnerNamespaces.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Namespaces"; return false; } return true; } return false; }
private bool IsTheSame(Interface comparisonInterface, ComparisonDepth depth) { if (comparisonInterface == null) return false; if (Name == comparisonInterface.Name) { if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonInterface, depth)) { return false; } if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonInterface.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } if (depth == ComparisonDepth.Outer) { return true; } // Now check all child objects Comparers.BaseConstructComparer comparer = new Comparers.BaseConstructComparer(); if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Events.ToArray(), comparisonInterface.Events.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Events"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Indexers.ToArray(), comparisonInterface.Indexers.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Indexers"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Methods.ToArray(), comparisonInterface.Methods.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Methods"; return false; } if (!ArchAngel.Providers.CodeProvider.CSharp.Utility.BaseContructCollectionsAreTheSame(Properties.ToArray(), comparisonInterface.Properties.ToArray(), comparer)) { ComparisonDifference += GetType().Name + ".Properties"; return false; } return true; } return false; }
public override bool IsTheSame(BaseConstruct comparisonNamespace, ComparisonDepth depth) { return IsTheSame(comparisonNamespace as Namespace, depth); }
public override bool IsTheSame(BaseConstruct comparisonObject, ComparisonDepth depth) { return IsTheSame(comparisonObject as RegionStart, depth); }
private bool IsTheSame(Function comparisonFunction, ComparisonDepth depth) { if (comparisonFunction == null) return false; if (Name == comparisonFunction.Name) { if (!ParametersAreTheSame(comparisonFunction, depth)) return false; // Function names are the same, so now compare the class names // TODO: Parent comparison // if (ParentObject.IsTheSame(comparisonFunction.ParentObject)) { if (depth == ComparisonDepth.Signature) return true; if (ReturnType != comparisonFunction.ReturnType) return false; if (!base.IsTheSame(comparisonFunction, depth)) return false; if (!Utility.StringCollectionsAreTheSame(Modifiers, comparisonFunction.Modifiers)) { ComparisonDifference += GetType().Name + ".Modifiers"; return false; } return true; } } return false; }
private bool IsTheSame(PropertyAccessor comparisonInterfaceAccessor, ComparisonDepth depth) { if (comparisonInterfaceAccessor == null) return false; if (AccessorType == comparisonInterfaceAccessor.AccessorType) { // Function names are the same, so now compare the class names // TODO: Parent comparison //if (ParentObject.IsTheSame(comparisonInterfaceAccessor.ParentObject)) { if (depth == ComparisonDepth.Signature) { return true; } if (!base.IsTheSame(comparisonInterfaceAccessor, depth)) { return false; } if (depth == ComparisonDepth.Outer) { return true; } if (Text != comparisonInterfaceAccessor.Text) { ComparisonDifference += GetType().Name + ".Text"; return false; } return true; } } return false; }