// Token: 0x06000300 RID: 768 RVA: 0x0001AF0C File Offset: 0x0001910C
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("OwaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = null;
            state  = null;
            action = null;
            HttpRequest request     = owaContext.HttpContext.Request;
            UserContext userContext = owaContext.UserContext;

            if (!Utilities.IsPostRequest(request))
            {
                return(userContext.LastClientViewState.ToPreFormActionResponse());
            }
            string             type2 = owaContext.FormsRegistryContext.Type;
            NavigationModule   navigationModuleFromStoreType   = MoveItemHelper.GetNavigationModuleFromStoreType(type2);
            ApplicationElement applicationElementFromStoreType = MoveItemHelper.GetApplicationElementFromStoreType(type2);

            if ((navigationModuleFromStoreType == NavigationModule.Calendar && !userContext.IsFeatureEnabled(Feature.Calendar)) || (navigationModuleFromStoreType == NavigationModule.Contacts && !userContext.IsFeatureEnabled(Feature.Contacts)))
            {
                throw new OwaSegmentationException("The " + type + " feature is disabled");
            }
            StoreObjectId[] storeObjectIdsFromForm        = RequestParser.GetStoreObjectIdsFromForm(request, true);
            StoreObjectId   folderIdFromQueryString       = RequestParser.GetFolderIdFromQueryString(request, true);
            StoreObjectId   targetFolderIdFromQueryString = RequestParser.GetTargetFolderIdFromQueryString(request, true);
            string          formParameter = Utilities.GetFormParameter(request, "hidt");

            string[] array = formParameter.Split(new char[]
            {
                ','
            });
            if (array.Length != storeObjectIdsFromForm.Length)
            {
                throw new OwaInvalidRequestException("The counts of the items and their types are not identical.");
            }
            ItemOperations.Result result = null;
            if (navigationModuleFromStoreType == NavigationModule.Mail && applicationElementFromStoreType == ApplicationElement.Item)
            {
                result = ItemOperations.GetNextViewItem(userContext, ItemOperations.Action.Delete, storeObjectIdsFromForm[0], folderIdFromQueryString);
            }
            if (!MoveItemPreFormAction.DoMove(targetFolderIdFromQueryString, storeObjectIdsFromForm, array, owaContext))
            {
                PreFormActionResponse preFormActionResponse = new PreFormActionResponse();
                preFormActionResponse.ApplicationElement = ApplicationElement.Dialog;
                preFormActionResponse.Type   = owaContext.FormsRegistryContext.Type;
                preFormActionResponse.Action = owaContext.FormsRegistryContext.Action;
                preFormActionResponse.AddParameter("fid", folderIdFromQueryString.ToBase64String());
                return(preFormActionResponse);
            }
            if (result != null)
            {
                owaContext[OwaContextProperty.InfobarMessage] = null;
            }
            userContext.ForceNewSearch = true;
            return(ItemOperations.GetPreFormActionResponse(userContext, result));
        }
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            state  = string.Empty;
            action = string.Empty;
            HttpContext httpContext = owaContext.HttpContext;
            UserContext userContext = owaContext.UserContext;
            HttpRequest request     = httpContext.Request;

            if (!Utilities.IsPostRequest(request) && owaContext.FormsRegistryContext.Action != "Prev" && owaContext.FormsRegistryContext.Action != "Next")
            {
                return(userContext.LastClientViewState.ToPreFormActionResponse());
            }
            string storeObjectId;
            string storeObjectId2;

            if (Utilities.IsPostRequest(request))
            {
                storeObjectId  = Utilities.GetFormParameter(request, "hidfldid", true);
                storeObjectId2 = Utilities.GetFormParameter(request, "hidid", true);
            }
            else
            {
                storeObjectId  = Utilities.GetQueryStringParameter(request, "fId", true);
                storeObjectId2 = Utilities.GetQueryStringParameter(request, "id", true);
            }
            StoreObjectId folderId       = Utilities.CreateStoreObjectId(userContext.MailboxSession, storeObjectId);
            StoreObjectId storeObjectId3 = Utilities.CreateStoreObjectId(userContext.MailboxSession, storeObjectId2);

            ItemOperations.Result result = null;
            string action2;

            if ((action2 = owaContext.FormsRegistryContext.Action) != null)
            {
                if (!(action2 == "Prev"))
                {
                    if (!(action2 == "Next"))
                    {
                        if (!(action2 == "Del"))
                        {
                            if (!(action2 == "Junk"))
                            {
                                if (!(action2 == "NotJunk"))
                                {
                                    goto IL_1FA;
                                }
                                if (!userContext.IsJunkEmailEnabled)
                                {
                                    throw new OwaInvalidRequestException(LocalizedStrings.GetNonEncoded(552277155));
                                }
                                owaContext[OwaContextProperty.InfobarMessage] = JunkEmailHelper.MarkAsNotJunk(userContext, new StoreObjectId[]
                                {
                                    storeObjectId3
                                });
                                userContext.ForceNewSearch = true;
                            }
                            else
                            {
                                if (!userContext.IsJunkEmailEnabled)
                                {
                                    throw new OwaInvalidRequestException(LocalizedStrings.GetNonEncoded(552277155));
                                }
                                owaContext[OwaContextProperty.InfobarMessage] = JunkEmailHelper.MarkAsJunk(userContext, new StoreObjectId[]
                                {
                                    storeObjectId3
                                });
                                userContext.ForceNewSearch = true;
                            }
                        }
                        else
                        {
                            result = ItemOperations.DeleteItem(userContext, storeObjectId3, folderId);
                            userContext.ForceNewSearch = true;
                        }
                    }
                    else
                    {
                        result = ItemOperations.GetNextViewItem(userContext, ItemOperations.Action.Next, storeObjectId3, folderId);
                    }
                }
                else
                {
                    result = ItemOperations.GetNextViewItem(userContext, ItemOperations.Action.Prev, storeObjectId3, folderId);
                }
                return(ItemOperations.GetPreFormActionResponse(userContext, result));
            }
IL_1FA:
            throw new OwaInvalidRequestException("Unknown command");
        }