Esempio n. 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (Id.Text.Equals("") || Naziv.Text.Equals(""))
            {
                MessageBox.Show("Neophodno je popuniti Id i Naziv!");
                Id.Focus();
                return;
            }

            foreach (TipLokala tl in this.Window.TipoviLokala)
            {
                if (tl.Id.Equals(Id.Text))
                {
                    System.Media.SystemSounds.Beep.Play();
                    MessageBox.Show("Uneseni Id je vec u upotrebi");
                    Id.Focus();
                    return;
                }
            }

            TipLokala tLokala;

            try
            {
                tLokala = new TipLokala(Id.Text, Naziv.Text, Opis.Text, IconPath.Equals("") ? "../../Data/icon.png" : IconPath);
            }catch
            {
                System.Media.SystemSounds.Beep.Play();
                MessageBox.Show("Doslo je do greske pri unosu");
                return;
            }
            this.Window.TipoviLokala.Add(tLokala);
            FileIO.UpisiLokal("tipoviLokala.bin", this.Window.TipoviLokala);
            this.Close();
        }
Esempio n. 2
0
        public bool Equals(DestinyPerkReference input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     PerkHash == input.PerkHash ||
                     (PerkHash.Equals(input.PerkHash))
                     ) &&
                 (
                     IconPath == input.IconPath ||
                     (IconPath != null && IconPath.Equals(input.IconPath))
                 ) &&
                 (
                     IsActive == input.IsActive ||
                     (IsActive != null && IsActive.Equals(input.IsActive))
                 ) &&
                 (
                     Visible == input.Visible ||
                     (Visible != null && Visible.Equals(input.Visible))
                 ));
        }
        public bool Equals(DestinyDerivedItemDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     ItemHash == input.ItemHash ||
                     (ItemHash.Equals(input.ItemHash))
                     ) &&
                 (
                     ItemName == input.ItemName ||
                     (ItemName != null && ItemName.Equals(input.ItemName))
                 ) &&
                 (
                     ItemDetail == input.ItemDetail ||
                     (ItemDetail != null && ItemDetail.Equals(input.ItemDetail))
                 ) &&
                 (
                     ItemDescription == input.ItemDescription ||
                     (ItemDescription != null && ItemDescription.Equals(input.ItemDescription))
                 ) &&
                 (
                     IconPath == input.IconPath ||
                     (IconPath != null && IconPath.Equals(input.IconPath))
                 ) &&
                 (
                     VendorItemIndex == input.VendorItemIndex ||
                     (VendorItemIndex.Equals(input.VendorItemIndex))
                 ));
        }
Esempio n. 4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            SluzenjeAlkohola sluzenje = this.Window.Items[this.itemIndex].StatusSluzenjaAlkohola;

            switch (StatusSluzenjaAlkohola.Text)
            {
            case "Ne sluzi":
                sluzenje = SluzenjeAlkohola.NE_SLUZI;
                break;

            case "Sluzi do 23":
                sluzenje = SluzenjeAlkohola.SLUZI_DO_23;
                break;

            case "Sluzi nocu":
                sluzenje = SluzenjeAlkohola.SLUZI_NOCU;
                break;
            }

            KategorijeCena kat = this.Window.Items[this.itemIndex].KategorijaCene;

            switch (KategorijaCene.Text)
            {
            case "Niske":
                kat = KategorijeCena.NISKE;
                break;

            case "Srednje":
                kat = KategorijeCena.SREDNJE;
                break;

            case "Visoke":
                kat = KategorijeCena.VISOKE;
                break;

            case "Izuzetno visoke":
                kat = KategorijeCena.IZUZETNO_VISOKE;
                break;
            }
            var item = this.Window.Items[this.itemIndex];

            item.Id    = Id.Text;
            item.Naziv = Naziv.Text;
            item.Tip   = Tip.SelectedItem as TipLokala;
            item.StatusSluzenjaAlkohola = sluzenje;
            item.Ikonica = IconPath.Equals("") ? this.Window.Items[this.itemIndex].Ikonica : IconPath;
            item.DostupanHendikepiranim = DostupnoHendikepiranim.IsChecked ?? false;
            item.DozvoljenoPusenje      = DozvoljenoPusenje.IsChecked ?? false;
            item.PrimaRezervacije       = PrimaRezervacije.IsChecked ?? false;
            item.KategorijaCene         = kat;
            item.Kapacitet      = Int32.Parse(Kapacitet.Text);
            item.DatumOtvaranja = DatumOtvaranja.SelectedDate.GetValueOrDefault(DateTime.Now);
            item.UcitajIkonicu();
            FileIO.UpisiLokal(this.ActiveMap.Split('.')[0] + ".bin", this.Window.Items);
            this.Window.renderMap();
            this.Window.lvDataBinding.ItemsSource = this.Window.Items;
            this.Close();
        }
