/// <summary> /// Creates a new control of given type <typeparamref name="TControl"/> and attaches it as a child control. /// </summary> /// <remarks> /// This uses the control classes from original Colossal UI for instantiating the new control but wraps it /// automatically with the control classes from SkylineToolkit. /// </remarks> /// <typeparam name="TControl">The type of the new control.</typeparam> /// <returns>The newly created control.</returns> public ColossalControl <TControl> AddComponent <TControl>() where TControl : UIComponent { TControl component = this.UIComponent.AddUIComponent <TControl>(); return(new ColossalControl <TControl>(component)); }
public TControl New <TControl>() where TControl : TChildrenType, new() { var control = new TControl(); Children.Add(control); return(control); }
public SMNatives(NativeData nativeData) { Globals = new TGlobals(nativeData); Application = new TApplication(nativeData); Control = new TControl(nativeData); ElWind = new TElWind(nativeData); SMMain = new TSMMain(nativeData); Database = new TDatabase(nativeData); Registry = new TRegistry(Database, nativeData); }
private void ControlThread() { TControl tControl = new TControl(); while (true) { bool sleep = tControl.ControlThread(floors, elevators, settings.Capacity); if (sleep) { Thread.Sleep(settings.LoginSpeed); } } }
public TControl GetActiveControl <TControl>() where TControl : class { ThreadHelper.ThrowIfNotOnUIThread(); Control ctrl = ActiveDialogOrFrameControl; IContainerControl cc; while (null != (cc = ctrl as IContainerControl)) { ctrl = cc.ActiveControl; if (ctrl == null || ctrl == cc) { ctrl = cc as Control; break; } } if (ctrl == null) { return(null); } while (ctrl != null) { TControl tc = ctrl as TControl; if (tc != null) { return(tc); } ctrl = ctrl.Parent; } return(null); }
public static Constraint GetControlElementConstraint() { var dummyControl = new TControl(); return(dummyControl.ElementConstraint); }
/// <summary> /// Inno Setup <a href="https://jrsoftware.org/ishelp/index.php?topic=scriptclasses">Documentation</a> /// </summary> public void IncTopDecHeight(TControl AControl, int Amount) { }
public void Build(TableSorter <TRequest, TEntity, TControl> sorter, TControl controlValue) { sorter.AddColumn(controlValue, Expression); }
internal ChildControlEventArgs(TControl item) { Control = item; }
private async Task <TResult> ShowHostedDialog <TControl, TViewModel, TResult>() where TViewModel : class where TResult : class where TControl : UserControl, new() { var ctrl = new TControl(); var vm = ctrl.DataContext as TViewModel; bool newHost = false; DialogWindowHost host = CurrentDialogHost; if (host == null) { host = new DialogWindowHost { Owner = Window, Content = ctrl }; host.Closed += (s, e) => { DialogStack.Clear(); CurrentDialogHost = null; }; CurrentDialogHost = host; newHost = true; } else { host.Content = ctrl; } var hostVm = host.DataContext as IDialogHostViewModel; await hostVm.Setup(vm); TResult result = null; await Dispatcher.RunAsync(() => { bool shouldSetupResult = false; if (newHost) { try { shouldSetupResult = host.ShowDialog() == true; } catch (InvalidOperationException) { // Window was closed during setup } } if (shouldSetupResult) { result = DialogStack.ResultSetup <TViewModel, TResult>(vm); } }); return(result); }
/// <summary> /// Inno Setup <a href="https://jrsoftware.org/ishelp/index.php?topic=scriptclasses">Documentation</a> /// </summary> public void ScrollInView(TControl AControl) { }