Exemplo n.º 1
0
        public bool Equals(CoreSetting input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Identifier == input.Identifier ||
                     (Identifier != null && Identifier.Equals(input.Identifier))
                     ) &&
                 (
                     IsDefault == input.IsDefault ||
                     (IsDefault != null && IsDefault.Equals(input.IsDefault))
                 ) &&
                 (
                     DisplayName == input.DisplayName ||
                     (DisplayName != null && DisplayName.Equals(input.DisplayName))
                 ) &&
                 (
                     Summary == input.Summary ||
                     (Summary != null && Summary.Equals(input.Summary))
                 ) &&
                 (
                     ImagePath == input.ImagePath ||
                     (ImagePath != null && ImagePath.Equals(input.ImagePath))
                 ) &&
                 (
                     ChildSettings == input.ChildSettings ||
                     (ChildSettings != null && ChildSettings.SequenceEqual(input.ChildSettings))
                 ));
        }
 public override bool Equals(object obj)
 {
     return(obj is TouristSpotModelForImport import &&
            Name.Equals(import.Name) &&
            Description.Equals(import.Description) &&
            ImagePath.Equals(import.ImagePath));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Get the Image that the Sprite is using
        /// </summary>
        /// <returns>An Image</returns>
        public Texture2D getImage()
        {
            if (getRenderer() == null)
            {
                return(null);
            }
            if (ImagePath == null)
            {
                ImagePath = PIXEL;
            }

            if (image == null && ImagePath != null || newImage)
            {
                newImage = false;
                if (ImagePath.Equals(PIXEL))
                {
                    image = getRenderer().getPixel();
                }
                else
                {
                    image = getResources().loadImage(ImagePath);
                }

                Center();
            }


            return(image);
        }
Exemplo n.º 4
0
        //const Uri uriImage = new Uri("placeholder_can");
        //UriImageSource test = new UriImageSource { Uri = uriImage };

        //[DefaultValue("")]
        //public UriImageSource savedImg { get; set; }
        #endregion

        #region Story 7 code
        /// <summary>
        /// This method will set a bool value to true when the image gets saved locally
        /// </summary>
        /// <returns></returns>
        public bool ImageSaved()
        {
            //throw new NotImplementedException();
            //if (ImagePath == null)
            if (ImagePath.Equals("") || ImagePath.Equals("placeholder_can") || ImagePath == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 5
0
        public bool Matches(MediaFile file)
        {
            if (file == null)
            {
                throw new ArgumentNullException("file", "Mediafile is null");
            }
            else
            {
                if (ImagePath.Equals(file.ImagePath))
                {
                    return(true);
                }

                return(false);
            }
        }
Exemplo n.º 6
0
 public void  loadFromImagePath()
 {
     if (ImagePath.Equals(""))
     {
         return;
     }
     try
     {
         String path = Helper.AssemblyLocalPath + "\\" + ImagePath;
         Bmp = BitmapConversion.LoadBitmapAndDispose(path);
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show("Error loading Image from Disk for SpriteObject " + Name + ":\n" + ex.Message);
     }
 }
Exemplo n.º 7
0
 public override bool Equals(object obj)
 {
     try
     {
         Film filmToCompareTo = (Film)obj;
         return(IsReleased == filmToCompareTo.IsReleased &&
                Title.Equals(filmToCompareTo.Title) &&
                Id.Equals(filmToCompareTo.Id) &&
                Length.Equals(filmToCompareTo.Length) &&
                BriefDescription.Equals(filmToCompareTo.BriefDescription) &&
                DetailedDescription.Equals(filmToCompareTo.DetailedDescription) &&
                ImagePath.Equals(filmToCompareTo.ImagePath) &&
                Year.Equals(filmToCompareTo.Year) &&
                Classification.Equals(filmToCompareTo.Classification) &&
                compareStringArr(Directors, filmToCompareTo.Directors) &&
                compareStringArr(Actors, filmToCompareTo.Actors) &&
                compareStringArr(Genres, filmToCompareTo.Genres));
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 8
0
        public Boolean add()
        {
            string qryStringMember;

            if (ImagePath.Equals(""))
            {
                qryStringMember =
                    "Insert into tbl_users (name, contact_no, email, username, password, user_level, date_added) " +
                    " VALUES (@name, @contact_no, @email, @username, @password, @user_level, NOW())";
            }

            else
            {
                qryStringMember =
                    "Insert into tbl_users (name, contact_no, email, username, password, user_level, user_image, date_added) " +
                    " VALUES (@name, @contact_no, @email, @username, @password, @user_level, @user_image, NOW())";
            }

            try
            {
                if (!ImagePath.Equals("") && !ImagePath.Equals("Remove"))
                {
                    fs        = new FileStream(ImagePath, FileMode.Open, FileAccess.Read);
                    br        = new BinaryReader(fs);
                    ImageData = br.ReadBytes((int)fs.Length);
                    br.Close();
                    fs.Close();
                }

                Connect.CnSql = new MySqlConnection(Connect.ConnStr);
                Connect.CnSql.Open();
                Connect.CmSql = new MySqlCommand(qryStringMember, Connect.CnSql);
                Connect.CmSql.Parameters.AddWithValue("@name", Name.Trim());
                Connect.CmSql.Parameters.AddWithValue("@contact_no", ContactNo.Trim());
                Connect.CmSql.Parameters.AddWithValue("@username", Username.Trim());
                Connect.CmSql.Parameters.AddWithValue("@password", Password);
                Connect.CmSql.Parameters.AddWithValue("@email", Email.Trim());
                Connect.CmSql.Parameters.AddWithValue("@user_level", UserLevel);

                if (!ImagePath.Equals("") && !ImagePath.Equals("Remove"))
                {
                    Connect.CmSql.Parameters.AddWithValue("@user_image", ImageData);
                }
                else if (ImagePath.Equals("Remove"))
                {
                    Connect.CmSql.Parameters.AddWithValue("@user_image", null);
                }

                Trans = Connect.CnSql.BeginTransaction();
                Connect.CmSql.Transaction = Trans;
                Connect.CmSql.ExecuteNonQuery();
                Trans.Commit();
                return(true);
            }
            catch (MySqlException e)
            {
                XtraMessageBox.Show(e.Message, "SQL Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Trans.Rollback();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "General Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                Trans.Rollback();
            }
            finally
            {
                Connect.CnSql.Close();
                Connect.CnSql.Dispose();
                Connect.CmSql.Dispose();
                Connect.CmSql = null;
                Connect.DrSql = null;
            }
            return(false);
        }