public ToolTip(ShellView view) { InitializeComponent(); this.DataContext = this; this._View = view; _DelayTimer.Interval = TimeSpan.FromMilliseconds(700); _DelayTimer.Tick += DelayTimer_Tick; }
public void PopulateAvailableColumns(List<Collumns> AvailableCols, ShellView ShellView, System.Windows.Point Location) { BrowserControl = ShellView; for (int i = 1; i < AvailableCols.Count; i++) { if (!String.IsNullOrEmpty(AvailableCols[i].Name)) { ListViewItem lvi = new ListViewItem(AvailableCols[i].Name); lvi.Tag = AvailableCols[i]; if (AvailableCols[i].IsColumnHandler) lvi.ForeColor = Color.Red; foreach (Collumns collumn in ShellView.Collumns) { if (collumn.pkey.fmtid == AvailableCols[i].pkey.fmtid && collumn.pkey.pid == AvailableCols[i].pkey.pid) { lvi.Checked = true; } } lvColumns.Items.Add(lvi); } } Opacity = 0; if (lvColumns.Items.Count > 0) Show(ShellView); this.Location = new Point((int)Location.X, (int)Location.Y); //this.lvColumns.Sort(); //'this didn't do anything... lol. this.lvColumns.Sorting = SortOrder.Ascending; Opacity = 255; }
public static void Open(ShellView ShellListView) { var csf = new ConditionalSelectForm(); csf.ShowDialog(); if (!csf.CancelAction) { csf.ConditionallySelectFiles(csf.csd, ShellListView); } }
/// <summary> /// Initializes a new instance of the <see cref="ShellContextMenu"/> class. /// </summary> /// /// <param name="items"> /// The items to which the context menu should refer. /// </param> /// <param name="svgio"></param> /// <param name="view">The ShellView the ContextMenu is associated with</param> public ShellContextMenu(IListItemEx[] items, SVGIO svgio = SVGIO.SVGIO_SELECTION, ShellView view = null) { this._ShellView = view; if (svgio == SVGIO.SVGIO_BACKGROUND) { Initialize(items[0]); } else { Initialize(items); } }
/* * public static System.Runtime.InteropServices.ComTypes.IDataObject GetIDataObject(this IListItemEx item, out IntPtr dataObjectPtr) { * var parent = item.Parent ?? item; * * IntPtr[] pidls = new IntPtr[1]; * pidls[0] = item.ILPidl; * Guid IID_IDataObject = Ole32.IID_IDataObject; * parent.GetIShellFolder().GetUIObjectOf(IntPtr.Zero, (uint)pidls.Length, pidls, ref IID_IDataObject, 0, out dataObjectPtr); * * System.Runtime.InteropServices.ComTypes.IDataObject dataObj = * (System.Runtime.InteropServices.ComTypes.IDataObject) * Marshal.GetTypedObjectForIUnknown(dataObjectPtr, typeof(System.Runtime.InteropServices.ComTypes.IDataObject)); * * return dataObj; * } */ /// <summary> /// Sets the <paramref name="row"/> and <paramref name="column"/> based on the row and column that the <paramref name="hitPoint">point</paramref> falls on /// </summary> /// <param name="shellView">The <see cref="ShellView"/> you want to test with</param> /// <param name="hitPoint">The point on the screen you awnt to look for</param> /// <param name="row">The value for row that was hit</param> /// <param name="column">The value for column that was hit</param> /// <returns>Was the <paramref name="shellView"/> hit at all?</returns> public static bool HitTest(this ShellView shellView, Point hitPoint, out int row, out int column) { // clear the output values row = column = -1; // set up some win32 api constant values const int LVM_FIRST = 0x1000; //const int LVM_SUBITEMHITTEST = (LVM_FIRST + 57); const int LVM_HITTEST = (LVM_FIRST + 18); const int LVHT_NOWHERE = 0x1; const int LVHT_ONITEMICON = 0x2; const int LVHT_ONITEMLABEL = 0x4; const int LVHT_ONITEMSTATEICON = 0x8; const int LVHT_EX_ONCONTENTS = 0x04000000; const int LVHT_ONITEM = (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON | LVHT_EX_ONCONTENTS); // set up the return value bool hitLocationFound = false; // initialize a hittest information structure LVHITTESTINFO lvHitTestInfo = new LVHITTESTINFO(); lvHitTestInfo.pt.x = hitPoint.X; lvHitTestInfo.pt.y = hitPoint.Y; // send the hittest message to find out where the click was if (User32.SendMessage(shellView.LVHandle, LVM_HITTEST, 0, ref lvHitTestInfo) != 0) { bool nowhere = ((lvHitTestInfo.flags & LVHT_NOWHERE) != 0); bool onItem = ((lvHitTestInfo.flags & LVHT_ONITEM) != 0); if (onItem && !nowhere) { row = lvHitTestInfo.iItem; column = lvHitTestInfo.iSubItem; hitLocationFound = true; } } else if (User32.SendMessage(shellView.LVHandle, LVM_FIRST, 0, ref lvHitTestInfo) != 0) { row = 0; hitLocationFound = true; } return(hitLocationFound); }
/// <summary> /// Initializes a new instance of the <see cref="ShellContextMenu"/> class. /// </summary> /// <param name="shellView">The ShellView the ContextMenu is associated with</param> /// <param name="Use_GetNewContextMenu"></param> public ShellContextMenu(ShellView shellView, bool Use_GetNewContextMenu) { this._ShellView = shellView; IntPtr iContextMenu = IntPtr.Zero; if (Use_GetNewContextMenu) { this.GetNewContextMenu(_ShellView.CurrentFolder, out iContextMenu, out m_ComInterface); } else { this.GetOpenWithContextMenu(_ShellView.SelectedItems.ToArray(), out iContextMenu, out m_ComInterface); } m_ComInterface2 = m_ComInterface as IContextMenu2; m_ComInterface3 = m_ComInterface as IContextMenu3; m_MessageWindow = new MessageWindow(this); }
/// <summary> /// Initializes a new instance of the <see cref="ShellContextMenu"/> /// class. /// </summary> /// /// <param name="shellView">The <see cref="ShellView">ShellView</see> for this context menu</param> /// <param name="item"> /// The item to which the context menu should refer. /// </param> public ShellContextMenu(ShellView shellView, IListItemEx item) { this._ShellView = shellView; Initialize(new IListItemEx[] { item }); }
public ShellBrowser(ShellView shellView) { m_ShellView = shellView; }
public DialogShellBrowser(ShellView shellView) : base(shellView) { t.Interval = 100; t.Tick += t_Tick; }
public VirtualGrouping(ShellView view) { this._VirtualListView = view; }
/// <summary> /// Initializes a new instance of the <see cref="ShellContextMenu"/> class. /// </summary> /// <param name="shellView">The ShellView the ContextMenu is associated with</param> /// <param name="Use_GetNewContextMenu"></param> public ShellContextMenu(ShellView shellView, bool Use_GetNewContextMenu) { this._ShellView = shellView; IntPtr iContextMenu = IntPtr.Zero; if (Use_GetNewContextMenu) this.GetNewContextMenu(_ShellView.CurrentFolder, out iContextMenu, out m_ComInterface); else this.GetOpenWithContextMenu(_ShellView.SelectedItems.ToArray(), out iContextMenu, out m_ComInterface); m_ComInterface2 = m_ComInterface as IContextMenu2; m_ComInterface3 = m_ComInterface as IContextMenu3; m_MessageWindow = new MessageWindow(this); }
/// <summary> /// Initializes a new instance of the <see cref="ShellContextMenu"/> class. /// </summary> /// /// <param name="items"> /// The items to which the context menu should refer. /// </param> /// <param name="svgio"></param> /// <param name="view">The ShellView the ContextMenu is associated with</param> public ShellContextMenu(IListItemEx[] items, SVGIO svgio = SVGIO.SVGIO_SELECTION, ShellView view = null) { this._ShellView = view; if (svgio == SVGIO.SVGIO_BACKGROUND) Initialize(items[0]); else Initialize(items); }
public FOperationProgressSink(ShellView view) { this._View = view; this.CurrentFolder = view.CurrentFolder; }
private void ConditionallySelectFiles(ConditionalSelectData csd, ShellView ShellListView) { if (csd == null) return; //The following items are added var Matches_Name = new List<BExplorer.Shell._Plugin_Interfaces.IListItemEx>(); var Matches_Size = new List<BExplorer.Shell._Plugin_Interfaces.IListItemEx>(); var Matches_DateCreated = new List<BExplorer.Shell._Plugin_Interfaces.IListItemEx>(); var Matches_DateLastModified = new List<BExplorer.Shell._Plugin_Interfaces.IListItemEx>(); var Matches_LastAccessed = new List<BExplorer.Shell._Plugin_Interfaces.IListItemEx>(); ShellListView.DeSelectAllItems(); if (csd.FilterByFileName) { foreach (var item in ShellListView.Items) { var data = new FileInfo(item.ParsingName); string ToFind = csd.FileNameData.matchCase ? data.Name : data.Name.ToLowerInvariant(); switch (csd.FileNameData.filter) { case ConditionalSelectParameters.FileNameFilterTypes.Contains: if (ToFind.Contains(csd.FileNameData.matchCase ? csd.FileNameData.query : csd.FileNameData.query.ToLowerInvariant())) Matches_Name.Add(item); break; case ConditionalSelectParameters.FileNameFilterTypes.StartsWith: if (ToFind.StartsWith(csd.FileNameData.query)) Matches_Name.Add(item); break; case ConditionalSelectParameters.FileNameFilterTypes.EndsWith: if (ToFind.EndsWith(csd.FileNameData.query)) Matches_Name.Add(item); break; case ConditionalSelectParameters.FileNameFilterTypes.Equals: if (ToFind == csd.FileNameData.query) Matches_Name.Add(item); break; case ConditionalSelectParameters.FileNameFilterTypes.DoesNotContain: if (!ToFind.Contains(csd.FileNameData.query)) Matches_Name.Add(item); break; case ConditionalSelectParameters.FileNameFilterTypes.NotEqualTo: if (ToFind != csd.FileNameData.query) Matches_Name.Add(item); break; default: break; } } } else { //Matches_Name.AddRange(shells.Where((x) => !Directory.Exists(x.ParsingName))); } if (csd.FilterByFileSize) { foreach (var item in Matches_Name) { var data = new FileInfo(item.ParsingName); switch (csd.FileSizeData.filter) { case ConditionalSelectParameters.FileSizeFilterTypes.LargerThan: if (data.Length > csd.FileSizeData.query1) Matches_Size.Add(item); break; case ConditionalSelectParameters.FileSizeFilterTypes.SmallerThan: if (data.Length < csd.FileSizeData.query1) Matches_Size.Add(item); break; case ConditionalSelectParameters.FileSizeFilterTypes.Equals: if (data.Length == csd.FileSizeData.query1) Matches_Size.Add(item); break; case ConditionalSelectParameters.FileSizeFilterTypes.Between: long largebound, smallbound; if (csd.FileSizeData.query2 > csd.FileSizeData.query1) { smallbound = csd.FileSizeData.query1; largebound = csd.FileSizeData.query2; } else if (csd.FileSizeData.query2 < csd.FileSizeData.query1) { smallbound = csd.FileSizeData.query2; largebound = csd.FileSizeData.query1; } else { if (data.Length == csd.FileSizeData.query1) Matches_Size.Add(item); break; } if (data.Length > smallbound && data.Length < largebound) Matches_Size.Add(item); break; case ConditionalSelectParameters.FileSizeFilterTypes.NotEqualTo: if (data.Length != csd.FileSizeData.query1) Matches_Size.Add(item); break; case ConditionalSelectParameters.FileSizeFilterTypes.NotBetween: long largebound2, smallbound2; if (csd.FileSizeData.query2 > csd.FileSizeData.query1) { smallbound2 = csd.FileSizeData.query1; largebound2 = csd.FileSizeData.query2; } else if (csd.FileSizeData.query2 < csd.FileSizeData.query1) { smallbound2 = csd.FileSizeData.query2; largebound2 = csd.FileSizeData.query1; } else { // they are the same, use Unequal code if (data.Length != csd.FileSizeData.query1) Matches_Size.Add(item); break; } if (data.Length < smallbound2 || data.Length > largebound2) Matches_Size.Add(item); break; default: break; } } } else { Matches_Size.AddRange(Matches_Name); } if (csd.FilterByDateCreated) Matches_DateCreated.AddRange(!csd.FilterByDateCreated ? Matches_Size : DateFilter(Matches_Size, csd.DateCreatedData, x => x.CreationTimeUtc)); if (csd.FilterByDateModified) Matches_DateLastModified.AddRange(!csd.FilterByDateModified ? Matches_Size : DateFilter(Matches_DateCreated, csd.DateModifiedData, x => x.LastWriteTimeUtc)); if (csd.FilterByDateAccessed) Matches_LastAccessed.AddRange(!csd.FilterByDateAccessed ? Matches_DateLastModified : DateFilter(Matches_DateLastModified, csd.DateAccessedData, x => x.LastAccessTimeUtc)); ShellListView.SelectItems( Matches_Name. Union(Matches_Size). Union(Matches_Size). Union(Matches_DateCreated). Union(Matches_DateLastModified). Union(Matches_LastAccessed ).ToArray()); ShellListView.Focus(); }
public static IOrderedEnumerable <IListItemEx> SetSortCollumn(this IEnumerable <IListItemEx> items, ShellView view, Boolean isReorder, Collumns column, SortOrder order, Boolean reverseOrder = true) { if (column == null) { column = view.Collumns.FirstOrDefault(); } try { IOrderedEnumerable <IListItemEx> result = null; //var selectedItems = this.SelectedItems.ToArray(); if (column.ID == view.LastSortedColumnId && reverseOrder) { // Reverse the current sort direction for this column. view.LastSortOrder = view.LastSortOrder == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending; } else { // Set the column number that is to be sorted; default to ascending. view.LastSortedColumnId = column.ID; view.LastSortOrder = order; } if (isReorder) { var itemsQuery = items.Where(w => view.ShowHidden || !w.IsHidden).OrderByDescending(o => o.IsFolder); if (column.CollumnType != typeof(String)) { if (order == SortOrder.Ascending) { result = itemsQuery.ThenBy(o => o.GetPropertyValue(column.pkey, typeof(String)).Value ?? "1"); } else { result = itemsQuery.ThenByDescending(o => o.GetPropertyValue(column.pkey, typeof(String)).Value ?? "1"); } } else { if (order == SortOrder.Ascending) { result = itemsQuery.ThenBy(o => o.GetPropertyValue(column.pkey, typeof(String)).Value?.ToString(), NaturalStringComparer.Default); } else { result = itemsQuery.ThenByDescending(o => o.GetPropertyValue(column.pkey, typeof(String)).Value?.ToString(), NaturalStringComparer.Default); } } var i = 0; } //var colIndexReal = view.Collumns.IndexOf(view.Collumns.FirstOrDefault(w => w.ID == view.LastSortedColumnId)); //if (colIndexReal > -1) { // User32.SendMessage(view.LVHandle, MSG.LVM_SETSELECTEDCOLUMN, colIndexReal, 0); // view.SetSortIcon(colIndexReal, order); //} else { // User32.SendMessage(view.LVHandle, MSG.LVM_SETSELECTEDCOLUMN, -1, 0); //} //if (!this.IsRenameInProgress) { // this.SelectItems(selectedItems); //} return(result); } catch { return(null); } }
public void LoadIcons(ShellView shellView, bool isLibrary) { tbLibrary.Text = @"C:\Windows\System32\imageres.dll"; this._ShellView = shellView; this._IsLibrary = isLibrary; ShowDialog(); }
public void AttachToListView(ShellView listView, Int32 type) { this._ShellViewEx = listView; User32.SendMessage(listView.LVHandle, MSG.LVM_SETIMAGELIST, type, this.Handle); }