コード例 #1
0
        public override bool Equals(object obj)
        {
            SelectablePropertyModel <T> selectablePropertyModel = obj as SelectablePropertyModel <T>;

            if (selectablePropertyModel != null && this.isSelected == selectablePropertyModel.isSelected)
            {
                return(this.propertyModel.Equals((object)selectablePropertyModel.propertyModel));
            }
            return(false);
        }
コード例 #2
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }
            SelectablePropertyModel <T> selectablePropertyModel = obj as SelectablePropertyModel <T>;

            if (selectablePropertyModel != null)
            {
                BaseResourceModel baseResourceModel1 = (object)this.propertyModel as BaseResourceModel;
                BaseResourceModel baseResourceModel2 = (object)selectablePropertyModel.propertyModel as BaseResourceModel;
                if (baseResourceModel1 != null && baseResourceModel2 != null)
                {
                    return(baseResourceModel1.CompareTo((object)baseResourceModel2));
                }
            }
            throw new ArgumentException(ExceptionStringTable.CompareToMustBeCalledWithASelectablePropertyModelTOrNull, "obj");
        }
コード例 #3
0
 public VirtualizingResourceItem(SelectablePropertyModel <T> resourceModel)
 {
     this.resourceModel = resourceModel;
 }
コード例 #4
0
        public VirtualizingResourceItem <T> FindItemInCategory <T>(string categoryKey, SelectablePropertyModel <T> resource) where T : BaseResourceModel
        {
            ResourceTypeItem resourceTypeItem;

            if (this.categories.TryGetValue(categoryKey, out resourceTypeItem))
            {
                foreach (VirtualizingResourceItem <T> virtualizingResourceItem in (Collection <ResourceVirtualizingTreeItem>)resourceTypeItem.Children)
                {
                    if (virtualizingResourceItem.Model.Equals((object)resource))
                    {
                        return(virtualizingResourceItem);
                    }
                }
            }
            return((VirtualizingResourceItem <T>)null);
        }