ScreenToGif/Controls/AttachmentListBoxItem.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interop;
using System.Windows.Media.Imaging;

namespace ScreenToGif.Controls
{
    public class AttachmentListBoxItem : ListBoxItem
    {
        #region Dependency Property

        public static readonly DependencyProperty ShortNameProperty = DependencyProperty.Register("ShortName", typeof(string), typeof(AttachmentListBoxItem),
                    new FrameworkPropertyMetadata("Something", FrameworkPropertyMetadataOptions.AffectsMeasure));

        public static readonly DependencyProperty AttachmentProperty = DependencyProperty.Register("Attachment", typeof(string), typeof(AttachmentListBoxItem),
            new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsMeasure, AttachmentChangedCallback));

        public static readonly DependencyProperty FileIconProperty = DependencyProperty.Register("FileIcon", typeof(BitmapSource), typeof(AttachmentListBoxItem));

        #endregion

        #region Property Accessor

        [Bindable(true), Category("Common")]
        public string ShortName
        {
            get { return (string)GetValue(ShortNameProperty); }
            private set { SetValue(ShortNameProperty, value); }
        }

        [Bindable(true), Category("Common")]
        public string Attachment
        {
            get { return (string)GetValue(AttachmentProperty); }
            private set { SetValue(AttachmentProperty, value); }
        }

        [Bindable(true), Category("Common")]
        public BitmapSource FileIcon
        {
            get { return (BitmapSource)GetValue(FileIconProperty); }
            private set { SetValue(FileIconProperty, value); }
        }

        #endregion

        static AttachmentListBoxItem()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(AttachmentListBoxItem), new FrameworkPropertyMetadata(typeof(AttachmentListBoxItem)));
        }

        public AttachmentListBoxItem(string attachment)
        {
            Attachment = attachment;
        }

后面还有 27 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。