本文整理汇总了C#中IFrame类的典型用法代码示例。如果您正苦于以下问题:C# IFrame类的具体用法?C# IFrame怎么用?C# IFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IFrame类属于命名空间,在下文中一共展示了IFrame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetCurrentMovableTileLabels
/// <summary>
/// Override method GetCurrentMovableTileLabels in classic game.
/// </summary>
/// <param name="frame">Frame of type IFrame.</param>
/// <returns>List of strings.</returns>
protected override List<string> GetCurrentMovableTileLabels(IFrame frame)
{
var result = new List<string>();
var nullTilePosition = this.FindTilePosition(string.Empty, frame);
if (this.NotFoundPosition == nullTilePosition)
{
return result;
}
if (0 <= nullTilePosition.Row - 1)
{
result.Add(frame.Tiles[nullTilePosition.Row - 1, nullTilePosition.Col].Label);
}
if (nullTilePosition.Row + 1 < frame.Rows)
{
result.Add(frame.Tiles[nullTilePosition.Row + 1, nullTilePosition.Col].Label);
}
if (0 <= nullTilePosition.Col - 1)
{
result.Add(frame.Tiles[nullTilePosition.Row, nullTilePosition.Col - 1].Label);
}
if (nullTilePosition.Col + 1 < frame.Cols)
{
result.Add(frame.Tiles[nullTilePosition.Row, nullTilePosition.Col + 1].Label);
}
return result;
}
开发者ID:TeamGameFifteen2AtTelerikAcademy,项目名称:Game-Fifteen,代码行数:38,代码来源:ClassicMover.cs
示例2: using
CefReturnValue IRequestHandler.OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback)
{
using (callback)
{
if (request.Method == "POST")
{
using (var postData = request.PostData)
{
var elements = postData.Elements;
var charSet = request.GetCharSet();
foreach (var element in elements)
{
if (element.Type == PostDataElementType.Bytes)
{
var body = element.GetBody(charSet);
}
}
}
}
//Note to Redirect simply set the request Url
//if (request.Url.StartsWith("https://www.google.com", StringComparison.OrdinalIgnoreCase))
//{
// request.Url = "https://github.com/";
//}
//Callback in async fashion
//callback.Continue(true);
//return CefReturnValue.ContinueAsync;
}
return CefReturnValue.Continue;
}
开发者ID:bjarteskogoy,项目名称:CefSharp,代码行数:35,代码来源:RequestHandler.cs
示例3: Uri
CefReturnValue IRequestHandler.OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame,
IRequest request, IRequestCallback callback) {
if (CommonUrls.IsWithSixUrl(request.Url)) {
var headers = request.Headers;
headers[Common.ClientHeader] = DomainEvilGlobal.SecretData.UserInfo.ClientId.ToString();
headers[Common.ClientHeaderV] = Common.App.ProductVersion;
request.Headers = headers;
}
return CefReturnValue.Continue;
//Example of how to set Referer
// Same should work when setting any header
// For this example only set Referer when using our custom scheme
var url = new Uri(request.Url);
if (url.Scheme == "customscheme") // CefSharpSchemeHandlerFactory.SchemeName
{
var headers = request.Headers;
headers["Referer"] = "http://google.com";
request.Headers = headers;
}
//NOTE: If you do not wish to implement this method returning false is the default behaviour
// We also suggest you explicitly Dispose of the callback as it wraps an unmanaged resource.
//callback.Dispose();
//return false;
//NOTE: When executing the callback in an async fashion need to check to see if it's disposed
if (!callback.IsDisposed) {
using (callback) {
if (request.Method == "POST") {
using (var postData = request.PostData) {
if (postData != null) {
var elements = postData.Elements;
var charSet = request.GetCharSet();
foreach (var element in elements) {
if (element.Type == PostDataElementType.Bytes) {
var body = element.GetBody(charSet);
}
}
}
}
}
//Note to Redirect simply set the request Url
//if (request.Url.StartsWith("https://www.google.com", StringComparison.OrdinalIgnoreCase))
//{
// request.Url = "https://github.com/";
//}
//Callback in async fashion
//callback.Continue(true);
//return CefReturnValue.ContinueAsync;
}
}
return CefReturnValue.Continue;
}
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:60,代码来源:SixWebControlBehavior.cs
示例4: GetResourceHandler
public IResourceHandler GetResourceHandler(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request)
{
// Every time we request the main GPM page allow another JS injection
if (Regex.Match(request.Url, @"^http[s]?://play\.google\.com/music/listen", RegexOptions.IgnoreCase).Success)
{
firstJSOnly = true;
}
if (Regex.Match(request.Url, @"\.js", RegexOptions.IgnoreCase).Success && Regex.Match(request.Url, @"http", RegexOptions.IgnoreCase).Success && firstJSOnly)
{
firstJSOnly = false;
using (WebClient webClient = new WebClient())
{
// These are the JS files to inject into GPM
string custom_interface = Properties.Resources.custom_interface;
return ResourceHandler.FromStream(new MemoryStream(Encoding.UTF8.GetBytes(
webClient.DownloadString(request.Url) + ";window.onload=function(){csharpinterface.showApp();};document.addEventListener('DOMContentLoaded', function () {" +
"window.OBSERVER = setInterval(function() { if (document.getElementById('material-vslider')) { clearInterval(window.OBSERVER); " +
Properties.Resources.gmusic_min + Properties.Resources.gmusic_theme_min + Properties.Resources.gmusic_mini_player_min +
this.getInitCode() +
custom_interface +
"}}, 10);});")), webClient.ResponseHeaders["Content-Type"]);
}
}
return null;
}
开发者ID:ananthonline,项目名称:Google-Play-Music-Desktop-Player-UNOFFICIAL-,代码行数:26,代码来源:ResourceHandlerFactory.cs
示例5: Prepare
/// <summary>
/// Are about to send a new message
/// </summary>
/// <param name="message">Message to send</param>
/// <remarks>
/// Can be used to prepare the next message. for instance serialize it etc.
/// </remarks>
/// <exception cref="NotSupportedException">Message is of a type that the encoder cannot handle.</exception>
public void Prepare(object message)
{
if (!(message is IFrame))
throw new NotSupportedException("Only supports IFrame derived classes");
_frame = (IFrame) message;
}
开发者ID:jakubmacek,项目名称:Griffin.Framework,代码行数:15,代码来源:StompEncoder.cs
示例6: NewTabEventArgs
bool ILifeSpanHandler.OnBeforePopup(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, string targetFrameName, WindowOpenDisposition targetDisposition, bool userGesture, IPopupFeatures popupFeatures, IWindowInfo windowInfo, IBrowserSettings browserSettings, ref bool noJavascriptAccess, out IWebBrowser newBrowser)
{
newBrowser = null;
//browserControl.Load(targetUrl);
OpenInNewTab?.Invoke(this, new NewTabEventArgs(targetUrl)); //this breaks when there are multiple window.open calls from JS.
return true;
}
开发者ID:joe-williams-cccu,项目名称:OSIRTv2,代码行数:7,代码来源:LifespanHandler.cs
示例7: GetCurrentMovableTileLabels
/// <summary>
/// Override method GetCurrentMovableTileLabels in RowCol game.
/// </summary>
/// <param name="frame">The Frame.</param>
/// <returns>Result by selection of tile.</returns>
protected override List<string> GetCurrentMovableTileLabels(IFrame frame)
{
var result = new List<string>();
var nullTilePosition = this.FindTilePosition(string.Empty, frame);
if (this.NotFoundPosition == nullTilePosition)
{
return result;
}
for (int row = 0; row < frame.Rows; row++)
{
if (row == nullTilePosition.Row)
{
continue;
}
result.Add(frame.Tiles[row, nullTilePosition.Col].Label);
}
for (int col = 0; col < frame.Cols; col++)
{
if (col == nullTilePosition.Col)
{
continue;
}
result.Add(frame.Tiles[nullTilePosition.Row, col].Label);
}
return result;
}
开发者ID:TeamGameFifteen2AtTelerikAcademy,项目名称:Game-Fifteen,代码行数:38,代码来源:RowColMover.cs
示例8: Send
public void Send(IFrame frame)
{
if (frame == null) throw new ArgumentNullException("frame");
if (frame.Name != "MESSAGE")
throw new InvalidOperationException("Only MESSAGE frames may be sent through a subscription.");
_messagesSentThisSecond++;
if (IsPending)
throw new InvalidOperationException("Is either waiting on an ACK/NACK for the current message, or you've tried to send too many messages per second without acking them.");
if (IsThrottled)
throw new InvalidOperationException("You've tried to send too many messages per second. Adjust the MaxMessagesPerSecond property.");
if (_pendingFrames.Count >= 20)
throw new InvalidOperationException("Client already have more then 20 pending messages. Start ACK them.");
// not 100% accurate, but should keep the throttling reasonable stable.
if (DateTime.Now.Subtract(_startThrottle).TotalMilliseconds > 1000)
{
_messagesSentThisSecond = 0;
_startThrottle = DateTime.Now;
}
if (AckType != "auto")
_pendingFrames.Add(frame);
Client.Send(frame);
}
开发者ID:jorgenlidholm,项目名称:Griffin.Framework,代码行数:27,代码来源:Subscription.cs
示例9: OnBeforeContextMenu
public bool OnBeforeContextMenu(IWebBrowser browser, IFrame frame, IContextMenuParams parameters)
{
Console.WriteLine("Context menu opened");
Console.WriteLine(parameters.MisspelledWord);
return true;
}
开发者ID:klkn,项目名称:CefSharp,代码行数:7,代码来源:MenuHandler.cs
示例10: EnqueueFrame
protected void EnqueueFrame(NetContext context, IFrame frame)
{
lock(this)
{
AddFrame(context, ref singleFrameOrList, frame);
}
}
开发者ID:ReinhardHsu,项目名称:NetGain,代码行数:7,代码来源:ProtocolProcessor.cs
示例11: LoadErrorEventArgs
public LoadErrorEventArgs(IFrame frame, CefErrorCode errorCode, string errorText, string failedUrl)
{
Frame = frame;
ErrorCode = errorCode;
ErrorText = errorText;
FailedUrl = failedUrl;
}
开发者ID:klkn,项目名称:CefSharp,代码行数:7,代码来源:LoadErrorEventArgs.cs
示例12: ValidateUserDefinedLink
private static bool ValidateUserDefinedLink(IFrame frame)
{
var urlLinkFrame = FrameUtils.ConvertToUserDefinedURLLinkFrame(frame);
var ok = ValidateTextEncoding(urlLinkFrame.TextEncoding);
return ok;
}
开发者ID:saitodisse,项目名称:id3tag.net,代码行数:7,代码来源:Id3V2Validator.cs
示例13: ValidatePictureFrame
private static bool ValidatePictureFrame(IFrame frame)
{
var pictureFrame = FrameUtils.ConvertToPictureFrame(frame);
var ok = ValidateTextEncoding(pictureFrame.TextEncoding);
return ok;
}
开发者ID:saitodisse,项目名称:id3tag.net,代码行数:7,代码来源:Id3V2Validator.cs
示例14: Handle
public override int Handle(IFrame frame, IList<IFrame> frames)
{
return frame.Rolls
.Where(r => r.Pins.HasValue)
.Select(r => r.Pins.Value)
.Sum();
}
开发者ID:crixo,项目名称:KataBowling,代码行数:7,代码来源:BaseRuleLink.cs
示例15: FrameLoadStartEventArgs
public FrameLoadStartEventArgs(IBrowser browser, IFrame frame)
{
Browser = browser;
Frame = frame;
Url = frame.Url;
IsMainFrame = frame.IsMain;
}
开发者ID:bjarteskogoy,项目名称:CefSharp,代码行数:7,代码来源:FrameLoadStartEventArgs.cs
示例16: GetResourceHandler
public IResourceHandler GetResourceHandler(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request)
{
// Every time we request the main GPM page allow another JS injection
if (Regex.Match(request.Url, @"^http[s]?://play\.google\.com/music/listen", RegexOptions.IgnoreCase).Success)
{
firstJSOnly = true;
}
if (Regex.Match(request.Url, @"\.js", RegexOptions.IgnoreCase).Success && Regex.Match(request.Url, @"http", RegexOptions.IgnoreCase).Success && firstJSOnly)
{
firstJSOnly = false;
using (WebClient webClient = new WebClient())
{
// These are the JS files to inject into GPM
string dark_theme = Google_Play_Music.Properties.Resources.dark_theme;
string custom_interface = Google_Play_Music.Properties.Resources.custom_interface;
string mini_player = Google_Play_Music.Properties.Resources.mini_player;
Color c = Properties.Settings.Default.CustomColor;
string RGB = "#" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
string custom_color = ";(function() {window.CustomColor = '" + RGB + "';})();";
bool controlsOnHover = Properties.Settings.Default.HoverControls;
string controlsOnHoverJS = ";(function() {window.hoverControls = " + controlsOnHover.ToString().ToLower() + ";})();";
string setInitialZoomJS = ";(function() {csharpinterface.setInitialZoom();})();";
return ResourceHandler.FromStream(new MemoryStream(Encoding.UTF8.GetBytes(webClient.DownloadString(request.Url) + ";" + custom_color + controlsOnHoverJS + setInitialZoomJS + dark_theme + custom_interface + mini_player)), webClient.ResponseHeaders["Content-Type"]);
}
}
return null;
}
开发者ID:hj3938,项目名称:Google-Play-Music-Desktop-Player-UNOFFICIAL-,代码行数:31,代码来源:ResourceHandlerFactory.cs
示例17: ProxyFrame
/// <summary>
/// Initializes a new instance of the ProxyFrame class.
/// </summary>
/// <param name="frame">Frame of type IFrame.</param>
public ProxyFrame(IFrame frame)
{
Validator.ValidateIsEqualOrGreaterThan(frame.Rows, Constants.FrameDimensionMin, "frame.Rows");
Validator.ValidateIsEqualOrGreaterThan(frame.Cols, Constants.FrameDimensionMin, "frame.Cols");
this.realFrame = frame;
}
开发者ID:TeamGameFifteen2AtTelerikAcademy,项目名称:Game-Fifteen,代码行数:11,代码来源:ProxyFrame.cs
示例18: SetCurrentFrame
public void SetCurrentFrame(IFrame currentFrame)
{
if (currentFrame == null || currentFrame.Function != _lastFunction)
{
instructionsListView.Items.Clear();
_lastFunction = null;
}
if (currentFrame != null)
{
if (currentFrame.Function == _lastFunction)
{
foreach (var item in instructionsListView.Items.Cast<MsilInstructionListViewItem>())
item.UpdateItem(currentFrame);
}
else
{
_lastFunction = currentFrame.Function;
var bytes = ((RuntimeFunction)currentFrame.Function).IlCode.GetBytes();
var disassembler = new MsilDisassembler(new MemoryStreamReader(bytes), new DefaultOperandResolver());
foreach (var instruction in disassembler.Disassemble())
{
var instructionBytes = new byte[instruction.Size];
Buffer.BlockCopy(bytes, instruction.Offset, instructionBytes, 0, instruction.Size);
var item = new MsilInstructionListViewItem(instruction, instructionBytes);
item.UpdateItem(currentFrame);
instructionsListView.Items.Add(item);
}
}
}
}
开发者ID:die-Deutsche-Orthopaedie,项目名称:LiteDevelop,代码行数:31,代码来源:MsilInstructionsControl.cs
示例19: Handle
public override int Handle(IFrame frame, IList<IFrame> frames)
{
if (!CanHandle(frame)) return 0;
int frameScore = Configuration.NumberOfPins;
List<int> extraRolls = new List<int>();
var nextFrame = frames.FirstOrDefault(f => f.Sequence == frame.Sequence + 1);
while(nextFrame != null && extraRolls.Count < Configuration.NumberOfRollsPerFrame)
{
if (IsStrike(nextFrame))
{
extraRolls.Add(Configuration.NumberOfPins);
nextFrame = frames.FirstOrDefault(f => f.Sequence == frame.Sequence + 1);
}
else
{
extraRolls.Add(
nextFrame.Rolls
.Where(r => r.Pins.HasValue)
.Select(r => r.Pins.Value).ToArray()[extraRolls.Count]
);
}
}
return frameScore + extraRolls.Sum();
}
开发者ID:crixo,项目名称:KataBowling,代码行数:28,代码来源:StrikeRuleLink.cs
示例20: Copy
public IFrame Copy(IFrame srcFrame, Guid newFrameId, bool copyData)
{
if (!(srcFrame is SimpleFrame))
throw new ArgumentException("srcFrame");
SimpleFrame copy = null;
if (copyData)
return Copy(srcFrame, newFrameId);
if (srcFrame is SimpleFrame)
{
SimpleFrame srcSimpleFrame = srcFrame as SimpleFrame;
copy = new SimpleFrame(newFrameId);
copy.MinimumCapacity = srcSimpleFrame.RowCount;
foreach (DataColumn col in srcSimpleFrame.Columns)
{
DataColumn newCol = CopyColumn(col);
copy.Columns.Add(newCol);
}
for (int i = 0; i < srcSimpleFrame.Rows.Count; i++)
{
copy.Rows.Add(copy.NewRow());
}
copy.AcceptChanges();
}
return copy;
}
开发者ID:BgRva,项目名称:Blob1,代码行数:28,代码来源:SimpleFrameDataCopier.cs
注:本文中的IFrame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论