コード例 #1
0
        public CoreGroup[] GetGroup(uint startFrom, uint size)
        {
            uint groupSize = GetGroupSize();

            if (groupSize > startFrom)
            {
                object groupObject = new CoreDll.adGroup();
                int    sizeOfGroup = Marshal.SizeOf(groupObject);
                size = Math.Min(groupSize - startFrom, size);
                byte[]      buffer     = new byte[sizeOfGroup * size];
                CoreGroup[] groups     = new CoreGroup[size];
                UIntPtr[]   pStartFrom = new UIntPtr[1];
                pStartFrom[0] = new UIntPtr(startFrom);
                UIntPtr[] pSize = new UIntPtr[1];
                pSize[0] = new UIntPtr(size);
                if (m_dll.adGroupGet(m_handle, Marshal.UnsafeAddrOfPinnedArrayElement(pStartFrom, 0),
                                     Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0),
                                     Marshal.UnsafeAddrOfPinnedArrayElement(pSize, 0)) == CoreDll.Error.Ok)
                {
                    for (uint i = 0; i < pSize[0].ToUInt32(); ++i)
                    {
                        IntPtr          pGroup = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, (int)(i * sizeOfGroup));
                        CoreDll.adGroup group  = (CoreDll.adGroup)Marshal.PtrToStructure(pGroup, groupObject.GetType());
                        groups[i] = new CoreGroup(ref group, this);
                    }
                }
                return(groups);
            }
            return(null);
        }
コード例 #2
0
ファイル: ThumbnailGroupTable.cs プロジェクト: vsf6/AntiDupl
 public void ChangeCurrentThumbnail(CoreGroup group, int index)
 {
     if (OnCurrentThumbnailChanged != null)
     {
         OnCurrentThumbnailChanged(group, index);
     }
 }
コード例 #3
0
 public ThumbnailGroupPanel(CoreLib core, AntiDupl.NET.Options options, CoreGroup group, ThumbnailGroupTable thumbnailGroupTable)
 {
     m_core                = core;
     m_options             = options;
     m_group               = group;
     m_thumbnailGroupTable = thumbnailGroupTable;
     InitializeComponents();
 }
コード例 #4
0
 public void SetThumbnail(CoreGroup group, int index)
 {
     m_group = group;
     m_index = index;
     m_pictureBoxPanel.UpdateImage(ImageInfo);
     m_pictureBoxPanel.UpdateImagePadding(m_group.sizeMax);
     m_pictureBoxPanel.Refresh();
 }
コード例 #5
0
ファイル: ThumbnailGroupTable.cs プロジェクト: vsf6/AntiDupl
 public bool Rename(CoreGroup group, int index, string newFileName)
 {
     if (m_core.Rename(group.id, index, newFileName))
     {
         UpdateGroups();
         return(true);
     }
     return(false);
 }
コード例 #6
0
ファイル: ThumbnailPanel.cs プロジェクト: vsf6/AntiDupl
 public ThumbnailPanel(CoreLib core, AntiDupl.NET.Options options, CoreGroup group, int index, ThumbnailGroupPanel thumbnailGroupPanel)
 {
     m_core                = core;
     m_options             = options;
     m_group               = group;
     m_index               = index;
     m_thumbnailGroupPanel = thumbnailGroupPanel;
     InitializeComponents();
     SetImageInfo();
 }