本文整理汇总了C#中jQueryObject类的典型用法代码示例。如果您正苦于以下问题:C# jQueryObject类的具体用法?C# jQueryObject怎么用?C# jQueryObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
jQueryObject类属于命名空间,在下文中一共展示了jQueryObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PhotoBrowsingUsingKeysControl
public PhotoBrowsingUsingKeysControl(jQueryObject[] focusControls)
{
for (int i = 0; i < focusControls.Length; i++)
{
focusControls[i].Keydown(KeyDown);
}
}
开发者ID:davelondon,项目名称:dontstayin,代码行数:7,代码来源:PhotoBrowsingUsingKeysControl.cs
示例2: LinkFn
private void LinkFn(CanvasPieceLayoutScope scope, jQueryObject element, dynamic attr)
{
element.Width(scope.Width);
element.Height(scope.Height);
element[0].Style.Display = "inline-block";
var context = (CanvasRenderingContext2D)((CanvasElement)element[0]).GetContext(CanvasContextId.Render2D);
Action updatePieceLayout = () =>
{
context.Canvas.Width = context.Canvas.Width;
context.Me().webkitImageSmoothingEnabled = false;
context.Me().mozImageSmoothingEnabled = false;
context.Me().imageSmoothingEnabled = false;
context.FillStyle = "#FFFFFF";
context.FillRect(0, 0, scope.Width, scope.Height);
context.BeginPath();
context.Rect(0, 0, scope.Width, scope.Height);
context.Clip();
context.ClosePath();
if (scope.PieceLayout == null) return;
var rect = scope.PieceLayout.GetRectangle(scope.ObjectData);
context.Scale(scope.Width / ((double)rect.Width), scope.Height / ((double)rect.Height));
context.Translate(-rect.X, -rect.Y);
scope.PieceLayout.DrawUI(context, true, -1, scope.ObjectData);
};
scope.Watch("pieceLayout", updatePieceLayout);
scope.Watch("pieceLayout.pieces", updatePieceLayout, true);
}
开发者ID:OurSonic,项目名称:OurSonicSharp,代码行数:33,代码来源:CanvasPieceLayoutDirective.cs
示例3: LanguageSelection
public LanguageSelection(jQueryObject select, string currentLanguage)
: base(select)
{
currentLanguage = currentLanguage ?? "en";
var self = this;
this.Change(e =>
{
jQuery.Instance.cookie("LanguagePreference", select.GetValue(), new { path = Q.Config.ApplicationPath });
Window.Location.Reload(true);
});
Q.GetLookupAsync<LanguageRow>("Administration.Language").Then(x =>
{
if (!x.Items.Any(z => z.LanguageId == currentLanguage))
{
var idx = currentLanguage.LastIndexOf("-");
if (idx >= 0)
{
currentLanguage = currentLanguage.Substr(0, idx);
if (!x.Items.Any(z => z.LanguageId == currentLanguage))
{
currentLanguage = "en";
}
}
else
currentLanguage = "en";
}
foreach (var l in x.Items)
Q.AddOption(select, l.LanguageId, l.LanguageName);
select.Value(currentLanguage);
});
}
开发者ID:HatsuneMiku0309,项目名称:vs2015-winform,代码行数:35,代码来源:LanguageSelection.cs
示例4: LinkFn
private void LinkFn(CanvasPieceScope scope, jQueryObject element, dynamic attr)
{
element.Width(scope.Width);
element.Height(scope.Height);
element[0].Style.Display = scope.Inline ? "inline-block" : "block";
var context = (CanvasRenderingContext2D)((CanvasElement)element[0]).GetContext(CanvasContextId.Render2D);
Action updateAsset = () =>
{
context.Canvas.Width = context.Canvas.Width;
context.Me().webkitImageSmoothingEnabled = false;
context.Me().mozImageSmoothingEnabled = false;
context.Me().imageSmoothingEnabled = false;
var levelObjectAssetFrames = scope.Asset.Frames;
if (levelObjectAssetFrames.Count == 0) return;
levelObjectAssetFrames[0].DrawSimple(context, new Point(0, 0), scope.Width, scope.Height, false, false);
};
scope.Watch("asset", updateAsset);
scope.Watch("asset.frames", updateAsset);
scope.Watch("asset.width", updateAsset);
scope.Watch("asset.height", updateAsset);
}
开发者ID:OurSonic,项目名称:OurSonicSharp,代码行数:26,代码来源:CanvasPieceAssetDirective.cs
示例5: ControlWrapperView
/// <summary>Constructor.</summary>
/// <param name="divHost">The control host DIV.</param>
/// <param name="control">The logical IView control (null if not available).</param>
/// <param name="htmlElement">The control content (supplied by the test class. This is the control that is under test).</param>
/// <param name="displayMode">The sizing strategy to use for the control.</param>
/// <param name="allViews">The Collection of all controls.</param>
public ControlWrapperView(
jQueryObject divHost,
IView control,
jQueryObject htmlElement,
ControlDisplayMode displayMode,
IEnumerable allViews) : base(divHost)
{
// Setup initial conditions.
this.control = control;
this.htmlElement = htmlElement;
this.displayMode = displayMode;
this.allViews = allViews;
index = divHost.Children().Length; // Store the order position of the control in the host.
events = Common.Events;
// Create the wrapper DIV.
divRoot = Html.CreateDiv();
divRoot.CSS(Css.Position, Css.Absolute);
divRoot.AppendTo(divHost);
// Insert the content.
htmlElement.CSS(Css.Position, Css.Absolute);
htmlElement.AppendTo(divRoot);
// Wire up events.
events.ControlHostSizeChanged += OnHostResized;
// Finish up.
UpdateLayout();
}
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:36,代码来源:ControlWrapperView.cs
示例6: LinkFn
private void LinkFn(dynamic scope, jQueryObject element, dynamic attr)
{
scope.itemClick = new Action<dynamic>((item) => { scope.bind = item; });
scope.currentClass = new Func<dynamic, dynamic>((item) => (item == scope.bind) ? "fancy-list-item fancy-list-item-selected" : "fancy-list-item ");
scope.parentScope = scope["$parent"]["$parent"]["$parent"];
}
开发者ID:Shuffle-Game,项目名称:ShufflySharp,代码行数:7,代码来源:FancyListDirective.cs
示例7: ListTreeView
/// <summary>Constructor.</summary>
/// <param name="container">The containing element.</param>
public ListTreeView(jQueryObject container) : base(container)
{
ListCss.InsertCss();
divInner = Html.AppendDiv(container);
Css.AbsoluteFill(divInner);
Css.SetOverflow(divInner, CssOverflow.Hidden);
}
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:9,代码来源:ListTreeView.cs
示例8: ButtonView
/// <summary>Constructor.</summary>
/// <param name="model">The logical model of the button</param>
/// <param name="container">The HTML container of the button.</param>
protected ButtonView(IButton model, jQueryObject container) : base(InitContainer(container))
{
// Setup initial conditions.
if (Script.IsNullOrUndefined(model)) model = new ButtonBase();
this.model = model;
Focus.BrowserHighlighting = false;
// Setup CSS.
Css.InsertLink(Css.Urls.CoreButtons);
Container.AddClass(ClassButton);
Container.AddClass(Css.Classes.NoSelect);
// Insert the content and mask containers.
divContent = CreateContainer("buttonContent");
// Create child controllers.
eventController = new ButtonEventController(this);
contentController = new ButtonContentController(this, divContent);
// Wire up events.
Model.LayoutInvalidated += OnLayoutInvalidated;
Helper.ListenPropertyChanged(Model, OnModelPropertyChanged);
eventController.PropertyChanged += OnEventControllerPropertyChanged;
GotFocus += delegate { UpdateLayout(); };
LostFocus += delegate { UpdateLayout(); };
IsEnabledChanged += delegate { UpdateLayout(); };
Container.Keydown(delegate(jQueryEvent e)
{
OnKeyPress(Int32.Parse(e.Which));
});
// Finish up.
SyncCanFocus();
}
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:37,代码来源:ButtonView.cs
示例9: PartDownloader
// private DelayedAction timeout;
public PartDownloader(PartDefinition definition, jQueryObject container, PartCallback onComplete, bool initializeOnComplete)
{
this.definition = definition;
this.container = container;
this.onComplete = onComplete;
this.initializeOnComplete = initializeOnComplete;
}
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:9,代码来源:PartDownloader.cs
示例10: PhoneEditor
public PhoneEditor(jQueryObject input)
: base(input)
{
this.AddValidationRule(this.uniqueName, (e) =>
{
string value = this.Value.TrimToNull();
if (value == null)
return null;
return Validate(value, this.Multiple);
});
input.Bind("change", delegate(jQueryEvent e)
{
if (!e.HasOriginalEvent())
return;
FormatValue();
});
input.Bind("blur", delegate(jQueryEvent e)
{
if (this.element.HasClass("valid"))
{
FormatValue();
}
});
}
开发者ID:ToniRiegler,项目名称:Serene,代码行数:28,代码来源:PhoneEditor.cs
示例11: URLEditor
public URLEditor(jQueryObject input)
: base(input)
{
input.AddClass("url").Attribute("title",
"URL 'http://www.site.com/sayfa' formatında girilmelidir.");
input.Bind("blur." + this.uniqueName, delegate
{
var validator = input.Closest("form").GetDataValue("validator").As<jQueryValidator>();
if (validator == null)
return;
if (!input.HasClass("error"))
return;
var value = input.GetValue().TrimToNull();
if (value == null)
return;
value = "http://" + value;
if (((dynamic)(jQueryValidator.Methods["url"])).apply(validator, new object[] { value, input[0] }) == true)
{
input.Value(value);
validator.ValidateElement(input[0]);
}
});
}
开发者ID:fzhenmei,项目名称:Serenity,代码行数:28,代码来源:URLEditor.cs
示例12: FoldersWidget
public FoldersWidget(jQueryObject parent, FolderJson[] folders, string folderPath)
{
string separator = Environment.ServerType == ServerType.AspNet ? "\\" : "/";
attachedObject = Template.Get("client", "folders-table", true).AppendTo(parent).Attribute("data-path", folderPath);
((List<FolderJson>)(object)folders).Sort(delegate(FolderJson a, FolderJson b)
{
return Utility.NaturalCompare(a.name, b.name);
});
foreach (FolderJson folder in folders)
{
string subfolderPath = folderPath + separator + folder.name;
jQueryObject row = Template.Get("client", "folders-trow", true).AppendTo(attachedObject.Children());
jQueryObject btn = jQuery.Select(".folders-btn", row).Click(FolderButtonClick).Attribute("data-path", subfolderPath).Text(folder.count == 0 ? folder.name : String.Format("{0} ({1})", folder.name, folder.count)).Attribute("data-count", folder.count.ToString());
jQueryObject expandBtn = jQuery.Select(".folders-expand-btn", row).Click(ExpandButtonClick);
if (folder.subfolders != null && folder.subfolders.Length > 0)
{
expandBtn.Attribute("data-path", subfolderPath).Children().AddClass("icon-plus");
new FoldersWidget(jQuery.Select(".folders-tcell", row), folder.subfolders, subfolderPath);
}
}
if (folderPath != "")
{
attachedObject.Hide();
if (Settings.UseAnimation)
{
attachedObject.AddClass("fade");
}
}
}
开发者ID:a-fung,项目名称:MangaWeb3,代码行数:33,代码来源:FoldersWidget.cs
示例13: AddOption
public static void AddOption(jQueryObject select, string key, string text)
{
J("<option/>")
.Value(key)
.Text(text)
.AppendTo(select);
}
开发者ID:fzhenmei,项目名称:Serenity,代码行数:7,代码来源:Q.HtmlUtils.cs
示例14: Show
public static void Show(jQueryObject element)
{
Script.SetTimeout(delegate()
{
element.Show();
}, 0);
}
开发者ID:LimeyJohnson,项目名称:Agave,代码行数:7,代码来源:ViewManager.cs
示例15: FindElementWithRelativeId
public static jQueryObject FindElementWithRelativeId(jQueryObject element, string relativeId)
{
var elementId = element.GetAttribute("id");
if (elementId.IsEmptyOrNull())
return J("#" + relativeId);
var result = J(elementId + relativeId);
if (result.Length > 0)
return result;
result = J(elementId + "_" + relativeId);
if (result.Length > 0)
return result;
while (true)
{
var idx = elementId.LastIndexOf('_');
if (idx <= 0)
return J("#" + relativeId);
elementId = elementId.Substring(0, idx);
result = J("#" + elementId + "_" + relativeId);
if (result.Length > 0)
return result;
}
}
开发者ID:fzhenmei,项目名称:Serenity,代码行数:28,代码来源:Q.HtmlUtils.cs
示例16: LayoutFillHeight
public static void LayoutFillHeight(jQueryObject element)
{
var h = LayoutFillHeightValue(element);
string n = h + "px";
if (element.GetCSS("height") != n)
element.CSS("height", n);
}
开发者ID:fzhenmei,项目名称:Serenity,代码行数:7,代码来源:Q.Layout.cs
示例17: ThemeSelection
public ThemeSelection(jQueryObject select)
: base(select)
{
var self = this;
this.Change(e =>
{
jQuery.Instance.cookie("ThemePreference", select.GetValue(), new { path = Q.Config.ApplicationPath });
J("body").RemoveClass("skin-" + GetCurrentTheme());
J("body").AddClass("skin-" + select.GetValue());
});
Q.AddOption(select, "blue", Q.Text("Site.Layout.ThemeBlue"));
Q.AddOption(select, "blue-light", Q.Text("Site.Layout.ThemeBlueLight"));
Q.AddOption(select, "purple", Q.Text("Site.Layout.ThemePurple"));
Q.AddOption(select, "purple-light", Q.Text("Site.Layout.ThemePurpleLight"));
Q.AddOption(select, "red", Q.Text("Site.Layout.ThemeRed"));
Q.AddOption(select, "red-light", Q.Text("Site.Layout.ThemeRedLight"));
Q.AddOption(select, "green", Q.Text("Site.Layout.ThemeGreen"));
Q.AddOption(select, "green-light", Q.Text("Site.Layout.ThemeGreenLight"));
Q.AddOption(select, "yellow", Q.Text("Site.Layout.ThemeYellow"));
Q.AddOption(select, "yellow-light", Q.Text("Site.Layout.ThemeYellowLight"));
Q.AddOption(select, "black", Q.Text("Site.Layout.ThemeBlack"));
Q.AddOption(select, "black-light", Q.Text("Site.Layout.ThemeBlackLight"));
select.Value(GetCurrentTheme());
}
开发者ID:dalowery70,项目名称:Serenity-Tutorials,代码行数:27,代码来源:ThemeSelection.cs
示例18: ExecuteEverytimeWhenShown
public static void ExecuteEverytimeWhenShown(jQueryObject element, Action callback,
bool callNowIfVisible)
{
autoIncrement++;
string eventClass = "ExecuteEverytimeWhenShown" + autoIncrement;
bool wasVisible = element.Is(":visible");
if (wasVisible && callNowIfVisible)
callback();
jQueryEventHandler check = delegate(jQueryEvent e)
{
if (element.Is(":visible"))
{
if (!wasVisible)
{
wasVisible = true;
callback();
}
}
else
wasVisible = false;
};
var uiTabs = element.Closest(".ui-tabs");
if (uiTabs.Length > 0)
uiTabs.Bind("tabsactivate." + eventClass, check);
var dialog = element.Closest(".ui-dialog-content");
if (dialog.Length > 0)
dialog.Bind("dialogopen." + eventClass, check);
element.Bind("shown." + eventClass, check);
}
开发者ID:fzhenmei,项目名称:Serenity,代码行数:35,代码来源:LazyLoadHelper.cs
示例19: ShellView
/// <summary>Constructor.</summary>
/// <param name="container">The containing DIV.</param>
public ShellView(jQueryObject container) : base(container)
{
// Create child views.
sidebar = new SidebarView();
controlHost = new ControlHostView();
logContainer = new LogContainerView();
}
开发者ID:philcockfield,项目名称:Open.TestHarness.SL,代码行数:9,代码来源:ShellView.cs
示例20: InitFullHeightGridPage
public static void InitFullHeightGridPage(jQueryObject gridDiv)
{
J("body")
.AddClass("full-height-page");
jQueryEventHandler layout = delegate
{
if (gridDiv.Parent().HasClass("page-content"))
gridDiv.CSS("height", "1px")
.CSS("overflow", "hidden");
Q.LayoutFillHeight(gridDiv);
gridDiv.TriggerHandler("layout");
};
if (J("body").HasClass("has-layout-event"))
{
J("body").Bind("layout", layout);
}
else if (Window.Instance.As<dynamic>().Metronic != null)
Window.Instance.As<dynamic>().Metronic.addResizeHandler(layout);
else
{
jQuery.Window.Resize(layout);
}
layout(null);
}
开发者ID:receptuna,项目名称:Serenity,代码行数:28,代码来源:Q.Layout.cs
注:本文中的jQueryObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论