protected override void Progress(int index)
    {
        if (index < textLengthFor.Length)
        {
            if (textLengthFor[index].TagSuffix == "</font>")
            {
                // Debug.Log("FOOOOONT YOOOOOO");
                _textComponent.ForceMeshUpdate();
            }
            if (bc != null)
            {
                bc.size = new Vector3(_rt.sizeDelta.x, _rt.sizeDelta.y, 0.5f);
            }
//            Debug.Log(_textComponent);
//            Debug.Log(textLengthFor.Length);
            _textComponent.text = CurrentString.Substring(0, textLengthFor[index].StartsAt) + textLengthFor[index].TagSuffix;

            if (_textComponent.text.Length > 0)
            {
                string lastChr = _textComponent.text.Substring(_textComponent.text.Length - 1);
                if (!deafCharacters.Contains(lastChr) && characterCallback != null)
                {
                    characterCallback();
                }
            }
        }
        else
        {
            DisplayImmediate();
        }
    }
Ejemplo n.º 2
0
        private void NonItemTooltip()
        {
            RootLayout.Visibility = Visibility.Visible;
            try
            {
                string Title = CurrentString.Split('|')[0].Trim();
                string Desc  = CurrentString.Split('|')[1].Trim();

                ItemName.Text       = Title;
                ItemName.Foreground = new SolidColorBrush(Colors.Purple);

                // Hide Item related fields
                TypesPanel.Visibility       = Visibility.Collapsed;
                StatPanel.Visibility        = Visibility.Collapsed;
                GemStack.Visibility         = Visibility.Collapsed;
                GemNamesLabel1.Visibility   = Visibility.Collapsed;
                GemNamesLabel2.Visibility   = Visibility.Collapsed;
                GemNamesLabel3.Visibility   = Visibility.Collapsed;
                SocketBonusLabel.Visibility = Visibility.Collapsed;
                EnchantLabel.Visibility     = Visibility.Collapsed;

                LocationLabel.Visibility = Visibility.Visible;
                LocationLabel.Text       = Desc;

                ItemsGrid.Visibility = Visibility.Collapsed;
            }
            catch (Exception ex) {
                ErrorBox eb = new ErrorBox(
                    "Error setting up a Non-Item Tooltip",
                    ex.Message, "NonItemTooltip()", "No Additional Info",
                    ex.StackTrace);
            }
        }
        public void Transform()
        {
            CurrentString = SpacedString(CurrentString);
            string CurrentOperator = "";

            for (int i = 0; i < CurrentString.Length; i++)
            {
                if ((CurrentString[i] == '.') || (CurrentString[i] == ','))
                {
                    ExitString += ',';
                }
                else
                {
                    if (CurrentString.ToLower()[i] >= 'a' && CurrentString.ToLower()[i] < 'z')
                    {
                        CurrentOperator += CurrentString.ToLower()[i];
                    }
                    else
                    {
                        if (CurrentOperator.Length > 0)
                        {
                            Operator.Push(new PriorityInfo(CurrentOperator));
                            CurrentOperator = "";
                        }
                        if ((CurrentString[i] >= '0') && (CurrentString[i] <= '9'))
                        {
                            ExitString += CurrentString[i];
                        }
                        else
                        {
                            if (Operator.Count > 0)
                            {
                                while ((Operator.Count > 0) && (Operator.Peek().Priority > new PriorityInfo(CurrentString[i].ToString()).Priority))
                                {
                                    ExitString += " " + Operator.Pop().Txt;
                                }
                            }
                            if (CurrentString[i] == ')')
                            {
                                Operator.Pop();
                            }
                            else
                            {
                                Operator.Push(new PriorityInfo(CurrentString[i].ToString()));
                                if (ExitString.Length > 0)
                                {
                                    ExitString += " ";
                                }
                            }
                        }
                    }
                }
            }
            while (Operator.Count > 0)
            {
                ExitString += " " + Operator.Pop().Txt;
            }
        }
        public void AppendIfNotEndingWith_StringDoesEndWithPassed_DoesNotAppend()
        {
            // Arrange
            const string CurrentString = "Hello World";
            const string PassedString  = "World";

            // Act
            var actual = CurrentString.AppendIfNotEndingWith(PassedString);

            // Assert
            actual.Should().Be(CurrentString);
        }
        public void AppendIfNotEndingWith_StringDoesNotEndWithPassed_DoesAppend()
        {
            // Arrange
            const string CurrentString = "Hello World";
            const string PassedString  = " Matthias";

            // Act
            var actual = CurrentString.AppendIfNotEndingWith(PassedString);

            // Assert
            actual.Should().NotBeEquivalentTo(CurrentString);
            actual.Should().Be(CurrentString + PassedString);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Процедура инициализации текущего элемента класса "Распределение нагрузки"
        /// </summary>
        /// <param name="Tab">Образ таблицы базы данных</param>
        /// <param name="id">Идентификатор текущего элемента</param>
        public void Initialize(DataTable Tab, int id)
        {
            int    GetCode;
            string CurrentString;
            bool   Detected;
            bool   Even;

            //Код
            this.Code = Convert.ToInt32(Tab.Rows[id]["Код"].ToString());

            //Семестр
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colSemestr.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Семестр"].ToString();
                if (mdlData.colSemestr[i].SemNum == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Semestr = mdlData.colSemestr[GetCode];
            }
            else
            {
                this.Semestr = null;
                //MessageBox.Show("Не удалось определить семестр у элемента с кодом " + this.Code, "Оповещение");
            }

            //Специальность
            GetCode  = 0;
            Detected = false;
            Even     = false;

            for (int i = 0; i <= mdlData.colSpecialisation.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Специальность"].ToString();

                if (!mdlData.flgOldDB)
                {
                    if (CurrentString.StartsWith("В-"))
                    {
                        CurrentString = CurrentString.Substring(2);
                        Even          = true;
                    }

                    if (mdlData.colSpecialisation[i].ShortDop == CurrentString)
                    {
                        //Если с вечернего факультета
                        if (Even)
                        {
                            if (mdlData.colSpecialisation[i].Faculty != null)
                            {
                                if (mdlData.colSpecialisation[i].Faculty.Short.Equals("ВФ"))
                                {
                                    GetCode  = i;
                                    Detected = true;
                                    break;
                                }
                            }
                        }
                        //Если с дневного
                        else
                        {
                            GetCode  = i;
                            Detected = true;
                            break;
                        }
                    }
                }
                else
                {
                    if (mdlData.colSpecialisation[i].ShortUpravlenie == CurrentString)
                    {
                        GetCode  = i;
                        Detected = true;
                        break;
                    }
                }
            }
            if (Detected)
            {
                this.Speciality = mdlData.colSpecialisation[GetCode];
            }
            else
            {
                this.Speciality = null;
            }

            //Курс
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colKursNum.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Курс"].ToString();
                if (mdlData.colKursNum[i].Kurs.ToString() == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.KursNum = mdlData.colKursNum[GetCode];
            }
            else
            {
                this.KursNum = null;
            }

            //Название учебной дисциплины
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colSubject.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Название_дисциплины"].ToString();
                if (mdlData.colSubject[i].Subject == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Subject = mdlData.colSubject[GetCode];
            }
            else
            {
                this.Subject = null;
            }

            //Преподаватель
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Преподаватель"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Lecturer = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Lecturer = null;
            }

            //Преподаватель2
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Преподаватель2"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Lecturer2 = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Lecturer2 = null;
            }

            //Преподаватель3
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Преподаватель3"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Lecturer3 = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Lecturer3 = null;
            }

            //Дублёр
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Дублёр"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Doubler = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Doubler = null;
            }

            this.Text = Tab.Rows[id]["Для_диспетчерской"].ToString();

            //Необходимость подачи нагрузки в диспетчерскую
            if (Tab.Rows[id]["В_ведом_дисп"].ToString() == "False")
            {
                this.flgDispatch = false;
            }
            else
            {
                this.flgDispatch = true;
            }

            //Равномерная распределяемость
            if (Tab.Rows[id]["Распределяемая"].ToString() == "False")
            {
                this.flgDistrib = false;
            }
            else
            {
                this.flgDistrib = true;
            }

            //Вес единицы
            if (!(Tab.Rows[id]["Вес_единицы"] is DBNull))
            {
                this.Weight = Convert.ToInt32(Tab.Rows[id]["Вес_единицы"].ToString());
            }
            else
            {
                this.Weight = 0;
            }

            //Признак исключения из расчёта нагрузки
            if (Tab.Rows[id]["Исключить"].ToString() == "False")
            {
                this.flgExclude = false;
            }
            else
            {
                this.flgExclude = true;
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Процедура инициализации текущего элемента класса "Распределение нагрузки"
        /// </summary>
        /// <param name="Tab">Образ таблицы базы данных</param>
        /// <param name="id">Идентификатор текущего элемента</param>
        public void Initialize(DataTable Tab, int id)
        {
            int    GetCode;
            string CurrentString;
            bool   Detected;
            bool   Even;

            //Код
            this.Code = Convert.ToInt32(Tab.Rows[id]["Код"].ToString());

            //ФИО
            this.FIO = Tab.Rows[id]["ФИО"].ToString();

            //Специальность
            GetCode  = 0;
            Detected = false;
            Even     = false;

            for (int i = 0; i <= mdlData.colSpecialisation.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Специальность"].ToString();

                if (!mdlData.flgOldDB)
                {
                    if (CurrentString.StartsWith("В-"))
                    {
                        CurrentString = CurrentString.Substring(2);
                        Even          = true;
                    }

                    if (mdlData.colSpecialisation[i].ShortDop == CurrentString)
                    {
                        //Если с вечернего факультета
                        if (Even)
                        {
                            if (mdlData.colSpecialisation[i].Faculty != null)
                            {
                                if (mdlData.colSpecialisation[i].Faculty.Short.Equals("ВФ"))
                                {
                                    GetCode  = i;
                                    Detected = true;
                                    break;
                                }
                            }
                        }
                        //Если с дневного
                        else
                        {
                            GetCode  = i;
                            Detected = true;
                            break;
                        }
                    }
                }
                else
                {
                    if (mdlData.colSpecialisation[i].ShortUpravlenie == CurrentString)
                    {
                        GetCode  = i;
                        Detected = true;
                        break;
                    }
                }
            }
            if (Detected)
            {
                this.Speciality = mdlData.colSpecialisation[GetCode];
            }
            else
            {
                this.Speciality = null;
            }

            //Курс
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colKursNum.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Курс"].ToString();
                if (mdlData.colKursNum[i].Kurs.ToString() == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.KursNum = mdlData.colKursNum[GetCode];
            }
            else
            {
                this.KursNum = null;
            }

            //Кафедра
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colDepart.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Кафедра"].ToString();
                if (mdlData.colDepart[i].Short == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Depart = mdlData.colDepart[GetCode];
            }
            else
            {
                this.Depart = null;
            }

            //Руководитель
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Руководитель"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Lect = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Lect = null;
            }

            //Тема_работы
            this.Theme = Tab.Rows[id]["Тема_работы"].ToString();

            //Признак участия в индивидуальном плане преподавателя
            if (Tab.Rows[id]["В_плане"].ToString() == "False")
            {
                this.flgPlan = false;
            }
            else
            {
                this.flgPlan = true;
            }

            //Признак участия в почасовой
            if (Tab.Rows[id]["Почасовая"].ToString() == "False")
            {
                this.flgHoured = false;
            }
            else
            {
                this.flgHoured = true;
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Процедура инициализации текущего элемента класса "Распределение нагрузки"
        /// </summary>
        /// <param name="Tab">Образ таблицы базы данных</param>
        /// <param name="id">Идентификатор текущего элемента</param>
        public void Initialize(DataTable Tab, int id)
        {
            int    GetCode;
            string CurrentString;
            bool   Detected;
            bool   Even;

            //Код
            this.Code = Convert.ToInt32(Tab.Rows[id]["Код"].ToString());

            //Семестр
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colSemestr.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Семестр"].ToString();
                if (mdlData.colSemestr[i].SemNum == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Semestr = mdlData.colSemestr[GetCode];
            }
            else
            {
                this.Semestr = null;
                //MessageBox.Show("Не удалось определить семестр у элемента с кодом " + this.Code, "Оповещение");
            }

            //Специальность
            GetCode  = 0;
            Detected = false;
            Even     = false;

            for (int i = 0; i <= mdlData.colSpecialisation.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Специальность"].ToString();

                if (!mdlData.flgOldDB)
                {
                    if (CurrentString.StartsWith("В-"))
                    {
                        CurrentString = CurrentString.Substring(2);
                        Even          = true;
                    }

                    if (mdlData.colSpecialisation[i].ShortDop == CurrentString)
                    {
                        //Если с вечернего факультета
                        if (Even)
                        {
                            if (mdlData.colSpecialisation[i].Faculty != null)
                            {
                                if (mdlData.colSpecialisation[i].Faculty.Short.Equals("ВФ"))
                                {
                                    GetCode  = i;
                                    Detected = true;
                                    break;
                                }
                            }
                        }
                        //Если с дневного
                        else
                        {
                            GetCode  = i;
                            Detected = true;
                            break;
                        }
                    }
                }
                else
                {
                    if (mdlData.colSpecialisation[i].ShortUpravlenie == CurrentString)
                    {
                        GetCode  = i;
                        Detected = true;
                        break;
                    }
                }
            }
            if (Detected)
            {
                this.Speciality = mdlData.colSpecialisation[GetCode];
            }
            else
            {
                this.Speciality = null;
            }

            //Курс
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colKursNum.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Курс"].ToString();
                if (mdlData.colKursNum[i].Kurs.ToString() == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.KursNum = mdlData.colKursNum[GetCode];
            }
            else
            {
                this.KursNum = null;
            }

            //Название учебной дисциплины
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colSubject.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Название_дисциплины"].ToString();
                if (mdlData.colSubject[i].Subject == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Subject = mdlData.colSubject[GetCode];
            }
            else
            {
                this.Subject = null;
            }

            //Преподаватель
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Преподаватель"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Lecturer = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Lecturer = null;
            }

            //Преподаватель2
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Преподаватель2"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Lecturer2 = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Lecturer2 = null;
            }

            //Преподаватель3
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Преподаватель3"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Lecturer3 = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Lecturer3 = null;
            }

            //Дублёр
            GetCode  = 0;
            Detected = false;
            for (int i = 0; i <= mdlData.colLecturer.Count - 1; i++)
            {
                CurrentString = Tab.Rows[id]["Дублёр"].ToString();
                if (mdlData.colLecturer[i].FIO == CurrentString)
                {
                    GetCode  = i;
                    Detected = true;
                }
            }
            if (Detected)
            {
                this.Doubler = mdlData.colLecturer[GetCode];
            }
            else
            {
                this.Doubler = null;
            }

            //Лекции в часах
            if (!(Tab.Rows[id]["Лекция"] is DBNull))
            {
                this.Lecture = Convert.ToInt32(Tab.Rows[id]["Лекция"].ToString());
            }
            else
            {
                this.Lecture = 0;
            }

            //Экзамен в часах
            if (!(Tab.Rows[id]["Экзамен"] is DBNull))
            {
                this.Exam = Convert.ToInt32(Tab.Rows[id]["Экзамен"].ToString());
            }
            else
            {
                this.Exam = 0;
            }

            //Зачёт в часах
            if (!(Tab.Rows[id]["Зачёт"] is DBNull))
            {
                this.Credit = Convert.ToInt32(Tab.Rows[id]["Зачёт"].ToString());
            }
            else
            {
                this.Credit = 0;
            }

            //Рефераты и домашние задания в часах
            if (!(Tab.Rows[id]["Рефераты, домашние задания"] is DBNull))
            {
                this.RefHomeWork = Convert.ToInt32(Tab.Rows[id]["Рефераты, домашние задания"].ToString());
            }
            else
            {
                this.RefHomeWork = 0;
            }

            //Консультация в часах
            if (!(Tab.Rows[id]["Консультация"] is DBNull))
            {
                this.Tutorial = Convert.ToInt32(Tab.Rows[id]["Консультация"].ToString());
            }
            else
            {
                this.Tutorial = 0;
            }

            //Лабораторные работы в часах
            if (!(Tab.Rows[id]["Лаб_раб"] is DBNull))
            {
                this.LabWork = Convert.ToInt32(Tab.Rows[id]["Лаб_раб"].ToString());
            }
            else
            {
                this.LabWork = 0;
            }

            //Практические занятия в часах
            if (!(Tab.Rows[id]["Практ_зан"] is DBNull))
            {
                this.Practice = Convert.ToInt32(Tab.Rows[id]["Практ_зан"].ToString());
            }
            else
            {
                this.Practice = 0;
            }

            //Индивидуальное занятие в часах
            if (!(Tab.Rows[id]["Индив_зан"] is DBNull))
            {
                this.IndividualWork = Convert.ToInt32(Tab.Rows[id]["Индив_зан"].ToString());
            }
            else
            {
                this.IndividualWork = 0;
            }

            //КРАПК в часах
            if (!(Tab.Rows[id]["КРАПК"] is DBNull))
            {
                this.KRAPK = Convert.ToInt32(Tab.Rows[id]["КРАПК"].ToString());
            }
            else
            {
                this.KRAPK = 0;
            }

            //Курсовой проект в часах
            if (!(Tab.Rows[id]["Курс_пр"] is DBNull))
            {
                this.KursProject = Convert.ToInt32(Tab.Rows[id]["Курс_пр"].ToString());
            }
            else
            {
                this.KursProject = 0;
            }

            //Преддипломная практика в часах
            if (!(Tab.Rows[id]["Предд_пр"] is DBNull))
            {
                this.PreDiplomaPractice = Convert.ToInt32(Tab.Rows[id]["Предд_пр"].ToString());
            }
            else
            {
                this.PreDiplomaPractice = 0;
            }

            //Дипломный проект в часах
            if (!(Tab.Rows[id]["Дипл_пр"] is DBNull))
            {
                this.DiplomaPaper = Convert.ToInt32(Tab.Rows[id]["Дипл_пр"].ToString());
            }
            else
            {
                this.DiplomaPaper = 0;
            }

            //Учебная практика в часах
            if (!(Tab.Rows[id]["Учебн_пр"] is DBNull))
            {
                this.TutorialPractice = Convert.ToInt32(Tab.Rows[id]["Учебн_пр"].ToString());
            }
            else
            {
                this.TutorialPractice = 0;
            }

            //Производственная практика в часах
            if (!(Tab.Rows[id]["Произв_пр"] is DBNull))
            {
                this.ProducingPractice = Convert.ToInt32(Tab.Rows[id]["Произв_пр"].ToString());
            }
            else
            {
                this.ProducingPractice = 0;
            }

            //Аспирантура в часах
            if (!(Tab.Rows[id]["Аспирантура"] is DBNull))
            {
                this.PostGrad = Convert.ToInt32(Tab.Rows[id]["Аспирантура"].ToString());
            }
            else
            {
                this.PostGrad = 0;
            }

            //ГАК в часах
            if (!(Tab.Rows[id]["ГАК"] is DBNull))
            {
                this.GAK = Convert.ToInt32(Tab.Rows[id]["ГАК"].ToString());
            }
            else
            {
                this.GAK = 0;
            }

            //Часы
            if (!(Tab.Rows[id]["Часы"] is DBNull))
            {
                this.Hours = Convert.ToInt32(Tab.Rows[id]["Часы"].ToString());
            }
            else
            {
                this.Hours = 0;
            }

            //Часы по ЗЕТ
            if (!(Tab.Rows[id]["Часы_ЗЕТ"] is DBNull))
            {
                this.HoursZ = Convert.ToSingle(Tab.Rows[id]["Часы_ЗЕТ"].ToString());
            }
            else
            {
                this.HoursZ = 0;
            }

            //Часы дано
            if (!(Tab.Rows[id]["Часы_Дано"] is DBNull))
            {
                this.EnteredHours = Convert.ToInt32(Tab.Rows[id]["Часы_Дано"].ToString());
            }
            else
            {
                this.EnteredHours = 0;
            }

            //Часы дано по ЗЕТ
            if (!(Tab.Rows[id]["Часы_Дано_ЗЕТ"] is DBNull))
            {
                this.EnteredHoursZ = Convert.ToSingle(Tab.Rows[id]["Часы_Дано_ЗЕТ"].ToString());
            }
            else
            {
                this.EnteredHoursZ = 0;
            }

            //Часы на посещение занятий
            if (!(Tab.Rows[id]["Посещ_зан"] is DBNull))
            {
                this.Visiting = Convert.ToInt32(Tab.Rows[id]["Посещ_зан"].ToString());
            }
            else
            {
                this.Visiting = 0;
            }

            this.Text = Tab.Rows[id]["Для_диспетчерской"].ToString();

            //Часы на руководство магистрами
            if (!(Tab.Rows[id]["Магистратура"] is DBNull))
            {
                this.Magistry = Convert.ToInt32(Tab.Rows[id]["Магистратура"].ToString());
            }
            else
            {
                this.Magistry = 0;
            }

            //Необходимость подачи нагрузки в диспетчерскую
            if (Tab.Rows[id]["В_ведом_дисп"].ToString() == "False")
            {
                this.flgDispatch = false;
            }
            else
            {
                this.flgDispatch = true;
            }

            //Равномерная распределяемость
            if (Tab.Rows[id]["Распределяемая"].ToString() == "False")
            {
                this.flgDistrib = false;
            }
            else
            {
                this.flgDistrib = true;
            }

            //Вес единицы
            if (!(Tab.Rows[id]["Вес_единицы"] is DBNull))
            {
                this.Weight = Convert.ToInt32(Tab.Rows[id]["Вес_единицы"].ToString());
            }
            else
            {
                this.Weight = 0;
            }

            //Признак исключения из расчёта нагрузки
            if (Tab.Rows[id]["Исключить"].ToString() == "False")
            {
                this.flgExclude = false;
            }
            else
            {
                this.flgExclude = true;
            }

            //Код дисциплины по документу
            if (!(Tab.Rows[id]["КодДок"] is DBNull))
            {
                this.DocCode = Convert.ToInt32(Tab.Rows[id]["КодДок"].ToString());
            }
            else
            {
                this.DocCode = 9999;
            }
        }
