public void LoadItems(ISPCView view, List <ISPCItem> items, string listItemCollectionPositionNext, int itemCount)
        {
            if (listItemCollectionPositionNext != String.Empty)
            {
                NextButton.Enabled = true;
                if (ListItemCollectionPositionNexts[(CurrentPageIndex + 1).ToString()] == null)
                {
                    ListItemCollectionPositionNexts.Add((CurrentPageIndex + 1).ToString(), listItemCollectionPositionNext);
                }
            }
            else
            {
                NextButton.Enabled = false;
            }
            if (CurrentPageIndex > 0)
            {
                PreviousButton.Enabled = true;
            }
            int startIndex = CurrentPageIndex * view.RowLimit + 1;
            int endIndex   = startIndex + itemCount - 1;

            if (endIndex == 0)
            {
                startIndex = 0;
            }
            PagingLabel.Text = startIndex.ToString() + " - " + endIndex.ToString();

            OutlookConnector.GetConnector(view.SiteSetting).BindItemsToListViewControl(SelectedFolder, view, items, LibraryContentDataGridView);
        }
        private void ChangeView(ISPCView selectedView)
        {
            SortedFieldName  = String.Empty;
            IsAsc            = true;
            CurrentPageIndex = 0;
            ListItemCollectionPositionNexts = new NameValueCollection();
            ListItemCollectionPositionNexts.Add("0", String.Empty);
            string listItemCollectionPositionNext = String.Empty;
            int    itemCount;
            string currentListItemCollectionPositionNext = ListItemCollectionPositionNexts[(CurrentPageIndex).ToString()];

            List <ISPCItem> items = OutlookConnector.GetConnector(selectedView.SiteSetting).GetListItems(SelectedFolder, selectedView, SortedFieldName, IsAsc, CurrentPageIndex, currentListItemCollectionPositionNext, CustomFilters, out listItemCollectionPositionNext, out itemCount);

            EUView view = selectedView as EUView;

            if (view != null)
            {
                SelectedView = SharePointManager.GetView(view.WebURL, view.ListName, view.Name, view.SiteSetting);
            }
            else
            {
                SelectedView = selectedView;
            }

            object[] args = new object[4] {
                SelectedView, items, listItemCollectionPositionNext, itemCount
            };
            this.Invoke(new UpdateContentDataGridViewHandler(UpdateContentDataGridView), args);
        }
