public MainForm() { InitializeComponent(); formParameters = new FormParameters(); formVisualElements = new FormVisualElements(); updatebleForms = new List <IDataUpdatble>(); }
public CheckoutFormParams GetCheckoutFormParams(FormParameters formParams, InvoiceItem[] invoiceLines) { // normalize target site variable string targetSite = formParams["target_site"].EndsWith("/") ? formParams["target_site"] : formParams["target_site"] + "/"; CheckoutFormParams outputParams = new CheckoutFormParams(); // setup service url outputParams.Action = ServiceUrl; outputParams.Method = CheckoutFormParams.POST_METHOD; // copy command outputParams["cmd"] = CART_COMMAND; // workaround to make IPN callbacks work outputParams["rm"] = "2"; // set upload value to indicate a third-party shopping cart outputParams["upload"] = "1"; // set business outputParams["business"] = Business; // set cancel return url outputParams["cancel_return"] = String.Concat(targetSite, "?pid=ecOnlineStore&ContractId=", formParams[FormParameters.CONTRACT]); // set return url outputParams["return"] = targetSite; // set IPN-Endpoint url outputParams["notify_url"] = String.Concat(targetSite, IPN_PROCESSOR_ENDPOINT); // set invoice number outputParams["invoice"] = formParams[FormParameters.INVOICE]; // set contract number outputParams["custom"] = formParams[FormParameters.CONTRACT]; // set invoice currency outputParams["currency_code"] = formParams[FormParameters.CURRENCY]; // set formatted invoice number outputParams["item_name_1"] = String.Format("{0} #{1}", FormParameters.INVOICE, formParams[FormParameters.INVOICE]); // set invoice amount outputParams["amount_1"] = formParams[FormParameters.AMOUNT]; // copy first name AddParameter(formParams, outputParams, FormParameters.FIRST_NAME, "first_name"); // copy last name AddParameter(formParams, outputParams, FormParameters.LAST_NAME, "last_name"); // copy address AddParameter(formParams, outputParams, FormParameters.ADDRESS, "address1"); // copy city AddParameter(formParams, outputParams, FormParameters.CITY, "city"); // copy state AddParameter(formParams, outputParams, FormParameters.STATE, "state"); // copy country AddParameter(formParams, outputParams, FormParameters.COUNTRY, "country"); // copy zip AddParameter(formParams, outputParams, FormParameters.ZIP, "zip"); // copty email AddParameter(formParams, outputParams, FormParameters.EMAIL, "email"); // copy phone number if (formParams[FormParameters.COUNTRY] != "US" && formParams[FormParameters.COUNTRY] != "CA") { // phone numbers outside U.S copy as is outputParams["night_phone_b"] = formParams[FormParameters.PHONE]; } // return whole set of params return(outputParams); }
public dynamic DeletePost(string baseHostname, long id) { FormParameters form = new FormParameters(); form.Add("id", id); string url = String.Format("http://api.tumblr.com/v2/blog/{0}/post/delete", baseHostname); return _tumblr.POST(new Uri(url), form); }
private dynamic EditPost(string baseHostname, long id, FormParameters form) { form.Set("id", id); string url = String.Format("http://api.tumblr.com/v2/blog/{0}/post/edit", baseHostname); return(_tumblr.POST(new Uri(url), form)); }
internal static MvcForm BeginForm(IHtmlHelper htmlHelper, Action <MvcCoreBootstrapFormBuilder> configAction, string actionName, string controllerName, object routeValues, FormMethod method, bool?antiforgery, object htmlAttributes) { FormConfig config = new FormConfig(); configAction?.Invoke(new MvcCoreBootstrapFormBuilder(config)); FormParameters parameters = new FormParameters { Config = config, HtmlHelper = htmlHelper, Parser = new HtmlParser(), AntiForgery = antiforgery, ActionName = actionName, ControllerName = controllerName, Method = method, HtmlAttributes = htmlAttributes, RouteValues = routeValues, }; htmlHelper.ViewBag.FormConfig = config; return(new FormRenderer(parameters).Render()); }
public void AssertThatFormSentWithFile() { // **************************************** // // NOTE: Set your web form somewhere to actually test this! // // **************************************** var address = "http://localhost/testform"; var fileLocation = Path.Combine(TestContext.CurrentContext.TestDirectory, @"..\..\..\Test_files\test_file.txt"); var options = new Options { Address = address }; var formParams = new FormParameters() { InputName = "\"id\"", Value = "12345" }; var formFileParams = new FormFileParameters() { InputName = "\"file\"", FileLocation = fileLocation }; var parameters = new Parameters { FileParameteres = new[] { formFileParams }, FormParameters = new[] { formParams } }; var result = SubmitForm.SendForm(parameters, options); }
public FormMain(int idListener, List <StatisticCommon.TEC> tec) { //Создать объект - чтение зашифрованного файла с параметрами соединения s_fileConnSett = new FIleConnSett(@"connsett.ini", FIleConnSett.MODE.FILE); s_listFormConnectionSettings = new List <FormConnectionSettings>(); //Добавить элемент с параметрами соединения из объекта 'FIleConnSett' s_listFormConnectionSettings.Add(new FormConnectionSettings(-1, s_fileConnSett.ReadSettingsFile, s_fileConnSett.SaveSettingsFile)); s_listFormConnectionSettings.Add(null); Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = ProgramBase.ss_MainCultureInfo; formParameters = new FormParameters_DB(s_listFormConnectionSettings[0].ConnectionSettingsEdit); m_panel = new PanelCommonAux(formParameters.m_arParametrSetup[(int)FormParameters.PARAMETR_SETUP.COMMON_AUX_PATH]); m_panel.GetListTEC(tec); if (!(m_panel == null)) { InitializeComponent(); } else { } //???Исключение m_panel.SetDelegateReport(ErrorReport, WarningReport, ActionReport, ReportClear); }
static void Main(string[] args) { string json = "{\"Form\": \"2\"}"; FormParameters fp = JsonConvert.DeserializeObject <FormParameters>(json); Console.WriteLine("Form Id = " + fp.Form.Id); }
private void AddParameter(FormParameters inputParams, CheckoutFormParams outputParams, string inputKey, string outputKey) { string formParameter = inputParams[inputKey]; if (formParameter != null) { outputParams[outputKey] = formParameter; } }
private void LoadParamsFromStore() { FormParameters.ClearParameters(); foreach (System.Collections.DictionaryEntry den in _AbsintheState.ParameterTable) { GlobalDS.FormParam fp = (GlobalDS.FormParam)den.Value; FormParameters.AddParameter(fp.Name, fp.DefaultValue, fp.Injectable, fp.AsString); } }
public dynamic DeletePost(string baseHostname, long id) { FormParameters form = new FormParameters(); form.Add("id", id); string url = String.Format("http://api.tumblr.com/v2/blog/{0}/post/delete", baseHostname); return(_tumblr.POST(new Uri(url), form)); }
/// <summary> /// Инициализация панели /// </summary> public bool initialize(out string msgError) { bool bRes = true; msgError = string.Empty; if (s_listFormConnectionSettings[(int)CONN_SETT_TYPE.CONFIG_DB].Ready == 0) { _state = InitializeConfigDB(out msgError); switch (_state) { case -1: msgError = FormMainStatistic.MSG_ERROR_INIT[(int)FormMainStatistic.INDEX_ERROR_INIT.UNKNOWN]; break; case -3: //@"Не найден пользователь@ break; case -2: case -5: case -4: //@"Необходимо изменить параметры соединения с БД" - получено из 'Initialize' bRes = false; break; case -6: //@"Пользователю не разрешено использовать задачу" - получено из 'Initialize' break; default: //Успех... пост-инициализация formParameters = new FormParameters_DB(s_listFormConnectionSettings[(int)CONN_SETT_TYPE.CONFIG_DB].getConnSett()); updateParametersSetup(); s_iMainSourceData = Int32.Parse(formParameters.m_arParametrSetup[(int)FormParameters.PARAMETR_SETUP.MAIN_DATASOURCE]); m_panel = new PanelSourceData(SystemColors.ControlText, SystemColors.Control); m_panel.SetDelegateReport(ErrorReport, WarningReport, ActionReport, ReportClear); m_panel.Start(); #region Добавить рабочую панель на форму this._panelMain.SuspendLayout(); _panelMain.Controls.Add(this.m_panel); this._panelMain.ResumeLayout(false); this._panelMain.PerformLayout(); #endregion break; } } else {//Файла с параметрами соединения нет совсем или считанные параметры соединения не валидны msgError = @"Необходимо изменить параметры соединения с БД конфигурации"; bRes = false; } return(bRes); }
public dynamic GetDrafts(string baseHostname, string filter = null) { FormParameters query = new FormParameters { { "filter", filter }, }; string url = String.Format("http://api.tumblr.com/v2/blog/{0}/posts/draft{1}", baseHostname, query); return(_tumblr.GET(new Uri(url))); }
public dynamic GetSubmissions(string baseHostname, string offset = null, string filter = null) { FormParameters query = new FormParameters { { "offset", offset }, { "filter", filter }, }; string url = String.Format("http://api.tumblr.com/v2/blog/{0}/posts/submission{1}", baseHostname, query); return(_tumblr.GET(new Uri(url))); }
public dynamic Follow(string url) { if (url == null) throw new ArgumentNullException("url"); FormParameters form = new FormParameters { { "url", url }, }; return _tumblr.POST(new Uri("http://api.tumblr.com/v2/user/follow"), form); }
public dynamic GetLikes(int? limit = null, int? offset = null) { FormParameters query = new FormParameters { { "limit", limit }, { "offset", offset }, }; StringBuilder sb = new StringBuilder(); sb.Append("http://api.tumblr.com/v2/user/likes"); sb.Append(query); return _tumblr.GET(new Uri(sb.ToString())); }
public dynamic EditText(string baseHostname, long id, string body = null, string title = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("title", title); form.Add("body", body); return(EditPost(baseHostname, id, form)); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { JObject jo = JObject.Load(reader); int id = jo["Form"].Value <int>(); FormParameters fp = new FormParameters { Form = new Form { Id = id } }; return(fp); }
public dynamic EditAudio(string baseHostname, long id, string externalUrl = null, string caption = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("external_url", externalUrl); form.Add("caption", caption); return(EditPost(baseHostname, id, form)); }
public dynamic EditVideo(string baseHostname, long id, string embed = null, string caption = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("caption", caption); form.Add("embed", embed); return(EditPost(baseHostname, id, form)); }
public dynamic EditChat(string baseHostname, long id, string conversation = null, string title = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("conversation", conversation); form.Add("title", title); return(EditPost(baseHostname, id, form)); }
public dynamic EditQuote(string baseHostname, long id, string quote = null, string source = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("quote", quote); form.Add("source", source); return(EditPost(baseHostname, id, form)); }
/// <summary> /// Инициализация панели /// </summary> public bool initialize(out string msgError) { bool bRes = true; msgError = string.Empty; //handlerCmd(Environment.GetCommandLineArgs()); if (s_listFormConnectionSettings[(int)CONN_SETT_TYPE.CONFIG_DB].Ready == 0) { //!!! Один экземпляр для всего приложения на весь срок выполнения new DbTSQLConfigDatabase(s_listFormConnectionSettings [(int)CONN_SETT_TYPE.CONFIG_DB].getConnSett()); DbTSQLConfigDatabase.DbConfig().Register(); _state = validateUser(out msgError); switch (_state) { case -1: msgError = FormMainStatistic.MSG_ERROR_INIT[(int)FormMainStatistic.INDEX_ERROR_INIT.UNKNOWN]; break; case -3: //@"Не найден пользователь@ break; case -2: case -5: case -4: //@"Необходимо изменить параметры соединения с БД" - получено из 'Initialize' bRes = false; break; case -6: //@"Пользователю не разрешено использовать задачу" - получено из 'Initialize' break; default: //Успех... пост-инициализация formParameters = new FormParameters_DB(); updateParametersSetup(); s_iMainSourceData = Int32.Parse(formParameters.m_arParametrSetup[(int)FormParameters.PARAMETR_SETUP.MAIN_DATASOURCE]); break; } DbTSQLConfigDatabase.DbConfig().UnRegister(); } else {//Файла с параметрами соединения нет совсем или считанные параметры соединения не валидны msgError = @"Необходимо изменить параметры соединения с БД конфигурации"; bRes = false; } return(bRes); }
public dynamic GetFollowing(int?limit = null, int?offset = null) { FormParameters query = new FormParameters { { "limit", limit }, { "offset", offset }, }; StringBuilder sb = new StringBuilder(); sb.Append("http://api.tumblr.com/v2/user/following"); sb.Append(query); return(_tumblr.GET(new Uri(sb.ToString()))); }
private void menuItemExecute_Click(object sender, EventArgs e) { StrategyInfo strategyInfo = GetSelectedStrategy(); IStrategy strategy = strategyInfo.CreateStrategy().Strategy; IParameters parameters = strategy.Parameters; FormParameters frmParamSetting = new FormParameters(parameters); DialogResult result = frmParamSetting.ShowDialog(); if (result == DialogResult.OK) { RunStrategy(strategy); } }
public dynamic Unfollow(string url) { if (url == null) { throw new ArgumentNullException("url"); } FormParameters form = new FormParameters { { "url", url }, }; return(_tumblr.POST(new Uri("http://api.tumblr.com/v2/user/unfollow"), form)); }
private void LoadCookiesFromStore() { FormParameters.ClearCookies(); if (_AbsintheState.Cookies == null) { return; } foreach (System.Collections.DictionaryEntry cookie in _AbsintheState.Cookies) { FormParameters.AddCookie((string)cookie.Key, (string)cookie.Value); } }
public dynamic EditLink(string baseHostname, long id, string url = null, string title = null, string description = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("url", url); form.Add("title", title); form.Add("description", description); return(EditPost(baseHostname, id, form)); }
public dynamic EditPhoto(string baseHostname, long id, string source = null, string caption = null, string link = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("source", source); form.Add("caption", caption); form.Add("link", link); return(EditPost(baseHostname, id, form)); }
public dynamic Unlike(long id, string reblogKey) { if (reblogKey == null) { throw new ArgumentNullException("reblogKey"); } FormParameters form = new FormParameters { { "id", id }, { "reblog_key", reblogKey }, }; return(_tumblr.POST(new Uri("http://api.tumblr.com/v2/user/unlike"), form)); }
public dynamic GetTagged(string tag, int? before = null, int? limit = null, string filter = null) { if (tag == null) throw new ArgumentNullException("tag"); FormParameters form = new FormParameters { { "id", tag }, { "before", before }, { "limit", before }, { "filter", before }, }; if (String.IsNullOrEmpty(AuthorizedToken)) form.Add("api_key", ConsumerKey); return POST(new Uri("http://api.tumblr.com/v2/user/unlike"), form); }
public dynamic EditVideo(string baseHostname, long id, Stream data = null, string caption = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("caption", caption); if (data != null) { form.Add("data", TumblrClient.ReadBytes(data)); } return(EditPost(baseHostname, id, form)); }
public dynamic ReblogPost(string baseHostname, long id, string reblogKey, string type, string comment = null, TumblrPostOptions options = null) { if (options == null) { options = new TumblrPostOptions(); } FormParameters form = GetPostParameters(options); form.Add("type", type); form.Add("id", id); form.Add("reblog_key", reblogKey); form.Add("comment", comment); string url = String.Format("http://api.tumblr.com/v2/blog/{0}/post/reblog", baseHostname); return(_tumblr.POST(new Uri(url), form)); }
public dynamic GetDashboard(int? limit = null, int? offset = null, string type = null, long? sinceId = null, bool? reblogInfo = null, bool? notesInfo = null) { FormParameters query = new FormParameters { { "limit", limit }, { "offset", offset }, { "type", type }, { "since_id", sinceId}, { "reblog_info", reblogInfo}, { "notes_info", notesInfo }, }; StringBuilder sb = new StringBuilder(); sb.Append("http://api.tumblr.com/v2/user/dashboard"); sb.Append(query); return _tumblr.GET(new Uri(sb.ToString())); }
/// <summary> /// Инициализация панели /// </summary> public bool initialize(out string msgError) { bool bRes = true; msgError = string.Empty; if (s_listFormConnectionSettings[(int)CONN_SETT_TYPE.CONFIG_DB].Ready == 0) { _state = InitializeConfigDB(out msgError); switch (_state) { case -1: msgError = @"Неизвестная причина"; break; case -3: //@"Не найден пользователь@ break; case -2: case -5: case -4: //@"Необходимо изменить параметры соединения с БД" - получено из 'Initialize' bRes = false; break; case -6: //@"Пользователю не разрешено использовать задачу" - получено из 'Initialize' break; default: //Успех... пост-инициализация formParameters = new FormParameters_DB(s_listFormConnectionSettings[(int)CONN_SETT_TYPE.CONFIG_DB].getConnSett()); updateParametersSetup(); s_iMainSourceData = Int32.Parse(formParameters.m_arParametrSetup[(int)FormParameters.PARAMETR_SETUP.MAIN_DATASOURCE]); m_panel.Start(); break; } } else {//Файла с параметрами соединения нет совсем или считанные параметры соединения не валидны msgError = @"Необходимо изменить параметры соединения с БД конфигурации"; bRes = false; } return(bRes); }
/* * Survey 2.0 Release Additions */ /// <summary> /// For a given parameter name return the expression. /// For example for SuryeyId return SurveyId=22 /// /// </summary> /// <param name="parameterName"></param> /// <returns></returns> public static string getRequestParameterExpression(FormParameters[] parameterNames) { string retval = string.Empty, s; foreach (FormParameters param in parameterNames) { if (HttpContext.Current.Request[param.ToString()] != null) s = param + "=" + HttpContext.Current.Request[param.ToString()]; else s = param + "=-1"; retval = retval.Length == 0 ? s : retval + "&" + s; } return (retval.Length > 0) ? "?" + retval : retval; }
private void SetFormParameters(FormParameters parameters) { WindowState = parameters.WindowState; FormBorderStyle = parameters.BorderStyle; Location = parameters.Location; ShowIcon = parameters.ShowIcon; Visible = parameters.Visible; // Control.set_Visible tampers with ClientSize TopMost = parameters.TopMost; // Control.set_TopMost tampers with ClientSize ClientSize = parameters.Size; // ...therefore set ClientSize last }
private void InitializeGameForm() { Size = MinimumSize; // Forms crops MinimumSize automatically down to screen size but not Size _previousWindowedModeParameters = GetCurrentFormParameters(); _originalIcon = Icon; AW2.Helpers.Log.Written += AddToLogView; _logCache = new StringBuilder(); _updateTimer = new Timer { Interval = 1000 }; _updateTimer.Tick += Update; _updateTimer.Start(); // Text entry is handled by WndProcImpl() which is called at a keypress // only if this GameForm or _gameView has focus. Initially, this GameForm has // focus and we cannot set it to any other control in this method. Later, if // some other control has got the focus, it is no longer possible to focus // this GameForm. Also, clicking on _gameView doesn't automatically focus it, // so we set focus then explicitly. Note that clicking on other controls does // set focus to them. _gameView.Click += (sender, e) => _gameView.Focus(); if (_game.CommandLineOptions.DedicatedServer) _splitContainer.Panel1Collapsed = true; }
public void SetFullScreen(int width, int height) { if (_graphicsDeviceService == null) return; if (Interlocked.CompareExchange(ref _isChangingFullScreen, 1, 0) != 0) return; try { if (_isFullScreen && width == ClientSize.Width && height == ClientSize.Height) return; if (!HasFocus) { // Without focus we may lose the window completely. Wait for GotFocus event. _pendingFullScreenSize = Tuple.Create(width, height); return; } _runner.Pause(); Application.DoEvents(); if (!_isFullScreen) _previousWindowedModeParameters = GetCurrentFormParameters(); _isFullScreen = true; _splitContainer.Visible = false; SetFormParameters(GetFullScreenFormParameters(width, height)); _graphicsDeviceService.SetFullScreen(width, height); _runner.Resume(); } finally { _isChangingFullScreen = 0; } }
private dynamic EditPost(string baseHostname, long id, FormParameters form) { form.Set("id", id); string url = String.Format("http://api.tumblr.com/v2/blog/{0}/post/edit", baseHostname); return _tumblr.POST(new Uri(url), form); }
public static string GetParameterValue(FormParameters paramName) { return HttpContext.Current.Request.Params[paramName.ToString()]; }
public dynamic GetSubmissions(string baseHostname, string offset = null, string filter = null) { FormParameters query = new FormParameters { { "offset", offset }, { "filter", filter }, }; string url = String.Format("http://api.tumblr.com/v2/blog/{0}/posts/submission{1}", baseHostname, query); return _tumblr.GET(new Uri(url)); }
public dynamic GetPosts(string baseHostname, string type = null, long? id = null, string tag = null, int? limit = null, int? offset = null, bool? reblogInfo = null, bool? notesInfo = null, string filter = null) { FormParameters query = new FormParameters { { "api_key", _tumblr.ConsumerKey }, { "id", id }, { "tag", tag }, { "limit", limit }, { "offset", offset }, { "reblog_info", reblogInfo }, { "notes_info", notesInfo }, { "filter", filter }, }; StringBuilder sb = new StringBuilder(); sb.AppendFormat("http://api.tumblr.com/v2/blog/{0}/posts", baseHostname); if (type != null) sb.AppendFormat("/{0}", type); sb.Append(query); return _tumblr.GET(new Uri(sb.ToString())); }
public dynamic GetDrafts(string baseHostname, string filter = null) { FormParameters query = new FormParameters { { "filter", filter }, }; string url = String.Format("http://api.tumblr.com/v2/blog/{0}/posts/draft{1}", baseHostname, query); return _tumblr.GET(new Uri(url)); }
public static bool isParameterSupplied(PageBase pbase, FormParameters paramName) { if (paramName == FormParameters.folderid) if (pbase.SelectedFolderId == -1) return false; else return true; if (GetParameterValue(paramName) == null || GetParameterValue(paramName) == "-1") return false; return true; }
/// <summary> /// Return true if all the Parameters in the List are available /// </summary> /// <param name="paramNames"></param> /// <returns></returns> public static bool AreParametersSupplied(PageBase pBase, FormParameters[] paramNamesList) { foreach (FormParameters par in paramNamesList) if (!isParameterSupplied(pBase, par)) return false; return true; }
internal dynamic POST(Uri uri, FormParameters form = null) { return ReadJson(AuthorizedPOST(uri, form)); }
public dynamic Like(long id, string reblogKey) { if (reblogKey == null) throw new ArgumentNullException("reblogKey"); FormParameters form = new FormParameters { { "id", id }, { "reblog_key", reblogKey }, }; return _tumblr.POST(new Uri("http://api.tumblr.com/v2/user/like"), form); }