private static MaterialModel CreateEmptyMaterialTemplate(IFontService fontService) { var backgroundBytes = Resources.flyer_sample.ToByteArray(); return new MaterialModel(-1, View.Properties.Resources.EmptyMaterial, "", Enumerable.Empty<MaterialFieldModel>(), backgroundBytes, backgroundBytes, fontService.AllFontFamilies.First()); }
public FlyerMakerViewModel(List<Material> materials, int selectedMateriaId, Func<string, FontInfo> getFont, IFontService fontService, IWindowService windowService) : base(materials, getFont, fontService, windowService) { SetMaterials(materials, selectedMateriaId, fontService); LayoutMode = false; }
public CameraService(IFontService fontService, INetworkService networkService, IControllerService controllerService) { _fontService = fontService; _networkService = networkService; _controllerService = controllerService; lastPosition = new Vector2(); }
internal static Label MakeSingleColorLabel(IUIService uiService, IFontService fontService, string friendlyName, Color?FGColor, float fontSize, FontStyle style, Color?BGColor = null) { // Single Color FGColor = TQColorHelper.GetColorFromTaggedString(friendlyName)?.Color() ?? FGColor ?? TQColor.White.Color(); // Color Tag take précédence var txt = TQColorHelper.RemoveLeadingColorTag(friendlyName); var row = new Label() { Text = txt, ForeColor = FGColor.Value, Font = fontService.GetFontAlbertusMTLight(fontSize, style, uiService.Scale), AutoSize = true, Anchor = AnchorStyles.Left, BackColor = BGColor ?? Color.Transparent, //BackColor = Color.Red, BorderStyle = BorderStyle.None, // BorderStyle.FixedSingle Margin = new Padding(0), }; if (BGColor.HasValue) { row.BackColor = BGColor.Value; } return(row); }
public BaseTooltip(IItemProvider itemProvider, IFontService fontService, IUIService uiService, ITranslationService translationService) { this.ItemProvider = itemProvider; this.FontService = fontService; this.UIService = uiService; this.TranslationService = translationService; }
public MediaManagerController(IPostService postService, IPostImageService postImageService, IImageService imageService, IFontService fontService) { _postService = postService; _postImageService = postImageService; _imageService = imageService; _fontService = fontService; }
public static MaterialModel ToMaterialModel(this Material material, IFontService fontService) { var defaultFontFamily = new FontFamilyWithName(fontService.GetFontFamily(material.DefaultFont)); return new MaterialModel(material.Id, material.Title, material.Description, material.MaterialFields.Select(f => f.ToMaterialFieldModel(fontService)), material.FlyerFrontSide, material.FlyerBackside, defaultFontFamily); }
public static MaterialFieldModel ToMaterialFieldModel(this MaterialField field, IFontService fontService) { var fontFamilyWithName = new FontFamilyWithName(fontService.GetFontFamily(field.FontName)); return new MaterialFieldModel(field.FieldName, field.Value, fontFamilyWithName, field.FontSize, field.Bold, field.Italic, field.Uppper, field.MaxLength, field.MaxRows, field.LeftMargin, field.TopMargin, field.TextColor); }
private void SetMaterials(IEnumerable<Material> materials, int selectedMateriaId, IFontService fontService) { Materials = materials.Select(m => m.ToMaterialModel(fontService)).ToList(); if (selectedMateriaId != -1) { SelectedMaterial = Materials.Single(m => m.Id.Equals(selectedMateriaId)); } }
protected FlyerViewModelBase(SelectedMaterialProvider selectedMaterialProvider, IFontService fontService, ViewStates viewState) { this.viewState = viewState; SelectedMaterialProvider = selectedMaterialProvider; FontService = fontService; CanAddLogo = true; }
public AdminWizardController(IFontService fontService, IOrchardServices services, IWorkContextAccessor workContextAccessor) { _fontService = fontService; Services = services; _workContextAccessor = workContextAccessor; var culture = _workContextAccessor.GetContext().CurrentCulture.Trim(); cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY"); }
/// <summary> /// Registers graphics service instance to be used for the current rendering thread /// </summary> /// <param name="service"></param> public static void RegisterThreadLocalContext(IFontService service) { if (_threadLocalService == null) { _threadLocalService = new ThreadLocal <IFontService>(); } _threadLocalService.Value = service; }
protected FlyerMakerViewModelBase(List<Material> materials, Func<string, FontInfo> getFont, IFontService fontService, IWindowService windowService) { this.fontService = fontService; FontHelper.UpdateFonts(materials, getFont, this.fontService); this.windowService = windowService; SelectedMaterialProvider = new SelectedMaterialProvider(); SelectedMaterialProvider.PropertyChanged += (s, e) => OnPropertyChanged("CanCreate"); }
public AdminViewModel(List<Material> materials, Func<string, FontInfo> getFont, IFontService fontService, IWindowService windowService) : base(materials, getFont, fontService, windowService) { Materials = materials.Select(m => m.ToMaterialModel(fontService)).ToList(); Materials.Insert(0, CreateEmptyMaterialTemplate(fontService)); ViewState = ViewStates.SelectTemplate; LayoutMode = true; FlyerViewModel.CanAddLogo = false; }
public ShellViewModel(IEventAggregator eventAggragator, IDialogService dialogService, IMessageBoxService messageBoxService, IFontService fontService, IRecentFilesService recentFilesService) { this.SetTitle(); this.eventAggragator = eventAggragator; this.dialogService = dialogService; this.messageBoxService = messageBoxService; this.recentFilesService = recentFilesService; this.fontService = fontService; this.FontSizes = fontService.GetFontSizes(); this.FontNames = fontService.GetFontNames(); this.HighlightColors = fontService.GetHighlightColors(); this.ClearDataProperties(); this.DeactivateAdaptersRefreshTrigger(); this.DelayAfterFirstEdit = TimeSpan.FromSeconds(10); this.DelayAfterLastEdit = TimeSpan.FromSeconds(10); this.ZoomLevel = 1; this.FontColor = Colors.Red; this.TextHighlightColor = Colors.Yellow; this.DocumentStatus = IgWordDocumentStatus.NoDocumentLoaded; this.SelectedBackstageMenuItem = "New"; // TFS 190054 - Workaround: do not initialize the value of the IsBackstageOpen property to true before the ribbon is loaded //this.IsBackstageOpened = true; this.recentFilesService.SetRepositories(Properties.Settings.Default, p => Properties.Settings.Default.RecentFilesRepo, p => Properties.Settings.Default.RecentFoldersRepo); //Subscribe to events this.eventAggragator.GetEvent <FileOpenedEvent>().Subscribe(OnFileLoaded); this.eventAggragator.GetEvent <FileSavedEvent>().Subscribe(OnFileSaved); this.eventAggragator.GetEvent <NewDocumentEvent>().Subscribe(OnNewDocumentEvent); this.eventAggragator.GetEvent <CharacterSettingsUpdatedEvent>().Subscribe(OnCharacterSettingsUpdatedEvent); this.eventAggragator.GetEvent <ParagraphSettingsUpdatedEvent>().Subscribe(OnParagraphSettingsUpdatedEvent); //Commands SaveDocumentCommand = new DelegateCommand(ExecuteSaveDocument); CloseDocumentCommand = new DelegateCommand(ExecuteCloseDocument); CreateNewDocumentCommand = new DelegateCommand <string>(CreateNewDocument); ShowFontDialogCommand = new DelegateCommand <RichTextDocument>(ExecuteShowFontDialog, CanExecuteShowFormattingDialog); ShowParagraphDialogCommand = new DelegateCommand <RichTextDocument>(ExecuteShowParagraphDialog, CanExecuteShowFormattingDialog); ShowFindDialogCommand = new DelegateCommand <FindReplaceManager>(ExecuteShowFindDialog, CanExecuteShowFindReplaceDialog); ShowReplaceDialogCommand = new DelegateCommand <FindReplaceManager>(ExecuteShowReplaceDialog, CanExecuteShowFindReplaceDialog); ShowHyperlinkDialogCommand = new DelegateCommand <RichTextDocument>(ExecuteShowHyperlinkDialog, CanExecuteShowFormattingDialog); ShowInsertTableDialogCommand = new DelegateCommand <RichTextDocument>(ExecuteShowInsertTableDialog, CanExecuteShowFormattingDialog); ShowInsertPictureDialogCommand = new DelegateCommand <RichTextDocument>(ExecuteShowInsertPictureDialog, CanExecuteShowFormattingDialog); ResetZoomLevelCommand = new DelegateCommand(ExecuteResetZoomLevel); IncreaseZoomLevelCommand = new DelegateCommand(ExecuteIncreaseZoomLevel); DecreaseZoomLevelCommand = new DelegateCommand(ExecuteDecreaseZoomLevel); }
/// <summary> /// Initializes a new instance of the BagButtonBase class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> public BagButtonBase(int bagNumber, GetToolTip getToolTip, IServiceProvider serviceProvider) { InitializeComponent(); this.ServiceProvider = serviceProvider; this.FontService = this.ServiceProvider.GetService <IFontService>(); this.UIService = this.ServiceProvider.GetService <IUIService>(); this.getToolTip = getToolTip; this.ButtonNumber = bagNumber; // Da_FileServer: Some small paint optimizations. this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); }
public void OpenExternalEditWindow(SelectedMaterialProvider selectedMaterialProvider, IFontService fontService) { if (externalEditView != null) { CloseExternalEditWindow(); } externalEditView = new ExternalEditView { DataContext = new ExternalViewModel(selectedMaterialProvider, fontService), Owner = mainWindow }; externalEditView.Show(); }
public AdminExportPrintsController(ICampaignService campaignService, ISiteService siteService, IShapeFactory shapeFactory, IOrderService orderService, IimageHelper imageHelper, IFontService fontService, IWorkContextAccessor workContextAccessor) { _campaignService = campaignService; _siteService = siteService; _imageHelper = imageHelper; _orderService = orderService; _fontService = fontService; Shape = shapeFactory; T = NullLocalizer.Instance; Logger = NullLogger.Instance; _workContextAccessor = workContextAccessor; }
public static void UpdateFonts(IEnumerable<Material> materials, Func<string, FontInfo> getFont, IFontService fontService) { var requiredFonts = materials.SelectMany(m => m.MaterialFields).Select(f => f.FontName); foreach (var requiredFontName in requiredFonts.Where(f => fontService.IsFontAvailable(f) == false)) { var fontInfo = getFont(requiredFontName); if (fontInfo != null) { fontService.InstallFont(fontInfo.FileName, fontInfo.Buffer); } } }
public FontDialogViewModel(IEventAggregator eventAggragator, IFontService fontService) { this.Title = ResourceStrings.ResourceStrings.Dlg_Font_Title; this.IconSource = "pack://application:,,,/IgWord.Infrastructure;component/Images/Font.ico"; TextData = "Sample"; ComplexTextData = "عينة"; OkCommand = new DelegateCommand(ExecuteOk); CancelCommand = new DelegateCommand(ExecuteCancel); FontSizes = fontService.GetFontSizes(); FontFamilies = fontService.GetFontNames(); this.eventAggragator = eventAggragator; }
/// <summary> /// Initializes a new instance of the VaultForm class. /// </summary> public VaultForm(IServiceProvider serviceProvider) { if (LicenseManager.UsageMode == LicenseUsageMode.Runtime) { this.ServiceProvider = serviceProvider; this.FontService = this.ServiceProvider.GetService <IFontService>(); this.UIService = this.ServiceProvider.GetService <IUIService>(); this.Database = this.ServiceProvider.GetService <IDatabase>(); this.ItemProvider = this.ServiceProvider.GetService <IItemProvider>(); this.PlayerCollectionProvider = this.ServiceProvider.GetService <IPlayerCollectionProvider>(); this.GamePathResolver = this.ServiceProvider.GetService <IGamePathService>(); this.titleFont = FontService.GetFontAlbertusMTLight(9.5F); InitForm(); } }
/// <summary> /// Initializes a new instance of the BagButtonBase class. /// </summary> /// <param name="bagNumber">number of the bag for display</param> /// <param name="getToolTip">Tooltip delegate</param> protected BagButtonBase(int bagNumber, GetToolTip getToolTip, IServiceProvider serviceProvider) { this.ServiceProvider = serviceProvider; this.FontService = this.ServiceProvider.GetService <IFontService>(); this.UIService = this.ServiceProvider.GetService <IUIService>(); this.getToolTip = getToolTip; this.ButtonNumber = bagNumber; BackColor = Color.Black; MouseEnter += new EventHandler(this.MouseEnterCallback); MouseLeave += new EventHandler(this.MouseLeaveCallback); Paint += new PaintEventHandler(this.PaintCallback); // Da_FileServer: Some small paint optimizations. this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); }
private SearchFiltersTooltip( SearchDialogAdvanced instance , IItemProvider itemProvider , IFontService fontService , IUIService uiService , ITranslationService translationService ) : base(itemProvider, fontService, uiService, translationService) { this.Owner = instance; InitializeComponent(); SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); this.CurrentWorkingArea = Screen.FromControl(this).WorkingArea; // Tooltip can goes multi-columns this.flowLayoutPanelFriendlyNames.MaximumSize = new Size(this.CurrentWorkingArea.Width, this.CurrentWorkingArea.Height); // Fill it outside of screen to avoid flickering this.Location = new Point(0, this.CurrentWorkingArea.Height); }
public WizardController(IOrchardServices orchardServices, ICampaignService campaignService, IimageHelper imageHelper, IFontService fontService, IProductService productService, ISwatchService swatchService, ITShirtCostService costService, ITeeyootMessagingService teeyootMessagingService, IRepository<CommonSettingsRecord> commonSettingsRepository, IRepository<ArtRecord> artRepository, IRepository<CheckoutCampaignRequest> checkoutCampaignRequestRepository, ShellSettings shellSettings, IWorkContextAccessor workContextAccessor, IRepository<CurrencyRecord> currencyRepository) { _orchardServices = orchardServices; _campaignService = campaignService; _imageHelper = imageHelper; _fontService = fontService; _productService = productService; _swatchService = swatchService; Logger = NullLogger.Instance; _costService = costService; _teeyootMessagingService = teeyootMessagingService; _commonSettingsRepository = commonSettingsRepository; _checkoutCampaignRequestRepository = checkoutCampaignRequestRepository; _shellSettings = shellSettings; T = NullLocalizer.Instance; _artRepository = artRepository; _workContextAccessor = workContextAccessor; var culture = _workContextAccessor.GetContext().CurrentCulture.Trim(); cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY"); _currencyRepository = currencyRepository; }
public WizardController( IOrchardServices orchardServices, ICampaignService campaignService, IimageHelper imageHelper, IFontService fontService, IProductService productService, ISwatchService swatchService, ITShirtCostService costService, ITeeyootMessagingService teeyootMessagingService, IRepository <CommonSettingsRecord> commonSettingsRepository, IRepository <ArtRecord> artRepository, IRepository <CheckoutCampaignRequest> checkoutCampaignRequestRepository, ShellSettings shellSettings, IWorkContextAccessor workContextAccessor, IRepository <CurrencyRecord> currencyRepository, IPriceConversionService priceConversionService) { _orchardServices = orchardServices; _campaignService = campaignService; _imageHelper = imageHelper; _fontService = fontService; _productService = productService; _swatchService = swatchService; Logger = NullLogger.Instance; _costService = costService; _teeyootMessagingService = teeyootMessagingService; _commonSettingsRepository = commonSettingsRepository; _checkoutCampaignRequestRepository = checkoutCampaignRequestRepository; _shellSettings = shellSettings; T = NullLocalizer.Instance; _artRepository = artRepository; var culture = workContextAccessor.GetContext().CurrentCulture.Trim(); _cultureUsed = culture == "en-SG" ? "en-SG" : (culture == "id-ID" ? "id-ID" : "en-MY"); _currencyRepository = currencyRepository; _priceConversionService = priceConversionService; }
public FormatCellsDialogViewModel(IEventAggregator eventAggragator, IFontService fontService, IFormatsService formatsService) { this.Title = ResourceStrings.ResourceStrings.Text_FormatCells; this.IconSource = "pack://application:,,,/IgExcel.Infrastructure;component/Images/FormatCells.ico"; this.eventAggragator = eventAggragator; this.fontService = fontService; this.formatsService = formatsService; this.FontNames = fontService.GetFontNames(); this.FontSizes = fontService.GetFontSizes(); this.NumberFormats = formatsService.GetNumberFormats(); this.SelectedNumberFormatCategory = this.NumberFormats.FirstOrDefault(); this.modifiedProperties = new List <string>(); HookPropertyChanged(true); //Commands OkCommand = new DelegateCommand(ExecuteOk, CanExecuteOk); CancelCommand = new DelegateCommand(ExecuteCancel); ResetFontSettingsCommand = new DelegateCommand <bool?>(ExecuteResetFontSettings); }
public Overlay( IApplicationContext context, IActiveWindowService activeWindowService, IFontService fontService, IMenuLoader menuLoader, IEnumerable <IInputHandler> inputHandlers) { this.InitializeComponent(); context.Overlay = this; //TODO better solution for this? this.activeWindowService = activeWindowService; this.fontService = fontService; this.menuLoader = menuLoader; this.inputHandlers = inputHandlers; this.primaryMenuContainer = new MenuPanel(); this.secondaryMenuContainer = new MenuPanel { Visible = false }; this.activeMenuContainer = this.primaryMenuContainer; }
public CombatLogViewModelFactory(ISettingsService settingsService, IImageService imageService, IFontService fontService) { this.settingsService = settingsService; this.imageService = imageService; this.fontService = fontService; }
public MotorService(IFontService fontService, INetworkService networkService, IControllerService controllerService) { _fontService = fontService; _networkService = networkService; _controllerService = controllerService; }
public MainForm( IServiceProvider serviceProvider // TODO Refactor : injecting service factory is anti pattern , ILogger <MainForm> log , SessionContext sessionContext , IPlayerService playerService , IVaultService vaultService , IStashService stashService , IFontService fontService ) : base(serviceProvider) { this.userContext = sessionContext; this.playerService = playerService; this.vaultService = vaultService; this.stashService = stashService; Log = log; Log.LogInformation("TQVaultAE Initialization !"); InitForm(); #region Apply custom font & scaling this.exitButton.Font = FontService.GetFontLight(12F, UIService.Scale); ScaleControl(this.UIService, this.exitButton); this.characterComboBox.Font = FontService.GetFontLight(13F, UIService.Scale); ScaleControl(this.UIService, this.characterComboBox, false); this.characterLabel.Font = FontService.GetFontLight(11F, UIService.Scale); ScaleControl(this.UIService, this.characterLabel, false); this.itemText.Font = FontService.GetFontLight(11F, FontStyle.Bold, UIService.Scale); this.vaultListComboBox.Font = FontService.GetFontLight(13F, UIService.Scale); ScaleControl(this.UIService, this.vaultListComboBox, false); this.vaultLabel.Font = FontService.GetFontLight(11F, UIService.Scale); ScaleControl(this.UIService, this.vaultLabel, false); this.configureButton.Font = FontService.GetFontLight(12F, UIService.Scale); ScaleControl(this.UIService, this.configureButton); this.customMapText.Font = FontService.GetFont(11.25F, UIService.Scale); ScaleControl(this.UIService, this.customMapText, false); this.showVaulButton.Font = FontService.GetFontLight(12F, UIService.Scale); ScaleControl(this.UIService, this.showVaulButton); this.secondaryVaultListComboBox.Font = FontService.GetFontLight(11F, UIService.Scale); ScaleControl(this.UIService, this.secondaryVaultListComboBox, false); this.aboutButton.Font = FontService.GetFontLight(8.25F, UIService.Scale); ScaleControl(this.UIService, this.aboutButton); this.titleLabel.Font = FontService.GetFontLight(24F, UIService.Scale); ScaleControl(this.UIService, this.titleLabel); this.searchButton.Font = FontService.GetFontLight(12F, UIService.Scale); ScaleControl(this.UIService, this.searchButton); ScaleControl(this.UIService, this.tableLayoutPanelMain); #endregion if (TQDebug.DebugEnabled) { // Write this version into the debug file. Log.LogDebug( $@"Current TQVault Version: {this.currentVersion} Debug Levels {nameof(TQDebug.ArcFileDebugLevel)}: {TQDebug.ArcFileDebugLevel} {nameof(TQDebug.DatabaseDebugLevel)}: {TQDebug.DatabaseDebugLevel} {nameof(TQDebug.ItemAttributesDebugLevel)}: {TQDebug.ItemAttributesDebugLevel} {nameof(TQDebug.ItemDebugLevel)}: {TQDebug.ItemDebugLevel} "); } // Process the mouse scroll wheel to cycle through the vaults. this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel); }
public MjpegService(IFontService fontService, IControllerService controllerService) { _fontService = fontService; _controllerService = controllerService; }
public LayoutViewModel(SelectedMaterialProvider selectedMaterialProvider, IFontService fontService, ViewStates viewState) : base(selectedMaterialProvider, fontService, viewState) { }
public static void Register(IFontService service) { _globalService = service; }
public MainSettingsViewModel(ISettingsService settingsService, IFontService fontService) { this.settingsService = settingsService; this.fontService = fontService; }
public ThemeManagerController(IThemeService themeService, IFontService fontService) { _themeService = themeService; _fontService = fontService; }
public CompassService(IFontService fontService) { _fontService = fontService; HUDOrientation = 0; }
public FontDemoViewModel() { _fontService = DependencyService.Get <IFontService>(); Load(); }
public ShellViewModel(IEventAggregator eventAggragator, IDialogService dialogService, IMessageBoxService messageBoxService, IFontService fontService, IStyleService styleService, IRecentFilesService recentFilesService) { this.eventAggragator = eventAggragator; this.dialogService = dialogService; this.messageBoxService = messageBoxService; this.recentFilesService = recentFilesService; this.styleService = styleService; this.FontSizes = fontService.GetFontSizes(); this.FontNames = fontService.GetFontNames(); this.TableStyles = styleService.GetAllTableStyles(); this.CellStyles = styleService.GetAllCellStyles(); this.GoodBadAndNeutralCellStyles = styleService.GetGoodBadAndNeutralCellStyles(); this.DataAndModelCellStyles = styleService.GetDataAndModelCellStyles(); this.TitlesAndHeadingsCellStyles = styleService.GetTitlesAndHeadingsCellStyles(); this.NumberFormatCellStyles = styleService.GetNumberFormatCellStyles(); this.ThemedCellStyles = styleService.GetThemedCellStyles(); this.IsUiPartEnabled = false; this.SetTitle(); this.SelectedBackstageMenuItem = ShellParameters.NewTabName; // TFS 191000 - Workaround: do not initialize the value of the IsBackstageOpen property to true before the ribbon is loaded //this.IsBackstageOpened = true; this.ZoomLevel = 100; this.recentFilesService.SetRepositories(Properties.Settings.Default, p => Properties.Settings.Default.RecentFilesRepo, p => Properties.Settings.Default.RecentFoldersRepo); this.eventAggragator.GetEvent <FileOpenedEvent>().Subscribe(OnFileLoaded); this.eventAggragator.GetEvent <FileSavedEvent>().Subscribe(OnFileSaved); this.eventAggragator.GetEvent <NewDocumentEvent>().Subscribe(OnNewDocumentEvent); this.eventAggragator.GetEvent <TableAddedEvent>().Subscribe(OnTableAddedEvent); this.eventAggragator.GetEvent <CustomZoomLevelChangedEvent>().Subscribe(OnCustomZoomLevelChangedEvent); this.eventAggragator.GetEvent <PasswordToOpenEnteredEvent>().Subscribe(OnPasswordToOpenEnteredEvent); this.eventAggragator.GetEvent <PasswordToModifyEnteredEvent>().Subscribe(OnPasswordToModifyEnteredEvent); //Commands this.ShowNumberSettingsDialogCommand = new DelegateCommand <object>(ExecuteShowNumberSettingsDialog); this.ShowFontSettingsDialogCommand = new DelegateCommand <object>(ExecuteShowFontSettingsDialog); this.ShowFillSettingsDialogCommand = new DelegateCommand <object>(ExecuteShowFillSettingsDialog); this.ShowAlignmnetSettingsDialogCommand = new DelegateCommand <object>(ExecuteShowAlignmnetSettingsDialog); this.ShowDimensionDialogCommand = new DelegateCommand <DimensionDialogMode?>(ExecuteShowDimensionDialog); this.CloseDocumentCommand = new DelegateCommand(ExecuteCloseDocument); this.FormatAsTableCommand = new DelegateCommand <string>(ExecuteFormatAsTable); this.SaveDocumentCommand = new DelegateCommand(ExecuteSaveDocument); this.CreateNewDocumentCommand = new DelegateCommand <string>(CreateNewDocument); this.ShowZoomDialogCommand = new DelegateCommand(ExecuteShowZoomDialog); this.ShowDataValidationDialogCommand = new DelegateCommand(ExecuteShowDataValidationDialog); this.PropertyChanged += OnPropertyChanged; }
public MainForm( IServiceProvider serviceProvider , ILogger <MainForm> log , SessionContext sessionContext , IPlayerService playerService , IVaultService vaultService , ISearchService searchService , IStashService stashService , IFontService fontService ) : base(serviceProvider) { this.userContext = sessionContext; this.playerService = playerService; this.vaultService = vaultService; this.searchService = searchService; this.stashService = stashService; Log = log.Logger; Log.Info("TQVaultAE Initialization !"); InitForm(); #region Apply custom font & scaling this.exitButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale); ScaleControl(this.UIService, this.exitButton); this.characterComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale); ScaleControl(this.UIService, this.characterComboBox); this.characterLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale); ScaleControl(this.UIService, this.characterLabel); ScaleControl(this.UIService, this.itemTextPanel); ScaleControl(this.UIService, this.itemText); this.vaultListComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale); ScaleControl(this.UIService, this.vaultListComboBox); this.vaultLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale); ScaleControl(this.UIService, this.vaultLabel); this.configureButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale); ScaleControl(this.UIService, this.configureButton); this.customMapText.Font = FontService.GetFontAlbertusMT(11.25F, UIService.Scale); ScaleControl(this.UIService, this.customMapText); this.panelSelectButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale); ScaleControl(this.UIService, this.panelSelectButton); this.secondaryVaultListComboBox.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale); ScaleControl(this.UIService, this.secondaryVaultListComboBox); this.aboutButton.Font = FontService.GetFontAlbertusMTLight(8.25F, UIService.Scale); ScaleControl(this.UIService, this.aboutButton); this.titleLabel.Font = FontService.GetFontAlbertusMTLight(24F, UIService.Scale); ScaleControl(this.UIService, this.titleLabel); this.searchButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale); ScaleControl(this.UIService, this.searchButton); #endregion if (TQDebug.DebugEnabled) { // Write this version into the debug file. Log.DebugFormat(CultureInfo.InvariantCulture, "Current TQVault Version: {0}", this.currentVersion); Log.Debug(string.Empty); Log.Debug("Debug Levels"); Log.DebugFormat(CultureInfo.InvariantCulture, "ARCFileDebugLevel: {0}", TQDebug.ArcFileDebugLevel); Log.DebugFormat(CultureInfo.InvariantCulture, "DatabaseDebugLevel: {0}", TQDebug.DatabaseDebugLevel); Log.DebugFormat(CultureInfo.InvariantCulture, "ItemAttributesDebugLevel: {0}", TQDebug.ItemAttributesDebugLevel); Log.DebugFormat(CultureInfo.InvariantCulture, "ItemDebugLevel: {0}", TQDebug.ItemDebugLevel); Log.Debug(string.Empty); } // Set up Item strings Item.ItemWith = Resources.ItemWith; Item.ItemRelicBonus = Resources.ItemRelicBonus; Item.ItemRelicCompleted = Resources.ItemRelicCompleted; Item.ItemQuest = Resources.ItemQuest; Item.ItemSeed = Resources.ItemSeed; Item.ItemIT = Resources.ItemIT; Item.ItemRagnarok = Resources.ItemRagnarok; Item.ItemAtlantis = Resources.ItemAtlantis; Item.ShowSkillLevel = Config.Settings.Default.ShowSkillLevel; // Process the mouse scroll wheel to cycle through the vaults. this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel); }
static FontToolbox() { _fontService = DependencyService.Get <IFontService>(); }
public ExternalViewModel(SelectedMaterialProvider selectedMaterialProvider, IFontService fontService) { SelectedMaterialProvider = selectedMaterialProvider; FontService = fontService; }
internal static Control MakeRow(IUIService uiService, IFontService fontService, string friendlyName, Color?FGColor = null, float fontSize = 10F, FontStyle style = FontStyle.Regular, Color?BGColor = null) { friendlyName = friendlyName ?? string.Empty; Control row = null; if (friendlyName == TOOLTIPSPACER) { row = new Label() { Text = " ", Font = fontService.GetFontAlbertusMTLight(fontSize, style, uiService.Scale), AutoSize = true, }; } else if (friendlyName == TOOLTIPDELIM) { row = new Label() { Text = string.Empty, BackColor = TQColor.DarkGray.Color(), BorderStyle = BorderStyle.FixedSingle, Height = 3, Anchor = AnchorStyles.Left | AnchorStyles.Right, Margin = new Padding(2, 3, 2, 3), }; } else { // Replace all TQNewLine to regular '\n' friendlyName = friendlyName.Replace(StringHelper.TQNewLineTag, "\n"); // If there is a color tag in the middle if (friendlyName.LastIndexOf('{') > 0) { var multiColors = friendlyName.Split('{').Where(t => !string.IsNullOrEmpty(t)).ToArray(); if (multiColors.Count() > 1) { row = new FlowLayoutPanel() { AutoSize = true, AutoSizeMode = AutoSizeMode.GrowOnly, FlowDirection = FlowDirection.LeftToRight, Padding = new Padding(0), Anchor = AnchorStyles.Left, BorderStyle = BorderStyle.None, Margin = new Padding(0), }; if (BGColor.HasValue) { row.BackColor = BGColor.Value; } row.SuspendLayout(); foreach (var coloredSegment in multiColors) { // IsColorTagged if (coloredSegment.First() == '^') { var segTxt = '{' + coloredSegment; row.Controls.Add(MakeSingleColorLabel(uiService, fontService, segTxt, FGColor, fontSize, style, BGColor)); } else { row.Controls.Add(MakeSingleColorLabel(uiService, fontService, coloredSegment, FGColor, fontSize, style, BGColor)); } } row.ResumeLayout(); } } else { row = MakeSingleColorLabel(uiService, fontService, friendlyName, FGColor, fontSize, style, BGColor); } } return(row); }
/// <summary> /// Initializes a new instance of the VaultPanel class. /// </summary> /// <param name="dragInfo">Instance of the ItemDragInfo</param> /// <param name="numberOfBags">Number of bags in this panel</param> /// <param name="panelSize">Main panel size</param> /// <param name="numberOfAutosortButtons">The number of AutoSort buttons associated with this panel.,</param> /// <param name="autoMoveLocation">The automovelocation for this panel.</param> public VaultPanel(ItemDragInfo dragInfo, int numberOfBags, Size panelSize, int numberOfAutosortButtons, AutoMoveLocation autoMoveLocation, IServiceProvider serviceProvider) { this.ServiceProvider = serviceProvider; this.FontService = this.ServiceProvider.GetService <IFontService>(); this.UIService = this.ServiceProvider.GetService <IUIService>(); this.DragInfo = dragInfo; this.AutoMoveLocation = autoMoveLocation; this.Text = Resources.PlayerPanelNoVault; this.NoPlayerString = Resources.PlayerPanelNoVault; this.BackColor = Color.Transparent; this.DrawAsGroupBox = false; // Setup the offset to make room for the autosort button int autosortOffset = 0; if (numberOfAutosortButtons > 0) { autosortOffset = Convert.ToInt32(27.0F * UIService.Scale); } this.Size = new Size( (panelSize.Width * UIService.ItemUnitSize) + Convert.ToInt32(10.0F * UIService.Scale) + autosortOffset + BorderPad, (panelSize.Height * UIService.ItemUnitSize) + Convert.ToInt32(56.0F * UIService.Scale) + BorderPad); this.TabStop = false; this.Font = new Font(this.Font.FontFamily, this.Font.SizeInPoints * UIService.Scale, this.Font.Style); this.BagPanelOffset = 0; // bag panel starts with bag #0 this.BagSackPanel = new SackPanel(panelSize.Width, panelSize.Height, this.DragInfo, autoMoveLocation, this.ServiceProvider); this.BagSackPanel.SetLocation(new Point(autosortOffset + BorderPad, this.Size.Height - (this.BagSackPanel.Size.Height + BorderPad))); this.BagSackPanel.OnNewItemHighlighted += new EventHandler <SackPanelEventArgs>(this.NewItemHighlightedCallback); this.BagSackPanel.OnAutoMoveItem += new EventHandler <SackPanelEventArgs>(this.AutoMoveItemCallback); this.BagSackPanel.OnActivateSearch += new EventHandler <SackPanelEventArgs>(this.ActivateSearchCallback); this.BagSackPanel.OnItemSelected += new EventHandler <SackPanelEventArgs>(this.ItemSelectedCallback); this.BagSackPanel.OnClearAllItemsSelected += new EventHandler <SackPanelEventArgs>(this.ClearAllItemsSelectedCallback); this.BagSackPanel.OnResizeForm += new EventHandler <ResizeEventArgs>(this.ResizeFormCallback); this.Controls.Add(this.BagSackPanel); this.BagSackPanel.IsPlayerBagPanel = false; this.BagSackPanel.MaxSacks = numberOfBags; // Create the buttons this.bagButtons = new Collection <BagButtonBase>(); this.CreateBagButtons(numberOfBags); // Assume it's the trash panel if we are not autosorting it. if (numberOfAutosortButtons == 0) { this.BagSackPanel.SackType = SackType.Trash; } else { this.autoSortButtons = new Collection <AutoSortButton>(); for (int i = 0; i < numberOfAutosortButtons; ++i) { this.autoSortButtons.Insert(i, this.CreateAutoSortButton(i)); this.Controls.Add(this.autoSortButtons[i]); } this.BagSackPanel.SackType = SackType.Vault; } this.contextMenu = new ContextMenuStrip(); this.contextMenu.BackColor = Color.FromArgb(46, 41, 31); this.contextMenu.DropShadowEnabled = true; this.contextMenu.Font = FontService.GetFontAlbertusMT(9.0F * UIService.Scale); this.contextMenu.ForeColor = Color.FromArgb(200, 200, 200); this.contextMenu.Opacity = 0.80; this.contextMenu.ShowImageMargin = false; this.contextMenu.ItemClicked += new ToolStripItemClickedEventHandler(this.ContextMenuItemClicked); this.contextMenu.Renderer = new CustomProfessionalRenderer(); this.PropertyChanged += new PropertyChangedEventHandler(this.PropertyChangedCallback); this.Paint += new PaintEventHandler(this.PaintCallback); // to avoid flickering use double buffer and to force control to use OnPaint this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); }
public MainForm( IServiceProvider serviceProvider , ILogger <MainForm> log , SessionContext sessionContext , IPlayerService playerService , IVaultService vaultService , ISearchService searchService , IStashService stashService , IFontService fontService ) : base(serviceProvider) { this.userContext = sessionContext; this.playerService = playerService; this.vaultService = vaultService; this.searchService = searchService; this.stashService = stashService; Log = log.Logger; Log.Info("TQVaultAE Initialization !"); InitForm(); #region Apply custom font & scaling this.exitButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale); ScaleControl(this.UIService, this.exitButton); this.characterComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale); ScaleControl(this.UIService, this.characterComboBox, false); this.characterLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale); ScaleControl(this.UIService, this.characterLabel, false); this.itemText.Font = FontService.GetFontAlbertusMTLight(11F, FontStyle.Bold, UIService.Scale); this.vaultListComboBox.Font = FontService.GetFontAlbertusMTLight(13F, UIService.Scale); ScaleControl(this.UIService, this.vaultListComboBox, false); this.vaultLabel.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale); ScaleControl(this.UIService, this.vaultLabel, false); this.configureButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale); ScaleControl(this.UIService, this.configureButton); this.customMapText.Font = FontService.GetFontAlbertusMT(11.25F, UIService.Scale); ScaleControl(this.UIService, this.customMapText, false); this.showVaulButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale); ScaleControl(this.UIService, this.showVaulButton); this.secondaryVaultListComboBox.Font = FontService.GetFontAlbertusMTLight(11F, UIService.Scale); ScaleControl(this.UIService, this.secondaryVaultListComboBox, false); this.aboutButton.Font = FontService.GetFontAlbertusMTLight(8.25F, UIService.Scale); ScaleControl(this.UIService, this.aboutButton); this.titleLabel.Font = FontService.GetFontAlbertusMTLight(24F, UIService.Scale); ScaleControl(this.UIService, this.titleLabel); this.searchButton.Font = FontService.GetFontAlbertusMTLight(12F, UIService.Scale); ScaleControl(this.UIService, this.searchButton); ScaleControl(this.UIService, this.tableLayoutPanelMain); #endregion if (TQDebug.DebugEnabled) { // Write this version into the debug file. Log.DebugFormat(CultureInfo.InvariantCulture, "Current TQVault Version: {0}", this.currentVersion); Log.Debug(string.Empty); Log.Debug("Debug Levels"); Log.DebugFormat(CultureInfo.InvariantCulture, "ARCFileDebugLevel: {0}", TQDebug.ArcFileDebugLevel); Log.DebugFormat(CultureInfo.InvariantCulture, "DatabaseDebugLevel: {0}", TQDebug.DatabaseDebugLevel); Log.DebugFormat(CultureInfo.InvariantCulture, "ItemAttributesDebugLevel: {0}", TQDebug.ItemAttributesDebugLevel); Log.DebugFormat(CultureInfo.InvariantCulture, "ItemDebugLevel: {0}", TQDebug.ItemDebugLevel); Log.Debug(string.Empty); } // Process the mouse scroll wheel to cycle through the vaults. this.MouseWheel += new MouseEventHandler(this.MainFormMouseWheel); }
/// <summary> /// Registers the global service to be used. /// </summary> /// <param name="service"></param> public static void RegisterGlobalService(IFontService service) { _globalService = service ?? new VirtualFontService(); }