Esempio n. 5
0
        public bool Equals(FireteamUserInfoCard input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     FireteamDisplayName == input.FireteamDisplayName ||
                     (FireteamDisplayName != null && FireteamDisplayName.Equals(input.FireteamDisplayName))
                     ) &&
                 (
                     FireteamMembershipType == input.FireteamMembershipType ||
                     (FireteamMembershipType != null && FireteamMembershipType.Equals(input.FireteamMembershipType))
                 ) &&
                 (
                     SupplementalDisplayName == input.SupplementalDisplayName ||
                     (SupplementalDisplayName != null && SupplementalDisplayName.Equals(input.SupplementalDisplayName))
                 ) &&
                 (
                     IconPath == input.IconPath ||
                     (IconPath != null && IconPath.Equals(input.IconPath))
                 ) &&
                 (
                     CrossSaveOverride == input.CrossSaveOverride ||
                     (CrossSaveOverride != null && CrossSaveOverride.Equals(input.CrossSaveOverride))
                 ) &&
                 (
                     ApplicableMembershipTypes == input.ApplicableMembershipTypes ||
                     (ApplicableMembershipTypes != null && ApplicableMembershipTypes.SequenceEqual(input.ApplicableMembershipTypes))
                 ) &&
                 (
                     IsPublic == input.IsPublic ||
                     (IsPublic != null && IsPublic.Equals(input.IsPublic))
                 ) &&
                 (
                     MembershipType == input.MembershipType ||
                     (MembershipType != null && MembershipType.Equals(input.MembershipType))
                 ) &&
                 (
                     MembershipId == input.MembershipId ||
                     (MembershipId.Equals(input.MembershipId))
                 ) &&
                 (
                     DisplayName == input.DisplayName ||
                     (DisplayName != null && DisplayName.Equals(input.DisplayName))
                 ) &&
                 (
                     BungieGlobalDisplayName == input.BungieGlobalDisplayName ||
                     (BungieGlobalDisplayName != null && BungieGlobalDisplayName.Equals(input.BungieGlobalDisplayName))
                 ) &&
                 (
                     BungieGlobalDisplayNameCode == input.BungieGlobalDisplayNameCode ||
                     (BungieGlobalDisplayNameCode.Equals(input.BungieGlobalDisplayNameCode))
                 ));
        }
