示例#1
0
        public bool Equals(FlingrResource obj)
        {
            // STEP 1: Check for null if nullable (e.g., a reference type)
            if (obj == null)
            {
                return(false);
            }
            // STEP 2: Check for ReferenceEquals if this is a reference type
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            // STEP 4: Possibly check for equivalent hash codes
            if (this.GetHashCode() != obj.GetHashCode())
            {
                return(false);
            }
            // STEP 5: Check base.Equals if base overrides Equals()
            System.Diagnostics.Debug.Assert(
                base.GetType() != typeof(object));

            if (!base.Equals(obj))
            {
                return(false);
            }

            // STEP 6: Compare identifying fields for equality.
            return((this.FileInfo.FullName.Equals(obj.FileInfo.FullName)) &&
                   (this.Name.Equals(obj.Name)) &&
                   (this.Data.Equals(obj.Data)));
        }
示例#2
0
        private void AddFlingrResource(FileInfo fileInfo)
        {
            FlingrResource resource = new FlingrResource(fileInfo);

            using (System.Drawing.Icon sysicon = System.Drawing.Icon.ExtractAssociatedIcon(fileInfo.FullName))
            {
                resource.Icon = sysicon.ToBitmap();
            }

            flingrResources.Add(resource);
        }
示例#3
0
        private void FlingrResource_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            ListViewItem item = sender as ListViewItem;

            if (item != null && item.IsSelected)
            {
                FlingrResource resource = fileListView.SelectedItem as FlingrResource;
                if (resource != null)
                {
                    FolderManager.OpenFile(resource.FileInfo);
                }
            }
        }
示例#4
0
        private void RemoveFlingrResource(FileInfo fileInfo)
        {
            FlingrResource resource = new FlingrResource(fileInfo);

            flingrResources.Remove(resource);
        }