示例#1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + HttpStatus.GetHashCode();

                hashCode = hashCode * 59 + ErrorCode.GetHashCode();
                if (Description != null)
                {
                    hashCode = hashCode * 59 + Description.GetHashCode();
                }
                if (DocumentationLink != null)
                {
                    hashCode = hashCode * 59 + DocumentationLink.GetHashCode();
                }
                if (AdditionalInfo != null)
                {
                    hashCode = hashCode * 59 + AdditionalInfo.GetHashCode();
                }
                return(hashCode);
            }
        }
示例#2
0
        /// <summary>
        /// Returns true if ResponseError instances are equal
        /// </summary>
        /// <param name="other">Instance of ResponseError to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ResponseError other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     HttpStatus == other.HttpStatus ||

                     HttpStatus.Equals(other.HttpStatus)
                     ) &&
                 (
                     ErrorCode == other.ErrorCode ||

                     ErrorCode.Equals(other.ErrorCode)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     DocumentationLink == other.DocumentationLink ||
                     DocumentationLink != null &&
                     DocumentationLink.Equals(other.DocumentationLink)
                 ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     other.AdditionalInfo != null &&
                     AdditionalInfo.SequenceEqual(other.AdditionalInfo)
                 ));
        }
        public MainWindowViewModel(ISnackbarMessageQueue snackbarMessageQueue)
        {
            if (snackbarMessageQueue == null)
            {
                throw new ArgumentNullException(nameof(snackbarMessageQueue));
            }

            HMI_Item = new[]
            {
                new HMI_Item("Home", new Home(),
                             new []
                {
                    new DocumentationLink(DocumentationLinkType.Wiki, $"{ConfigurationManager.AppSettings["GitHub"]}/wiki", "WIKI"),
                    DocumentationLink.DemoPageLink <Home>()
                }
                             ),
                new HMI_Item("Palette", new PaletteSelector {
                    DataContext = new PaletteSelectorViewModel()
                },
                             new []
                {
                    DocumentationLink.WikiLink("Brush-Names", "Brushes"),
                    DocumentationLink.WikiLink("Custom-Palette-Hues", "Custom Palettes"),
                    DocumentationLink.WikiLink("Swatches-and-Recommended-Colors", "Swatches"),
                    DocumentationLink.DemoPageLink <PaletteSelector>("Demo View"),
                    DocumentationLink.DemoPageLink <PaletteSelectorViewModel>("Demo View Model"),
                    DocumentationLink.ApiLink <PaletteHelper>()
                }),
                new HMI_Item("Buttons & Toggles", new Buttons {
                    DataContext = new ButtonsViewModel()
                },
                             new []
                {
                    DocumentationLink.WikiLink("Button-Styles", "Buttons"),
                    DocumentationLink.DemoPageLink <Buttons>("Demo View"),
                    DocumentationLink.DemoPageLink <ButtonsViewModel>("Demo View Model"),
                    DocumentationLink.StyleLink("Button"),
                    DocumentationLink.StyleLink("CheckBox"),
                    DocumentationLink.StyleLink("PopupBox"),
                    DocumentationLink.StyleLink("ToggleButton"),
                    DocumentationLink.ApiLink <PopupBox>()
                })
                {
                    VerticalScrollBarVisibilityRequirement = ScrollBarVisibility.Auto
                },
                new HMI_Item("Fields", new TextFields(),
                             new []
                {
                    DocumentationLink.DemoPageLink <TextFields>(),
                    DocumentationLink.StyleLink("TextBox"),
                    DocumentationLink.StyleLink("ComboBox"),
                })
                {
                    VerticalScrollBarVisibilityRequirement = ScrollBarVisibility.Auto
                },
                new HMI_Item("Pickers", new Pickers {
                    DataContext = new PickersViewModel()
                },
                             new []
                {
                    DocumentationLink.DemoPageLink <Pickers>(),
                    DocumentationLink.StyleLink("Clock"),
                    DocumentationLink.StyleLink("DatePicker"),
                    DocumentationLink.ApiLink <TimePicker>()
                }),
                new HMI_Item("Sliders", new Sliders(), new []
                {
                    DocumentationLink.DemoPageLink <Sliders>(),
                    DocumentationLink.StyleLink("Sliders")
                }),
                new HMI_Item("Chips", new Chips(), new []
                {
                    DocumentationLink.DemoPageLink <Chips>(),
                    DocumentationLink.StyleLink("Chip"),
                    DocumentationLink.ApiLink <Chip>()
                }),
                new HMI_Item("Typography", new Typography(), new []
                {
                    DocumentationLink.DemoPageLink <Typography>(),
                    DocumentationLink.StyleLink("TextBlock")
                })
                {
                    VerticalScrollBarVisibilityRequirement   = ScrollBarVisibility.Auto,
                    HorizontalScrollBarVisibilityRequirement = ScrollBarVisibility.Auto
                },
                new HMI_Item("Cards", new Cards(), new []
                {
                    DocumentationLink.DemoPageLink <Cards>(),
                    DocumentationLink.StyleLink("Card"),
                    DocumentationLink.ApiLink <Card>()
                })
                {
                    VerticalScrollBarVisibilityRequirement = ScrollBarVisibility.Auto
                },
                new HMI_Item("Icon Pack", new IconPack {
                    DataContext = new IconPackViewModel(snackbarMessageQueue)
                },
                             new []
                {
                    DocumentationLink.DemoPageLink <IconPack>("Demo View"),
                    DocumentationLink.DemoPageLink <IconPackViewModel>("Demo View Model"),
                    DocumentationLink.ApiLink <PackIcon>()
                }),
                new HMI_Item("Colour Zones", new ColorZones(),
                             new []
                {
                    DocumentationLink.DemoPageLink <ColorZones>(),
                    DocumentationLink.ApiLink <ColorZone>()
                }),
                new HMI_Item("Lists", new Lists {
                    DataContext = new ListsAndGridsViewModel()
                },
                             new []
                {
                    DocumentationLink.DemoPageLink <Lists>("Demo View"),
                    DocumentationLink.DemoPageLink <ListsAndGridsViewModel>("Demo View Model", "Domain"),
                    DocumentationLink.StyleLink("ListBox"),
                    DocumentationLink.StyleLink("ListView")
                })
                {
                    VerticalScrollBarVisibilityRequirement = ScrollBarVisibility.Auto
                },
                new HMI_Item("Trees", new Trees {
                    DataContext = new TreesViewModel()
                },
                             new []
                {
                    DocumentationLink.DemoPageLink <Trees>("Demo View"),
                    DocumentationLink.DemoPageLink <TreesViewModel>("Demo View Model"),
                    DocumentationLink.StyleLink("TreeView")
                }),
                new HMI_Item("Grids", new Grids {
                    DataContext = new ListsAndGridsViewModel()
                },
                             new []
                {
                    DocumentationLink.DemoPageLink <Grids>("Demo View"),
                    DocumentationLink.DemoPageLink <ListsAndGridsViewModel>("Demo View Model", "Domain"),
                    DocumentationLink.StyleLink("DataGrid")
                }),
                new HMI_Item("Expander", new Expander(),
                             new []
                {
                    DocumentationLink.DemoPageLink <Expander>(),
                    DocumentationLink.StyleLink("Expander")
                }),
                new HMI_Item("Group Boxes", new GroupBoxes(),
                             new []
                {
                    DocumentationLink.DemoPageLink <GroupBoxes>(),
                    DocumentationLink.StyleLink("GroupBox")
                }),
                new HMI_Item("Menus & Tool Bars", new MenusAndToolBars(),
                             new []
                {
                    DocumentationLink.DemoPageLink <MenusAndToolBars>(),
                    DocumentationLink.StyleLink("Menu"),
                    DocumentationLink.StyleLink("ToolBar")
                }),
                new HMI_Item("Progress Indicators", new Progress(),
                             new []
                {
                    DocumentationLink.DemoPageLink <Progress>(),
                    DocumentationLink.StyleLink("ProgressBar")
                }),
                new HMI_Item("Dialogs", new Dialogs {
                    DataContext = new DialogsViewModel()
                },
                             new []
                {
                    DocumentationLink.WikiLink("Dialogs", "Dialogs"),
                    DocumentationLink.DemoPageLink <Dialogs>("Demo View"),
                    DocumentationLink.DemoPageLink <DialogsViewModel>("Demo View Model", "Domain"),
                    DocumentationLink.ApiLink <DialogHost>()
                }),
                new HMI_Item("Drawer", new Drawers(),
                             new []
                {
                    DocumentationLink.DemoPageLink <Drawers>(),
                    DocumentationLink.ApiLink <DrawerHost>()
                }),
                new HMI_Item("Snackbar", new Snackbars(),
                             new []
                {
                    DocumentationLink.WikiLink("Snackbar", "Snackbar"),
                    DocumentationLink.DemoPageLink <Snackbars>(),
                    DocumentationLink.StyleLink("Snackbar"),
                    DocumentationLink.ApiLink <Snackbar>(),
                    DocumentationLink.ApiLink <ISnackbarMessageQueue>()
                }),
                new HMI_Item("Transitions", new Transitions(),
                             new []
                {
                    DocumentationLink.WikiLink("Transitions", "Transitions"),
                    DocumentationLink.DemoPageLink <Transitions>(),
                    DocumentationLink.ApiLink <Transitioner>("Transitions"),
                    DocumentationLink.ApiLink <TransitionerSlide>("Transitions"),
                    DocumentationLink.ApiLink <TransitioningContent>("Transitions"),
                }),
                new HMI_Item("Shadows", new Shadows(),
                             new []
                {
                    DocumentationLink.DemoPageLink <Shadows>(),
                }),
            };
        }