Ejemplo n.º 9
0
        private void NonItemTooltip()
        {
            RootLayout.Visibility = Visibility.Visible;
            try {
                string Title = CurrentString.Split('|')[0].Trim();
                string Desc  = CurrentString.Split('|')[1].Trim();

                ItemName.Text       = Title;
                ItemName.Foreground = new SolidColorBrush(Colors.Purple);

                // Hide Item related fields
                TypesPanel.Visibility       = Visibility.Collapsed;
                StatPanel.Visibility        = Visibility.Collapsed;
                GemStack.Visibility         = Visibility.Collapsed;
                GemNamesLabel1.Visibility   = Visibility.Collapsed;
                GemNamesLabel2.Visibility   = Visibility.Collapsed;
                GemNamesLabel3.Visibility   = Visibility.Collapsed;
                SocketBonusLabel.Visibility = Visibility.Collapsed;
                EnchantLabel.Visibility     = Visibility.Collapsed;
                ReforgingLabel.Visibility   = Visibility.Collapsed;
                SetLabel.Visibility         = Visibility.Collapsed;
                UnusedStatPanel.Visibility  = Visibility.Collapsed;

                LocationLabel.Visibility = Visibility.Visible;
                LocationLabel.Text       = Desc;

                if (ItemSet != null && ItemSet.Count > 0)
                {
                    ItemsGrid.Visibility = Visibility.Visible;
                    #region Additional Items, like in Build Upgrade List
                    ItemsGrid.Children.Clear();
                    ItemsGrid.RowDefinitions.Clear();
                    int row = 0;
                    foreach (ItemInstance setItem in ItemSet)
                    {
                        ItemsGrid.RowDefinitions.Add(new RowDefinition()
                        {
                            Height = GridLength.Auto
                        });
                        if (setItem == null)
                        {
                            continue;
                        }

                        Image iconImage = new Image();
                        iconImage.Style  = Resources["SmallIconStyle"] as Style;
                        iconImage.Source = Icons.AnIcon(setItem.Item.IconPath);
                        Grid.SetColumn(iconImage, 0);
                        Grid.SetRow(iconImage, row);
                        ItemsGrid.Children.Add(iconImage);

                        if (setItem.Gem1Id > 0)
                        {
                            Image gem1Image = new Image();
                            gem1Image.Style  = Resources["SmallIconStyle"] as Style;
                            gem1Image.Source = Icons.AnIcon(setItem.Gem1.IconPath);
                            Grid.SetColumn(gem1Image, 1);
                            Grid.SetRow(gem1Image, row);
                            ItemsGrid.Children.Add(gem1Image);
                        }

                        if (setItem.Gem2Id > 0)
                        {
                            Image gem2Image = new Image();
                            gem2Image.Style  = Resources["SmallIconStyle"] as Style;
                            gem2Image.Source = Icons.AnIcon(setItem.Gem2.IconPath);
                            Grid.SetColumn(gem2Image, 2);
                            Grid.SetRow(gem2Image, row);
                            ItemsGrid.Children.Add(gem2Image);
                        }

                        if (setItem.Gem3Id > 0)
                        {
                            Image gem3Image = new Image();
                            gem3Image.Style  = Resources["SmallIconStyle"] as Style;
                            gem3Image.Source = Icons.AnIcon(setItem.Gem3.IconPath);
                            Grid.SetColumn(gem3Image, 3);
                            Grid.SetRow(gem3Image, row);
                            ItemsGrid.Children.Add(gem3Image);
                        }

                        TextBlock nameText = new TextBlock();
                        if (setItem.EnchantId > 0)
                        {
                            nameText.Text = string.Format("{0} ({1})", setItem.Item.Name, setItem.Enchant.Name);
                        }
                        else
                        {
                            nameText.Text = string.Format("{0}", setItem.Item.Name);
                        }
                        nameText.Foreground = new SolidColorBrush(ColorForQuality(setItem.Item.Quality));
                        Grid.SetColumn(nameText, 4);
                        Grid.SetRow(nameText, row);
                        ItemsGrid.Children.Add(nameText);

                        row++;
                    }
                    #endregion
                }
                else
                {
                    ItemsGrid.Visibility = Visibility.Collapsed;
                }
            } catch (Exception ex) {
                new Base.ErrorBox()
                {
                    Title        = "Error setting up a Non-Item Tooltip",
                    Function     = "NonItemTooltip()",
                    TheException = ex,
                }.Show();
            }
        }