Esempio n. 6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Name?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Description?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (IconPath?.GetHashCode() ?? 0);
         if (Coordinates.Length > 0)
         {
             hashCode = (hashCode * 397) ^ Coordinates[0].GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (IconPath.Length != 0)
            {
                hash ^= IconPath.GetHashCode();
            }
            if (Title.Length != 0)
            {
                hash ^= Title.GetHashCode();
            }
            if (Header.Length != 0)
            {
                hash ^= Header.GetHashCode();
            }
            if (headerColor_ != null)
            {
                hash ^= HeaderColor.GetHashCode();
            }
            if (Background.Length != 0)
            {
                hash ^= Background.GetHashCode();
            }
            if (backgroundColor_ != null)
            {
                hash ^= BackgroundColor.GetHashCode();
            }
            hash ^= storeSubcategories_.GetHashCode();
            if (HeaderPrefab.Length != 0)
            {
                hash ^= HeaderPrefab.GetHashCode();
            }
            if (itemColor_ != null)
            {
                hash ^= ItemColor.GetHashCode();
            }
            if (Enabled != false)
            {
                hash ^= Enabled.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 8
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////


        #region Serialization
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        public override XElement ToXML(bool internalPurpose = true)
        {
            XDocument res = Utilities.CreateXMLDoc("Badge", false);

            res.Root.Add(
                new XElement(ConfigReader.S2CNS + "ID", ID),
                new XElement(ConfigReader.S2CNS + "Name", Name.FixXML()),
                new XElement(ConfigReader.S2CNS + "Descr", Descr.FixXML()),
                new XElement(ConfigReader.S2CNS + "RefersTo", RefersTo),
                new XElement(ConfigReader.S2CNS + "Threshold", Threshold),
                new XElement(ConfigReader.S2CNS + "Level", Level),
                new XElement(ConfigReader.S2CNS + "IconPath", IconPath.FixXML()),
                new XElement(ConfigReader.S2CNS + "Timestamp", Timestamp),
                new XElement(ConfigReader.S2CNS + "ActiveDescr", ActiveDescr.FixXML())
                );

            return(res.Root);
        }
Esempio n. 9
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            TipLokala lo = this.Id.SelectedItem as TipLokala;

            if (lo == null)
            {
                MessageBox.Show("Neophodno je odabrati postojeci tip!");
                return;
            }

            lo.Naziv   = Naziv.Text;
            lo.Opis    = Opis.Text;
            lo.Ikonica = IconPath.Equals("") ? lo.Ikonica : IconPath;
            FileIO.UpisiLokal("tipoviLokala.bin", this.Window.TipoviLokala);
            Window.ucitaj_ikonice();
            Window.renderMap();
            this.Close();
        }
Esempio n. 10
0
        public override void SetupModule(DataTable changedInfo)
        {
            int     countRows = changedInfo.Rows.Count;
            DataRow row       = changedInfo.Rows[0];

            Number             = row["Номер модуля"].ToString();
            IconPath           = row["Изображение"].ToString();
            Sсheme             = row["Форма модуля"].ToString();
            _dimentions.Lenght = double.Parse(row["Высота модуля (мм)"].ToString());
            _dimentions.Width  = double.Parse(row["Ширина модуля (мм)"].ToString());
            _dimentions.Depth  = double.Parse(row["Глубина модуля (мм)"].ToString());
            _dimentions.A      = double.Parse(row["A размер (мм)"].ToString());
            _dimentions.B      = double.Parse(row["B размер (мм)"].ToString());
            _dimentions.C      = double.Parse(row["C размер (мм)"].ToString());
            _dimentions.D      = double.Parse(row["D размер (мм)"].ToString());
            _moduleAssembly    = row["Сборка модуля"].ToString();
            BackWall           = row["Задняя стенка"].ToString();
            _shelfPo           = row["Полка по ширине секции (шт)"].ToString();
            _shelfMinusTwoMm   = row["Полка - 2мм (шт)"].ToString();
            _shelfForRazdel    = row["Полка разделительная (шт)"].ToString();
            _shelfGlass        = row["Полка стеклянная (шт)"].ToString();

            var formula = IconPath.Split('_')[1];

            _facade._records[0].NumberOnScheme = int.Parse(row["№ схемы фасада"].ToString());
            _calcMode = row["Режим расчёта"].ToString();

            if (_calcMode == "Автоматически")
            {
                KitchenUpFacadeCalculator calculator = new KitchenUpFacadeCalculator();
                calculator.CalculateDimentions(_facade, _dimentions, formula);
            }
            else
            {
                _facade._records[0].HorisontalDimension = double.Parse(row["Горизонтальный размер"].ToString());
                _facade._records[0].VerticalDimension   = double.Parse(row["Вертикальный размер"].ToString());
            }

            _facade._records[0].Type     = row["Тип фасада"].ToString();
            _facade._records[0].Material = row["Материал фасада"].ToString();
        }
Esempio n. 11
0
        protected MirrorModule(ITools tools)
        {
            _dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
            Tools       = tools;
            ModuleName  = GetType().Name;

            if (string.IsNullOrWhiteSpace(IconPath) || !IconPath.ToLower().EndsWith(".xaml"))
            {
                throw new Exception($"The module {ModuleName}'s icon path is invalid.");
            }

            if (MainPage != null && !typeof(ModulePage).IsAssignableFrom(MainPage))
            {
                throw new InvalidCastException($"The MainPage's type should be an {nameof(ModulePage)}.");
            }

            _primaryPeriodicTaskTimer   = new DispatcherTimer();
            _secondaryPeriodicTaskTimer = new DispatcherTimer();

            Initialize();
        }
Esempio n. 12
0
        /// <param name="severity">severity level, if supported by this alert</param>
        /// <returns>the icon path to the texture for the provided severity level</returns>
        public string GetIconPath(short?severity = null)
        {
            if (!SupportsSeverity && severity != null)
            {
                Logger.WarningS("alert", "attempted to get icon path for severity level for alert {0}, but" +
                                " this alert does not support severity levels", AlertType);
            }
            if (!SupportsSeverity)
            {
                return(IconPath);
            }
            if (severity == null)
            {
                Logger.WarningS("alert", "attempted to get icon path without severity level for alert {0}," +
                                " but this alert requires a severity level. Using lowest" +
                                " valid severity level instead...", AlertType);
                severity = MinSeverity;
            }

            if (severity < MinSeverity)
            {
                Logger.WarningS("alert", "attempted to get icon path with severity level {0} for alert {1}," +
                                " but the minimum severity level for this alert is {2}. Using" +
                                " lowest valid severity level instead...", severity, AlertType, MinSeverity);
                severity = MinSeverity;
            }
            if (severity > MaxSeverity)
            {
                Logger.WarningS("alert", "attempted to get icon path with severity level {0} for alert {1}," +
                                " but the max severity level for this alert is {2}. Using" +
                                " highest valid severity level instead...", severity, AlertType, MaxSeverity);
                severity = MaxSeverity;
            }

            // split and add the severity number to the path
            var ext = IconPath.LastIndexOf('.');

            return(IconPath.Substring(0, ext) + severity + IconPath.Substring(ext, IconPath.Length - ext));
        }
Esempio n. 13
0
        protected override void Execute(CodeActivityContext context)
        {
            using (PowerShell ps = PowerShell.Create())
            {
                ps.AddCommand("New-BurntToastNotification");

                //Sets the icon of the notification to the picture at the specified path
                if (!String.IsNullOrEmpty(IconPath.Get(context)))
                {
                    ps.AddParameter("AppLogo", Path.GetFullPath(IconPath.Get(context)));
                }

                //
                if (!String.IsNullOrEmpty(Header.Get(context)))
                {
                    ps.AddParameter("Text");
                }
                IAsyncResult result = ps.BeginInvoke();
                while (result.IsCompleted == false)
                {
                    Thread.Sleep(100);
                }
            }
        }
 public Stream OpenIconStream()
 {
     return(IconPath.IfNotNull(File.OpenRead));
 }
Esempio n. 15
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Priority != 0)
            {
                hash ^= Priority.GetHashCode();
            }
            if (SubcategoryId.Length != 0)
            {
                hash ^= SubcategoryId.GetHashCode();
            }
            if (IconPath.Length != 0)
            {
                hash ^= IconPath.GetHashCode();
            }
            if (ShowQuantityBanner != false)
            {
                hash ^= ShowQuantityBanner.GetHashCode();
            }
            if (QuantityOverride.Length != 0)
            {
                hash ^= QuantityOverride.GetHashCode();
            }
            if (PrefabPath.Length != 0)
            {
                hash ^= PrefabPath.GetHashCode();
            }
            if (MarketingText.Length != 0)
            {
                hash ^= MarketingText.GetHashCode();
            }
            if (DescriptionText.Length != 0)
            {
                hash ^= DescriptionText.GetHashCode();
            }
            if (ShowBadge != false)
            {
                hash ^= ShowBadge.GetHashCode();
            }
            if (BonusValue != 0)
            {
                hash ^= BonusValue.GetHashCode();
            }
            if (RarityId.Length != 0)
            {
                hash ^= RarityId.GetHashCode();
            }
            if (PackSize != 0)
            {
                hash ^= PackSize.GetHashCode();
            }
            if (ShowInHud != false)
            {
                hash ^= ShowInHud.GetHashCode();
            }
            if (HudPriority != 0)
            {
                hash ^= HudPriority.GetHashCode();
            }
            if (HudIconPath.Length != 0)
            {
                hash ^= HudIconPath.GetHashCode();
            }
            if (Icon2Path.Length != 0)
            {
                hash ^= Icon2Path.GetHashCode();
            }
            if (PopupImageOverride.Length != 0)
            {
                hash ^= PopupImageOverride.GetHashCode();
            }
            if (HidePackOnSoldOut != false)
            {
                hash ^= HidePackOnSoldOut.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Esempio n. 16
0
        public static async Task LoadQuickStartItemsAsync(bool IsRefresh = false)
        {
            if (Interlocked.Exchange(ref LoadQuickStartLockResource, 1) == 0)
            {
                try
                {
                    if (!IsQuickStartLoaded || IsRefresh)
                    {
                        IsQuickStartLoaded = true;

                        if (IsRefresh)
                        {
                            QuickStartList.Clear();
                            WebLinkList.Clear();
                        }

                        foreach ((string Name, string IconPath, string Protocal, string Type) in SQLite.Current.GetQuickStartItem())
                        {
                            StorageFile ImageFile = null;

                            try
                            {
                                ImageFile = IconPath.StartsWith("ms-appx") ? await StorageFile.GetFileFromApplicationUriAsync(new Uri(IconPath))
                                                                       : await StorageFile.GetFileFromPathAsync(Path.Combine(ApplicationData.Current.LocalFolder.Path, IconPath));

                                BitmapImage Bitmap = new BitmapImage();

                                using (IRandomAccessStream Stream = await ImageFile.OpenAsync(FileAccessMode.Read))
                                {
                                    await Bitmap.SetSourceAsync(Stream);
                                }

                                if (Enum.Parse <QuickStartType>(Type) == QuickStartType.Application)
                                {
                                    QuickStartList.Add(new QuickStartItem(QuickStartType.Application, Bitmap, Protocal, IconPath, Name));
                                }
                                else
                                {
                                    WebLinkList.Add(new QuickStartItem(QuickStartType.WebSite, Bitmap, Protocal, IconPath, Name));
                                }
                            }
                            catch (Exception ex)
                            {
                                LogTracer.Log(ex, $"Could not load QuickStart item, Name: {Name}");

                                SQLite.Current.DeleteQuickStartItem(Name, Protocal, IconPath, Type);

                                if (ImageFile != null)
                                {
                                    await ImageFile.DeleteAsync(StorageDeleteOption.PermanentDelete);
                                }
                            }
                        }

                        QuickStartList.Add(new QuickStartItem());
                        WebLinkList.Add(new QuickStartItem());
                    }
                }
                catch (Exception ex)
                {
                    LogTracer.Log(ex);
                }
                finally
                {
                    _ = Interlocked.Exchange(ref LoadQuickStartLockResource, 0);
                }
            }
        }
Esempio n. 17
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            foreach (Lokal lok in Window.Mapa1)
            {
                if (lok.Id.Equals(Id.Text))
                {
                    System.Media.SystemSounds.Beep.Play();
                    MessageBox.Show("Uneseni id je vec u upotrebi na Mapi1");
                    Id.Focus();
                    return;
                }
            }
            foreach (Lokal lok in Window.Mapa2)
            {
                if (lok.Id.Equals(Id.Text))
                {
                    System.Media.SystemSounds.Beep.Play();
                    MessageBox.Show("Uneseni id je vec u upotrebi na Mapi2");
                    Id.Focus();
                    return;
                }
            }
            foreach (Lokal lok in Window.Mapa3)
            {
                if (lok.Id.Equals(Id.Text))
                {
                    System.Media.SystemSounds.Beep.Play();
                    MessageBox.Show("Uneseni id je vec u upotrebi na Mapi3");
                    Id.Focus();
                    return;
                }
            }
            foreach (Lokal lok in Window.Mapa4)
            {
                if (lok.Id.Equals(Id.Text))
                {
                    System.Media.SystemSounds.Beep.Play();
                    MessageBox.Show("Uneseni id je vec u upotrebi na Mapi4");
                    Id.Focus();
                    return;
                }
            }
            SluzenjeAlkohola sluzenje = SluzenjeAlkohola.NE_SLUZI;

            switch (StatusSluzenjaAlkohola.Text)
            {
            case "Ne sluzi":
                sluzenje = SluzenjeAlkohola.NE_SLUZI;
                break;

            case "Sluzi do 23h":
                sluzenje = SluzenjeAlkohola.SLUZI_DO_23;
                break;

            case "Sluzi celu noc":
                sluzenje = SluzenjeAlkohola.SLUZI_NOCU;
                break;
            }

            KategorijeCena kat = KategorijeCena.NISKE;

            switch (KategorijaCene.Text)
            {
            case "Niske":
                kat = KategorijeCena.NISKE;
                break;

            case "Srednje":
                kat = KategorijeCena.SREDNJE;
                break;

            case "Visoke":
                kat = KategorijeCena.VISOKE;
                break;

            case "Veoma visoke":
                kat = KategorijeCena.IZUZETNO_VISOKE;
                break;
            }
            TipLokala tLokala = Tip.SelectedItem as TipLokala;
            Lokal     l       = null;

            try
            {
                l = new Lokal(Id.Text, Naziv.Text, tLokala, sluzenje, IconPath.Equals("") ? "" : IconPath, DostupnoHendikepiranim.IsChecked ?? false, DozvoljenoPusenje.IsChecked ?? false, PrimaRezervacije.IsChecked ?? false, kat, Int32.Parse(Kapacitet.Text), DatumOtvaranja.SelectedDate.GetValueOrDefault(DateTime.Now));
            }
            catch
            {
                System.Media.SystemSounds.Beep.Play();
                MessageBox.Show("Neke vrednosti nisu bile dobro unete");
                return;
            }
            l.Etikete = this.OdabraneEtikete;
            l.UcitajIkonicu();
            this.Items.Insert(0, l);
            FileIO.UpisiLokal(this.ActiveMap.Split('.')[0] + ".bin", this.Items);
            this.Close();
        }
