Exemplo n.º 1
0
        public static Comparer Compare(this NumberText first, NumberText second)
        {
            var comparer = new Comparer(first, second);

            comparer.Compare();

            return(comparer);
        }
Exemplo n.º 2
0
        private void AddError(NumberText targetTextArea, Comparer sourceTargetComparison)
        {
            switch (sourceTargetComparison.Result)
            {
            case Comparer.ResultDescription.DifferentSequences:
            {
                targetTextArea.AddError(NumberText.ErrorLevel.SegmentPairLevel, PluginResources.Error_DifferentSequences);
                break;
            }

            case Comparer.ResultDescription.DifferentValues:
                targetTextArea.AddError(NumberText.ErrorLevel.SegmentPairLevel,
                                        PluginResources.Error_DifferentValues);
                break;

            case Comparer.ResultDescription.SameSequence | Comparer.ResultDescription.DifferentValues:
            {
                var message = PluginResources.Error_SameSequenceDifferentValues;
                targetTextArea.AddError(NumberText.ErrorLevel.SegmentPairLevel,
                                        message);

                break;
            }

            case Comparer.ResultDescription.TargetUnlocalised:
            {
                targetTextArea.AddError(NumberText.ErrorLevel.SegmentPairLevel,
                                        PluginResources.Error_MissingTargetSeparators);

                break;
            }

            case Comparer.ResultDescription.SourceUnlocalised:
            {
                targetTextArea.AddError(NumberText.ErrorLevel.SegmentPairLevel,
                                        PluginResources.Error_MissingSourceSeparators);

                break;
            }
            }
        }