Ejemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CatalogItem other &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) &&
                   ((Abbreviation == null && other.Abbreviation == null) || (Abbreviation?.Equals(other.Abbreviation) == true)) &&
                   ((LabelColor == null && other.LabelColor == null) || (LabelColor?.Equals(other.LabelColor) == true)) &&
                   ((AvailableOnline == null && other.AvailableOnline == null) || (AvailableOnline?.Equals(other.AvailableOnline) == true)) &&
                   ((AvailableForPickup == null && other.AvailableForPickup == null) || (AvailableForPickup?.Equals(other.AvailableForPickup) == true)) &&
                   ((AvailableElectronically == null && other.AvailableElectronically == null) || (AvailableElectronically?.Equals(other.AvailableElectronically) == true)) &&
                   ((CategoryId == null && other.CategoryId == null) || (CategoryId?.Equals(other.CategoryId) == true)) &&
                   ((TaxIds == null && other.TaxIds == null) || (TaxIds?.Equals(other.TaxIds) == true)) &&
                   ((ModifierListInfo == null && other.ModifierListInfo == null) || (ModifierListInfo?.Equals(other.ModifierListInfo) == true)) &&
                   ((Variations == null && other.Variations == null) || (Variations?.Equals(other.Variations) == true)) &&
                   ((ProductType == null && other.ProductType == null) || (ProductType?.Equals(other.ProductType) == true)) &&
                   ((SkipModifierScreen == null && other.SkipModifierScreen == null) || (SkipModifierScreen?.Equals(other.SkipModifierScreen) == true)) &&
                   ((ItemOptions == null && other.ItemOptions == null) || (ItemOptions?.Equals(other.ItemOptions) == true)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Filters a <see cref="BoardLabelCollection"/> for a given <see cref="CardFilter"/>.
        /// </summary>
        /// <param name="labels">The <see cref="BoardLabelCollection"/></param>
        /// <param name="filter">The new <see cref="CardFilter"/> by which to filter.</param>
        /// <returns>The filtered collection.</returns>
        public static BoardLabelCollection Filter(this BoardLabelCollection labels, LabelColor filter)
        {
            var collection = new BoardLabelCollection(labels, labels.Auth);

            collection.SetFilter(filter);
            return(collection);
        }
        public EllipseBuilder SetBorder(LabelColor color, int thickness)
        {
            Context.BorderColor     = color;
            Context.BorderThickness = thickness;

            return(this);
        }
 /// <summary>
 /// Adds a filter to the collection.
 /// </summary>
 /// <param name="labelColor">The filter value.</param>
 public void Filter(LabelColor labelColor)
 {
     if (_additionalParameters == null)
     {
         _additionalParameters = new Dictionary <string, object>();
     }
     _additionalParameters["filter"] = labelColor.GetDescription();
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Label"/> class.
        /// </summary>
        /// <param name="jsonData">
        /// The JSON data for the new label.
        /// </param>
        internal Label(string jsonData)
        {
            var o = JObject.Parse(jsonData);

            _name     = (string)o.SelectToken("name");
            _color    = (LabelColor)(int)o.SelectToken("color");
            _jsonData = jsonData;
        }
        public RectangleBuilder SetBorder(LabelColor color, int thickness, int cornerRounding)
        {
            Context.BorderColor     = color;
            Context.BorderThickness = thickness;
            Context.CornerRounding  = cornerRounding;

            return(this);
        }
Ejemplo n.º 7
0
        internal static ILabel CheckLabel(this Board board, string labelName, LabelColor labelColor)
        {
            TrelloRequestCounter.TrelloPostCount += 3;
            var label = board.Labels.FirstOrDefault(l => l.Name == labelName);
            var task  = board.Labels.Add(labelName, labelColor);

            task.RunSynchronously();
            return(task.Result);
        }
Ejemplo n.º 8
0
 void OnSerializingMethod(StreamingContext sc)
 {
     Images      = new string[] { Image };
     sLabelColor = LabelColor.ToString();
     sLineColor  = LineColor.ToString();
     FontFamily  = TextFormat.FontFamily.ToString();
     FontStyle   = TextFormat.FontStyle.ToString();
     FontWeight  = TextFormat.FontWeight.ToString();
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Creates a new drop down option.
        /// </summary>
        /// <param name="text">The text.</param>
        /// <param name="color">(Optional) The label color.</param>
        /// <returns>A new drop down option.</returns>
        /// <remarks>This object will not update.  It is intended for adding new options to custom drop down fields.</remarks>
        public static IDropDownOption Create(string text, LabelColor color = LabelColor.None)
        {
            var json = TrelloConfiguration.JsonFactory.Create <IJsonCustomDropDownOption>();

            json.Text          = text;
            json.Color         = color;
            json.ValidForMerge = true;

            return(new DropDownOption(json, null, true));
        }
Ejemplo n.º 10
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (Value != null ? Value.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ LabelColor.GetHashCode();
         hashCode = (hashCode * 397) ^ CanEdit.GetHashCode();
         hashCode = (hashCode * 397) ^ CanDelete.GetHashCode();
         hashCode = (hashCode * 397) ^ Highlight.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 11
0
        public async Task RemoveLabelColorFromCardAsync(Card card, LabelColor labelColor)
        {
            try
            {
                var foundCard = await FindAndCheckNullabilityHelper <Card> .InDatabaseAsync(context.Cards, card, "Card not found!", false);

                var foundLabeColor = await FindAndCheckNullabilityHelper <LabelColor> .InCollectionAsync(foundCard.LabelColors, labelColor, "Label color was not found!", false);

                foundCard.LabelColors.Remove(foundLabeColor);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Create a new label.
        /// </summary>
        /// <param name="labelName">
        /// The name of the new label.
        /// </param>
        /// <param name="color">
        /// The color.
        /// </param>
        public void CreateLabel(string labelName, LabelColor color)
        {
            this.CheckLoginStatus();

            // Validation
            if (string.IsNullOrWhiteSpace(labelName))
            {
                throw new ArgumentNullException("labelName");
            }

            Core.GetJsonData(
                Core.ConstructUri(
                    "addLabel?",
                    string.Format("token={0}&name={1}&color={2}", this.apiToken, labelName, color.GetHashCode()),
                    false));
        }
Ejemplo n.º 13
0
        public async Task AddLabelColorToCardAsync(Card card, LabelColor labelColor)
        {
            try
            {
                var foundCard = await FindAndCheckNullabilityHelper <Card> .InDatabaseAsync(context.Cards, card, "Card not found!", false);

                var foundLabeColor = await FindAndCheckNullabilityHelper <LabelColor> .InCollectionAsync(foundCard.LabelColors, labelColor, "Such label color is already assigned to this card!", true);

                labelColor.Cards.Add(foundCard);
                context.Set <LabelColor>().Add(labelColor);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Update the color of a specified label.
        /// </summary>
        /// <param name="name">
        /// The name of the label to update.
        /// </param>
        /// <param name="color">
        /// The new color.
        /// </param>
        public void UpdateLabelColor(string name, LabelColor color)
        {
            CheckLoginStatus();

            // Validation
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentNullException("name");
            }

            Core.GetJsonData(
                Core.ConstructUri(
                    "updateLabelColor?",
                    string.Format("token={0}&name={1}&color={2}", ApiToken, name, color.GetHashCode()),
                    false));
        }
Ejemplo n.º 15
0
        public static Vector2 DrawGenericDraggable(RectangleF rect, string title)
        {
            if (BackgroundNineslice == null)
            {
                NoRegisterError("BackgroundNineSlice");
                return(Vector2.Zero);
            }

            if (!LabelColor.HasValue)
            {
                NoRegisterError("LabelColor");
                return(Vector2.Zero);
            }

            Vector2 dragPos = IMGUI.StartDraggable(new IMGuiDraggableContent(rect, new Size(rect.width, 24), BackgroundNineslice, Color.White, 1)
                                                   .SetTitle(title, LabelColor.GetValueOrDefault(), LabelFont), true);

            return(dragPos);
        }
Ejemplo n.º 16
0
        public override JsonCollection BuildParams()
        {
            var options = new JsonCollection(false);

            if (Clickable.HasValue)
            {
                options.Add <bool>("clickable", Clickable.Value);
            }

            if (SuppressInfoWindows.HasValue)
            {
                options.Add <bool>("supressInfoWindows", SuppressInfoWindows.Value);
            }

            options.Add("labelColor", "google.maps.weather.LabelColor." + LabelColor.ToString().ToUpperInvariant(), LabelColor != WeatherLayer.LabelColor.Auto);
            options.Add("temperatureUnits", "google.maps.weather.TemperatureUnit." + TemperatureUnits.ToString().ToUpperInvariant(), TemperatureUnits != WeatherLayer.TemperatureUnit.Default);
            options.Add("windSpeedUnits", "google.maps.weather.WindSpeedUnit." + WindSpeedUnits.ToString().ToUpperInvariant(), WindSpeedUnits != WeatherLayer.WindSpeedUnit.Default);

            return(options);
        }
Ejemplo n.º 17
0
        public override int GetHashCode()
        {
            int hashCode = -419430818;

            if (Name != null)
            {
                hashCode += Name.GetHashCode();
            }

            if (DiscountType != null)
            {
                hashCode += DiscountType.GetHashCode();
            }

            if (Percentage != null)
            {
                hashCode += Percentage.GetHashCode();
            }

            if (AmountMoney != null)
            {
                hashCode += AmountMoney.GetHashCode();
            }

            if (PinRequired != null)
            {
                hashCode += PinRequired.GetHashCode();
            }

            if (LabelColor != null)
            {
                hashCode += LabelColor.GetHashCode();
            }

            if (ModifyTaxBasis != null)
            {
                hashCode += ModifyTaxBasis.GetHashCode();
            }

            return(hashCode);
        }
Ejemplo n.º 18
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is CatalogDiscount other &&
                   ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) &&
                   ((DiscountType == null && other.DiscountType == null) || (DiscountType?.Equals(other.DiscountType) == true)) &&
                   ((Percentage == null && other.Percentage == null) || (Percentage?.Equals(other.Percentage) == true)) &&
                   ((AmountMoney == null && other.AmountMoney == null) || (AmountMoney?.Equals(other.AmountMoney) == true)) &&
                   ((PinRequired == null && other.PinRequired == null) || (PinRequired?.Equals(other.PinRequired) == true)) &&
                   ((LabelColor == null && other.LabelColor == null) || (LabelColor?.Equals(other.LabelColor) == true)) &&
                   ((ModifyTaxBasis == null && other.ModifyTaxBasis == null) || (ModifyTaxBasis?.Equals(other.ModifyTaxBasis) == true)));
        }
Ejemplo n.º 19
0
        public void SetEnabled(bool enabled)
        {
            if (enabled)
            {
                TitleLabel.TextColor = LabelColor;
            }
            else
            {
                LabelColor = TitleLabel.TextColor;

                nfloat r, g, b, a;
                LabelColor.GetRGBA(out r, out g, out b, out a);
                r = NMath.Floor((nfloat)(r * 100.0 + 0.5)) / (nfloat)100.0;
                g = NMath.Floor((nfloat)(g * 100.0 + 0.5)) / (nfloat)100.0;
                b = NMath.Floor((nfloat)(b * 100.0 + 0.5)) / (nfloat)100.0;
                TitleLabel.TextColor = UIColor.FromRGBA(
                    (r + (nfloat)0.4),
                    (g + (nfloat)0.4),
                    (b + (nfloat)0.4),
                    (nfloat)1);
            }
            Enabled = enabled;
            CheckView.SetNeedsDisplay();
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Creates a new <see cref="ISearchQuery"/> specifying a label color search parameter.
        /// </summary>
        /// <param name="labelColor">The label color to search for.</param>
        /// <returns>A new <see cref="ISearchQuery"/> parameter list.</returns>
        public ISearchQuery Label(LabelColor labelColor)
        {
            _parameters.Add(new LabelSearchParameter(labelColor));

            return(this);
        }
 /// <summary>
 /// Creates a new <see cref="SearchFor"/> appending a label color search parameter.
 /// </summary>
 /// <param name="search">The current search</param>
 /// <param name="labelColor">The label color to search for.</param>
 /// <returns>A new <see cref="SearchFor"/> parameter list.</returns>
 public static SearchFor AndLabel(this SearchFor search, LabelColor labelColor)
 {
     return(new SearchFor(search, new LabelSearchParameter(labelColor)));
 }
Ejemplo n.º 22
0
 public static ZPLCommand GE(int width, int height, int borderThickness, LabelColor lineColor)
 => new ZPLCommand("^GE", width, height, borderThickness, (char)lineColor);
Ejemplo n.º 23
0
 public static ZPLCommand GD(int width, int height, int borderThickness, LabelColor lineColor, bool inverseDirection = false)
 => new ZPLCommand("^GD", width, height, borderThickness, (char)lineColor, inverseDirection ? 'L' : 'R');
Ejemplo n.º 24
0
 public static ZPLCommand GB(int width, int height, int borderThickness, LabelColor lineColor, int cornerRounding)
 => new ZPLCommand("^GB", width, height, borderThickness, (char)lineColor, cornerRounding);
Ejemplo n.º 25
0
 /// <summary>
 /// Adds a filter to the collection.
 /// </summary>
 /// <param name="labelColor">The filter value.</param>
 public void Filter(LabelColor labelColor)
 {
     AdditionalParameters["filter"] = labelColor.GetDescription();
 }
Ejemplo n.º 26
0
 /// <summary>
 /// Creates a new <see cref="SearchFor"/> specifying a label color search parameter.
 /// </summary>
 /// <param name="labelColor">The label color to search for.</param>
 /// <returns>A new <see cref="SearchFor"/> parameter list.</returns>
 public static SearchFor Label(LabelColor labelColor)
 {
     return(new SearchFor(new LabelSearchParameter(labelColor)));
 }
Ejemplo n.º 27
0
        public override int GetHashCode()
        {
            int hashCode = -268666674;

            if (Name != null)
            {
                hashCode += Name.GetHashCode();
            }

            if (Description != null)
            {
                hashCode += Description.GetHashCode();
            }

            if (Abbreviation != null)
            {
                hashCode += Abbreviation.GetHashCode();
            }

            if (LabelColor != null)
            {
                hashCode += LabelColor.GetHashCode();
            }

            if (AvailableOnline != null)
            {
                hashCode += AvailableOnline.GetHashCode();
            }

            if (AvailableForPickup != null)
            {
                hashCode += AvailableForPickup.GetHashCode();
            }

            if (AvailableElectronically != null)
            {
                hashCode += AvailableElectronically.GetHashCode();
            }

            if (CategoryId != null)
            {
                hashCode += CategoryId.GetHashCode();
            }

            if (TaxIds != null)
            {
                hashCode += TaxIds.GetHashCode();
            }

            if (ModifierListInfo != null)
            {
                hashCode += ModifierListInfo.GetHashCode();
            }

            if (Variations != null)
            {
                hashCode += Variations.GetHashCode();
            }

            if (ProductType != null)
            {
                hashCode += ProductType.GetHashCode();
            }

            if (SkipModifierScreen != null)
            {
                hashCode += SkipModifierScreen.GetHashCode();
            }

            if (ItemOptions != null)
            {
                hashCode += ItemOptions.GetHashCode();
            }

            return(hashCode);
        }
Ejemplo n.º 28
0
 public static LabelColorDTO GetLabelColorDTOFromEntity(LabelColor labelColor)
 {
     return(MapperHelper.GetEntityFromDTO <LabelColor, LabelColorDTO>(labelColor));
 }
Ejemplo n.º 29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Label"/> class. 
 /// </summary>
 /// <param name="jsonData">
 /// The JSON data for the new label.
 /// </param>
 internal Label(string jsonData)
 {
     var o = JObject.Parse(jsonData);
     this.name = (string)o.SelectToken("name");
     this.color = (LabelColor)(int)o.SelectToken("color");
     this.jsonData = jsonData;
 }
Ejemplo n.º 30
0
 public LabelSearchParameter(LabelColor color)
 {
     Query = $"#{color.ToLowerString()}";
 }
Ejemplo n.º 31
0
        public bool Equals(ToolbarEntry other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(String.Equals(Value, other.Value) && String.Equals(Label, other.Label) && LabelColor.Equals(other.LabelColor) &&
                   CanEdit.Equals(other.CanEdit) && CanDelete.Equals(other.CanDelete) && Highlight.Equals(other.Highlight));
        }
Ejemplo n.º 32
0
        /// <summary>
        /// Create a new label.
        /// </summary>
        /// <param name="labelName">
        /// The name of the new label.
        /// </param>
        /// <param name="color">
        /// The color.
        /// </param>
        public void CreateLabel(string labelName, LabelColor color)
        {
            this.CheckLoginStatus();

            // Validation
            if (string.IsNullOrWhiteSpace(labelName))
            {
                throw new ArgumentNullException("labelName");
            }

            Core.GetJsonData(
                Core.ConstructUri(
                    "addLabel?", 
                    string.Format("token={0}&name={1}&color={2}", this.apiToken, labelName, color.GetHashCode()), 
                    false));
        }