public ActionResult Create(InputFields inputFields) { ElasticClient client = eSServices.Connect_ES(); eSServices.PutSingleDoc(inputFields, client); return(RedirectToAction("Index")); }
public bool ActionButtonPressed(ConsoleKey key) { switch (key) { case ConsoleKey.Y: message = "TryLogin " + userName + " " + passWord + " "; userName = ""; passWord = ""; return(true); case ConsoleKey.N: Console.Clear(); userName = ""; passWord = ""; message = ""; currInputField = InputFields.USERNAME; break; case ConsoleKey.Escape: message = "ViewEndView"; return(true); } return(false); }
// Use this for initialization void Start() { timer = 4f; text = GetComponent <Text>(); string left = InputFields.left.ToString(); string right = InputFields.right.ToString(); if (InputFields.checkJoystick()) { if (InputFields.joystickAxis == "LeftAnalog") { left = "left analog stick"; } else { left = "right analog stick"; } interactButton = "A Button"; text.text = "Use the " + left + " to move left and right"; } else { interactButton = InputFields.interact.ToString(); text.text = "Use " + left + " and " + right + " to move left and right"; } }
public void RobotsFileTest() { RobotsFileStub fileStub = new RobotsFileStub(); InputFields inputFields = new InputFields() { Domain = Path.Combine(@"D:\", "mkyong.txt"), UserAgent = "yandexbot" }; //RobotsParser robotsParser=new RobotsParser(inputFields,new LogMessanger(), fileStub); //robotsParser.ParseFile(); //var tesRes = robotsParser.GetResult(); YandexBot yandexBot = new YandexBot(); yandexBot.GetCrawlDelay = 2; //robotsParser.Expect(parser => parser.GetResult()) // .Return(new KeyValuePair<string, IUserAgent>("\"http://www.mkyong.com\"", yandexBot)); KeyValuePair <string, IUserAgent> test = new KeyValuePair <string, IUserAgent>("https://msdn.microsoft.com/en-us/library/windows/desktop/ms633545(v=vs.85).aspx", yandexBot); Uri test1 = new Uri("/sandbox/", UriKind.Relative); Uri test2 = "https://habrahabr.ru/company/tm/".ToUri(); TextReader textReader = File.OpenText(Path.Combine(@"D:\", "1.txt")); GrammaHttpParser parser = new GrammaHttpParser(); parser.GetNestedUri(textReader.ReadToEnd(), "https://habrahabr.ru".ToUri()); //Uri uri=new Uri(); //Crawler crawler=new Crawler(test,new LogMessanger()); //Extensions.IsSubDomain(""); //Uri uri=new Uri("http://cdndl.zaycev.net/960403/6692165/post_malone_feat._21_savage_-_rockstar_%28zaycev.net%29.mp3"); //crawler.CrawAsync(); }
public bool ActionButtonPressed(ConsoleKey key) { bool viewChangeInit = false; switch (key) { case ConsoleKey.Y: ViewHandler.CurrentView = ViewHandler.Views.Reception; viewChangeInit = true; break; case ConsoleKey.N: Console.Clear(); userName = ""; passWord = ""; draw.WriteAt("\t\t", 10, 2); draw.WriteAt("\t\t", 10, 3); currInputField = InputFields.USERNAME; break; case ConsoleKey.Escape: ViewHandler.CurrentView = ViewHandler.Views.EndProgram; viewChangeInit = true; break; } return(viewChangeInit); }
public void Show(OnSearchDelegate searchCallback) { gameObject.SetActive(true); transform.SetAsLastSibling(); SearchCallback = searchCallback; stringFilterPanel.gameObject.SetActive(false); integerFilterPanel.gameObject.SetActive(false); toggleFilterPanel.gameObject.SetActive(false); for (int i = FilterPanels.Count - 1; i >= 0; i--) { Destroy(FilterPanels[i].gameObject); FilterPanels.RemoveAt(i); } InputFields.Clear(); Toggles.Clear(); nameInputField.text = Filters.Name; nameInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); }; InputFields.Add(nameInputField); idInputField.text = Filters.Id; idInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); }; InputFields.Add(idInputField); setCodeInputField.text = Filters.SetCode; setCodeInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); }; InputFields.Add(setCodeInputField); foreach (PropertyDef property in CardGameManager.Current.CardProperties) { AddPropertyPanel(property, property.Name); } propertyFiltersContent.sizeDelta = new Vector2(propertyFiltersContent.sizeDelta.x, PropertyPanelHeight * (FilterPanels.Count + 3)); }
/// <summary> /// 清理视图组件所持有的基础控件列表。 /// </summary> private void CleanControlList() { Images.Clear(); RawImages.Clear(); Buttons.Clear(); InputFields.Clear(); Sliders.Clear(); }
public LoginView() { Console.Clear(); draw = new Draw(); currInputField = InputFields.USERNAME; userName = ""; passWord = ""; }
public ActionResult Edit(InputFields thisPoint) { InputFields ThisPoint = thisPoint; ElasticClient client = eSServices.Connect_ES(); eSServices.PutSingleDoc(thisPoint, client); return(RedirectToAction("Index")); }
public ActionResult Delete(string id) { InputFields ThisPoint = new InputFields(); ElasticClient client = eSServices.Connect_ES(); ThisPoint = eSServices.GetSpecificPoint(client, id); return(View(ThisPoint)); }
public ViewLogin(string messageFromController = "") { Console.Clear(); currInputField = InputFields.USERNAME; userName = ""; passWord = ""; //Response = messageFromController; message = ""; }
public void InitBlank() { LastModified.Reset(); Locations.Clear(); Notes.Clear(); InputFields.Clear(); Tags.Clear(); TagMaps.Clear(); BlockRanges.Clear(); Bookmarks.Clear(); UserMarks.Clear(); }
public void Show(OnNameChangeDelegate nameChangeCallback, OnSearchDelegate searchCallback) { gameObject.SetActive(true); transform.SetAsLastSibling(); NameChangeCallback = nameChangeCallback; SearchCallback = searchCallback; stringPropertyPanel.gameObject.SetActive(false); integerPropertyPanel.gameObject.SetActive(false); enumPropertyPanel.gameObject.SetActive(false); for (int i = FilterPanels.Count - 1; i >= 0; i--) { Destroy(FilterPanels[i].gameObject); FilterPanels.RemoveAt(i); } InputFields.Clear(); Toggles.Clear(); nameInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); }; InputFields.Add(nameInputField); idInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); }; InputFields.Add(idInputField); setCodeInputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); }; InputFields.Add(setCodeInputField); propertyFiltersContent.sizeDelta = new Vector2(propertyFiltersContent.sizeDelta.x, PropertyPanelHeight * CardGameManager.Current.CardProperties.Count + (PropertyPanelHeight * 3)); foreach (PropertyDef property in CardGameManager.Current.CardProperties) { GameObject newPanel; if (CardGameManager.Current.IsEnumProperty(property.Name)) { newPanel = CreateEnumPropertyFilterPanel(property); } else if (property.Type == PropertyType.Integer) { newPanel = CreateIntegerPropertyFilterPanel(property.Name, property.Display); } else //if (property.Type == PropertyType.String) { newPanel = CreateStringPropertyFilterPanel(property.Name, property.Display); } FilterPanels.Add(newPanel); foreach (InputField inputField in newPanel.GetComponentsInChildren <InputField>()) { inputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); }; InputFields.Add(inputField); } foreach (Toggle toggle in newPanel.GetComponentsInChildren <Toggle>()) { Toggles.Add(toggle); } } }
public FormViewModel(HttpRequestBase request, IOrchardServices orchard, PipelineConfigurationPart part, Process process) { _orchard = orchard; Part = part; Process = process; Geo = process.Parameters.Any(p => p.Name.EndsWith(".Latitude", StringComparison.OrdinalIgnoreCase)); Latitude = string.Empty; Longitude = string.Empty; Accuracy = string.Empty; Request = request; Entity = process.Entities.FirstOrDefault(); SectionsDisplayed = new HashSet <string>(); if (Entity != null) { Row = Entity.Rows.FirstOrDefault(); InputFields = Entity.Fields.Where(f => f.Input).ToArray(); HasFile = Entity.Fields.Any(f => f.InputType == "file"); // determine focus if (Request.HttpMethod == "GET") { Focus = InputFields.First(f => !f.PrimaryKey).Alias; } else { var previous = Request.Form["Orchard.Focus"] == "Orchard.Submit" ? InputFields.Last() : InputFields.First(f => f.Name == Request.Form["Orchard.Focus"]); var maxIndex = InputFields.Where(f => !f.PrimaryKey).Max(f => f.Index); if (previous.Index < maxIndex) { var next = InputFields.OrderBy(f => f.Index).FirstOrDefault(f => f.Index > previous.Index); if (next != null) { Focus = next.Alias; } else { var invalid = InputFields.FirstOrDefault(f => f.ValidField != string.Empty && !(bool)Row[f.ValidField]); Focus = invalid == null ? "Orchard.Submit" : invalid.Alias; } } else { var invalid = InputFields.FirstOrDefault(f => f.ValidField != string.Empty && !(bool)Row[f.ValidField]); Focus = invalid == null ? "Orchard.Submit" : invalid.Alias; } } Valid = Entity.ValidField != string.Empty && (Row != null && (bool)Row[Entity.ValidField]); } }
public ViewResult GetResults(InputFields inputFields) { if (ModelState.IsValid) { string googleSearchUrl = UrlGenerator.GenerateGoogleSearchUrl(inputFields.KeyWords); string webPageContent = WebPageDownloader.GetWebPageContent(googleSearchUrl); string rankings = ResultsGenerator.GetRankingsFormattedAsString(webPageContent, inputFields.Url); Results results = new Results { Rankings = rankings }; return(View("Results", results)); } return(View("Index")); }
public InputFields GetSpecificPoint(ElasticClient client, string id) { InputFields SpecificPoint = new InputFields(); var searchResponse = client.Search <InputFields>(s => s .Query(q => q .Match(m => m .Field("_id") .Query(id) ) ) ); SpecificPoint = searchResponse.Documents.FirstOrDefault(); return(SpecificPoint); }
public IReadOnlyList <Image <Rgba32> > CreateLayers(IReadOnlyList <object[]> inputs) { if (inputs.Count != InputFields.Count) { throw new ArgumentException($"Input length mismatch: expected {InputFields.Count} but got {inputs.Count} inputs"); } var allLayers = new List <Image <Rgba32> >(); var mask = CreateMask(); allLayers.Add(mask); allLayers.AddRange(InputFields.Select((t, i) => CreateLayer(mask, t, inputs[i]))); return(allLayers); }
/// <summary> /// Get the input field. /// </summary> /// <param name="inputFieldName">Input field name.</param> /// <returns>Input field.</returns> public virtual IUContextArgumentInfo GetInputField(string inputFieldName) { IUContextArgumentInfo lInputField = null; if (InputFields.ContainsKey(inputFieldName)) { return(InputFields[inputFieldName]); } else { lInputField = new IUContextArgumentInfo(inputFieldName); InputFields[inputFieldName] = lInputField; } return(lInputField); }
private void InputValue() { if (currInputField == InputFields.USERNAME) { draw.WriteAt("", 10, 2); userName = Console.ReadLine(); currInputField = InputFields.PASSWORD; draw.WriteAt("", 10, 3); } else if (currInputField == InputFields.PASSWORD) { draw.WriteAt("", 10, 3); passWord = Console.ReadLine(); currInputField = InputFields.OTHER; } }
// Use this for initialization void Start() { tool = Tools.CREATE; StartCoroutine(create()); mouseDown = false; mouseUp = false; nodes = new List <Node>(); edges = new List <Edge>(); reactions = new List <Reaction>(); Nodes = new GameObject("Nodes"); Edges = new GameObject("Edges"); Supports = new GameObject("Supports"); Node.main = this; Edge.main = this; index = 0; input = inputsGo.GetComponent <InputFields>(); }
public void AddPropertyPanel(PropertyDef forProperty, string propertyName) { if (forProperty == null || string.IsNullOrEmpty(propertyName)) { Debug.LogWarning("AddPropertyPanel::NullPropertyOrName"); return; } if (forProperty.Type == PropertyType.Object || forProperty.Type == PropertyType.ObjectList) { foreach (PropertyDef childProperty in forProperty.Properties) { AddPropertyPanel(childProperty, propertyName + PropertyDef.ObjectDelimiter + childProperty.Name); } return; } GameObject newPanel; if (CardGameManager.Current.IsEnumProperty(propertyName)) { newPanel = CreateEnumPropertyFilterPanel(propertyName, forProperty); } else if (forProperty.Type == PropertyType.Boolean) { newPanel = CreateBooleanPropertyFilterPanel(propertyName, forProperty.Display); } else if (forProperty.Type == PropertyType.Integer) { newPanel = CreateIntegerPropertyFilterPanel(propertyName, forProperty.Display); } else //if (property.Type == PropertyType.String) { newPanel = CreateStringPropertyFilterPanel(propertyName, forProperty.Display); } FilterPanels.Add(newPanel); foreach (InputField inputField in newPanel.GetComponentsInChildren <InputField>()) { inputField.onValidateInput += delegate(string input, int charIndex, char addedChar) { return(Inputs.FilterFocusNameInput(addedChar)); }; InputFields.Add(inputField); } foreach (Toggle toggle in newPanel.GetComponentsInChildren <Toggle>()) { Toggles.Add(toggle); } }
public void Clear() { _schema = null; Path.Clear(); Variables.Clear(); Fragments.Clear(); UsedVariables.Clear(); UnusedVariables.Clear(); DeclaredVariables.Clear(); Names.Clear(); Types.Clear(); Directives.Clear(); OutputFields.Clear(); InputFields.Clear(); Errors.Clear(); IsInError = false; }
public void AddConnection(Field a, Field b, Connection.Creator createdBy) { //Find out which is the input field and which is the output field Field input, output; if (InputFields.Contains(a) && OutputFields.Contains(b)) { input = a; output = b; } else if (InputFields.Contains(b) && OutputFields.Contains(a)) { input = b; output = a; } else { //Only connect inputs with outputs return; } // Remove any existing connections to a newly connected output. // There should never be more than one input connected to any given output var conflictingConnections = Connections.Where(conn => conn.Output == output).ToList(); foreach (var conn in conflictingConnections) { RemoveConnection(conn); } SelectionStatus selectionStatus; if (Selection.Contains(input) || Selection.Contains(output)) { selectionStatus = SelectionStatus.ConnectionSelected; } else { selectionStatus = SelectionStatus.NotSelected; } Connections.Add(new Connection(input, output, createdBy, selectionStatus)); input.IsConnected = true; output.IsConnected = true; }
public virtual bool InputValue(Render renderer = null) { if (currInputField == InputFields.USERNAME) { renderer.WriteAt("", 10, 2); userName = Console.ReadLine(); currInputField = InputFields.PASSWORD; renderer.WriteAt("", 10, 3); } else if (currInputField == InputFields.PASSWORD) { renderer.WriteAt("", 10, 3); passWord = Console.ReadLine(); currInputField = InputFields.OTHER; //return true; } return(ActionButtonPressed(Console.ReadKey().Key)); }
public static string PrepareJson(List<Comanda.Ordine> ordini, string tipo, string returnurl, string cancelurl) { CurrentRequest Request = new CurrentRequest(); float Totale = 0f; ItemList item_list = new ItemList(); item_list.items = new List<item>(); //currentitem = null; foreach(Comanda.Ordine o in ordini) { item currentitem = new item(); currentitem.name = o.Nome; currentitem.quantity = o.Quantità.ToString(); currentitem.description = ""; currentitem.price = o.PrezzoBase.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture); currentitem.currency = "EUR"; //item_list.items.Capacity = item_list.items.Capacity + 1; item_list.items.Add(currentitem); Totale += o.Prezzo; } Transaction transaction = new Transaction(); transaction.amount = new Amount { total = Totale.ToString("0.00", System.Globalization.CultureInfo.InvariantCulture), currency = "EUR" }; transaction.item_list = item_list; transaction.description = tipo; transaction.invoice_number = ""; Request.intent = "sale"; Request.redirect_urls = new RedirectUrls { return_url = returnurl, cancel_url = cancelurl }; Request.payer = new Payer { payment_method = "paypal" }; Request.transactions = new List<Transaction>(); Request.transactions.Add(transaction); InputFields inputfields = new InputFields {no_shipping = 1, address_override = 1 }; Experience exp = new Experience (); exp.input_fields = inputfields; Request.experience = exp; string json = JsonConvert.SerializeObject(Request); File.WriteAllText(Path.Combine(Application.persistentDataPath, "PaymentRequest.json"), json); return json; // File.WriteAllText(Path.Combine(Application.persistentDataPath, "PaymentRequest.json"), json); // print(Application.persistentDataPath); }
public void TakeInputSelect(int value) { if (InputFields.checkJoystick()) { Debug.Log("what"); switch (value) { case 0: InputFields.interact = KeyCode.Joystick1Button0; break; case 1: InputFields.interact = KeyCode.Joystick1Button2; break; case 2: InputFields.interact = KeyCode.Joystick1Button1; break; } } else { switch (value) { case 0: Debug.Log("Space"); InputFields.interact = KeyCode.Space; break; case 1: Debug.Log("E"); InputFields.interact = KeyCode.E; break; case 2: Debug.Log("F"); InputFields.interact = KeyCode.F; break; } } }
public override async Task <IList <IEvent> > OnPropertyChanged(string propertyName, object propertyValue) { var result = new List <IEvent>(); if (propertyName == "FilterItems") { var change = Convert.ToBoolean(propertyValue.ToString()); if (change) { var combo = InputFields.Where(i => i.InputName == "Comparison").Single() as EnumComboBoxInput <FilterComparison>; combo.UpdateList(x => x.Key == FilterComparison.Contains || x.Key == FilterComparison.NotEquals, null, false); var list = combo.ListItems; result.Add(new UpdateComboBoxSource("Comparison", list)); var listInput = InputFields.Where(i => i.InputName == "List").Single() as ListSelectionInput; listInput.ListSource = new Dictionary <string, object>() { { "x", "ITem XXX" } }; var tmp = listInput.ListSource; result.Add(new UpdateComboBoxSource("List", tmp)); } } else if (propertyName == "User") { var userId = propertyValue?.ToString(); if (userId == "a444fd59-1ed5-49f4-80be-4c6c1dae6aa2") { result.Add(new UpdateInputVisibility("Email", true)); } else { result.Add(new UpdateInputVisibility("Email", false)); } } return(result); }
public override bool ActionButtonPressed(ConsoleKey key) { switch (key) { case ConsoleKey.A: message = "ViewReception"; return(true); case ConsoleKey.R: Console.Clear(); name = ""; socialSequrityNumber = ""; currentInputField = InputFields.Name; return(false); case ConsoleKey.Escape: message = "ViewEndProgram"; return(true); } return(false); }
public override bool InputValue(Render renderer) { if (currentInputField == InputFields.Name) { renderer.WriteAt("", 10, 2); name = Console.ReadLine(); currentInputField = InputFields.SocialSequrityNumber; } else if (currentInputField == InputFields.SocialSequrityNumber) { renderer.WriteAt("", 10, 3); socialSequrityNumber = Console.ReadLine(); currentInputField = InputFields.Other; } else { renderer.WriteAt("(A)dd Customer or (R)eset values", 0, 6); return(ActionButtonPressed(Console.ReadKey().Key)); } return(false); }
// Use this for initialization void Start() { if (InputFields.checkJoystick()) { Debug.Log("Joystick connected, length is " + Input.GetJoystickNames().Length); Debug.Log("inside names: " + Input.GetJoystickNames()[0]); Dropdown movement = GetComponent <Dropdown>(); movement.options.Clear(); movement.RefreshShownValue(); List <string> options = new List <string>(); options.Add("left analog"); options.Add("right analog"); movement.AddOptions(options); movement.RefreshShownValue(); } }
public ServeItemsForm(InputFields input, DbForm parent):base(parent) { InitializeComponent(); this.input = input; }
public void useInput(InputFields input) { this.input = input; }