Esempio n. 18
0
        public bool Equals(DestinyProfileUserInfoCard input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     DateLastPlayed == input.DateLastPlayed ||
                     (DateLastPlayed != null && DateLastPlayed.Equals(input.DateLastPlayed))
                     ) &&
                 (
                     IsOverridden == input.IsOverridden ||
                     (IsOverridden != null && IsOverridden.Equals(input.IsOverridden))
                 ) &&
                 (
                     IsCrossSavePrimary == input.IsCrossSavePrimary ||
                     (IsCrossSavePrimary != null && IsCrossSavePrimary.Equals(input.IsCrossSavePrimary))
                 ) &&
                 (
                     PlatformSilver == input.PlatformSilver ||
                     (PlatformSilver != null && PlatformSilver.Equals(input.PlatformSilver))
                 ) &&
                 (
                     UnpairedGameVersions == input.UnpairedGameVersions ||
                     (UnpairedGameVersions.Equals(input.UnpairedGameVersions))
                 ) &&
                 (
                     SupplementalDisplayName == input.SupplementalDisplayName ||
                     (SupplementalDisplayName != null && SupplementalDisplayName.Equals(input.SupplementalDisplayName))
                 ) &&
                 (
                     IconPath == input.IconPath ||
                     (IconPath != null && IconPath.Equals(input.IconPath))
                 ) &&
                 (
                     CrossSaveOverride == input.CrossSaveOverride ||
                     (CrossSaveOverride != null && CrossSaveOverride.Equals(input.CrossSaveOverride))
                 ) &&
                 (
                     ApplicableMembershipTypes == input.ApplicableMembershipTypes ||
                     (ApplicableMembershipTypes != null && ApplicableMembershipTypes.SequenceEqual(input.ApplicableMembershipTypes))
                 ) &&
                 (
                     IsPublic == input.IsPublic ||
                     (IsPublic != null && IsPublic.Equals(input.IsPublic))
                 ) &&
                 (
                     MembershipType == input.MembershipType ||
                     (MembershipType != null && MembershipType.Equals(input.MembershipType))
                 ) &&
                 (
                     MembershipId == input.MembershipId ||
                     (MembershipId.Equals(input.MembershipId))
                 ) &&
                 (
                     DisplayName == input.DisplayName ||
                     (DisplayName != null && DisplayName.Equals(input.DisplayName))
                 ) &&
                 (
                     BungieGlobalDisplayName == input.BungieGlobalDisplayName ||
                     (BungieGlobalDisplayName != null && BungieGlobalDisplayName.Equals(input.BungieGlobalDisplayName))
                 ) &&
                 (
                     BungieGlobalDisplayNameCode == input.BungieGlobalDisplayNameCode ||
                     (BungieGlobalDisplayNameCode.Equals(input.BungieGlobalDisplayNameCode))
                 ));
        }
