ArcGISCompare.frmMaster.DomainValueComparison C# (CSharp) Метод

DomainValueComparison() публичный Метод

public DomainValueComparison ( TreeNode &N, IDomain theS, IDomain theD ) : bool
N TreeNode
theS IDomain
theD IDomain
Результат bool
        public bool DomainValueComparison(ref TreeNode N, IDomain theS, IDomain theD)
        {
            ICodedValueDomain theSS;
            ICodedValueDomain theDS;
            int i, j;
            string sValue, sName, dName;
            bool anyBad = false;
            Boolean hasMatch = false;

            if (theS.Type == theD.Type && theS.Type == esriDomainType.esriDTCodedValue)
            {
                theSS = (ICodedValueDomain)theS;
                theDS = (ICodedValueDomain)theD;

                for (i = 0; i < theSS.CodeCount; i++)
                {
                    sValue = theSS.get_Value(i).ToString();
                    hasMatch = false;

                    for (j = 0; j < theDS.CodeCount; j++)
                    {
                        if (sValue == theDS.get_Value(j).ToString())
                        {
                            hasMatch = true;
                            sName = theSS.get_Name(i).ToString();
                            dName = theDS.get_Name(j).ToString();

                            if (sName != dName)
                            {
                                TreeNode defNode = new TreeNode("Matched Value " + sValue + " has mismatched definition") { ImageIndex = 1, SelectedImageIndex = 1 };
                                defNode.Nodes.Add(new Guid().ToString(),"Template Value Definition is " + sName, 1, 1);
                                defNode.Nodes.Add(new Guid().ToString(), "Implementation Value Definition is " + dName, 1, 1);
                                N.Nodes.Add(defNode);
                            }
                        }
                    }
                    if (hasMatch != true)
                    {
                        N.Nodes.Add(new Guid().ToString(), "Template Value " + sValue + " is missing in Implementation", 1, 1);
                        anyBad = true;
                    }
                }
                for (i = 0; i < theDS.CodeCount; i++)
                {
                    sValue = theDS.get_Value(i).ToString();
                    hasMatch = false;

                    for (j = 0; j < theSS.CodeCount; j++)
                    {
                        if (sValue == theSS.get_Value(j).ToString()) { hasMatch = true; }
                    }
                    if (hasMatch != true)
                    {
                        N.Nodes.Add(new Guid().ToString(), "Implementation Value " + sValue + " is missing in Template", 1, 1);
                        anyBad = true;
                    }
                }
            }
            return anyBad;
        }