Пример #1
0
        /// <summary>
        /// Checks if the folder exists or not.
        /// </summary>		
        /// <param name="path">Parent folder path</param>
        /// <param name="folderName">Name of the folder to search</param>
        /// <returns>True if found, else false.</returns>
        private bool CheckExist(ItemTypeEnum type, string path, string folderName)
        {
            string fullPath = path + folderName;

            // Condition criteria.
            SearchCondition[] conditions;

            // Condition criteria.
            SearchCondition condition = new SearchCondition();
            condition.Condition = ConditionEnum.Contains;
            condition.ConditionSpecified = true;
            condition.Name = "Name";
            switch (type)
            {
                case ItemTypeEnum.Unknown:
                    break;
                case ItemTypeEnum.Folder:
                    condition.Value = folderName;
                    break;
                case ItemTypeEnum.Report:
                    break;
                case ItemTypeEnum.Resource:
                    break;
                case ItemTypeEnum.LinkedReport:
                    break;
                case ItemTypeEnum.DataSource:
                    path += folderName.Substring(0, folderName.LastIndexOf('/'));
                    condition.Value = folderName.Substring(folderName.LastIndexOf('/') + 1);
                    break;
                case ItemTypeEnum.Model:
                    break;
                default:
                    break;
            }
            conditions = new SearchCondition[1];
            conditions[0] = condition;

            this.ReturnedItems = ReportingService.FindItems(path, BooleanOperatorEnum.Or,
                conditions);

            // Iterate thro' each report properties to get the path.
            foreach (CatalogItem item in ReturnedItems)
            {
                if (item.Type == type)
                {
                    if (item.Path == fullPath)
                        return true;
                }
            }
            return false;
        }
Пример #2
0
 /// <remarks/>
 public void FindItemsAsync(string Folder, BooleanOperatorEnum BooleanOperator, SearchCondition[] Conditions) {
     this.FindItemsAsync(Folder, BooleanOperator, Conditions, null);
 }
Пример #3
0
 /// <remarks/>
 public void FindItemsAsync(string Folder, BooleanOperatorEnum BooleanOperator, SearchCondition[] Conditions, object userState) {
     if ((this.FindItemsOperationCompleted == null)) {
         this.FindItemsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnFindItemsOperationCompleted);
     }
     this.InvokeAsync("FindItems", new object[] {
                 Folder,
                 BooleanOperator,
                 Conditions}, this.FindItemsOperationCompleted, userState);
 }
Пример #4
0
 public CatalogItem[] FindItems(string Folder, BooleanOperatorEnum BooleanOperator, SearchCondition[] Conditions) {
     object[] results = this.Invoke("FindItems", new object[] {
                 Folder,
                 BooleanOperator,
                 Conditions});
     return ((CatalogItem[])(results[0]));
 }