コード例 #1
0
ファイル: Reference.cs プロジェクト: vinhdoan/Angroup.demo
 /// <remarks/>
 public void GetFolderAsync(GetFolderType GetFolder1, object userState) {
     if ((this.GetFolderOperationCompleted == null)) {
         this.GetFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFolderOperationCompleted);
     }
     this.InvokeAsync("GetFolder", new object[] {
                 GetFolder1}, this.GetFolderOperationCompleted, userState);
 }
コード例 #2
0
        /********************************************************************
          * GET UNREAD ITEM COUNT FROM A FOLDER
          ********************************************************************/
        public static int GetUnreadFolderItemsCount(String folderName)
        {
            int unReadCount = -1;
            // Identify the folder properties to return.
            FolderResponseShapeType properties = new FolderResponseShapeType();
            PathToUnindexedFieldType ptuft = new PathToUnindexedFieldType();
            ptuft.FieldURI = UnindexedFieldURIType.folderManagedFolderInformation;
            PathToUnindexedFieldType[] ptufts = new PathToUnindexedFieldType[1] { ptuft };
            properties.AdditionalProperties = ptufts;
            properties.BaseShape = DefaultShapeNamesType.AllProperties;

            // Form the get folder request.
            BaseFolderIdType p_folder = FindFolderID(folderName);

            GetFolderType request = new GetFolderType();
            request.FolderIds = new BaseFolderIdType[1] { p_folder };
            request.FolderShape = properties;

            // Send the request and get the response.
            GetFolderResponseType response = service.GetFolder(request);

            ArrayOfResponseMessagesType aormt = response.ResponseMessages;
            LogicLayer.ExchangeWebServices.ResponseMessageType[] rmta = aormt.Items;
            foreach (LogicLayer.ExchangeWebServices.ResponseMessageType rmt in rmta)
            {
                if (rmt.ResponseClass == ResponseClassType.Error)
                {
                    throw new Exception(rmt.MessageText);
                }
                else
                {
                    FolderInfoResponseMessageType firmt;
                    firmt = (rmt as FolderInfoResponseMessageType);
                    BaseFolderType[] folders = firmt.Folders;

                    foreach (BaseFolderType rfolder in folders)
                    {
                        if (rfolder is FolderType)
                        {
                            FolderType myFolder;
                            myFolder = (rfolder as FolderType);
                            if (myFolder.UnreadCountSpecified)
                            {
                                unReadCount = myFolder.UnreadCount;
                            }
                        }
                    }
                }
            }
            return unReadCount;
        }
コード例 #3
0
ファイル: Reference.cs プロジェクト: vinhdoan/Angroup.demo
 /// <remarks/>
 public void GetFolderAsync(GetFolderType GetFolder1) {
     this.GetFolderAsync(GetFolder1, null);
 }