本文整理汇总了C#中System.Windows.Controls.NotifyEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# NotifyEventArgs类的具体用法?C# NotifyEventArgs怎么用?C# NotifyEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NotifyEventArgs类属于System.Windows.Controls命名空间,在下文中一共展示了NotifyEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
{
}
}
}
示例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);
}
}
示例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();
}
}
示例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;
}
}
示例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());
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
}
示例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;
}
}
示例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 });
}
}
示例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);
}
}
示例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");
}
}
示例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();
}
}
示例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;
}
}
示例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);
}
}