Esempio n. 19
0
 public override int GetHashCode()
 {
     return(Name.GetHashCode() +
            IconPath.GetHashCode() +
            Content?.GetHashCode() ?? 0);
 }
Esempio n. 20
0
        public TreeNode()
        {
            panel.Orientation = Orientation.Horizontal;
            panel.Children.Add(viewbox);
            panel.Children.Add(textLabelCtl);
            panel.Children.Add(textBoxCtl);

            if (this.IconPath != null)
            {
                if (this.IconPath.Contains(";"))
                {
                    string[] packIconValues = IconPath.Split(';');
                    string   packIconType   = packIconValues[0];
                    string   packIconKind   = packIconValues[1];

                    switch (packIconType)
                    {
                    case "PackIconMaterial":
                        PackIconMaterial iconMat = new PackIconMaterial();
                        ((PackIconMaterial)iconMat).Kind = (PackIconMaterialKind)Enum
                                                           .Parse(typeof(PackIconMaterialKind),
                                                                  packIconKind);

                        viewbox.Child = iconMat;
                        break;

                    case "PackIconMaterialLight":
                        PackIconMaterialLight iconMatLight = new PackIconMaterialLight();
                        ((PackIconMaterialLight)iconMatLight).Kind = (PackIconMaterialLightKind)Enum
                                                                     .Parse(typeof(PackIconMaterialLightKind),
                                                                            packIconKind);

                        viewbox.Child = iconMatLight;
                        break;

                    case "PackIconModern":
                        PackIconModern iconModern = new PackIconModern();
                        ((PackIconModern)iconModern).Kind = (PackIconModernKind)Enum
                                                            .Parse(typeof(PackIconModernKind),
                                                                   packIconKind);

                        viewbox.Child = iconModern;
                        break;

                    case "PackIconOcticons":
                        PackIconOcticons iconOcti = new PackIconOcticons();
                        ((PackIconOcticons)iconOcti).Kind = (PackIconOcticonsKind)Enum
                                                            .Parse(typeof(PackIconOcticonsKind),
                                                                   packIconKind);

                        viewbox.Child = iconOcti;
                        break;

                    case "PackIconSimpleIcons":
                        PackIconSimpleIcons iconSimple = new PackIconSimpleIcons();
                        ((PackIconSimpleIcons)iconSimple).Kind = (PackIconSimpleIconsKind)Enum
                                                                 .Parse(typeof(PackIconSimpleIconsKind),
                                                                        packIconKind);

                        viewbox.Child = iconSimple;
                        break;

                    case "PackIconEntypo":
                        PackIconEntypo iconEnt = new PackIconEntypo();
                        ((PackIconEntypo)iconEnt).Kind = (PackIconEntypoKind)Enum
                                                         .Parse(typeof(PackIconEntypoKind),
                                                                packIconKind);

                        viewbox.Child = iconEnt;
                        break;

                    case "PackIconFontAwesome":
                        PackIconFontAwesome icon = new PackIconFontAwesome();
                        ((PackIconFontAwesome)icon).Kind = (PackIconFontAwesomeKind)Enum
                                                           .Parse(typeof(PackIconFontAwesomeKind),
                                                                  packIconKind);

                        viewbox.Child = icon;
                        break;
                    }

                    viewbox.Margin = new Thickness(0, 0, 8, 0);
                }
            }

            Style materialDesignTreeViewItem = Application.Current.TryFindResource("MaterialDesignTreeViewItem") as Style;

            if (materialDesignTreeViewItem != null)
            {
                this.Style = materialDesignTreeViewItem;
            }

            Style materialDesignTextbox = Application.Current.TryFindResource("MaterialDesignFloatingHintTextBox") as Style;

            if (materialDesignTextbox != null)
            {
                textBoxCtl.Style = materialDesignTextbox;
                HintAssist.SetHint(this, "(" + HintText + ")");
            }

            this.Header = panel;

            textBoxCtl.Visibility        = Visibility.Collapsed;
            textBoxCtl.LostFocus        += textBox_LostFocus;
            textBoxCtl.IsVisibleChanged += textBox_IsVisibleChanged;
            textBoxCtl.KeyDown          += textBox_KeyDown;

            textLabelCtl.MouseLeftButtonDown += text_MouseLeftButtonDown;
            textLabelCtl.KeyDown             += text_KeyDown;
        }
