public static void ReflectUserMode(wucDXBase window) { var cc_DisplayOptions = VNC.Core.Xaml.PhysicalTree.FindChild <ContentControl>(window, "cc_DisplayOptions"); if (cc_DisplayOptions == null) { Log.Warning(string.Format("Can't locate element {0}", "cc_DisplayOptions"), Common.LOG_APPNAME); return; } var adminOptions = VNC.Core.Xaml.PhysicalTree.FindChild <WrapPanel>(cc_DisplayOptions, "AdminOptions"); if (adminOptions == null) { Log.Warning(string.Format("Can't locate element {0}", "adminOptions"), Common.LOG_APPNAME); return; } if (Common.UserMode.Administrator || Common.UserMode.Advanced) { ((WrapPanel)adminOptions).Visibility = Visibility.Visible; } else { ((WrapPanel)adminOptions).Visibility = Visibility.Hidden; } }
private void UnhookTitleEvent(wucDXBase control) { if (control != null) { control.TitleChanged -= SetTitle; } }
private void HookTitleEvent(wucDXBase control) { SetTitle(control, EventArgs.Empty); if (control != null) { control.TitleChanged += SetTitle; //control.TitleChanged2 += SetTitle2; } }
private void SetTitle2(object sender, EventArgs e) { wucDXBase uc = sender as wucDXBase; if (uc != null && !string.IsNullOrEmpty(uc.Title)) { this.Title = string.Format("VNCCodeCommandConsole: {0}", uc.Title); } else { this.Title = "VNCCodeCommandConsole"; } }