예제 #3
0
        public void BindItemsToListViewControl(ISPCFolder folder, ISPCView view, List <ISPCItem> items, DataGridView LibraryContentDataGridView)
        {
            EUFolder _folder = folder as EUFolder;

            for (int i = LibraryContentDataGridView.Columns.Count - 1; i > 2; i--)
            {
                LibraryContentDataGridView.Columns.RemoveAt(i);
            }
            for (int i = 0; i < view.ViewFields.Count; i++)
            {
                string fieldName = view.ViewFields[i].Name;
                LibraryContentDataGridView.Columns.Add(fieldName, fieldName);
                if (fieldName == "DocIcon" || fieldName == "Attachments")
                {
                    LibraryContentDataGridView.Columns[fieldName].Visible = false;
                }
                LibraryContentDataGridView.Columns[fieldName].Tag = fieldName;
            }
            LibraryContentDataGridView.Rows.Clear();
            foreach (EUListItem item in items)
            {
                int             newRowIndex = LibraryContentDataGridView.Rows.Add();
                DataGridViewRow newRow      = LibraryContentDataGridView.Rows[newRowIndex];
                BindListItemToRow(item, newRow, _folder.IsDocumentLibrary, view);
            }
        }
        public List <ISPCItem> GetViewItems(ISPCView view, string sortField, bool isAsc, int pageIndex, EUCamlFilters filters, out string listItemCollectionPositionNext, out int itemCount)
        {
            string            currentListItemCollectionPositionNext = ListItemCollectionPositionNexts[(pageIndex).ToString()];
            IOutlookConnector connector = OutlookConnector.GetConnector(view.SiteSetting);

            return(connector.GetListItems(SelectedFolder, view, sortField, isAsc, CurrentPageIndex, currentListItemCollectionPositionNext, filters, out listItemCollectionPositionNext, out itemCount));
        }
        public void BindItemsToListViewControl(ISPCFolder folder, ISPCView view, List <ISPCItem> items, DataGridView LibraryContentDataGridView)
        {
            for (int i = LibraryContentDataGridView.Columns.Count - 1; i > 1; i--)
            {
                LibraryContentDataGridView.Columns.RemoveAt(i);
            }
            LibraryContentDataGridView.Columns.Add("TitleColumn", "Title");
            LibraryContentDataGridView.Columns["TitleColumn"].Tag = "TitleColumn";

            LibraryContentDataGridView.Rows.Clear();
            foreach (ISPCItem item in items)
            {
                int             newRowIndex = LibraryContentDataGridView.Rows.Add();
                DataGridViewRow newRow      = LibraryContentDataGridView.Rows[newRowIndex];

                string fileName      = item.Title;
                string extensionName = String.Empty;
                if (fileName.LastIndexOf(".") > 0)
                {
                    extensionName = fileName.Substring(fileName.LastIndexOf(".") + 1).ToLower();
                }

                newRow.Cells["ExtensionImageColumn"].Value = ImageManager.GetInstance().GetExtensionImageFromResource(extensionName);
                newRow.Cells["FilePathColumn"].Value       = item.URL;
                newRow.Cells["TitleColumn"].Value          = item.Title;
                newRow.Tag = item;
            }
        }
        public void UpdateContentDataGridView(ISPCView selectedView, List <ISPCItem> items, string listItemCollectionPositionNext, int itemCount)
        {
            NextButton.Enabled     = false;
            PreviousButton.Enabled = false;

            LoadItems(selectedView, items, listItemCollectionPositionNext, itemCount);
            LoadingPictureBox.Visible = false;
        }
        public List <ISPCItem> GetListItems(ISPCFolder folder, ISPCView view, string sortField, bool isAsc, int currentPageIndex, string currentListItemCollectionPositionNext, EUCamlFilters filters, out string listItemCollectionPositionNext, out int itemCount)
        {
            listItemCollectionPositionNext = String.Empty;
            itemCount = 0;
            GFolder _folder = folder as GFolder;

            return(GMailManager.GetInstance().GetItems(folder.SiteSetting, folder));
        }
        public List <ISPCItem> GetListItems(ISPCFolder folder, ISPCView view, string sortField, bool isAsc, int currentPageIndex, string currentListItemCollectionPositionNext, EUCamlFilters filters, out string listItemCollectionPositionNext, out int itemCount)
        {
            FSFolder _folder = (FSFolder)folder;

            listItemCollectionPositionNext = String.Empty;
            itemCount = Directory.GetFiles(_folder.Path).Count();
            List <ISPCItem> items = new List <ISPCItem>();

            foreach (string filePath in Directory.GetFiles(_folder.Path))
            {
                FileInfo fileInfo = new FileInfo(filePath);
                FSItem   item     = new FSItem(folder.SiteSetting, filePath, fileInfo.Name, filePath);
                items.Add(item);
            }
            return(items);
        }
        private void ViewsComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ISPCView selectedView = ViewsComboBox.SelectedItem as ISPCView;

            if (selectedView == null)
            {
                return;
            }
            LoadingPictureBox.Visible = true;
            BackgroundWorkerAction    = "ChangeView";
            if (ChangeViewBackgroundWorker.IsBusy == true)
            {
                MessageBox.Show("Background engine is busy right now, Please try again later.");
                return;
            }
            ChangeViewBackgroundWorker.RunWorkerAsync(selectedView);
        }
 public void BindItemsToListViewControl(ISPCFolder folder, ISPCView view, List <ISPCItem> items, DataGridView LibraryContentDataGridView)
 {
     throw new Exception("Not implemented");
 }
 public List <ISPCItem> GetListItems(ISPCFolder folder, ISPCView view, string sortField, bool isAsc, int currentPageIndex, string currentListItemCollectionPositionNext, EUCamlFilters filters, out string listItemCollectionPositionNext, out int itemCount)
 {
     throw new Exception("Not implemented");
 }
예제 #12
0
        public static void BindListItemToRow(EUListItem listItem, DataGridViewRow row, bool isDocumentLibrary, ISPCView view)
        {
            string title = String.Empty;

            if (isDocumentLibrary == true)
            {
                string fileName      = listItem.Title;
                string extensionName = String.Empty;
                if (fileName.LastIndexOf(".") > 0)
                {
                    extensionName = fileName.Substring(fileName.LastIndexOf(".") + 1).ToLower();
                }
                title = fileName;
                row.Cells["ExtensionImageColumn"].Value = ImageManager.GetInstance().GetExtensionImageFromResource(extensionName);
            }
            else
            {
                title = listItem.Title;
                row.Cells["ExtensionImageColumn"].Value = ImageManager.GetInstance().GetExtensionImageFromResource("list");
            }
            if (listItem.CheckoutUser != String.Empty)
            {
                row.Cells["ExtensionImageColumn"].Style.BackColor = Color.MediumSeaGreen;
            }

            row.Cells["TitleColumn"].Value    = title;
            row.Cells["FilePathColumn"].Value = listItem.URL;
            for (int i = 0; i < view.ViewFields.Count; i++)
            {
                string fieldName = view.ViewFields[i].Name;
                if (listItem.Properties["ows_" + fieldName] != null)
                {
                    row.Cells[fieldName].Value = listItem.Properties["ows_" + fieldName].Value;
                }
            }
            row.Tag = listItem;
        }
예제 #13
0
        public List <ISPCItem> GetListItems(ISPCFolder folder, ISPCView view, string sortField, bool isAsc, int currentPageIndex, string currentListItemCollectionPositionNext, EUCamlFilters filters, out string listItemCollectionPositionNext, out int itemCount)
        {
            EUFolder _folder = folder as EUFolder;

            return(SharePointManager.GetListItems(folder.SiteSetting, (EUView)view, sortField, isAsc, _folder.IsDocumentLibrary, _folder.WebUrl, _folder.ListName, _folder.FolderPath, currentListItemCollectionPositionNext, filters, out listItemCollectionPositionNext, out itemCount));
        }