本文整理汇总了C#中System.Windows.Controls.NotifyEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# NotifyEventArgs类的具体用法?C# NotifyEventArgs怎么用?C# NotifyEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotifyEventArgs类属于System.Windows.Controls命名空间,在下文中一共展示了NotifyEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: BrowserScriptNotify
private void BrowserScriptNotify(object sender, NotifyEventArgs e)
{
string wooterMarker = "wooterimage";
var url = e.Value;
Match match = this.regex.Match(url);
if (url.StartsWith(wooterMarker))
{
url = url.Substring(wooterMarker.Length);
DisplayAdditionalImage(url);
}
else if (match.Success)
{
url = match.Groups[1].Value;
DisplayAdditionalImage(url);
}
else
{
try
{
task.Uri = new Uri(url);
task.Show();
}
catch
{
}
}
}
开发者ID:virmani,项目名称:Wooter,代码行数:28,代码来源:WootControl.xaml.cs
示例2: ScriptNotify
private void ScriptNotify(object sender, NotifyEventArgs e)
{
if (!string.IsNullOrEmpty(e.Value))
{
Uri navigateTo = utilities.processBBcodeLink(e.Value);
if (navigateTo != null)
NavigationService.Navigate(navigateTo);
}
}
开发者ID:passick,项目名称:wp.fm,代码行数:9,代码来源:trackInfoPage.xaml.cs
示例3: Browser_ScriptNotify
private void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
if (e.Value == "chooseAddress")
{
var task = new AddressChooserTask();
task.Completed += task_Completed;
task.Show();
}
}
开发者ID:timothybinkley,项目名称:Windows-Phone-8-In-Action,代码行数:9,代码来源:MainPage.xaml.cs
示例4: Browser_ScriptNotify
private void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
// if a page notifies that it should not be scrollable, disable
// scrolling.
if (e.Value == "noScroll")
{
_browserHelper.ScrollDisabled = true;
}
}
开发者ID:niths,项目名称:niths-wp7-fadderukeapp,代码行数:9,代码来源:MainPage.xaml.cs
示例5: browser_ScriptNotify
private void browser_ScriptNotify(object sender, NotifyEventArgs e)
{
var response = new object[]
{
DeviceStatus.ApplicationCurrentMemoryUsage,
DeviceStatus.ApplicationMemoryUsageLimit,
DeviceStatus.ApplicationPeakMemoryUsage,
DeviceStatus.DeviceTotalMemory
};
browser.InvokeScript("getMemoryUsageCallback", response.Select(c => c.ToString()).ToArray());
}
开发者ID:sondreb,项目名称:CERC,代码行数:12,代码来源:MainPage.xaml.cs
示例6: Browser_ScriptNotify
private void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
if (Debugger.IsAttached)
{
ScriptNotify newValue = new ScriptNotify()
{
Value = e.Value,
Time = DateTime.Now,
FormattedTime = "at " + (DateTime.Now.Subtract(startTime)).TotalMilliseconds.ToString("0,000") + " milliseconds"
};
notifications.Add(newValue);
DebugPanel.ScrollTo(newValue);
}
}
开发者ID:matthiasxc,项目名称:WP8-HTML-Tutorials,代码行数:15,代码来源:MainPage.xaml.cs
示例7: FacebookLoginBrowser_ScriptNotify
private void FacebookLoginBrowser_ScriptNotify(object sender, NotifyEventArgs e)
{
FacebookOAuthResult authResult;
if (FacebookOAuthResult.TryParse(e.Value, out authResult))
{
if (authResult.IsSuccess)
{
loggedIn = true;
loginSucceeded(authResult);
}
else
{
MessageBox.Show(authResult.ErrorDescription);
}
}
}
开发者ID:nitzo,项目名称:MegaStarz,代码行数:16,代码来源:MainPage.xaml.cs
示例8: Browser_ScriptNotify
private void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
switch (e.Value)
{
case "onload":
OnLoad();
break;
case "opendialog":
IsDialogVisible = true;
break;
case "closedialog":
IsDialogVisible = false;
break;
}
}
开发者ID:sondreb,项目名称:ImageCards,代码行数:16,代码来源:MainPage.xaml.cs
示例9: PART_Browser_ScriptNotify
void PART_Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
switch (e.Value)
{
case "domready":
isDomReady = true;
Task.Delay(100).ContinueWith(
task => { this.UpdateText(this.Text); },
TaskScheduler.FromCurrentSynchronizationContext());
break;
default:
// don't do any unnecessary binding if values are equal.
string text = GetValue(TextProperty) as string;
if (text != e.Value)
SetValue(TextProperty, e.Value);
break;
}
}
开发者ID:jarkkom,项目名称:awfuldotnet,代码行数:19,代码来源:HtmlTextBoxControl.xaml.cs
示例10: Browser_ScriptNotify
private void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
if (e.Value.StartsWith("scrollDisabled:"))
{
var disabled = e.Value.Substring(15);
_browserHelper.ScrollDisabled = disabled == "true";
}
if (e.Value == "hideSplashscreen")
{
Storyboard sb = this.Resources["SplashScreenHideAnim"] as Storyboard;
sb.Completed += (s, e2) => splash.Visibility = Visibility.Collapsed;
sb.Begin();
}
if (e.Value == "getTombstoneState" && App.Current.TombstoneState != null)
{
phoneGapView.Browser.InvokeScript("restoreTombstoneState", new string[] { App.Current.TombstoneState });
}
}
开发者ID:pauhlet,项目名称:PropertyFinder-HTML5,代码行数:20,代码来源:MainPage.xaml.cs
示例11: Catch_Script_Notification
// Step 1: Catch Javascript signal
private void Catch_Script_Notification(object sender, NotifyEventArgs e)
{
if (e.Value.StartsWith("LaunchPhotoChooser"))
{
// Step 2: Launch the PhotoChooser
_photoChooser = new PhotoChooserTask();
_photoChooser.Completed += _photoChooser_Completed;
// allow the user to either choose a saved image or take a new one
_photoChooser.ShowCamera = true;
_photoChooser.PixelHeight = 260;
_photoChooser.PixelWidth = 200;
_photoChooser.Show();
}
else
{
// used for debuggin
TextBlock alertBox = new TextBlock();
alertBox.Text = e.Value;
notifyAlert.Children.Add(alertBox);
}
}
开发者ID:matthiasxc,项目名称:WP8-HTML-Tutorials,代码行数:22,代码来源:MainPage.xaml.cs
示例12: FromJS
private void FromJS(object sender, NotifyEventArgs e)
{
var opcode = e.Value.Substring(0, 1);
if (opcode == "s") {
Debugger.Log(1, "FromJS", "saving\r\n");
var data = e.Value.Substring(1);
settings["data"] = data;
}
else if (opcode == "l")
{
Debugger.Log(1, "FromJS", "loading\r\n");
string data = settings["data"].ToString();
Browser.InvokeScript("preload", new string[] { data });
}
else
{
// Sent for debugging purposes only
Debugger.Log(1, "FromJS", e.Value + "\r\n");
}
}
开发者ID:wagnergsantos,项目名称:WritingPortableMobileApps,代码行数:21,代码来源:MainPage.xaml.cs
示例13: Browser_ScriptNotify
private void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
string fileName = "01_Susies_dnc_09-05-12.mp3";
var resource = Application.GetResourceStream(new Uri(@"media/" + fileName, UriKind.Relative));
IsolatedStorageFileStream fileStream = IsolatedStorageFile.GetUserStoreForApplication().CreateFile(fileName);
resource.Stream.CopyTo(fileStream, 4096);
resource.Stream.Close();
fileStream.Close();
Uri fileUri = new Uri(fileName, UriKind.RelativeOrAbsolute);
var ml = new MediaLibrary();
try
{
MediaLibraryExtensions.SaveSong(ml, fileUri, null, SaveSongOperation.CopyToLibrary);
}
catch (Exception ex)
{
string errorMessage = ex.Message.ToString();
}
}
开发者ID:powerfinger,项目名称:js1.3.1_breaks_hlink_in_phone,代码行数:21,代码来源:MainPage.xaml.cs
示例14: ArticleView_ScriptNotify
void ArticleView_ScriptNotify(object sender, NotifyEventArgs e)
{
// split
var parts = e.Value.Split('=');
if (parts.Length != 2)
{
return;
}
// parse
int number = 0;
if (!int.TryParse(parts[1], out number))
{
return;
}
// decide what to do
if (parts[0] == "scrollHeight")
{
_scrollHeight = number;
if (_visibleHeight > 0)
{
DisplayScrollBar.Maximum = _scrollHeight - _visibleHeight;
}
}
else if (parts[0] == "clientHeight")
{
_visibleHeight = number;
if (_scrollHeight > 0)
{
DisplayScrollBar.Maximum = _scrollHeight - _visibleHeight;
}
}
else if (parts[0] == "scrollTop")
{
DisplayScrollBar.Value = number;
}
}
开发者ID:now-readable,项目名称:now-readable,代码行数:38,代码来源:Article.xaml.cs
示例15: browser_ScriptNotify
/// <summary>
/// Handles calls to window.external.Notify from within the web browser control. We'll hijack this for message passing from browser back into C#.
/// TODO: Processing the instruction could be blocking....... bleh
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void browser_ScriptNotify(object sender, NotifyEventArgs e)
{
// Process instruction into a command + parameters (if specified).
string command = "";
string[] commandParams;
int colPos = e.Value.IndexOf(':');
if (colPos > 0)
{
command = e.Value.Substring(0, colPos);
commandParams = e.Value.Substring(colPos).Split('/');
}
else
{
command = e.Value;
commandParams = new string[0];
}
// Send command + params to the command manager and get the return value.
string returnValue = manager.processInstruction(command, commandParams);
if (returnValue != null && returnValue.Length > 0)
{
browser.InvokeScript("gap.evaluate", returnValue);
}
}
开发者ID:avenauche,项目名称:phonegap-winphone,代码行数:29,代码来源:MainPage.xaml.cs
示例16: CordovaBrowser_ScriptNotify
/*
* This method does the work of routing commands
* NotifyEventArgs.Value contains a string passed from JS
* If the command already exists in our map, we will just attempt to call the method(action) specified, and pass the args along
* Otherwise, we create a new instance of the command, add it to the map, and call it ...
* This method may also receive JS error messages caught by window.onerror, in any case where the commandStr does not appear to be a valid command
* it is simply output to the debugger output, and the method returns.
*
**/
void CordovaBrowser_ScriptNotify(object sender, NotifyEventArgs e)
{
string commandStr = e.Value;
string commandName = commandStr.Split('/').FirstOrDefault();
if (browserDecorators.ContainsKey(commandName))
{
browserDecorators[commandName].HandleCommand(commandStr);
return;
}
CordovaCommandCall commandCallParams = CordovaCommandCall.Parse(commandStr);
if (commandCallParams == null)
{
// ERROR
Debug.WriteLine("ScriptNotify :: " + commandStr);
}
else if (commandCallParams.Service == "CoreEvents")
{
switch (commandCallParams.Action.ToLower())
{
case "overridebackbutton":
string arg0 = JsonHelper.Deserialize<string[]>(commandCallParams.Args)[0];
this.OverrideBackButton = (arg0 != null && arg0.Length > 0 && arg0.ToLower() == "true");
break;
case "__exitapp":
Debug.WriteLine("Received exitApp command from javascript, app will now exit.");
CordovaBrowser.InvokeScript("eval", new string[] { "cordova.fireDocumentEvent('pause');" });
CordovaBrowser.InvokeScript("eval", new string[] { "setTimeout(function(){ cordova.fireDocumentEvent('exit'); cordova.exec(null,null,'CoreEvents','__finalexit',[]); },0);" });
break;
case "__finalexit":
IsExiting = true;
// hide the browser to prevent white flashes, since about:blank seems to always be white
CordovaBrowser.Opacity = 0d;
CordovaBrowser.Navigate(new Uri("about:blank", UriKind.Absolute));
break;
}
}
else
{
if (configHandler.IsPluginAllowed(commandCallParams.Service))
{
commandCallParams.Namespace = configHandler.GetNamespaceForCommand(commandCallParams.Service);
nativeExecution.ProcessCommand(commandCallParams);
}
else
{
Debug.WriteLine("Error::Plugin not allowed in config.xml. " + commandCallParams.Service);
}
}
}
开发者ID:EESTEC-AGH-Krakow,项目名称:event-logistics-facility,代码行数:62,代码来源:CordovaView.xaml.cs
示例17: GapBrowser_ScriptNotify
/*
* This method does the work of routing commands
* NotifyEventArgs.Value contains a string passed from JS
* If the command already exists in our map, we will just attempt to call the method(action) specified, and pass the args along
* Otherwise, we create a new instance of the command, add it to the map, and call it ...
* This method may also receive JS error messages caught by window.onerror, in any case where the commandStr does not appear to be a valid command
* it is simply output to the debugger output, and the method returns.
*
**/
void GapBrowser_ScriptNotify(object sender, NotifyEventArgs e)
{
string commandStr = e.Value;
if (commandStr.IndexOf("DOMStorage") == 0)
{
this.domStorageHelper.HandleStorageCommand(commandStr);
return;
}
else if (commandStr.IndexOf("Orientation") == 0)
{
this.orientationHelper.HandleCommand(commandStr);
return;
}
CordovaCommandCall commandCallParams = CordovaCommandCall.Parse(commandStr);
if (commandCallParams == null)
{
// ERROR
Debug.WriteLine("ScriptNotify :: " + commandStr);
}
else if (commandCallParams.Service == "CoreEvents")
{
switch (commandCallParams.Action.ToLower())
{
case "overridebackbutton":
string arg0 = JsonHelper.Deserialize<string[]>(commandCallParams.Args)[0];
this.OverrideBackButton = (arg0 != null && arg0.Length > 0 && arg0.ToLower() == "true");
break;
}
}
else
{
if (configHandler.IsPluginAllowed(commandCallParams.Service))
{
nativeExecution.ProcessCommand(commandCallParams);
}
else
{
Debug.WriteLine("Error::Plugin not allowed in config.xml. " + commandCallParams.Service);
}
}
}
开发者ID:peter76111,项目名称:myGeoApp,代码行数:53,代码来源:CordovaView.xaml.cs
示例18: GapBrowser_ScriptNotify
/*
* This method does the work of routing commands
* NotifyEventArgs.Value contains a string passed from JS
* If the command already exists in our map, we will just attempt to call the method(action) specified, and pass the args along
* Otherwise, we create a new instance of the command, add it to the map, and call it ...
* This method may also receive JS error messages caught by window.onerror, in any case where the commandStr does not appear to be a valid command
* it is simply output to the debugger output, and the method returns.
*
**/
void GapBrowser_ScriptNotify(object sender, NotifyEventArgs e)
{
string commandStr = e.Value;
string commandName = commandStr.Split('/').FirstOrDefault();
if (browserDecorators.ContainsKey(commandName))
{
browserDecorators[commandName].HandleCommand(commandStr);
return;
}
CordovaCommandCall commandCallParams = CordovaCommandCall.Parse(commandStr);
if (commandCallParams == null)
{
// ERROR
Debug.WriteLine("ScriptNotify :: " + commandStr);
}
else if (commandCallParams.Service == "CoreEvents")
{
switch (commandCallParams.Action.ToLower())
{
case "overridebackbutton":
string arg0 = JsonHelper.Deserialize<string[]>(commandCallParams.Args)[0];
this.OverrideBackButton = (arg0 != null && arg0.Length > 0 && arg0.ToLower() == "true");
break;
}
}
else
{
if (configHandler.IsPluginAllowed(commandCallParams.Service))
{
nativeExecution.ProcessCommand(commandCallParams);
}
else
{
Debug.WriteLine("Error::Plugin not allowed in config.xml. " + commandCallParams.Service);
}
}
}
开发者ID:phong101665,项目名称:Cinema,代码行数:49,代码来源:CordovaView.xaml.cs
示例19: GapBrowser_ScriptNotify
/*
* This method does the work of routing commands
* NotifyEventArgs.Value contains a string passed from JS
* If the command already exists in our map, we will just attempt to call the method(action) specified, and pass the args along
* Otherwise, we create a new instance of the command, add it to the map, and call it ...
* This method may also receive JS error messages caught by window.onerror, in any case where the commandStr does not appear to be a valid command
* it is simply output to the debugger output, and the method returns.
*
**/
void GapBrowser_ScriptNotify(object sender, NotifyEventArgs e)
{
string commandStr = e.Value;
Debug.WriteLine("Command::" + commandStr);
// DOMStorage/Local OR DOMStorage/Session
if (commandStr.IndexOf("DOMStorage") == 0)
{
this.domStorageHelper.HandleStorageCommand(commandStr);
return;
}
else if (commandStr.IndexOf("Orientation") == 0)
{
this.orientationHelper.HandleCommand(commandStr);
return;
}
PhoneGapCommandCall commandCallParams = PhoneGapCommandCall.Parse(commandStr);
if (commandCallParams == null)
{
// ERROR
Debug.WriteLine("ScriptNotify :: " + commandStr);
return;
}
else if (commandCallParams.Service == "CoreEvents")
{
switch (commandCallParams.Action.ToLower())
{
case "overridebackbutton":
string[] args = PhoneGap.JSON.JsonHelper.Deserialize<string[]>(commandCallParams.Args);
this.OverrideBackButton = (args != null && args.Length > 0 && args[0] == "true");
break;
}
return;
}
this.nativeExecution.ProcessCommand(commandCallParams);
}
开发者ID:roadlabs,项目名称:phonegap-1,代码行数:49,代码来源:PGView.xaml.cs
示例20: Browser_ScriptNotify
// **********************************************************************
// JavaScript communicating with C#
// **********************************************************************
private async void Browser_ScriptNotify(object sender, NotifyEventArgs e)
{
// Get a comma delimited string from js and convert to array
string valueStr = e.Value;
string[] valueArr = valueStr.Split(',');
// Trim and convert empty strings to null
for (int i = 0; i < valueArr.Length; i++)
{
valueArr[i] = valueArr[i].Trim();
if (string.IsNullOrWhiteSpace(valueArr[i]))
valueArr[i] = null;
}
// Activate trial mode
if (valueArr[0] == "checkLicense")
{
// Check if trial
if (valueArr[1] == "true")
{
C2SettingIsTrial = true;
}
CheckLicense();
}
// Game loaded
if (valueArr[0] == "gameLoaded")
{
Browser.Visibility = System.Windows.Visibility.Visible;
checkMusic();
if (App.WasTombstoned)
{
Browser.InvokeScript("eval", "window['tombstoned'] = true");
App.WasTombstoned = false;
}
}
// Stop music
if (valueArr[0] == "stopMusic")
{
if (MediaPlayer.GameHasControl)
{
FrameworkDispatcher.Update();
MediaPlayer.Stop();
}
}
// Play music
if (valueArr[0] == "playMusic")
{
if (MediaPlayer.GameHasControl)
{
var file = valueArr[1];
var loop = valueArr[2] == "0" ? false : true;
var db = Single.Parse(valueArr[3], CultureInfo.InvariantCulture);
var volume = Convert.ToSingle(dbToScale(db));
var uri = new Uri(file, UriKind.Relative);
var song = Song.FromUri(file, uri);
MediaPlayer.IsRepeating = loop;
MediaPlayer.Volume = volume;
FrameworkDispatcher.Update();
MediaPlayer.Stop();
MediaPlayer.Play(song);
}
}
// Stop music
if (valueArr[0] == "stopMusic")
{
if (MediaPlayer.GameHasControl)
{
FrameworkDispatcher.Update();
MediaPlayer.Stop();
}
}
// Play sound
if (valueArr[0] == "playSound")
{
var file = valueArr[1];
var loop = valueArr[2] == "0" ? false : true;
var db = Single.Parse(valueArr[3], CultureInfo.InvariantCulture);
var volume = Convert.ToSingle(dbToScale(db));
var tag = valueArr[4];
Stream stream = TitleContainer.OpenStream(file);
//.........这里部分代码省略.........
开发者ID:jksulkow,项目名称:KoalaQuest,代码行数:101,代码来源:MainPage.xaml.cs
注:本文中的System.Windows.Controls.NotifyEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论