Exemplo n.º 1
0
        public MergeResult Merge(Xsd source, MergeType type)
        {
            if (type == MergeType.MatchingOnly)
            {
                try
                {
                    foreach (Section sourceSection in source.sectionCollection.Sections)
                    {
                        foreach (Section destSection in this.sectionCollection.Sections)
                        {
                            if (destSection.NameEqualsTo(sourceSection.Name))
                            {
                                foreach (XString sourceTextString in sourceSection.XStrings.Rows)
                                {
                                    foreach (XString destTextString in destSection.XStrings.Rows)
                                    {
                                        if (destTextString.ResourceIndex == sourceTextString.ResourceIndex)
                                        {
                                            destTextString.TextString       = sourceTextString.TextString;
                                            destTextString.TextStringLength = sourceTextString.TextStringLength;
                                            destTextString.ParameterOrder   = sourceTextString.ParameterOrder;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                catch (System.Exception e)
                {
                    Debug.WriteLine(e.Message);
                    return(new MergeResult(MergeStatus.Failure));
                }
            }

            return(new MergeResult(MergeStatus.Success));
        }
Exemplo n.º 2
0
        public MergeResult Merge(Xsd source, MergeType type)
        {
            if (type == MergeType.MatchingOnly)
            {
                try
                {
                    foreach (Section sourceSection in source.sectionCollection.Sections)
                    {
                        foreach (Section destSection in this.sectionCollection.Sections)
                        {
                            if (destSection.NameEqualsTo(sourceSection.Name))
                            {
                                foreach (XString sourceTextString in sourceSection.XStrings.Rows)
                                {
                                    foreach (XString destTextString in destSection.XStrings.Rows)
                                    {
                                        if (destTextString.ResourceIndex == sourceTextString.ResourceIndex)
                                        {
                                            destTextString.TextString = sourceTextString.TextString;
                                            destTextString.TextStringLength = sourceTextString.TextStringLength;
                                            destTextString.ParameterOrder = sourceTextString.ParameterOrder;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                catch (System.Exception e)
                {
                    Debug.WriteLine(e.Message);
                    return new MergeResult(MergeStatus.Failure);
                }
            }

            return new MergeResult(MergeStatus.Success);
        }