public void CheckSubTypeProperties(ref TreeNode N, FeatureData theS, FeatureData theD) { ISubtypes theSS; ISubtypes theDS; IEnumSubtype theE; IEnumSubtype theF; int theV, theQ; string strV, strQ; Boolean isFound; string theVText, theDText; theSS = theS.theST; theDS = theD.theST; if (theSS.HasSubtype != theDS.HasSubtype) { if (theSS.HasSubtype) { N.Nodes.Add(new Guid().ToString(), "Template Has Subtypes and Implementation does NOT", 1, 1); } else { N.Nodes.Add(new Guid().ToString(), "Implementation Has Subtypes and Template does NOT", 1, 1); } } else if (theSS.HasSubtype) { TreeNode S = new TreeNode("SubTypes"); theE = theSS.Subtypes; theF = theDS.Subtypes; theVText = theE.Next(out theV); while (theV != 0) { strV = theV.ToString() + " - " + theVText; theF.Reset(); strQ = ""; isFound = false; theDText = theF.Next(out theQ); while (theQ != 0) { strQ = theQ.ToString() + " - " + theDText; if (strQ == strV) { isFound = true; } theDText = theF.Next(out theQ); } if (!isFound) { S.Nodes.Add(new Guid().ToString(), "SubType " + strQ + " missing from Implementation", 1, 1); } theVText = theE.Next(out theV); } theF.Reset(); theVText = theF.Next(out theV); while (theV != 0) { strV = theV.ToString() + " - " + theVText; theE.Reset(); strQ = ""; isFound = false; theDText = theE.Next(out theQ); while (theQ != 0) { strQ = theQ.ToString() + " - " + theDText; if (strQ == strV) { isFound = true; } theDText = theE.Next(out theQ); } if (!isFound) { S.Nodes.Add(new Guid().ToString(), "SubType " + strQ + " missing from Template", 1, 1); } theVText = theE.Next(out theV); } if (S.Nodes.Count == 0) { S.Nodes.Add("All SubTypes Agree Between Template and Implementation"); } else { N.ImageIndex = 1; N.SelectedImageIndex = 1; S.ImageIndex = 1; S.SelectedImageIndex = 1; } N.Nodes.Add(S); } }
public void CheckFieldProperties(ref TreeNode N, FeatureData theS, FeatureData theD) { IFields theSF; IFields theDF; string theFName; theSF = theS.theFlds; theDF = theD.theFlds; if (theSF.FieldCount != theDF.FieldCount) { N.Nodes.Add(new Guid().ToString(), "Field Counts Mismatched between Template and Implementation", 1, 1); } else { TreeNode F = new TreeNode("Attributes"); for (int C = 0; C < theSF.FieldCount; C++) { theFName = theSF.get_Field(C).Name; if (theDF.FindField(theFName) < 0) { F.Nodes.Add(new Guid().ToString(), "Field " + theFName + " missing from Implementation", 1, 1); } else { if (theSF.get_Field(C).Type != theDF.get_Field(theDF.FindField(theFName)).Type) { F.Nodes.Add(new Guid().ToString(), "Field " + theFName + " mismatched Data Type", 1, 1); } if (theSF.get_Field(C).Type == esriFieldType.esriFieldTypeString) { if (theSF.get_Field(C).Length != theDF.get_Field(theDF.FindField(theFName)).Length) { TreeNode OID = new TreeNode("Field " + theFName + " mismatched Character Length") { ImageIndex = 1, SelectedImageIndex = 1 }; //TODO: fix detection of implementation field length //OID.Nodes.Add(new Guid().ToString(), "Template is " + theSF.get_Field(C).Length.ToString(), 1); //OID.Nodes.Add(new Guid().ToString(), "Implementation is " + theDF.get_Field(C).Length.ToString(), 1); F.Nodes.Add(OID); } } if (theSF.get_Field(C).AliasName != theDF.get_Field(theDF.FindField(theFName)).AliasName) { TreeNode OID = new TreeNode("Field " + theFName + " mismatched Alias Name") { ImageIndex = 1, SelectedImageIndex = 1 }; //OID.Nodes.Add(new Guid().ToString(), "Template is " + theSF.get_Field(C).AliasName, 1); //OID.Nodes.Add(new Guid().ToString(), "Implementation is " + theDF.get_Field(theDF.FindField(theFName)).AliasName, 1); F.Nodes.Add(OID); } } } for (int C = 0; C < theDF.FieldCount; C++) { theFName = theDF.get_Field(C).Name; if (theSF.FindField(theFName) < 0) { F.Nodes.Add(new Guid().ToString(), "Field " + theFName + " missing from Template", 1, 1); } else { if (theDF.get_Field(C).Type != theSF.get_Field(theSF.FindField(theFName)).Type) { F.Nodes.Add(new Guid().ToString(), "Field " + theFName + " mismatched Data Type", 1, 1); } if (theDF.get_Field(C).AliasName != theDF.get_Field(theDF.FindField(theFName)).AliasName) { TreeNode OID = new TreeNode("Field " + theFName + " mismatched Alias Name") { ImageIndex = 1, SelectedImageIndex = 1 }; // OID.ImageIndex = 1; OID.Nodes.Add(new Guid().ToString(), "Template is " + theSF.get_Field(C).AliasName, 1, 1); OID.Nodes.Add(new Guid().ToString(), "Implementation is " + theDF.get_Field(theDF.FindField(theFName)).AliasName, 1, 1); //OID.Nodes[0].ImageIndex = 1; //OID.Nodes[1].ImageIndex = 1; F.Nodes.Add(OID); } } } if (F.Nodes.Count == 0) { F.Nodes.Add("All Fields Agree"); } else { N.ImageIndex = 1; F.ImageIndex = 1; } N.Nodes.Add(F); } }
public void CheckDomainsAndValues(ref TreeNode N, FeatureData theS, FeatureData theD) { ISubtypes theSS; ISubtypes theDS; IEnumSubtype theE; int theV, theQ; string strV, strQ; TreeNode FDV = null; Boolean firstTime = false; Boolean isFound; IDomain theSDVal, theDDVal; string theVText; theSS = theS.theST; theDS = theD.theST; if (theSS.HasSubtype == theDS.HasSubtype && theSS.HasSubtype) { TreeNode S = new TreeNode("Constraints"); theE = theSS.Subtypes; theVText = theE.Next(out theV); while (theV != 0) { firstTime = true; IFields theFlds = theS.theFlds; IFields destFlds = theD.theFlds; for (int C = 0; C < theFlds.FieldCount; C++) { if (theFlds.get_Field(C).Editable) { theDDVal = null; theSDVal = theSS.get_Domain(theV, theFlds.get_Field(C).Name); if (destFlds.FindField(theFlds.get_Field(C).Name) >= 0) { theDDVal = theDS.get_Domain(theV, theFlds.get_Field(C).Name); } if (theSDVal != null && theDDVal != null) { if (theSDVal.Name != theDDVal.Name) { if (firstTime) { FDV = new TreeNode("For Feature Type - " + theVText); } TreeNode DV = new TreeNode("Domain " + theSDVal.Name + " for Field " + theFlds.get_Field(C).Name + " unmatched"){ ImageIndex = 1, SelectedImageIndex = 1}; DV.Nodes.Add(new Guid().ToString(), "Template is " + theSDVal.Name, 1, 1); DV.Nodes.Add(new Guid().ToString(), "Implementation is " + theDDVal.Name, 1, 1); TreeNode V = new TreeNode("Domain Values Comparison"){ImageIndex = 1, SelectedImageIndex = 1}; DomainValueComparison(ref V, theSDVal, theDDVal); FDV.ImageIndex = 1; FDV.SelectedImageIndex = 1; //V.ImageIndex = 1; FDV.Nodes.Add(DV); DV.Nodes.Add(V); if (firstTime) { S.Nodes.Add(FDV); firstTime = false; } } else { TreeNode DV = new TreeNode("Domain " + theSDVal.Name + " for Field " + theFlds.get_Field(C).Name + " is Valid"); TreeNode V = new TreeNode("Domain Values Comparison"); //DomainValueComparison(ref V, theSDVal, theDDVal); ////FDV.Nodes.Add(DV); //DV.Nodes.Add(V); //S.Nodes.Add(DV); if (DomainValueComparison(ref V, theSDVal, theDDVal)) { DV.Text = "Domain " + theSDVal.Name + " for Field " + theFlds.get_Field(C).Name + " is not Valid"; DV.ImageIndex = 1; DV.SelectedImageIndex = 1; V.ImageIndex = 1; V.SelectedImageIndex = 1; DV.Nodes.Add(V); S.Nodes.Add(DV); } } } else if (theSDVal == null && theDDVal == null) { } else if (theSDVal == null) { TreeNode DV = new TreeNode("Domain " + theSDVal + " for Field " + theFlds.get_Field(C).Name + " Missing in Implementation"){ImageIndex = 1, SelectedImageIndex = 1}; S.Nodes.Add(DV); } else { TreeNode DV = new TreeNode("Domain " + theDDVal + " for Field " + theFlds.get_Field(C).Name + " Missing in Template"){ ImageIndex = 1, SelectedImageIndex = 1}; S.Nodes.Add(DV); } } } theVText = theE.Next(out theV); } if (S.Nodes.Count == 0) { S.Nodes.Add("All Domains and Values Agree between Template and Implementation"); } else { N.ImageIndex = 1; N.SelectedImageIndex = 1; S.ImageIndex = 1; S.SelectedImageIndex = 1; } N.Nodes.Add(S); } }
public void CheckFeatureProperties(ref TreeNode N, FeatureData theS, FeatureData theD) { if (theS.theAlias != theD.theAlias) { N.ImageIndex = 1; N.SelectedImageIndex = 1; TreeNode Alias = new TreeNode("Mismatched Alias") { ImageIndex = 1, SelectedImageIndex = 1 }; Alias.Nodes.Add("Template is " + theS.theAlias); Alias.Nodes.Add("Implementation is " + theD.theAlias); N.Nodes.Add(Alias); } if (theS.OIDName.ToUpper() != theD.OIDName.ToUpper()) { N.ImageIndex = 1; N.SelectedImageIndex = 1; TreeNode OID = new TreeNode("Mismatched OID Field Name") { ImageIndex = 1, SelectedImageIndex = 1 }; OID.Nodes.Add("Template is " + theS.OIDName.ToUpper()); OID.Nodes.Add("Implementation is " + theD.OIDName.ToUpper()); N.Nodes.Add(OID); } if (theS.theGType != theD.theGType) { N.ImageIndex = 1; N.SelectedImageIndex = 1; TreeNode OID = new TreeNode("Mismatched OID Field Name") { ImageIndex = 1, SelectedImageIndex = 1 }; OID.Nodes.Add("Template is " + theS.theGType.ToString()); OID.Nodes.Add("Implementation is " + theD.theGType.ToString()); N.Nodes.Add(OID); } if (theS.ShapeName != theD.ShapeName) { N.ImageIndex = 1; N.SelectedImageIndex = 1; N.Nodes.Add("Mismatched Shape Field Name"); } //if (theS.theDS.Name != theD.theDS.Name) { N.Nodes.Add("Mismatched Feature Dataset Name"); } }
public void CheckDefaultValues(ref TreeNode N, FeatureData theS, FeatureData theD) { ISubtypes theSS; ISubtypes theDS; Boolean firstTime = false; IEnumSubtype theE; IEnumSubtype theF; int theV, theQ; string strV, strQ; Boolean isFound; TreeNode FDV = null; string theSDVal, theDDVal, theVText; theSS = theS.theST; theDS = theD.theST; if (theSS.HasSubtype == theDS.HasSubtype && theSS.HasSubtype) { TreeNode S = new TreeNode("Default Values"); theE = theSS.Subtypes; theVText = theE.Next(out theV); while (theV != 0) { IFields theFlds = theS.theFlds; IFields destFlds = theD.theFlds; firstTime = true; for (int C = 0; C < theFlds.FieldCount; C++) { if (theFlds.get_Field(C).Editable) { theDDVal = ""; theSDVal = theSS.get_DefaultValue(theV, theFlds.get_Field(C).Name).ToString(); if (destFlds.FindField(theFlds.get_Field(C).Name) >= 0) { theDDVal = theDS.get_DefaultValue(theV, theFlds.get_Field(C).Name).ToString(); } if (theSDVal != theDDVal) { if (firstTime) { FDV = new TreeNode("For Feature Type - " + theVText) { ImageIndex = 1, SelectedImageIndex = 1 }; } TreeNode DV = new TreeNode("Default Value " + theSDVal + " for Field " + theFlds.get_Field(C).Name + " unmatched") { ImageIndex = 1, SelectedImageIndex = 1 }; DV.Nodes.Add(new Guid().ToString(), "Template is " + theSDVal, 1, 1); DV.Nodes.Add(new Guid().ToString(), "Implementation is " + theDDVal, 1, 1); FDV.Nodes.Add(DV); if (firstTime) { S.Nodes.Add(FDV); firstTime = false; } } } } firstTime = true; theVText = theE.Next(out theV); } if (S.Nodes.Count == 0) { S.Nodes.Add("All Default Values Agree Template and Implementation"); } else { N.ImageIndex = 1; N.SelectedImageIndex = 1; S.ImageIndex = 1; S.SelectedImageIndex = 1; } N.Nodes.Add(S); } }