public override UserControl[] GetPropertiesControls() { BoolControl boolctrl = new BoolControl() { Title = LocalizationManager.Get("State Dependent"), Value = IsStateDependent, Visibility = System.Windows.Visibility.Visible }; ScriptControl control = GetPropertyControl <ScriptControl>(); control.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; control.Commands.Clear(); foreach (var item in Commands) { if (item.AdditionalParameters.Count == 0) { for (int i = 0; i < 10; i++) { item.AdditionalParameters.Add(new One <string>()); } } control.Commands.Add(new vMixControlButtonCommand() { Action = item.Action, Collapsed = item.Collapsed, Input = item.Input, InputKey = item.InputKey, Parameter = item.Parameter, StringParameter = item.StringParameter, AdditionalParameters = item.AdditionalParameters }); } return(base.GetPropertiesControls().Concat(new UserControl[] { boolctrl, control }).ToArray()); }
public override UserControl[] GetPropertiesControls() { IntControl periodInt = GetPropertyControl <IntControl>(); periodInt.Title = LocalizationManager.Get("Update Period"); periodInt.Value = Period; FilePathControl providerPath = GetPropertyControl <FilePathControl>(); providerPath.Filter = "External Data|*.dll"; providerPath.Value = DataProviderPath; periodInt.Value = Period; BoolControl loopBool = GetPropertyControl <BoolControl>(); loopBool.Value = RestartData; loopBool.Title = LocalizationManager.Get("Loop Data"); loopBool.Tag = "RD"; var props = base.GetPropertiesControls(); foreach (var prop in props.OfType <BoolControl>()) { prop.Visibility = Visibility.Collapsed; } return((new UserControl[] { periodInt, providerPath, loopBool }).Concat(props).ToArray()); }
public ActionResult BaseGenerateBoolControl(string Id, Guid formId, string culture) { var boolControl = new BoolControl(); if (!string.IsNullOrEmpty(Id)) { var form = FormGeneratorComponent.Instance.FormStructureFacade.GetByCulture(formId, culture); if (form == null) { return(Content("false")); } var firstOrDefault = form.Controls.FindControl(Id); if (firstOrDefault != null) { boolControl = (BoolControl)firstOrDefault; } } ViewBag.BoolTextAlign = new SelectList( EnumUtils.ConvertEnumToIEnumerableInLocalization <Align>().Select( keyValuePair => new KeyValuePair <byte, string>((byte)keyValuePair.Key.ToEnum <Align>(), keyValuePair.Value)), "Key", "Value"); ViewBag.formId = formId; ViewBag.culture = culture; return(PartialView("PVBaseGenerateBoolControl", boolControl)); }
protected async Task DeleteManga(List <IManga> list, BoolControl deleteFolder) { foreach (var manga in list) { await Library.Remove(manga).ConfigureAwait(true); if (deleteFolder.Value) { DirectoryHelpers.DeleteDirectory(manga.GetAbsoluteFolderPath()); } } }
public override UserControl[] GetPropertiesControls() { IntControl control = GetPropertyControl <IntControl>(); control.Title = LocalizationManager.Get("Update Period"); control.Value = Period; FilePathControl control1 = GetPropertyControl <FilePathControl>(); control1.Filter = "External Data|*.dll"; control1.Value = DataProviderPath; control.Value = Period; BoolControl control2 = GetPropertyControl <BoolControl>(); control2.Value = RestartData; control2.Title = LocalizationManager.Get("Loop Data"); control2.Tag = "RD"; var props = base.GetPropertiesControls(); props.OfType <BoolControl>().First().Visibility = System.Windows.Visibility.Collapsed; return((new UserControl[] { control, control1, control2 }).Concat(props).ToArray()); }
public override async Task Execute(IEnumerable <IManga> mangas) { var list = mangas.ToList(); var isSingle = list.Count == 1; var text = isSingle ? string.Format("Удалить мангу {0}?", list[0].Name) : ("Удалить мангу?" + Environment.NewLine + string.Join(Environment.NewLine, list.Select(l => $" - {l}"))); var dialog = new Dialogs.Avalonia.Dialog { Title = "Удаление манги", Description = text + Environment.NewLine + "Манга и история её обновлений будет удалена." }; var deleteFolder = new BoolControl(); dialog.Controls.Add(deleteFolder); deleteFolder.Name = isSingle ? $"Удалить папку {list[0].Folder}" : "Удалить связанные папки"; var yes = dialog.Buttons.AddButton("Да"); var no = dialog.Buttons.AddButton("Нет"); if (await dialog.ShowAsync().ConfigureAwait(true) == yes) { await Library.ThreadAction(DeleteManga(list, deleteFolder)).LogException().ConfigureAwait(true); } }
/// <summary> /// Obtains a control to edit a given property. Changes to the selection set /// cause this method to be called again (and passed a new 'context'), /// unless ICacheablePropertyControl is implemented on the control. For /// performance reasons, it is highly recommended that the control implement /// the ICacheablePropertyControl interface.</summary> /// <param name="context">Context for property editing control</param> /// <returns>Control to edit the given context</returns> public Control GetEditingControl(PropertyEditorControlContext context) { m_boolControl = new BoolControl(context); SkinService.ApplyActiveSkin(m_boolControl); return(m_boolControl); }
/// <summary> /// Obtains a control to edit a given property. Changes to the selection set /// cause this method to be called again (and passed a new 'context'), /// unless ICacheablePropertyControl is implemented on the control. For /// performance reasons, it is highly recommended that the control implement /// the ICacheablePropertyControl interface.</summary> /// <param name="context">Context for property editing control</param> /// <returns>Control to edit the given context</returns> public Control GetEditingControl(PropertyEditorControlContext context) { m_boolControl = new BoolControl(context); return m_boolControl; }
/// <summary> /// Obtains a control to edit a given property. Changes to the selection set /// cause this method to be called again (and passed a new 'context'), /// unless ICacheablePropertyControl is implemented on the control. For /// performance reasons, it is highly recommended that the control implement /// the ICacheablePropertyControl interface.</summary> /// <param name="context">Context for property editing control</param> /// <returns>Control to edit the given context</returns> public Control GetEditingControl(PropertyEditorControlContext context) { m_boolControl = new BoolControl(context); SkinService.ApplyActiveSkin(m_boolControl); return m_boolControl; }