Example #1
0
 private void onIsFavortiteChange(CswNbtNodeProp NodeProp, bool Creating)
 {
     if (IsFavorite.wasAnySubFieldModified())
     {
         _toggleProps();
     }
 }
Example #2
0
 protected override void afterPopulateProps()
 {
     IsFavorite.SetOnPropChange(onIsFavortiteChange);
     IsRecurring.SetOnPropChange(onIsRecurringChange);
     Name.SetOnPropChange(onNamePropChange);
     SubmittedDate.SetOnPropChange(onSubmittedDatePropChange);
 } //afterPopulateProps()
Example #3
0
 public bool Equals(PocketItem other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id.Equals(other.Id) &&
            ResolvedId.Equals(other.ResolvedId) &&
            Equals(GivenUrl, other.GivenUrl) &&
            Equals(GivenTitle, other.GivenTitle) &&
            IsFavorite.Equals(other.IsFavorite) &&
            Status.Equals(other.Status) &&
            TimeAdded.Equals(other.TimeAdded) &&
            TimeUpdated.Equals(other.TimeUpdated) &&
            TimeRead.Equals(other.TimeRead) &&
            TimeFavorited.Equals(other.TimeFavorited) &&
            TimeSyncDatabaseAdded.Equals(other.TimeSyncDatabaseAdded) &&
            TimeSyncDatabaseUpdated.Equals(other.TimeSyncDatabaseUpdated) &&
            Equals(ResolvedTitle, other.ResolvedTitle) &&
            Equals(ResolvedUrl, other.ResolvedUrl) &&
            Equals(Excerpt, other.Excerpt) &&
            IsArticle.Equals(other.IsArticle) &&
            IsIndex.Equals(other.IsIndex) &&
            ImageContent.Equals(other.ImageContent) &&
            VideoContent.Equals(other.VideoContent) &&
            WordCount.Equals(other.WordCount) &&
            Equals(AmpUrl, other.AmpUrl) &&
            Equals(Encoding, other.Encoding) &&
            Equals(MimeType, other.MimeType) &&
            Equals(LeadImage, other.LeadImage));
 }
Example #4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = 47;
         hashCode = (hashCode * 53) ^ Id.GetHashCode();
         hashCode = (hashCode * 53) ^ ResolvedId.GetHashCode();
         if (GivenUrl != null)
         {
             hashCode = (hashCode * 53) ^ GivenUrl.GetHashCode();
         }
         if (GivenTitle != null)
         {
             hashCode = (hashCode * 53) ^ GivenTitle.GetHashCode();
         }
         hashCode = (hashCode * 53) ^ IsFavorite.GetHashCode();
         hashCode = (hashCode * 53) ^ (int)Status;
         hashCode = (hashCode * 53) ^ TimeAdded.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeUpdated.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeRead.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeFavorited.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeSyncDatabaseAdded.GetHashCode();
         hashCode = (hashCode * 53) ^ TimeSyncDatabaseUpdated.GetHashCode();
         if (ResolvedTitle != null)
         {
             hashCode = (hashCode * 53) ^ ResolvedTitle.GetHashCode();
         }
         if (ResolvedUrl != null)
         {
             hashCode = (hashCode * 53) ^ ResolvedUrl.GetHashCode();
         }
         if (Excerpt != null)
         {
             hashCode = (hashCode * 53) ^ Excerpt.GetHashCode();
         }
         hashCode = (hashCode * 53) ^ IsArticle.GetHashCode();
         hashCode = (hashCode * 53) ^ IsIndex.GetHashCode();
         hashCode = (hashCode * 53) ^ ImageContent.GetHashCode();
         hashCode = (hashCode * 53) ^ VideoContent.GetHashCode();
         hashCode = (hashCode * 53) ^ WordCount.GetHashCode();
         if (AmpUrl != null)
         {
             hashCode = (hashCode * 53) ^ AmpUrl.GetHashCode();
         }
         if (Encoding != null)
         {
             hashCode = (hashCode * 53) ^ Encoding.GetHashCode();
         }
         if (MimeType != null)
         {
             hashCode = (hashCode * 53) ^ MimeType.GetHashCode();
         }
         if (LeadImage != null)
         {
             hashCode = (hashCode * 53) ^ LeadImage.GetHashCode();
         }
         return(hashCode);
     }
 }
 /// <summary>
 ///
 /// </summary>
 public override void afterPropertySetPopulateProps()
 {
     Quantity.SetOnPropChange(onQuantityPropChange);
     TotalDispensed.SetOnPropChange(onTotalDispensedPropChange);
     Material.SetOnPropChange(onMaterialPropChange);
     TotalMoved.SetOnPropChange(onTotalMovedPropChange);
     IsFavorite.SetOnPropChange(onIsFavoritePropChange);
     IsRecurring.SetOnPropChange(onIsRecurringChange);
     RecurringFrequency.SetOnPropChange(onRecurringFrequencyPropChange);
 }//afterPopulateProps()
