Ejemplo n.º 1
0
 public override bool Equals(object obj)
 {
     try {
         FaceImageControl fic   = (FaceImageControl)obj;
         bool             equal = this.Face == fic.Face;
         return(equal);
     } catch (InvalidCastException) {
         return(base.Equals(obj));
     }
 }
Ejemplo n.º 2
0
        public void Remove(FaceImageControl faceImageControl, bool RemoveFromOtherCategoriesAsWell)
        {
            flowLayoutPanel1.SuspendLayout();

            // no idew how this internally compares stuff, apparently not with Equals() which is f*****g dumb but oh well
            //flowLayoutPanel1.Controls.Remove(faceImageControl);
            // let's do this manually then... *sigh*
            foreach (FaceImageControl c in flowLayoutPanel1.Controls)
            {
                if (c.Face == faceImageControl.Face)
                {
                    flowLayoutPanel1.Controls.Remove(c);
                }
            }

            RemoveFromXmlOrList(faceImageControl, RemoveFromOtherCategoriesAsWell);

            flowLayoutPanel1.ResumeLayout(true);
            flowLayoutPanel1.Refresh();
        }
Ejemplo n.º 3
0
 private void RemoveFromXmlOrList(FaceImageControl faceImageControl, bool RemoveFromOtherCategoriesAsWell)
 {
     if (XML != null)
     {
         // is the "all" control
         XML.Remove(faceImageControl.Face.Category, faceImageControl.Face);
         if (RemoveFromOtherCategoriesAsWell)
         {
             // delete from category it belongs to as well
             ParentFaceForm.FaceControls[faceImageControl.Face.Category].Remove(faceImageControl, false);
         }
     }
     else
     {
         // is a category
         ImageList.Remove(faceImageControl.Face);
         if (RemoveFromOtherCategoriesAsWell)
         {
             // delete from all control as well
             AllControl.Remove(faceImageControl, false);
         }
     }
 }
        public void Remove( FaceImageControl faceImageControl, bool RemoveFromOtherCategoriesAsWell )
        {
            flowLayoutPanel1.SuspendLayout();

            // no idew how this internally compares stuff, apparently not with Equals() which is f*****g dumb but oh well
            //flowLayoutPanel1.Controls.Remove(faceImageControl);
            // let's do this manually then... *sigh*
            foreach ( FaceImageControl c in flowLayoutPanel1.Controls ) {
                if ( c.Face == faceImageControl.Face ) {
                    flowLayoutPanel1.Controls.Remove( c );
                }
            }

            RemoveFromXmlOrList( faceImageControl, RemoveFromOtherCategoriesAsWell );

            flowLayoutPanel1.ResumeLayout( true );
            flowLayoutPanel1.Refresh();
        }
 private void RemoveFromXmlOrList( FaceImageControl faceImageControl, bool RemoveFromOtherCategoriesAsWell )
 {
     if ( XML != null ) {
         // is the "all" control
         XML.Remove( faceImageControl.Face.Category, faceImageControl.Face );
         if ( RemoveFromOtherCategoriesAsWell ) {
             // delete from category it belongs to as well
             ParentFaceForm.FaceControls[faceImageControl.Face.Category].Remove( faceImageControl, false );
         }
     } else {
         // is a category
         ImageList.Remove( faceImageControl.Face );
         if ( RemoveFromOtherCategoriesAsWell ) {
             // delete from all control as well
             AllControl.Remove( faceImageControl, false );
         }
     }
 }