예제 #1
0
        /// <summary>
        /// A method used to compose ROP command to execute ROP call.
        /// </summary>
        /// <param name="ropType">A parameter represents the ROP Type refers to a specific ROP call.</param>
        /// <param name="inputServerObjectHandle">A parameter represents an input Server object handle.</param>
        /// <param name="propertyValue">A parameter represents a TaggedPropertyValue structure.</param>
        /// <returns>A return value represents a byte array of serialized ROP command.</returns>
        public static byte[] ComposeRgbIn(ROPCommandType ropType, uint inputServerObjectHandle, TaggedPropertyValue propertyValue)
        {
            ComposeROPCommand composeROPCommand = new ComposeROPCommand();

            switch (ropType)
            {
                case ROPCommandType.RopSynchronizationImportDeletes:
                    return composeROPCommand.ComposeRopSynchronizationImportDeletes(inputServerObjectHandle, propertyValue);

                default:
                    throw new InvalidCastException("Invalid ROP command type");
            }
        }
예제 #2
0
 /// <summary>
 /// A method used to compose ROP command to execute ROP call.
 /// </summary>
 /// <param name="ropType">A parameter represents the ROP Type refers to a specific ROP call.</param>
 /// <param name="inputServerObjectHandle">A parameter represents an input Server object handle.</param>
 /// <param name="auxInfo">The auxInfo point to the object executed by this ROP call. 
 /// It could be a folder handle, a message handle or an attachment handle or the count to be operated.</param>
 /// <returns>A return value represents a byte array of serialized ROP command.</returns>
 public static byte[] ComposeRgbIn(ROPCommandType ropType, uint inputServerObjectHandle, ulong auxInfo)
 {
     ComposeROPCommand composeROPCommand = new ComposeROPCommand();
     
     // UserDN used for logon request.
     string userDN = null;
     
     switch (ropType)
     {
         case ROPCommandType.RopLogon:
             userDN = Common.GetConfigurationPropertyValue("AdminUserEssdn", site) + "\0";
             return composeROPCommand.ComposeLogonRequest(userDN, (uint)auxInfo);
         case ROPCommandType.RopLogonNormalUser:
             userDN = Common.GetConfigurationPropertyValue("NormalUserEssdn", site) + "\0";
             return composeROPCommand.ComposeLogonRequest(userDN, (uint)auxInfo);
         case ROPCommandType.RopCreateMessage:
             return composeROPCommand.ComposeCreateMessageRequest(inputServerObjectHandle, auxInfo);
         case ROPCommandType.RopOpenStream:
             return composeROPCommand.ComposeOpenStreamRequest(inputServerObjectHandle, auxInfo);
         case ROPCommandType.RopReadStream:
             return composeROPCommand.ComposeReadStreamRequest(inputServerObjectHandle, (uint)auxInfo);
         case ROPCommandType.RopCommitStream:
             return composeROPCommand.ComposeCommitStreamRequest(inputServerObjectHandle);
         case ROPCommandType.RopWriteStream:
             return composeROPCommand.ComposeWriteStreamRequest(inputServerObjectHandle);
         case ROPCommandType.RopOpenFolder:
             return composeROPCommand.ComposeOpenFolderRequest(inputServerObjectHandle, auxInfo);
         case ROPCommandType.RopGetHierarchyTable:
             return composeROPCommand.ComposeGetHierarchyTableRequest(inputServerObjectHandle);
         case ROPCommandType.RopSaveChangesMessage:
             return composeROPCommand.ComposeSaveChangesMessageRequest(inputServerObjectHandle);
         case ROPCommandType.RopQueryRows:
             return composeROPCommand.ComposeQueryRowsRequest(inputServerObjectHandle, (ushort)auxInfo);
         case ROPCommandType.RopFastTransferSourceCopyMessages:
             return composeROPCommand.ComposeFastTransferSourceCopyMessagesRequest(inputServerObjectHandle, auxInfo);
         case ROPCommandType.RopFastTransferSourceGetBuffer:
             return composeROPCommand.ComposeRopFastTransferSourceGetBufferRequest(inputServerObjectHandle, (ushort)auxInfo);
         case ROPCommandType.RopSetColumns:
             return composeROPCommand.ComposeSetColumnsRequest(inputServerObjectHandle);
         case ROPCommandType.RopRegisterNotification:
             return composeROPCommand.ComposeRegisterNotifyEvents(inputServerObjectHandle, auxInfo);
         case ROPCommandType.WithoutRops:
             return composeROPCommand.BuildRequestBuffer();
         case ROPCommandType.MultipleRops:
             return composeROPCommand.ComposeMultipleRops(inputServerObjectHandle);
         case ROPCommandType.RopGetContentsTable:
             return composeROPCommand.ComposeGetContentsTableRequest(inputServerObjectHandle, (byte)auxInfo);
         case ROPCommandType.RopLongTermIdFromId:
             return composeROPCommand.ComposeRopLongTermIdFromId(inputServerObjectHandle, auxInfo);
         case ROPCommandType.RopSynchronizationOpenCollector:
             return composeROPCommand.ComposeRopSynchronizationOpenCollector(inputServerObjectHandle);
         case ROPCommandType.RopSynchronizationImportMessageChange:
             return composeROPCommand.ComposeRopSynchronizationImportMessageChange(inputServerObjectHandle, (byte)auxInfo);
         case ROPCommandType.RopCreateFolder:
             return composeROPCommand.ComposeCreateFolderRequest(inputServerObjectHandle, site);
         case ROPCommandType.RopDeleteFolder:
             return composeROPCommand.ComposeDeleteFolderRequest(inputServerObjectHandle, auxInfo);
         case ROPCommandType.RopRelease:
             return composeROPCommand.ComposeRopReleaseRequest(inputServerObjectHandle);
         case ROPCommandType.RopHardDeleteMessagesAndSubfolders:
             return composeROPCommand.ComposeRopHardDeleteMessagesAndSubfolders(inputServerObjectHandle);
         default:
             throw new InvalidCastException("Invalid ROP command type");
     }
 }