Пример #1
0
        private void ScopeHome([NotNull] object sender, [NotNull] RoutedEventArgs e)
        {
            Debug.ArgumentNotNull(sender, nameof(sender));
            Debug.ArgumentNotNull(e, nameof(e));

            ItemTreeView.ScopeHome();
        }
Пример #2
0
        private void GoClick([NotNull] object sender, [NotNull] RoutedEventArgs e)
        {
            Debug.ArgumentNotNull(sender, nameof(sender));
            Debug.ArgumentNotNull(e, nameof(e));

            ItemTreeView.FindItem(Find.Text);
        }
Пример #3
0
        private void FilterChanged([NotNull] object sender, [NotNull] EventArgs e)
        {
            Debug.ArgumentNotNull(sender, nameof(sender));
            Debug.ArgumentNotNull(e, nameof(e));

            ItemTreeView.Filter(Filter.Text);
        }
        private void MoveFolders([NotNull] ItemTreeView itemTreeView, [NotNull] IEnumerable <ConnectionFolderTreeViewItem> items, [NotNull] string folder)
        {
            Debug.ArgumentNotNull(itemTreeView, nameof(itemTreeView));
            Debug.ArgumentNotNull(items, nameof(items));
            Debug.ArgumentNotNull(folder, nameof(folder));

            foreach (var item in items.ToList())
            {
                var oldFolder = item.Folder;
                var newFolder = Path.Combine(folder, Path.GetFileName(oldFolder) ?? string.Empty);

                if (string.Compare(oldFolder, newFolder, StringComparison.InvariantCultureIgnoreCase) == 0)
                {
                    continue;
                }

                Directory.Move(oldFolder, newFolder);
                ConnectionManager.MoveFolder(oldFolder, newFolder);

                var parent = item.GetAncestor <ItemsControl>();
                if (parent != null)
                {
                    parent.Items.Remove(item);
                }
                else
                {
                    itemTreeView.TreeView.Items.Remove(item);
                }
            }
        }
Пример #5
0
        public GutterContext([NotNull] ItemTreeView contentTree, [NotNull] IEnumerable <BaseTreeViewItem> selectedItems)
        {
            Assert.ArgumentNotNull(contentTree, nameof(contentTree));
            Assert.ArgumentNotNull(selectedItems, nameof(selectedItems));

            SelectedItems = selectedItems;
            ContentTree   = contentTree;
        }
        public TemplateHierarchyItemTreeViewContext([NotNull] ItemTreeView contentTree, [NotNull] IEnumerable <BaseTreeViewItem> selectedItems, [NotNull] TemplateHierarchyTab templateHierarchyTab) : base(contentTree, selectedItems)
        {
            Assert.ArgumentNotNull(contentTree, nameof(contentTree));
            Assert.ArgumentNotNull(selectedItems, nameof(selectedItems));
            Assert.ArgumentNotNull(templateHierarchyTab, nameof(templateHierarchyTab));

            TemplateHierarchyTab = templateHierarchyTab;
        }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cbItems_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cbWithItems = (ComboBox)sender;

            if (MarketItemSelected((MarketLog)cbWithItems.SelectedItem, cbWithItems.SelectedIndex != 0))
            {
                ItemTreeView.SelectByTag(cbWithItems.SelectedItem);
            }
        }
Пример #8
0
        private void ScopeForward([NotNull] object sender, [NotNull] RoutedEventArgs e)
        {
            Debug.ArgumentNotNull(sender, nameof(sender));
            Debug.ArgumentNotNull(e, nameof(e));

            if (ItemTreeView.CanGoForward)
            {
                ItemTreeView.ScopeForward();
            }
        }
Пример #9
0
        private void FindKeyDown([NotNull] object sender, [NotNull] KeyEventArgs e)
        {
            Debug.ArgumentNotNull(sender, nameof(sender));
            Debug.ArgumentNotNull(e, nameof(e));

            if (e.Key != Key.Enter)
            {
                return;
            }

            ItemTreeView.FindItem(Find.Text);
        }
