• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PanelPreferences类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PanelPreferences的典型用法代码示例。如果您正苦于以下问题:C# PanelPreferences类的具体用法?C# PanelPreferences怎么用?C# PanelPreferences使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PanelPreferences类属于命名空间,在下文中一共展示了PanelPreferences类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: StudyQuestionnairePostToDeployments

        public static CookieJar StudyQuestionnairePostToDeployments(CookieJar cookieJar, PanelPreferences preferences)
        {
            var studyQuestionnaireViewUrl = new Uri(preferences.PanelAdminUrl + "StudyQuestionnaireView.aspx");

            string questionnaireViewToDeployFormParams = GetQuestionnaireViewToDeployFormParams(studyQuestionnaireViewUrl, cookieJar.SourceCode);
            var bytes = Encoding.ASCII.GetBytes(questionnaireViewToDeployFormParams);

            var questionnaireViewToDeployRequest = AutomationHelper.CreatePost(studyQuestionnaireViewUrl, cookieJar);
            questionnaireViewToDeployRequest.Referer = preferences.PanelAdminUrl + "HomeView.aspx";
            questionnaireViewToDeployRequest.ContentLength = bytes.Length;

            using (Stream os = questionnaireViewToDeployRequest.GetRequestStream())
            {
                os.Write(bytes, 0, bytes.Length);
            }

            var response = (HttpWebResponse)questionnaireViewToDeployRequest.GetResponse();
            string cookies = response.Headers["Set-Cookie"];
            string pageSource = String.Empty;
            using (var reader = new StreamReader(response.GetResponseStream()))
            {
                pageSource = reader.ReadToEnd();
            }

            cookieJar.VcAuthentication = AutomationHelper.GetVcAuthentication(cookies);
            cookieJar.UniqueRequestId = AutomationHelper.GetReqId(cookies);

            response.Close();
            return cookieJar;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:30,代码来源:StudyQuestionnaire.cs


示例2: ValidateStudyPost

        public static CookieJar ValidateStudyPost(CookieJar cookieJar, PanelPreferences preferences)
        {
            var studyQuestionnaireViewUrl = new Uri(preferences.PanelAdminUrl + "StudyQuestionnaireView.aspx");
            string questionnaireViewFormParams = GetQuestionnaireViewFormParams(studyQuestionnaireViewUrl, cookieJar.SourceCode);
            var bytes = Encoding.ASCII.GetBytes(questionnaireViewFormParams);

            var questionnaireViewRequest = AutomationHelper.CreatePost(studyQuestionnaireViewUrl, cookieJar);
            questionnaireViewRequest.Referer = preferences.PanelAdminUrl + "HomeView.aspx";
            questionnaireViewRequest.ContentLength = bytes.Length;

            questionnaireViewRequest.Headers.Add("Cookie", "ASP.NET_SessionId=" + cookieJar.AspNetSessionId + "; .VCPanelAuth=" + cookieJar.VcAuthentication + "; " + ".reqid=" + cookieJar.UniqueRequestId + "; " + " .vcmach=" + cookieJar.MachineId);

            using (Stream os = questionnaireViewRequest.GetRequestStream())
            {
                os.Write(bytes, 0, bytes.Length);
            }

            var response = (HttpWebResponse)questionnaireViewRequest.GetResponse();
            string cookies = response.Headers["Set-Cookie"];
            string pageSource = String.Empty;
            using (var reader = new StreamReader(response.GetResponseStream()))
            {
                pageSource = reader.ReadToEnd();
            }

            cookieJar.SourceCode = pageSource;
            cookieJar.VcAuthentication = AutomationHelper.GetVcAuthentication(cookies);
            cookieJar.UniqueRequestId = AutomationHelper.GetReqId(cookies);

            response.Close();
            return cookieJar;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:32,代码来源:StudyQuestionnaire.cs


示例3: HomeViewGet

        public static CookieJar HomeViewGet(CookieJar cookieJar, PanelPreferences preferences)
        {
            var client = new WebClient();

            client.Headers.Add("Pragma", "no-cache");
            client.Headers.Add("Accept", "text/html, application/xhtml+xml, */*");
            client.Headers.Add("Accept-Encoding", "gzip, deflate");
            client.Headers.Add("Accept-Language", "en-US");
            client.Headers.Add("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
            client.Headers.Add("Referer", preferences.PanelAdminUrl + "HomeView.aspx");

            client.Headers.Add("Cookie", "ASP.NET_SessionId=" + cookieJar.AspNetSessionId + "; .VCPanelAuth=" + cookieJar.VcAuthentication + ";");

            var source = client.DownloadString(preferences.PanelAdminUrl + "ChangePasswordView.aspx");

            string cookies = client.ResponseHeaders["Set-Cookie"];

            cookieJar.MachineId = AutomationHelper.GetVcMach(cookies);
            cookieJar.VcAuthentication = AutomationHelper.GetVcAuthentication(cookies);
            cookieJar.UniqueRequestId = AutomationHelper.GetReqId(cookies);

            client.Dispose();

            return cookieJar;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:25,代码来源:Home.cs


示例4: HomeViewPostToPanelSettingsManager

        public static CookieJar HomeViewPostToPanelSettingsManager(CookieJar cookieJar, PanelPreferences preferences)
        {
            //Added for Panel settings will be fecthed from UI not from WebConfig
            var homeViewUrl = new Uri(preferences.PanelAdminUrl + "HomeView.aspx");
            string homeViewFormParams = GetHomeViewFormParams();
            var bytes = Encoding.ASCII.GetBytes(homeViewFormParams);

            var homeViewRequest = AutomationHelper.CreatePost(homeViewUrl, cookieJar);
            homeViewRequest.Referer = preferences.PanelAdminUrl + "HomeView.aspx";
            homeViewRequest.ContentLength = bytes.Length;

            using (Stream os = homeViewRequest.GetRequestStream())
            {
                os.Write(bytes, 0, bytes.Length);
            }

            var response = (HttpWebResponse)homeViewRequest.GetResponse();
            string cookies = response.Headers["Set-Cookie"];
            string pageSource = String.Empty;
            using (var reader = new StreamReader(response.GetResponseStream()))
            {
                pageSource = reader.ReadToEnd();
            }

            cookieJar.SourceCode = pageSource;
            cookieJar.VcAuthentication = AutomationHelper.GetVcAuthentication(cookies);
            cookieJar.UniqueRequestId = AutomationHelper.GetReqId(cookies);

            response.Close();
            return cookieJar;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:31,代码来源:Home.cs


示例5: GetContextCollection

        public ContextCollection GetContextCollection(PanelPreferences preferences)
        {
            CookieJar = preferences.CookieJar;
            ContextCollection collection;
            try
            {
                if (CookieJar.SourceCode.IndexOf("Settings are locked by VcAdmin") > 0)
                {
                    throw new Exception("Settings are currently locked, navigate away from settings, recycle or wait");
                }
                collection = new ContextCollection(CookieJar.SourceCode);
            }
            catch (Exception e)
            {
                // attempt to Navigate away to attempt not to lock panel settings
                try
                {
                    PanelSettingsManagement.PanelSettingsPostToAssetManager(CookieJar, preferences);
                }
                catch (Exception) { }
                throw e;
            }

            return collection;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:25,代码来源:AutomationService.cs


示例6: SetUpContext

        public LinkInfo SetUpContext(PanelPreferences preferences, string skinFolderPath)
        {
            // Offline and Advanced mode Changes

            var linkInfo = new LinkInfo {FolderName = Res.FolderName};
            if (!preferences.OfflineMode)
            {
                CookieJar = Login(preferences);

                CookieJar = Home.HomeViewPostToPanelSettingsManager(CookieJar, preferences);  //Source code here contains the Panel Settings Form

                var collection = new ContextCollection(CookieJar.SourceCode);

                ContextInfo contextInfo = collection.FindAvailableContext();
                Environment = contextInfo.Environment;

                collection.UpdateFormValue(contextInfo.ContextIndex, -1, "OpenPortalSkinFolder", contextInfo.SubDomain);
                collection.UpdateFormValue(contextInfo.ContextIndex, -1, "PortalSkinPath", Res.PortalSkinPathParent + "/" + contextInfo.SubDomain + "/");
                collection.UpdateFormValue(contextInfo.ContextIndex, -1, "IsHidden", "False");
                collection.UpdateFormValue(contextInfo.ContextIndex, -1, "Name", preferences.CompanyName + " Portal");
                // Added for Language selection
                collection.UpdateFormValue(contextInfo.ContextIndex, -1, "Culture", preferences.Language);

                PanelSettingsManagement.PanelSettingsUpdatePost(CookieJar, collection, preferences);
                linkInfo.FolderName = contextInfo.SubDomain;
                linkInfo.PortalLink = contextInfo.OpenPortalTestBaseUrl; //TODO CHANGE TO LIVE LINK
            }
            return linkInfo;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:29,代码来源:AutomationService.cs


示例7: CommunicationPostToAssetManager

        public static void CommunicationPostToAssetManager(PanelPreferences preferences)
        {
            var communicationViewUrl = new Uri(preferences.PanelAdminUrl + "CommunicationsManagementView.aspx");
            string panelSettingsViewFormParams = GetCommunicationToAssetManagerFormParams();
            var bytes = Encoding.ASCII.GetBytes(panelSettingsViewFormParams);

            var homeViewRequest = AutomationHelper.CreatePost(communicationViewUrl, preferences.CookieJar);
            homeViewRequest.Referer = preferences.PanelAdminUrl + "CommunicationsManagementView.aspx";
            homeViewRequest.ContentLength = bytes.Length;

            using (Stream os = homeViewRequest.GetRequestStream())
            {
                os.Write(bytes, 0, bytes.Length);
            }

            var response = (HttpWebResponse)homeViewRequest.GetResponse();
            string cookies = response.Headers["Set-Cookie"];
            string pageSource = String.Empty;
            using (var reader = new StreamReader(response.GetResponseStream()))
            {
                pageSource = reader.ReadToEnd();
            }

            preferences.CookieJar.UniqueRequestId = AutomationHelper.GetReqId(cookies);

            response.Close();
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:27,代码来源:Communication.cs


示例8: AuthenticationPost

        public static CookieJar AuthenticationPost(string viewState, CookieJar cookieJar, PanelPreferences preferences)
        {
            var authenticationViewUrl = new Uri(preferences.PanelAdminUrl + "AuthenticationView.aspx");
            string authenticationFormParams = GetAuthFormParams(viewState, preferences);
            byte[] bytes = Encoding.ASCII.GetBytes(authenticationFormParams);

            var authenticationRequest = AutomationHelper.CreatePost(authenticationViewUrl, cookieJar);
            authenticationRequest.Headers.Remove("Cookie");
            authenticationRequest.Referer = preferences.PanelAdminUrl + "AuthenticationView.aspx";
            authenticationRequest.ContentLength = bytes.Length;
            authenticationRequest.AllowAutoRedirect = false;

            using (Stream os = authenticationRequest.GetRequestStream())
            {
                os.Write(bytes, 0, bytes.Length);
            }

            var response = (HttpWebResponse)authenticationRequest.GetResponse();

            string cookies = response.Headers["Set-Cookie"];

            cookieJar.AspNetSessionId = AutomationHelper.GetSessionId(cookies);
            cookieJar.VcAuthentication = AutomationHelper.GetVcAuthentication(cookies);

            response.Close();

            return cookieJar;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:28,代码来源:Authorization.cs


示例9: Index

        public ActionResult Index(LoginPreferences loginPreferences)
        {
            var preferencesModel = new PreferencesModel();

            var mainDir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + @"\Content\Skins\Templates");
            int templateCount = mainDir.GetDirectories().Count(dir => (dir.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden);
            preferencesModel.HdnLayoutCount = templateCount.ToString();

            var lstOffline = new List<SelectListItem>();
            preferencesModel.AvailableContextSelectList = new SelectList(lstOffline);

            //Added for availablecontext
            if (!loginPreferences.OfflineMode)
            {

                var preferences = new PanelPreferences
                                      {
                                          PanelAdminEmail = loginPreferences.PanelAdminEmail,
                                          PanelAdminUrl = loginPreferences.PanelAdminUrl,
                                          PanelPassword = loginPreferences.PanelPassword
                                      };
                preferences.CookieJar = _automationService.GetCookieJar(preferences);
                preferences.ContextCollection = _automationService.GetContextCollection(preferences.CookieJar);
                var contextItemList = _automationService.GetAllContextItemsList(preferences);
                var lstAdvancedMode = new List<SelectListItem>();
                foreach (var contextItem in contextItemList)
                {
                    string[] contextInfo = { contextItem.ContextInfo.ContextIndex.ToString(), contextItem.ContextInfo.Culture, contextItem.ContextInfo.Environment, contextItem.ContextInfo.OpenPortalLiveBaseUrl, contextItem.ContextInfo.SubDomain, contextItem.ContextInfo.OpenPortalTestBaseUrl };
                    string contextValues = string.Join(Constants.Separator, contextInfo);
                    lstAdvancedMode.Add(new SelectListItem { Text = contextItem.ContextName, Value = contextValues });
                }

                preferencesModel.AvailableContextSelectList = lstAdvancedMode;
                Session["Collection"] = preferences.ContextCollection;
                Session["CookieJar"] = preferences.CookieJar;

            }

            preferencesModel.QuestionnaireSelectList = new SelectList(_automationService.PxmlManager.GetPxmlList(Server.MapPath(Res.PQsDirectoryPath)), "PxmlName", "PxmlName");

            preferencesModel.QuickPollVisible = true;
            preferencesModel.NewsletterVisible = true;

            //---- Code commented by Optimus : Code was used for the static controls on the web page---
            /*
            preferencesModel.PrimaryTextHexCode = "000000";
            preferencesModel.SecondaryTextHexCode = "333333";
            preferencesModel.PageBackgroundHexCode = "FFFFFF";
            preferencesModel.ContentBackgroundHexCode = "FFFFFF";
            */
            preferencesModel.PanelAdminUrl = loginPreferences.PanelAdminUrl;
            preferencesModel.PanelAdminEmail = loginPreferences.PanelAdminEmail;
            preferencesModel.PanelPassword = loginPreferences.PanelPassword;
            preferencesModel.OfflineMode = loginPreferences.OfflineMode;

            // Clear session variable by Optimus
            Session[Res.SessionTemplates] = null;

            return View(preferencesModel);
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:60,代码来源:HomeController.cs


示例10: GetUpdateLanguageAndSkinPostForms

        private static string GetUpdateLanguageAndSkinPostForms(string environment, PanelPreferences preferences)
        {
            const string eventTarget = "ApplyButton";
            string eventArgument = String.Empty;
            const string vcViewState = "13";
            string viewState = String.Empty;
            const string ctlCurrentXPos = "0";
            const string ctlCurrentYPos = "0";
            const string loggingOut = "false";
            string oPersistObject_FormElement = String.Empty;
            string nmPick = String.Empty;
            string ctl_NM_ContextData = String.Empty;
            string ctl_onlineHelpMenu = String.Empty;
            const string stabs = "%7B%22State%22%3A%7B%7D%2C%22TabState%22%3A%7B%22sTabs_ctl06%22%3A%7B%22Selected%22%3Atrue%7D%7D%7D";
            string openDateValue = String.Empty;
            string closeDateValue = String.Empty;
            const string languageDropDownInput = "English+%28US%29+%28default%29";

            //Edited  for Language Selection
            //string languageDropDownValue = "en-CA";
            string languageDropDownValue = preferences.Language;
            const string languageDropDownText = "English+%28US%29+%28default%29";
            string languageDropDownClientWidth = String.Empty;
            string languageDropDownClientHeight = String.Empty;
            string environmentDropDownInput = environment;
            string environmentDropDownValue = String.Empty;
            string environmentDropDownText = environment;
            string environmentDropDownClientWidth = String.Empty;
            string environmentDropDownClientHeight = String.Empty;

            var builder = new StringBuilder();
            builder.Append("__EVENTTARGET=" + eventTarget);
            builder.Append("&__EVENTARGUMENT=" + eventArgument);
            builder.Append("&__VisionCriticalVIEWSTATE=" + vcViewState);
            builder.Append("&__VIEWSTATE=" + viewState);
            builder.Append("&ctl08%24CurrentXPos=" + ctlCurrentXPos);
            builder.Append("&ctl08%24CurrentYPos=" + ctlCurrentYPos);
            builder.Append("&LogginOut=" + loggingOut);
            builder.Append("&oPersistObject_FormElement=" + oPersistObject_FormElement);
            builder.Append("&nmPick=" + nmPick);
            builder.Append("&ctl08_NM_ContextData=" + ctl_NM_ContextData);
            builder.Append("&ctl08_OnlineHelpCtxMenu_ContextData=" + ctl_onlineHelpMenu);
            builder.Append("&sTabs=" + stabs);
            builder.Append("&OpenDate%24DateValue=" + openDateValue);
            builder.Append("&CloseDate%24DateValue=" + closeDateValue);
            builder.Append("&CascadingContext%24LanguageDropDown_Input=" + languageDropDownInput);
            builder.Append("&CascadingContext%24LanguageDropDown_value=" + languageDropDownValue);
            builder.Append("&CascadingContext%24LanguageDropDown_text=" + languageDropDownText);
            builder.Append("&CascadingContext%24LanguageDropDown_clientWidth=" + languageDropDownClientWidth);
            builder.Append("&CascadingContext%24LanguageDropDown_clientHeight=" + languageDropDownClientHeight);
            builder.Append("&CascadingContext%24EnvironmentDropDown_Input=" + environmentDropDownInput);
            builder.Append("&CascadingContext%24EnvironmentDropDown_value=" + environmentDropDownValue);
            builder.Append("&CascadingContext%24EnvironmentDropDown_text=" + environmentDropDownText);
            builder.Append("&CascadingContext%24EnvironmentDropDown_clientWidth=" + environmentDropDownClientWidth);
            builder.Append("&CascadingContext%24EnvironmentDropDown_clientHeight=" + environmentDropDownClientHeight);

            return builder.ToString();
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:58,代码来源:AnonymousLink.cs


示例11: GetAuthFormParams

 private static string GetAuthFormParams(string viewState,PanelPreferences preferences)
 {
     const string eventTarget = "LoginBtn";
     const string eventArgument = "";
     string emailText = preferences.PanelAdminEmail;
     string passwordText =PasswordUtill.Decrypt(preferences.PanelPassword);
     string formParameters = String.Format("__EVENTTARGET={0}&__EVENTARGUMENT={1}&__VIEWSTATE={2}&eMailText={3}&PasswordText={4}", eventTarget, eventArgument, viewState, emailText, passwordText);
     return formParameters;
 }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:9,代码来源:Authorization.cs


示例12: CreateSkin

 public OfflineLinks CreateSkin(PanelPreferences preferences, string skinFolderPath, string appDataPath, string newFolderName)
 {
     SkinManager.CopyGenericFilesToUploadFolders(preferences.HdnSelectedLayout, skinFolderPath);
     SkinManager.ExtractUploadFolderZipFiles(skinFolderPath);
     SkinManager.DeleteUnusedZipFiles(skinFolderPath);
     SkinManager.UpdateSkin(preferences, skinFolderPath, appDataPath);
     OfflineLinks offlineLinks = SkinManager.CompressSkinFolder(skinFolderPath, newFolderName);
     return offlineLinks;
 }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:9,代码来源:AutomationService.cs


示例13: CreateSkin

 public OfflineLinks CreateSkin(PanelPreferences preferences, string skinFolderPath, string dataPath, string newFolderName)
 {
     // TODO the template path shouldn't be under the scratch path where we create
     //      the packages. For session support the scratch folder should be independent
     // remove the old update folder
     SkinManager manager = new SkinManager(skinFolderPath);
     manager.DeleteUploadFolders();
     manager.CreateDirectoriesAndUnzipFiles(preferences.HdnSelectedLayout);
     manager.UpdateSkin(preferences, dataPath);
     OfflineLinks offlineLinks = manager.CompressNewSkins(newFolderName);
     manager.DeleteUploadFolders();
     return offlineLinks;
 }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:13,代码来源:AutomationService.cs


示例14: CreateSurveyTestLink

 public string CreateSurveyTestLink(PanelPreferences preferences, string pqFolderPath)
 {
     CookieJar = AssetManager.AssetManagerPostToHomeView(CookieJar, preferences);
     CookieJar = Home.HomeViewPostToImportNewStudyView(CookieJar, preferences);
     CookieJar = ImportNewStudy.ImportNewPxmlStudy(CookieJar, PxmlManager.GetPxml(pqFolderPath, preferences.QuestionnaireName), preferences);
     CookieJar = StudyStatus.StudyStatusPostToStudyQuestionnaire(CookieJar, preferences);
     CookieJar = StudyQuestionnaire.ValidateStudyPost(CookieJar, preferences);
     CookieJar = StudyQuestionnaire.StudyQuestionnairePostToDeployments(CookieJar, preferences);
     CookieJar = StudyDeployment.DeploymentsPostToAnonymousLinkView(CookieJar, preferences);
     CookieJar = AnonymousLink.UpdateLanguageAndSkinPost(CookieJar, Environment, preferences);
     string testLink = AutomationHelper.ExtractTestLink(CookieJar.SourceCode);
     return testLink;
 }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:13,代码来源:AutomationService.cs


示例15: GetViewState

        public static string GetViewState(PanelPreferences preferences)
        {
            var client = new WebClient();

            client.Headers.Add("Pragma", "no-cache");
            client.Headers.Add("Accept", "text/html, application/xhtml+xml, */*");
            client.Headers.Add("Accept-Encoding", "gzip, deflate");
            client.Headers.Add("Accept-Language", "en-US");
            client.Headers.Add("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");

            var buffer = client.DownloadData(preferences.PanelAdminUrl + "AuthenticationView.aspx");
            string viewState = ParseViewState(Decompress(buffer));
            client.Dispose();

            return viewState;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:16,代码来源:Authorization.cs


示例16: SetUpContext

        public LinkInfo SetUpContext(PanelPreferences preferences, string skinFolderPath)
        {
            // Offline and Advanced mode Changes by Optimus

            var linkInfo = new LinkInfo {FolderName = Res.FolderName};
            if (!preferences.OfflineMode)
            {
                CookieJar = Login(preferences);

                try
                {
                    CookieJar = Home.HomeViewPostToPanelSettingsManager(CookieJar, preferences);  //Source code here contains the Panel Settings Form

                    if (CookieJar.SourceCode.IndexOf("Settings are locked by VcAdmin") > 0)
                    {
                        throw new Exception("Settings are currently locked, navigate away from settings, recycle or wait");
                    }
                    var collection = new ContextCollection(CookieJar.SourceCode);

                    ContextInfo contextInfo = collection.FindAvailableContext();
                    Environment = contextInfo.Environment;

                    collection.UpdateFormValue(contextInfo.ContextIndex, -1, "OpenPortalSkinFolder", contextInfo.FolderName());
                    collection.UpdateFormValue(contextInfo.ContextIndex, -1, "PortalSkinPath", Res.PortalSkinPathParent + "/" + contextInfo.FolderName() + "/");
                    collection.UpdateFormValue(contextInfo.ContextIndex, -1, "IsHidden", "False");
                    collection.UpdateFormValue(contextInfo.ContextIndex, -1, "Name", preferences.CompanyName + " Portal");

                    // Added for Language selection by Optimus
                    collection.UpdateFormValue(contextInfo.ContextIndex, -1, "Culture", preferences.Language);

                    PanelSettingsManagement.PanelSettingsUpdatePost(CookieJar, collection, preferences);
                    linkInfo.FolderName = contextInfo.FolderName();
                    linkInfo.PortalLink = contextInfo.OpenPortalTestBaseUrl; //TODO CHANGE TO LIVE LINK
                }
                catch (Exception e)
                {
                    // attempt to Navigate away to attempt not to lock panel settings
                    try
                    {
                        PanelSettingsManagement.PanelSettingsPostToAssetManager(CookieJar, preferences);
                    }
                    catch (Exception) { }
                    throw e;
                }
            }
            return linkInfo;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:47,代码来源:AutomationService.cs


示例17: Index

 public ActionResult Index(int[] selectedIndex)
 {
     try
     {
         var preferences = new PanelPreferences();
         List<ManagePanelModel> contextInformationList = new List<ManagePanelModel>();
         preferences.ContextCollection = (ContextCollection)Session["ContextCollection"];
         preferences.CookieJar = (CookieJar)Session["CookieJar"];
         preferences.PanelAdminUrl = Session["PanelAdminUrl"].ToString();
         _automationService.MakeContextAvailable(preferences, selectedIndex);
         contextInformationList = _automationService.GetUnavailableContextItemsList(preferences);
         return View(contextInformationList);
     }
     catch (Exception e)
     {
         var errorModel = new ErrorModel { Exception = e };
         return View("Error", errorModel);
     }
 }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:19,代码来源:ManagePanelController.cs


示例18: EditNewEmailTemplate

 public static void EditNewEmailTemplate(PanelPreferences preferences, EmailTemplate emailTemplate, string eid)
 {
     var communicationViewUrl = new Uri(preferences.PanelAdminUrl + "EmailWindow.aspx");
     string communicationViewFormParams = GetEmailEditViewFormParams(emailTemplate, eid);
     var bytes = Encoding.ASCII.GetBytes(communicationViewFormParams);
     var communicationsRequest = AutomationHelper.CreatePost(communicationViewUrl, preferences.CookieJar);
     communicationsRequest.Referer = preferences.PanelAdminUrl + "EmailWindow.aspx";
     communicationsRequest.ContentLength = bytes.Length;
     using (Stream os = communicationsRequest.GetRequestStream())
     {
         os.Write(bytes, 0, bytes.Length);
     }
     var response = (HttpWebResponse)communicationsRequest.GetResponse();
     string pageSource = String.Empty;
     using (var reader = new StreamReader(response.GetResponseStream()))
     {
         pageSource = reader.ReadToEnd();
     }
     response.Close();
 }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:20,代码来源:Communication.cs


示例19: CreateSkin

        // Modified  by Khushbu for phase 2 task 'Allow the UI to load previously generated zip files in order to pre-populate the form'.
        // Now this function will return created SkinPackage Link.
        public string CreateSkin(PanelPreferences preferences, string skinFolderPath, string dataPath, string newFolderName)
        {
            // TODO the template path shouldn't be under the scratch path where we create
            //      the packages. For session support the scratch folder should be independent
            // remove the old update folder
            SkinManager manager = new SkinManager(skinFolderPath);
            manager.DeleteUploadFolders();
            // manager.CreateDirectoriesAndUnzipFiles(preferences.HdnSelectedLayout);
            manager.CreateDirectoriesAndUnzipFiles(preferences.HdnSelectedLayoutName); // Modified by K.G. for phase 2 task.now operation  will be performed based on Template name rather than index.

            manager.UpdateSkin(preferences, dataPath);

            manager.UpdateEmailTemplates(preferences, dataPath, newFolderName);// Added by K.G(07/12/2011) to update email template files according to user entered values.

            manager.UpdateSubstitutionFile(preferences); // Added by K.G for phase 2 task. update the sbstitution file according to user selected value .

            string SkinPackageLink = manager.CompressNewSkins(newFolderName); // Added by K.G for phase 2 task. Returned only one link for created pacakage.

            return SkinPackageLink;
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:22,代码来源:AutomationService.cs


示例20: PanelSettingsUpdatePost

        public static void PanelSettingsUpdatePost(ContextCollection collection, PanelPreferences preferences)
        {
            var panelSettingsViewUrl = new Uri(preferences.PanelAdminUrl + "PanelSettingsManagementView.aspx");
            string panelSettingsViewFormParams = GetPanelSettingsViewFormParams(collection.GetFormString());
            var bytes = Encoding.ASCII.GetBytes(panelSettingsViewFormParams);

            var panelSettingsRequest = AutomationHelper.CreatePost(panelSettingsViewUrl, preferences.CookieJar);
            panelSettingsRequest.Referer = preferences.PanelAdminUrl + "PanelSettingsManagementView.aspx";
            panelSettingsRequest.ContentLength = bytes.Length;

            using (Stream os = panelSettingsRequest.GetRequestStream())
            {
                os.Write(bytes, 0, bytes.Length);
            }

            var response = (HttpWebResponse)panelSettingsRequest.GetResponse();
            string cookies = response.Headers["Set-Cookie"];
            preferences.CookieJar.VcAuthentication = AutomationHelper.GetVcAuthentication(cookies);
            preferences.CookieJar.UniqueRequestId = AutomationHelper.GetReqId(cookies);

            response.Close();
        }
开发者ID:abhishekverma18,项目名称:TestRepo,代码行数:22,代码来源:PanelSettingsManagement.cs



注:本文中的PanelPreferences类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Pango类代码示例发布时间:2022-05-24
下一篇:
C# Panel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap