Example #1
0
        public override bool Equals(Shape other)
        {
            if (other is Point)
            {
                var pt = other as Point;
                if (XCoordinate.Equals(pt.XCoordinate) && YCoordinate.Equals(pt.YCoordinate))
                {
                    return(true);
                }
                if (!XCoordinate.Equals(pt.XCoordinate))
                {
                    return(false);
                }
                if (!YCoordinate.Equals(pt.YCoordinate))
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }

            return(base.Equals(other));
        }
Example #2
0
        private void DoArrayWork()
        {
            LogInfo = string.Empty;
            Step    = 0;
            Log("Начало обработки файла.");
            var    printer = PrinterSettings.GeneratePrinter(Log);
            string data    = File.ReadAllText(SourceFileName);

            if (XCoordinate.IsSelected)
            {
                Log("Обработка координаты X");
                Thread.Sleep(1500);
                data = XCoordinate.ProcessWithArray(data, printer);
            }
            Step = 1;
            if (YCoordinate.IsSelected)
            {
                Log("Обработка координаты Y");
                Thread.Sleep(1500);
                data = YCoordinate.ProcessWithArray(data, printer);
            }
            Step = 2;
            if (ZCoordinate.IsSelected)
            {
                Log("Обработка координаты Z");
                Thread.Sleep(1500);
                data = ZCoordinate.ProcessWithArray(data, printer);
            }
            Step = 3;
            if (XCoordinate.IsSelected)
            {
                data = XCoordinate.InitArrayProcessLogic(data, printer);
            }
            if (YCoordinate.IsSelected)
            {
                data = YCoordinate.InitArrayProcessLogic(data, printer);
            }
            if (ZCoordinate.IsSelected)
            {
                data = ZCoordinate.InitArrayProcessLogic(data, printer);
            }
            if (DialogService.SaveFileDialog())
            {
                Log($"Запись результата в {DialogService.FilePath}");
                File.WriteAllText(DialogService.FilePath, data);
            }
            else
            {
                Log($"Файл не выбран, запись не произведена!");
            }
            Log($"Работа завершена");
        }
Example #3
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            if (XCoordinate != null)
            {
                sb.Append(XCoordinate.ToString());
                sb.Append(", ");
            }
            if (YCoordinate != null)
            {
                sb.Append(YCoordinate.ToString());
                sb.Append(", ");
            }
            sb.Append(string.Format("Text={0}, MarkColor={1}", Text, MarkColorName));

            return(sb.ToString());
        }
Example #4
0
        public override int GetHashCode()
        {
            int hashCode = 0;

            if (XCoordinate != null)
            {
                hashCode ^= XCoordinate.GetHashCode();
            }
            if (YCoordinate != null)
            {
                hashCode ^= YCoordinate.GetHashCode();
            }
            if (!string.IsNullOrEmpty(MarkColorName))
            {
                hashCode ^= MarkColorName.GetHashCode();
            }
            if (!string.IsNullOrEmpty(Text))
            {
                hashCode ^= Text.GetHashCode();
            }

            return(hashCode);
        }
Example #5
0
 private void YCoordinate_GotFocus(object sender, RoutedEventArgs e)
 {
     YCoordinate.SelectAll();
 }
 public string YCoordinateString()
 {
     return(YCoordinate.ToString(FormatUtils.GetNumberFormatInfo()));
 }
Example #7
0
 public override int GetHashCode()
 {
     return(XCoordinate.GetHashCode() ^ YCoordinate.GetHashCode());
 }