本文整理汇总了C#中jQueryApi.jQueryEvent类的典型用法代码示例。如果您正苦于以下问题:C# jQueryEvent类的具体用法?C# jQueryEvent怎么用?C# jQueryEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
jQueryEvent类属于jQueryApi命名空间,在下文中一共展示了jQueryEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SubmitForm
private void SubmitForm(jQueryEvent e)
{
e.PreventDefault();
string currentPassword = jQuery.Select("#change-password-current-password").GetValue();
string password = jQuery.Select("#change-password-new-password").GetValue();
string password2 = jQuery.Select("#change-password-new-password2").GetValue();
if (currentPassword == "" || password == "" || password2 == "" || submittingForm)
{
return;
}
if (password.Length < 8 || password != password2)
{
ErrorModal.ShowError(Strings.Get("AddUserInvalidInput"));
return;
}
submittingForm = true;
ChangePasswordRequest request = new ChangePasswordRequest();
request.currentPassword = currentPassword;
request.newPassword = password;
request.newPassword2 = password2;
Request.Send(request, SubmitSuccess, SubmitFailure);
}
示例2: OnMouseUp
private void OnMouseUp(jQueryEvent e)
{
bool wasMouseDown = IsMouseDown;
IsMouseDown = false;
if (IsEnabled && IsMouseOver && wasMouseDown) InvokeClick();
UpdateMouseState();
}
示例3: RequestMatch
public static void RequestMatch(jQueryEvent e)
{
jQueryObject button = jQuery.FromElement(e.CurrentTarget);
jQueryUIObject dialog = (jQueryUIObject)jQuery.Select("#challengeDialog");
jQueryUIObject datePicker = (jQueryUIObject)dialog.Find(".datepicker");
Utility.WireLocationAutoComplete((jQueryUIObject)dialog.Find(".placesAutoFill"), (jQueryUIObject)dialog.Find(".placesAutoValue"));
string id = button.GetElement(0).ID;
datePicker.DatePicker("disable");
dialog.Dialog(
new JsonObject(
"width", "260",
"height", "324",
"modal", true,
"title", button.GetAttribute("Title"),
"buttons", new JsonObject(
"Challenge!", (jQueryEventHandler)delegate(jQueryEvent ex)
{
CreateMatch(id);
}
),
"open", (Callback)delegate()
{
dialog.Find(".comments").Focus();
datePicker.DatePicker("enable");
},
"position", "top"
)
);
}
示例4: Calendar
/// <summary>
/// Popup for the calendar page showing potential and accepted offers by date.
/// </summary>
/// <param name="ev"></param>
public static void Calendar(jQueryEvent ev)
{
jQueryUIObject dialog = (jQueryUIObject)jQuery.Select("#calendarCard");
dialog.Children().First().Html("Loading...");
JsonObject parameters = new JsonObject("page", 0);
jQuery.Post("/services/Calendar?signed_request=" + Utility.GetSignedRequest(), Json.Stringify(parameters), (AjaxRequestCallback<object>)delegate(object data, string textStatus, jQueryXmlHttpRequest<object> request)
{
Utility.ProcessResponse((Dictionary)data);
}
);
// BUGBUG: currently the sizes are hard-coded and too big - need to fix this.
dialog.Dialog(
new JsonObject(
"width", jQuery.Window.GetWidth() - 120,
"height", jQuery.Window.GetHeight() - 40,
"modal", true,
"closeOnEscape", true,
"title", "Calendar",
"position", "top"
)
);
}
示例5: SaveDetails
private void SaveDetails(jQueryEvent e)
{
this.EditButton.Hide(EffectDuration.Fast);
this.Obj.Attribute("disabled", "disabled").AddClass("ui-state-disabled");
// Find the objects with the .edit class that are descendants of objects with .keyvaluerow class
// These are the editable key/value pairs
jQueryObject edits = this.Obj.Find(".keyvaluerow .edit");
string ntrp = edits.Find(".ntrp").GetValue();
string court = edits.Find(".placesAutoValue").GetValue();
string playPreference = edits.Find(".preference").GetValue();
string style = edits.Find(".style").GetValue();
string email = ((CheckBoxElement)edits.Find(".email").GetElement(0)).Checked ? "true" : "false";
JsonObject parameters = new JsonObject
(
"ntrp", ntrp,
"preference", playPreference,
"courtData", court,
"style", style,
"emailOffers", email
);
// Post the user data to the service
jQuery.Post("/services/PostTennisUserDetails" + "?signed_request=" + Utility.GetSignedRequest(), Json.Stringify(parameters), (AjaxRequestCallback<object>)delegate(object data, string textStatus, jQueryXmlHttpRequest<object> request)
{
Utility.ProcessResponse((Dictionary)data);
});
}
示例6: DeleteCommand
public void DeleteCommand(object data, jQueryEvent e)
{
Utility.ConfirmDialog(ResourceStrings.ConfirmDeleteConnection,delegate(){
string id = e.Target.ParentNode.GetAttribute("rowId").ToString();
OrganizationServiceProxy.BeginDelete(Connection.LogicalName, new Guid(id), delegate(object state)
{
try
{
OrganizationServiceProxy.EndDelete(state);
foreach (Entity connection in Connections.Data)
{
if (connection.Id == id)
{
Connections.RemoveItem(connection);
break;
}
}
Connections.Refresh();
}
catch (Exception ex)
{
ErrorMessage.SetValue(ex.Message);
}
});
},null);
}
示例7: SubmitForm
private void SubmitForm(jQueryEvent e)
{
e.PreventDefault();
string name = jQuery.Trim(jQuery.Select("#admin-user-add-name").GetValue());
string password = jQuery.Select("#admin-user-add-password").GetValue();
string password2 = jQuery.Select("#admin-user-add-password2").GetValue();
if (name == "" || password == "" || password2 == "" || submittingForm)
{
return;
}
RegularExpression regex = new RegularExpression("[^a-zA-Z0-9]");
if (regex.Test(name) || password.Length < 8 || password != password2)
{
ErrorModal.ShowError(Strings.Get("AddUserInvalidInput"));
return;
}
submittingForm = true;
AdminUserAddRequest request = new AdminUserAddRequest();
request.username = name;
request.password = password;
request.password2 = password2;
request.admin = jQuery.Select("#admin-user-add-administrator").Is(":checked");
Request.Send(request, SubmitSuccess, SubmitFailure);
}
示例8: CustomDialog_3
static void CustomDialog_3(jQueryEvent e){
var item = e.CurrentTarget.As<NavItem> ();
var dd = new Div(c=>{
new TextField(c, i=>i.Placeholder="name");
new CheckField(c,i=>{
i.Input.Text="I like cayita";
i.Input.Checked=true;
i.Input.Disabled=true;
});
new TextAreaInput(c, i=>i.Value="cayita is amazing ...");
});
Bootbox.Dialog (dd, new BootboxHandler {
Callback=()=> item.Text.LogInfo(),
Label="Go",
Class="btn-info",
},
new BootboxOptions {
Header=item.Text,
Classes="modal-large",
OnEscape=()=> "Esc pressed".LogInfo()
});
}
示例9: OnAddNearbyClick
private void OnAddNearbyClick(jQueryEvent e)
{
try
{
Service.GetSurroundingPlaces(
int.Parse(this.view.uiRadiusPlaceAutoComplete.Value),
int.Parse(this.view.uiNumberOfSurroundingTownsDropDown.Value),
delegate(PlaceStub[] result, object context, string name)
{
for (int i = 0; i < result.Length; i++)
{
this.view.uiPlacesMultiSelector.AddItem(result[i].name, result[i].k.ToString());
}
this.view.uiRadiusPlaceAutoComplete.Clear();
},
Trace.WebServiceFailure,
null,
5000
);
}
catch(Exception)
{
}
e.PreventDefault();
}
示例10: OnKeyDown
private void OnKeyDown(jQueryEvent e)
{
if ("ABCDEFGHIJKLMNOPQRSTUVWXYZ,.;#[]".IndexOf(String.FromCharCode(e.Which)) > -1)
{
e.PreventDefault();
}
}
示例11: OnBlur
private void OnBlur(jQueryEvent e)
{
if (GetDate() == null)
{
this.view.TextBox.Value = "";
}
}
示例12: InputKeypressHandler
public static void InputKeypressHandler(jQueryEvent evt, InputElement el, TransformCharDelegate transformChar) {
if (evt.AltKey || evt.CtrlKey)
return; // don't ever change Alt+key or Ctrl+key
if (jQuery.Browser.MSIE) {
if (evt.Which == 13)
return; // Enter seems to be the only non-printable key we catch in IE.
char newc = transformChar((char)evt.Which);
if (newc == 0) {
evt.PreventDefault();
}
else if (newc != evt.Which) {
((dynamic)evt).originalEvent.keyCode = newc;
}
}
else {
if (evt.Which == 0)
return; // Firefox, and likely other non-IE browsers, lets us trap non-characters, but we don't want that.
char newc = transformChar((char)evt.Which);
if (newc == 0) {
evt.PreventDefault();
}
else if (newc != evt.Which) {
int startPos = ((dynamic)el).selectionStart,
endPos = ((dynamic)el).selectionEnd;
string oldVal = el.Value;
el.Value = oldVal.Substr(0, startPos) + String.FromCharCode(newc) + oldVal.Substr(endPos);
((dynamic)el).setSelectionRange(startPos + 1, startPos + 1);
evt.PreventDefault();
}
}
}
示例13: GoLicense
void GoLicense(jQueryEvent evt)
{
evt.PreventDefault ();
Work.Empty ();
Work.Append (@"<div class=""well"">
<p>Copyright AICL.</p>
<p>Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:</p><p><a target=""_blank"" href=""http://www.apache.org/licenses/LICENSE-2.0"">http://www.apache.org/licenses/LICENSE-2.0</a></p><p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ""AS IS"" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p></div>");
}
示例14: GetCursorPosition
public static Pointer GetCursorPosition(jQueryEvent ev)
{
if (ev.Me().originalEvent && ev.Me().originalEvent.targetTouches && ev.Me().originalEvent.targetTouches.length > 0) ev = ev.Me().originalEvent.targetTouches[0];
if (ev.PageX.Me() != null && ev.PageY.Me() != null)
return new Pointer(ev.PageX, ev.PageY, 0, ev.Which == 3);
//if (ev.x != null && ev.y != null) return new { x: ev.x, y: ev.y };
return new Pointer(ev.ClientX, ev.ClientY, 0, ev.Which == 3);
}
示例15: BrowseButtonClicked
private void BrowseButtonClicked(jQueryEvent e)
{
e.PreventDefault();
if (collectionId > 0)
{
AdminFinderModal.ShowDialog(jQuery.Select("#admin-manga-edit-path"), collectionId);
}
}