Example #6
0
        private void RunFavoriteCommand(object obj)
        {
            //var userid = DependencyService.Get<IFacebook>().UserId;
            //await RamseyConnection.SaveFavoriteAsync(recipeMeta.RecipeID, userid);

            if (!loadedRecipe)
            {
                Analytics.TrackEvent("TriedChangingFavoriteBeforeRecipeLoaded", new Dictionary <string, string> {
                    { "loadedRecipe", loadedRecipe.ToString() }
                });
                return;
            }

            IsFavorite = !IsFavorite;

            Analytics.TrackEvent("changeFavorite", new Dictionary <string, string> {
                { "IsFavorite", IsFavorite.ToString() }
            });

            OnPropertyChanged(nameof(IsFavorite));

            try
            {
                //Save or unsave recipe
                var savedRecipes = User.User.SavedRecipes;
                // save
                if (IsFavorite && !savedRecipes.Any(p => p.Name == recipe.Name))
                {
                    savedRecipes.Insert(0, recipe);
                    User.User.SavedRecipes = savedRecipes;
                }
                // unsave
                else if (!IsFavorite && savedRecipes.Any(p => p.Name == recipe.Name))
                {
                    int toRemoveIndex = -1;
                    for (int i = 0; i < savedRecipes.Count; i++)
                    {
                        if (recipe.RecipeID == savedRecipes[i].RecipeID)
                        {
                            toRemoveIndex = i;
                            break;
                        }
                    }
                    if (toRemoveIndex != -1)
                    {
                        savedRecipes.RemoveAt(toRemoveIndex);
                        User.User.SavedRecipes = savedRecipes;
                    }
                }
            }
            catch (Exception ex) { Crashes.TrackError(ex); }
        }
        void ReleaseDesignerOutlets()
        {
            if (AttractionImage != null)
            {
                AttractionImage.Dispose();
                AttractionImage = null;
            }

            if (BackgroundImage != null)
            {
                BackgroundImage.Dispose();
                BackgroundImage = null;
            }

            if (City != null)
            {
                City.Dispose();
                City = null;
            }

            if (IsFavorite != null)
            {
                IsFavorite.Dispose();
                IsFavorite = null;
            }

            if (IsFlighBooked != null)
            {
                IsFlighBooked.Dispose();
                IsFlighBooked = null;
            }

            if (IsDirections != null)
            {
                IsDirections.Dispose();
                IsDirections = null;
            }

            if (SubTitle != null)
            {
                SubTitle.Dispose();
                SubTitle = null;
            }

            if (Title != null)
            {
                Title.Dispose();
                Title = null;
            }
        }
Example #8
0
        /// <summary>
        /// Returns a <see cref="System.String"/> that represents the current <see cref="TuxedoBerries.ScenePanel.SceneEntity"/>.
        /// </summary>
        /// <returns>A <see cref="System.String"/> that represents the current <see cref="TuxedoBerries.ScenePanel.SceneEntity"/>.</returns>
        public override string ToString()
        {
            var builder = new StringBuilder();

            builder.Append("{");
            // Name
            builder.Append("\"name\":");
            builder.Append("\"");
            builder.Append(Name);
            builder.Append("\",");
            // Full Path
            builder.Append("\"full_path\":");
            builder.Append("\"");
            builder.Append(FullPath);
            builder.Append("\",");
            // GUID
            builder.Append("\"guid\":");
            builder.Append("\"");
            builder.Append(GUID);
            builder.Append("\",");
            // SnapshotPath
            builder.Append("\"screenshot_path\":");
            builder.Append("\"");
            builder.Append(ScreenshotPath);
            builder.Append("\",");
            // IsFavorite
            builder.Append("\"is_favorite\":");
            builder.Append(IsFavorite.ToString().ToLower());
            builder.Append(",");
            // InBuild
            builder.Append("\"in_build\":");
            builder.Append(InBuild.ToString().ToLower());
            builder.Append(",");
            // IsEnabled
            builder.Append("\"is_enabled\":");
            builder.Append(IsEnabled.ToString().ToLower());
            builder.Append(",");
            // BuildIndex
            builder.Append("\"build_index\":");
            builder.Append(BuildIndex);

            builder.Append("}");
            return(builder.ToString());
        }
 public override void onRequestPropChange(CswNbtNodeProp Prop)
 {
     IsFavorite.RecalculateReferenceValue();
 }
 /// <summary>
 ///
 /// </summary>
 public override void beforePropertySetWriteNode(bool IsCopy, bool OverrideUniqueValidation)
 {
     IsFavorite.setHidden(value: true, SaveToDb: true);
 }
Example #11
0
        public override int GetHashCode()
        {
            var hashCode =
                Created.GetHashCode() ^
                LastModified.GetHashCode() ^
                Size.GetHashCode() ^
                IsFavorite.GetHashCode() ^
                CommentsCount.GetHashCode() ^
                CommentsUnread.GetHashCode() ^
                ShareTypes.GetHashCode() ^
                HasPreview.GetHashCode();

            if (ContentType != null)
            {
                hashCode ^= ContentType.GetHashCode();
            }

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

            if (Path != null)
            {
                hashCode ^= Path.GetHashCode();
            }

            if (CommentsHref != null)
            {
                hashCode ^= CommentsHref.GetHashCode();
            }

            // Is null on directories
            if (ETag != null)
            {
                hashCode ^= ETag.GetHashCode();
            }

            if (!string.IsNullOrEmpty(Id))
            {
                hashCode ^= Id.GetHashCode();
            }

            if (!string.IsNullOrEmpty(FileId))
            {
                hashCode ^= FileId.GetHashCode();
            }

            if (!string.IsNullOrEmpty(OwnderId))
            {
                hashCode ^= OwnderId.GetHashCode();
            }

            if (!string.IsNullOrEmpty(OwnerDisplayName))
            {
                hashCode ^= OwnerDisplayName.GetHashCode();
            }

            if (!string.IsNullOrEmpty(Checksums))
            {
                hashCode ^= Checksums.GetHashCode();
            }

            return(hashCode);
        }