Conversation
…ing from plugins.
| /// </summary> | ||
| public class ConstraintItem | ||
| { | ||
| public int Flag { get; set; } |
There was a problem hiding this comment.
Флаг чего? :) И почему он int?
| { | ||
| public int Flag { get; set; } | ||
|
|
||
| public (string, string) Elements { get; set; } |
There was a problem hiding this comment.
Тоже, тип возвращаемого значения ничего не говорит о его содержании. Может, лучше структуру возвращать?
|
|
||
| set | ||
| { | ||
| } |
There was a problem hiding this comment.
Это точно должно быть свойство, а не метод?
|
|
||
| if (this.Flag == 1) | ||
| { | ||
| var value = (ValueTuple<int, int>)this.Value; |
There was a problem hiding this comment.
Тут лучше наследование, а не такое нетипизированное решение. Особенно с ненужным boxing-ом
There was a problem hiding this comment.
Наследование я делала, но в таком случае возникают другие проблемы с переопределением свойства, помучавшись с этим вопросом, я в итоге вернулась к этому варианту. Вполне вероятно, я делала кривое наследование. Спрошу об этом завтра.
| return "Type: " + this.ObjectType + Environment.NewLine | ||
| + "Element: " + this.Elements.Item1 + Environment.NewLine | ||
| + "Attribute: " + this.AttributeName + Environment.NewLine | ||
| + "Value: " + this.Value.ToString(); |
There was a problem hiding this comment.
String interpolation не хотите тут попользовать?
|
|
||
| this.valueLabel.Text = "RegExp:"; | ||
| this.stringBox.Visibility = Visibility.Visible; | ||
| } |
There was a problem hiding this comment.
Это тоже обычно binging-ами делается
|
|
||
| if ((valueFrom < 0) || (valueTo < 0)) | ||
| { | ||
| throw new Exception("The number can not be less than zero."); |
There was a problem hiding this comment.
Просто исключения бросать нельзя, надо бросать исключение какого-то конкретного класса
| return true; | ||
| } | ||
| catch | ||
| catch (Exception ex) |
There was a problem hiding this comment.
А ловить Exception нельзя и подавно. От него же вообще все исключения в дотнете наследуются, Вы так поймаете даже ThreadAbortException, FileLoadException и прочие штуки, которые ловить было бы неправильно
| { | ||
| this.nodesList = value; | ||
| } | ||
| } |
There was a problem hiding this comment.
Может, это сделать автоматическим свойством, раз тут всё равно ничего содержательного не делается?
| { | ||
| NewValue = value | ||
| }; | ||
| this.OnAttributeChange?.Invoke(this, args); |
There was a problem hiding this comment.
Тут тоже с отступом что-то не так
3b4d20a to
54f3460
Compare
Created view and check methods for amount and attribute values constraints change.
Created view and check methods for amount and
attribute values constraints change.