Пример #10
0
        public void Locate([NotNull] ItemUri itemUri)
        {
            Assert.ArgumentNotNull(itemUri, nameof(itemUri));

            Activate();

            ItemTreeView.TreeView.Clear();
            var treeViewItem = ItemTreeView.ExpandTo(itemUri);

            if (treeViewItem != null)
            {
                treeViewItem.BringIntoView();
                treeViewItem.IsSelected = true;
                Keyboard.Focus(treeViewItem);
            }
            else
            {
                Keyboard.Focus(ItemTreeView.TreeView);
            }
        }
 public SelectItemDialogContext([NotNull] SelectItemDialog dialog, [NotNull] ItemTreeView contentTree, [NotNull] IEnumerable <BaseTreeViewItem> selectedItems) : base(contentTree, selectedItems)
 {
     Dialog = dialog;
 }
Пример #12
0
        /// <summary>
        /// The initial load of Market logs from cache files.
        /// ...
        /// TODO: write the rest...
        /// ...
        /// Fills the item ComboBox.
        /// </summary>
        private void LoadMarketLogsFromCache()
        {
            try
            {
                MarketLog ml;
                Parser    p = new Parser();

                //reset market logs
                Values.dtMarketLogsListTable = DataHandler.CreateMarketLogsListTable();

                EveCacheParser.Parser.SetCachedFilesFolders("CachedMethodCalls");
                EveCacheParser.Parser.SetIncludeMethodsFilter("GetOrders");
                FileInfo[]    cachedFiles = EveCacheParser.Parser.GetMachoNetCachedFiles();
                DirectoryInfo di          = new DirectoryInfo(Values.MarketLogPath + "\\Cache");
                if (!di.Exists)
                {
                    di.Create();
                }
                Hashtable htItems = _htAvailLogItems;

                //EVEMon's integrated unified uploader deletes cache files so we have to protect them
                foreach (FileInfo fi in cachedFiles)
                {
                    fi.CopyTo(Values.MarketLogPath + "\\Cache\\" + fi.Name, true);
                }

                foreach (FileInfo fi in di.GetFiles())
                {
                    ml = p.parseCachedMarketLog(fi, ref Values.dRegionNames);
                    if (ml != null)
                    {
                        Values.dtMarketLogsListTable.Rows.Add(DataHandler.MarketLogToDataRow(ml, Values.dtMarketLogsListTable));
                        // make list for item selection combobox, filter by date created from options
                        if (!htItems.Contains(ml.ItemHash))
                        {
                            // If Date filtering is set and logs created date is less than set date, then skip it.
                            if (Values.IsLogsDateFilterSet && ml.Created < Values.LogsDateFilter)
                            { /* skip */
                            }
                            else
                            {
                                htItems.Add(ml.ItemHash, ml);
                            }
                        }
                    }
                    // Step the progress bar
                    toolStripProgressBar1.PerformStep();
                    //pbGeneralProgressbar.PerformStep();
                }

                // Put the unique item in an arraylist to sort and use as datasource for combobox
                ArrayList alItems = new ArrayList();
                MarketLog mlFirstInlistMessage = new MarketLog {
                    Item = "!!!"
                };
                alItems.Insert(0, mlFirstInlistMessage);
                alItems.InsertRange(1, htItems.Values);
                MarketLogComparer compareOn = new MarketLogComparer(MarketLogCompareField.Item);
                alItems.Sort(compareOn);

                // Check for any items at all
                _isMarketlogsLoaded       = alItems.Count > 1;
                mlFirstInlistMessage.Item = _isMarketlogsLoaded ? Values.MSG_SELECT_ITEM : Values.MSG_NO_LOGS;

                cbItems.DataSource       = alItems;
                cbItems.MaxDropDownItems = 25;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, Values.MSG_ERROR);
            }
            // Clear the progressbar
            toolStripProgressBar1.Value = 0;

            // Load the market tree view
            if (!splitContainerMain.Panel1Collapsed && _isMarketlogsLoaded)
            {
                ItemTreeView.LoadTreeView(ref _htAvailLogItems);
            }

            LightErrorHandler();
        }