Esempio n. 21
0
        public override void SetupModule(DataTable changedInfo)
        {
            int     countRows = changedInfo.Rows.Count;
            DataRow row       = changedInfo.Rows[0];

            Number   = row["Номер модуля"].ToString();
            IconPath = row["Изображение"].ToString();
            Sсheme   = row["Форма модуля"].ToString();
            if (!double.TryParse(row["Высота модуля (мм)"].ToString(), out double height))
            {
                throw new ArgumentException("Высота модуля должна быть числом");
            }
            if (height < 0)
            {
                throw new ArgumentException("Высота модуля не может быть отрицательной");
            }
            _dimentions.Height = height;
            if (!double.TryParse(row["Ширина модуля (мм)"].ToString(), out double width))
            {
                throw new ArgumentException("Ширина модуля должна быть числом");
            }
            if (width < 0)
            {
                throw new ArgumentException("Ширина модуля не может быть отрицательной");
            }
            _dimentions.Width = width;


            if (!int.TryParse(row["№ схемы фасада"].ToString(), out int facadeNumber))
            {
                throw new ArgumentException("№ схемы фасада должен быть целым числом");
            }
            _calcMode = row["Режим расчёта"].ToString();
            var formula = IconPath.Split('_')[1];

            if ((facadeNumber > 0) && (_calcMode == "авт. мод."))
            {
                _facade._records[0].HorisontalDimension = double.Parse(row["Ширина"].ToString());
                _facade._records[0].VerticalDimension   = double.Parse(row["Высота"].ToString());
                KitchenUpFacadeCalculator calculator = new KitchenUpFacadeCalculator();
                calculator.CalculateModuleDimentions(_facade, _dimentions, formula);
            }

            if (!double.TryParse(row["Глубина модуля (мм)"].ToString(), out double depth))
            {
                throw new ArgumentException("Глубина модуля должна быть числом");
            }
            ;
            if (depth < 0)
            {
                throw new ArgumentException("Глубина модуля не может быть отрицательной");
            }
            _dimentions.Depth = depth;
            if (!double.TryParse(row["A размер (мм)"].ToString(), out double a))
            {
                throw new ArgumentException("A размер должен быть числом");
            }
            if (a < 0)
            {
                throw new ArgumentException("A размер не может быть отрицательным");
            }
            _dimentions.A = a;
            if (!double.TryParse(row["B размер (мм)"].ToString(), out double b))
            {
                throw new ArgumentException("B размер должен быть числом");
            }
            if (b < 0)
            {
                throw new ArgumentException("B размер не может быть отрицательным");
            }
            _dimentions.B = b;
            if (!double.TryParse(row["C размер (мм)"].ToString(), out double c))
            {
                throw new ArgumentException("C размер должен быть числом");
            }
            if (c < 0)
            {
                throw new ArgumentException("C размер не может быть отрицательным");
            }
            _dimentions.C = c;
            if (!double.TryParse(row["D размер (мм)"].ToString(), out double d))
            {
                throw new ArgumentException("D размер должен быть числом");
            }
            if (d < 0)
            {
                throw new ArgumentException("D размер не может быть отрицательным");
            }
            _dimentions.D     = d;
            _moduleAssembly   = row["Сборка модуля"].ToString();
            BackPanelAssembly = row["Задняя стенка"].ToString();
            _shelfAssembly    = row["Крепление полки"].ToString();
            _shelfsCount      = row["Кол-во полок"].ToString();

            if (facadeNumber <= 0)
            {
                return;
            }
            _facade._records[0].NumberOnScheme = facadeNumber;
            _facade._records[0].Type           = row["Тип фасада"].ToString();
            _facade._records[0].Material       = row["Материал фасада"].ToString();

            for (int i = 0; i < changedInfo.Rows.Count; i++)
            {
                row = changedInfo.Rows[i];
                if (_calcMode == "авт. фас.")
                {
                    KitchenUpFacadeCalculator calculator = new KitchenUpFacadeCalculator();
                    calculator.CalculateFacadeDimentions(_facade, _dimentions, formula, i);
                }
                else
                {
                    _facade._records[i].HorisontalDimension = double.Parse(row["Ширина"].ToString());
                    _facade._records[i].VerticalDimension   = double.Parse(row["Высота"].ToString());
                }
            }
        }