예제 #1
0
        public static String DownloadError(DownloadErrorType type, Boolean loggedUser, Boolean inModalWindow, long idItem, long idVersion, String name, Guid workingSessionId, Guid idNews, long idModule = -1, long idLink = -1)
        {
            String url = "Modules/Repository/ItemDownload" + ((loggedUser || inModalWindow) ? "" : "External") + (!inModalWindow ? "" : "Modal") + ".aspx?type=" + type.ToString() + "&idItem=" + idItem.ToString() + "&idVersion=" + idVersion.ToString() +
                         GetDownloadQuery((workingSessionId == Guid.Empty ? "" : workingSessionId.ToString()), (idNews == Guid.Empty ? "" : idNews.ToString()), idModule, idLink, true);

            return(url);
        }
예제 #2
0
        private void downloadError(DownloadErrorType error, string otherMessage)
        {
            tryDeleteTempFile();
            switch (error)
            {
            case DownloadErrorType.DOWNLOAD_COMPLETED_ERROR:
                MessageBox.Show("Произошла ошибка во время загрузки файла", "Обновление MultiCheat", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                break;

            case DownloadErrorType.TIMEOUT:
                MessageBox.Show("Превышение времени ожидания. Проверьте подключение к интернету", "Обновление MultiCheat", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                break;

            case DownloadErrorType.WEB_ERROR:
                MessageBox.Show("Ошибка во время подключения: " + otherMessage, "Обновление MultiCheat", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                break;
            }
            Hide();
            Program.StartProgram();
        }
예제 #3
0
        public void InitView(Boolean isExternalPage, long idItem, long idVersion, Int32 idModule, long idLink, DownloadErrorType type)
        {
            liteRepositoryItem item = (idItem > 0) ? Service.ItemGet(idItem) : null;
            Int32 idCommunity       = (idLink > 0 ? Service.ModuleLinkGetIdSourceCommunity(idLink) : 0);

            if (item != null)
            {
                RepositoryType repositoryType = (item.IdCommunity > 0 ? RepositoryType.Community : RepositoryType.Portal);
                switch (repositoryType)
                {
                case RepositoryType.Community:
                    if (idCommunity == 0)
                    {
                        idCommunity = item.IdCommunity;
                    }
                    View.InitializeCommunityView(item.DisplayName, item.Extension, type, item.IdCommunity, ((idCommunity > 0) ? CurrentManager.GetCommunityName(idCommunity) : ""));
                    break;

                case RepositoryType.Portal:
                    View.InitializePortalView(item.DisplayName, item.Extension, type);
                    break;
                    break;
                }
            }
            else
            {
                View.InitializeView(type);
            }
            if (isExternalPage)
            {
                View.InitializeContext(GetContext(idCommunity, idItem, idVersion, idModule, item));
            }
            else
            {
                View.InitializeContext();
            }
        }