public async void SelectResourceType(SelectionChangedEventArgs args) { if (args.AddedItems.Count == 1) { LoadGraphEnabled.Value = false; var resourceType = args.AddedItems[0] as ResourceType; Resources.Clear(); var resources = await _client.Resources(resourceType); foreach (var resource in resources) { Resources.Add(resource); } SelectedResource.Value = resources.First(); ResourcesSelectorEnabled.Value = resources.Count() > 1; } }
private void OnStartup(object sender, StartupEventArgs e) { ParseArguments(e.Args); DeleteOldLogFiles(); Resources.Add(SystemParameters.MenuPopupAnimationKey, PopupAnimation.None); var settings = new GuiCoreSettings { ApplicationName = "Riskeer", ApplicationIcon = ApplicationResources.Riskeer, SupportHeader = ApplicationResources.SupportHeader, SupportText = ApplicationResources.SupportText, SupportWebsiteAddressUrl = "https://iplo.nl/contact/", SupportPhoneNumber = "088-7970790", ManualFilePath = "Gebruikershandleiding Riskeer 22.1.1.pdf", MadeByBitmapImage = new BitmapImage(new Uri($"{PackUriHelper.UriSchemePack}://application:,,,/Resources/MadeBy.png")) }; var mainWindow = new MainWindow(); var projectMigrator = new ProjectMigrator(new DialogBasedInquiryHelper(mainWindow)); var assessmentSectionFromFileHandler = new AssessmentSectionFromFileHandler(mainWindow); var projectFactory = new RiskeerProjectFactory(() => assessmentSectionFromFileHandler.GetAssessmentSectionFromFile()); gui = new GuiCore(mainWindow, new StorageSqLite(), projectMigrator, projectFactory, settings) { Plugins = { new RiskeerPlugin(), new ClosingStructuresPlugin(), new StabilityPointStructuresPlugin(), new WaveImpactAsphaltCoverPlugin(), new GrassCoverErosionInwardsPlugin(), new GrassCoverErosionOutwardsPlugin(), new PipingPlugin(), new HeightStructuresPlugin(), new StabilityStoneCoverPlugin(), new DuneErosionPlugin(), new MacroStabilityInwardsPlugin() } }; RunRiskeer(); }
public MainWindow() { Overlord = new Overlord(); AOMDirectory = new AOMDirectory(); Resources.Add("Self", this); /*Resources.Add("OpenCommand", new DelegateCommand((sender) => { * var dialog = new System.Windows.Forms.FolderBrowserDialog(); * var result = dialog.ShowDialog(); * if (result == System.Windows.Forms.DialogResult.OK) { * LoadAOMDirectory(dialog.SelectedPath); * } * })); * Resources.Add("SaveCommand", new DelegateCommand((sender) => { * MessageBox.Show("Saving doesnt work yet"); * //var dialog = new SaveFileDialog() { }; * //dialog.ShowDialog(); * })); * Resources.Add("PrototypeImageCommand", new DelegateCommand((prototype) => { * var unitSettings = new UnitPrototypeSettings() { * Prototype = prototype as PrototypeViewModel, * }; * unitSettings.Show(); * }));*/ Resources.Add("CloseCommand", new DelegateCommand((sender) => { this.Close(); })); InitializeComponent(); //SetValue(PrototypesProperty, protoXml); Loaded += delegate { AOMDirectory.Enumerate(); //dir.Load(); //LoadAOMDirectory(dir); }; /*KeyDown += (s, e) => { * if (e.Key >= Key.D0 && e.Key <= Key.D9) { * SetValue(SelectedItemProperty, protoXml.Prototypes[(int)e.Key - (int)Key.D0]); * } * };*/ //DwmDropShadow.DropShadowToWindow(this); }
/// <exception cref="System.Exception"/> public virtual void TestGetLabelResourceWhenNodeActiveDeactive() { mgr.AddToCluserNodeLabels(ToSet("p1", "p2", "p3")); mgr.ReplaceLabelsOnNode(ImmutableMap.Of(ToNodeId("n1"), ToSet("p1"), ToNodeId("n2" ), ToSet("p2"), ToNodeId("n3"), ToSet("p3"))); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p1", null), EmptyResource ); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p2", null), EmptyResource ); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p3", null), EmptyResource ); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel(RMNodeLabelsManager.NoLabel , null), EmptyResource); // active two NM to n1, one large and one small mgr.ActivateNode(NodeId.NewInstance("n1", 1), SmallResource); mgr.ActivateNode(NodeId.NewInstance("n1", 2), LargeNode); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p1", null), Resources.Add (SmallResource, LargeNode)); // check add labels multiple times shouldn't overwrite // original attributes on labels like resource mgr.AddToCluserNodeLabels(ToSet("p1", "p4")); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p1", null), Resources.Add (SmallResource, LargeNode)); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p4", null), EmptyResource ); // change the large NM to small, check if resource updated mgr.UpdateNodeResource(NodeId.NewInstance("n1", 2), SmallResource); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p1", null), Resources.Multiply (SmallResource, 2)); // deactive one NM, and check if resource updated mgr.DeactivateNode(NodeId.NewInstance("n1", 1)); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p1", null), SmallResource ); // continus deactive, check if resource updated mgr.DeactivateNode(NodeId.NewInstance("n1", 2)); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel("p1", null), EmptyResource ); // Add two NM to n1 back mgr.ActivateNode(NodeId.NewInstance("n1", 1), SmallResource); mgr.ActivateNode(NodeId.NewInstance("n1", 2), LargeNode); // And remove p1, now the two NM should come to default label, mgr.RemoveFromClusterNodeLabels(ImmutableSet.Of("p1")); NUnit.Framework.Assert.AreEqual(mgr.GetResourceByLabel(RMNodeLabelsManager.NoLabel , null), Resources.Add(SmallResource, LargeNode)); }
bool UpdateResources(int newResourceCount) { if (newResourceCount == Resources.Count) { return(false); } int oldResourceCount = Resources.Count(); for (int i = 0; i < oldResourceCount - newResourceCount; i++) { Resources.RemoveAt(Resources.Count - 1); } for (int i = 0; i < newResourceCount - oldResourceCount; i++) { Resources.Add(CreateResource(Resources.Count)); } return(true); }
public string AddResource(string title, DateTime date_Start, DateTime date_End, int peopleID) { try { Resource resource = new Resource() { Title = title, Date_Start = date_Start, Date_End = date_End, PeopleID = peopleID }; Resources.Add(resource); Peoples.FirstOrDefault(i => i.PeopleID == peopleID).Resources.Add(resource); SaveChanges(); return("Запись успешно добавлена"); } catch (Exception ex) { return(ex.Message); } }
private void UpdateResources() { Resources.Clear(); if (!String.IsNullOrEmpty(resourceIds)) { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.LoadXml(resourceIds); foreach (XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes) { EntityKey entityKey = new EntityKey(objectContext.DefaultContainerName + ".Resources", "Key", Int32.Parse(xmlNode.Attributes["Value"].Value)); Object obj = null; if (objectContext.TryGetObjectByKey(entityKey, out obj)) { Resources.Add((Resource)obj); } } } }
private void LoadResources(string orderBy) { Resources.Clear(); foreach (DataRow r in new EventManager().GetResources(orderBy).Rows) { if ((string)r["name"] == "wizyty") { continue; } Resource res = new Resource((string)r["name"], Convert.ToString(r["id"])); res.DataItem = r; res.Columns.Add(new ResourceColumn(r["fsname"].ToString())); Resources.Add(res); } }
public void loadTheme() { string DarkTheme = "ProductChecker.Style.DarkTheme.css"; string LightTheme = "ProductChecker.Style.LightTheme.css"; string themeAdd = LightTheme; Setting st = Setting.GetSetting(); if (st.IsDarkTheme) { themeAdd = DarkTheme; } StyleSheet s = StyleSheet.FromAssemblyResource( IntrospectionExtensions.GetTypeInfo(typeof(App)).Assembly, themeAdd); Resources.Add(s); }
public MainWindow() { civ1 = new Civil(a); civ2 = new Civil(a); civ3 = new Civil(a); vat1 = new Vatrogasac(a); a2.Tip = "Zemljotres"; a2.USlucajuPozara += vat1.Reakcija; Resources.Add("c1", civ1); Resources.Add("c2", civ2); Resources.Add("c3", civ3); Resources.Add("v1", vat1); InitializeComponent(); dugme.Click += Zvrrr; d2.Click += Zvrrr; }
public MainWindow() { var services = new ServiceCollection(); services.AddBlazorWebView(); services.AddMatBlazor(); services.AddSingleton <IWebHostEnvironment, Env>(); services.AddSingleton <HttpClient>(); services.AddSingleton <ILogger, Logger>(); services.AddSingleton <ISessionDiscovery, SessionDiscovery>(); services.AddSingleton <IProcessDiscovery, ProcessDiscovery>(); services.AddSingleton <IProfilerDiscovery, ProfilersDiscovery>(); Resources.Add("services", services.BuildServiceProvider()); InitializeComponent(); }
public EditorSettingsTab(Style settingsStyle) { Resources.Add("settingsStyle", settingsStyle); InitializeComponent(); Settings.Default.SettingChanging += new System.Configuration.SettingChangingEventHandler(SettingChanging); var cultures = CultureInfo.GetCultures(CultureTypes.NeutralCultures); foreach (var cultureInfo in cultures) { Culture.Items.Add(cultureInfo); if (cultureInfo == CultureInfo.CurrentCulture) { Culture.SelectedItem = cultureInfo; } } }
public override void Load() { Color mainBackgroundColor = Color.FromRgb(0, 94, 184); Color mainLightBackgroundColor = Color.FromRgb(238, 238, 238); Color listBorderColor = Color.FromRgb(204, 204, 204); Color listBackgroundColor = Color.FromRgb(255, 255, 255); Color listSelectColor = Color.FromRgb(100, 194, 255); Color lightTextColor = Color.FromRgb(255, 255, 255); Color statusBarColor = Color.FromRgb(40, 120, 192); Resources.Add(MainBackgroundColor, mainBackgroundColor); Resources.Add(MainLightBackgroundColor, mainLightBackgroundColor); Resources.Add(ListBorderColor, listBorderColor); Resources.Add(ListBackgroundColor, listBackgroundColor); Resources.Add(ListSelectColor, listSelectColor); Resources.Add(LightTextColor, lightTextColor); Resources.Add(StatusBarColor, statusBarColor); }
private void LoadFromDirectory(DirectoryEntry resourceDirectory) { foreach (var resourceNameDir in resourceDirectory.EnumerateDirectories()) { foreach (var versionNameDir in resourceNameDir.EnumerateDirectories()) { var resource = Find(resourceNameDir.Name, versionNameDir.Name); if (resource == null) { resource = LoadFromDisk(resourceNameDir.Name, versionNameDir.Name, versionNameDir); if (resource != null) { Resources.Add(resource); } } } } }
/// <summary>Loads the resources.</summary> /// <exception cref="Exception">Thrown when setting the skinDirectory source property.</exception> protected override void LoadResources() { foreach (var uri in _sources) { var skinDictionary = new ResourceDictionary(); try { skinDictionary.Source = uri; } catch (Exception ex) { Debug.WriteLine("Change error: " + ex); throw; } Resources.Add(skinDictionary); } }
// 更改软件主题 public void ChangeTheme(string Style) { if (Style == "DarkTheme") { Resources.Remove("bColor"); Resources.Add("bColor", new SolidColorBrush(Color.FromRgb(0x1E, 0x1E, 0x1E))); Resources.Remove("fColor"); Resources.Add("fColor", new SolidColorBrush(Colors.White)); } else if (Style == "LightTheme") { Resources.Remove("fColor"); Resources.Add("fColor", new SolidColorBrush(Colors.Black)); Resources.Remove("bColor"); Resources.Add("bColor", new SolidColorBrush(Colors.White)); } color = Style; }
// -------------------------------------------------------------------------------------------------- #region ctors public Configuration() { InitializeComponent(); // Try to avoid troubles in the designer view if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { return; } // Avoid the main-window to come over Commands.MainWindow.Topmost = false; // Override the application resources if not already overridden in Skin var keys = Resources.MergedDictionaries[0].Keys; foreach (var key in Application.Current.Resources.Keys) { if (key is Type) // Only types (implicit styles) require this trick { var wxobj = Application.Current.Resources[key]; if (wxobj is Style st) { bool found = false; foreach (var skey in keys) { if (found = key == skey) { break; } } if (!found) { // Create empty style to shadow the application Style Resources.Add(key, new Style(st.TargetType)); } } } } // Apply Style fully Style = (Style)FindResource(typeof(Window)); }
void AddResource(string v) { if (string.IsNullOrEmpty(v)) { return; } string name, filename; bool local = Path.GetFullPath(v).StartsWith(Path.GetFullPath(".")); int comma = v.IndexOf(','); if (comma == -1) { if (local) { name = v; filename = v; } else { name = filename = Path.GetFileName(v); if (!InPlace) { File.Copy(v, Path.Combine(TmpDir, Path.GetFileName(v))); } else { File.Copy(v, Path.Combine(WorkingDir, Path.GetFileName(v))); } } } else { name = v.Substring(comma + 1); filename = v.Substring(0, comma); if (!InPlace) { File.Copy(filename, Path.Combine(TmpDir, Path.GetFileName(filename))); filename = Path.Combine(TmpDir, Path.GetFileName(filename)); } } Resources.Add(name, filename); }
public StyleSelectionMenuItemList() { ItemsSource = AvailableStyles.Instance; var checkableMenuItemStyle = new Style { TargetType = typeof(MenuItem) }; var headerBinding = new Binding(); var headerSetter = new Setter(HeaderProperty, headerBinding); checkableMenuItemStyle.Setters.Add(headerSetter); var isCheckableSetter = new Setter(IsCheckableProperty, true); checkableMenuItemStyle.Setters.Add(isCheckableSetter); ICommand command = new RelayCommand(SelectStyle); var commandSetter = new Setter(CommandProperty, command); checkableMenuItemStyle.Setters.Add(commandSetter); var commandParamBinding = new Binding(); var commandParamSetter = new Setter(CommandParameterProperty, commandParamBinding); checkableMenuItemStyle.Setters.Add(commandParamSetter); var isCheckedMultiBinding = new MultiBinding { Converter = new MultiValueStringsMatchConverter(), Mode = BindingMode.OneWay }; isCheckedMultiBinding.Bindings.Add(new Binding { Mode = BindingMode.OneWay }); isCheckedMultiBinding.Bindings.Add(new Binding("SelectedStyle") { Source = AvailableStyles.Instance, Mode = BindingMode.OneWay }); var isCheckedSetter = new Setter(IsCheckedProperty, isCheckedMultiBinding); checkableMenuItemStyle.Setters.Add(isCheckedSetter); Resources.Add(typeof(MenuItem), checkableMenuItemStyle); }
private void EnsureResourcesAreConfigured() { if (Locator == null) { Locator = new Locator(); } if (WindowManager == null) { WindowManager = new WindowManager { AppName = GetType().Assembly.GetName().Name }; } if (!Resources.Contains(nameof(Locator))) { Resources.Add(nameof(Locator), Locator); } if (!Resources.Contains(nameof(WindowManager))) { Resources.Add(nameof(WindowManager), WindowManager); } if (Resources.MergedDictionaries.Count == 0) { Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml") }); Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml") }); Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml") }); } if (ThemeManager.DetectAppStyle(this) == null) { Resources.MergedDictionaries.Add(ThemeManager.GetAccent("Blue").Resources); Resources.MergedDictionaries.Add(ThemeManager.GetAppTheme("BaseLight").Resources); } }
// // Summary: // Called on the CEF IO thread when a resource load has completed. // // Parameters: // frame: // The frame that is being redirected. // // request: // the request object - cannot be modified in this callback // // response: // the response object - cannot be modified in this callback // // status: // indicates the load completion status // // receivedContentLength: // is the number of response bytes actually read. public void OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength) { if (request.Url.Contains(".user.js")) { var code = browserControl.GetSourceAsync().ToString(); myForm.monyet.InstallScript(request.Url, code); } if (oldAddress != browserControl.Address || oldAddress == "") { oldAddress = browserControl.Address; Resources.Clear(); ResponseHeaders.Clear(); RequestHeaders.Clear(); } Dictionary <string, string> dictionary = response.Headers.AllKeys.ToDictionary((string x) => x, (string x) => response.Headers[x]); ResponseHeaders.Add(new HeaderWrapper(request.Identifier, dictionary)); Dictionary <string, string> strs = request.Headers.AllKeys.ToDictionary((string x) => x, (string x) => request.Headers[x]); RequestHeaders.Add(new HeaderWrapper(request.Identifier, strs)); if (responseDictionary.TryGetValue(request.Identifier, out MemoryStreamResponseFilter memoryStreamResponseFilter)) { byte[] data = memoryStreamResponseFilter.Data; Resources.Add(new RequestWrapper(request.Url, request.ResourceType, response.MimeType, data, request.Identifier)); } //var x = response.MimeType; //scrape all link on current web here //myForm.X.Appender(request.Url.GetQuery("path")); //myForm.X.Appender(request.Url + " = " + status); /* * if (request.Url.Contains(myForm.ViewsourceURL)) * { * * var code = myForm.viewer.View(request.Url.GetQuery("path")); * MessageBox.Show(code.ToString()); * var t = string.Format("var x = @{0}{1}{0};", '"', code); * t += string.Format("$({0}#xmpTagId{0}).text(x);", '"'); * myForm.X.ExecuteJs(t); * * } */ }
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (e.Property == InfoProperty) { if (e.NewValue != null) { if (Info.Resources.Count > 0) { foreach (object key in Info.Resources.Keys) { Resources.Add(key, Info.Resources[key]); } } Title = Info.Title; Content = Info.Content; Footer = Info.Footer; if (Info.IconBrushKey != null) { SetResourceReference(IconBrushProperty, Info.IconBrushKey); } if (Info.ContentTemplateKey != null) { SetResourceReference(ContentTemplateProperty, Info.ContentTemplateKey); } //if (Info.FooterTemplateKey != null) // SetResourceReference(FooterTemplateProperty, Info.FooterTemplateKey); if (Info.AdditionalContentTemplateKey != null) { SetResourceReference(AdditionalContentTemplateProperty, Info.AdditionalContentTemplateKey); } Buttons = Info.Buttons.GetFinalButtonsList(); FooterButtons = new ObservableCollection <MessageBoxFooterButton>(Info.GetFooterButtonsFinal()); } if (e.OldValue != null) { Resources.Clear(); } } if (e.Property == AdditionalContentTemplateProperty) { AdditionalContentAvailable = e.NewValue != null; } }
/// <summary> /// Called when the GetResources response is received. /// </summary> /// <param name="header">The header.</param> /// <param name="message">The message.</param> /// <param name="resource">The resource.</param> /// <param name="uri">The URI.</param> private void OnGetResourcesResponse(IMessageHeader header, ISpecificRecord message, IResource resource, string uri) { var viewModel = ResourceViewModel.NoData; // Handle case when "No Data" Acknowledge message was received if (resource != null) { viewModel = new ResourceViewModel(Runtime, resource) { LoadChildren = GetResources }; resource.FormatLastChanged(); } LogObjectDetails(new ProtocolEventArgs <ISpecificRecord>(header, message)); // Handle when message is received from JSON Message tab if (string.IsNullOrWhiteSpace(uri)) { return; } // If the message URI equals "/" or the current base URI then treat // it as a root object. if (EtpUri.IsRoot(uri) || uri.EqualsIgnoreCase(Model.BaseUri)) { Resources.ForEach(x => x.IsSelected = false); viewModel.IsSelected = true; Resources.Add(viewModel); return; } var parent = Resources.FindByMessageId(header.CorrelationId); if (parent == null) { return; } viewModel.Parent = parent; parent.Children.Add(viewModel); }
public Militz() : base() { SequencePrio = 2; Avatar = GodLesZ.SettlerOnline.FightSimulator.Properties.Resources.Miliz; Name = "Miliz"; PlayerLevel = 18; HitDamage = 40; MissDamage = 20; HitPercentage = 80; HitPoints = 60; Experience = 9; ProductionTime = 480; // Resources Resources.Add(Library.EResource.Population, 1); Resources.Add(Library.EResource.SwordIron, 10); Resources.Add(Library.EResource.Beer, 10); }
public Elitesoldat() : base() { SequencePrio = 5; Avatar = GodLesZ.SettlerOnline.FightSimulator.Properties.Resources.Elitesoldat; Name = "Elitesoldaten"; PlayerLevel = 35; HitDamage = 40; MissDamage = 20; HitPercentage = 90; HitPoints = 120; Experience = 20; ProductionTime = 1800; // Resources Resources.Add(Library.EResource.Population, 1); Resources.Add(Library.EResource.SwordTitanium, 10); Resources.Add(Library.EResource.Beer, 50); }
public Diamond(string ImagePath, int Column, int Row, int Type) { // Required to initialize variables this.MouseLeftButtonDown += new MouseButtonEventHandler(Diamond_MouseLeftButtonDown); this.MouseLeftButtonUp += new MouseButtonEventHandler(Diamond_MouseLeftButtonUp); this.MouseMove += new MouseEventHandler(Diamond_MouseMove); this.RenderTransform = new TranslateTransform(); this.direction = Direction.Nothing; this.ImageSource = ImagePath; this.Column = Column; this.Row = Row; this.Type = Type; Storyboard sb = new Storyboard(); sb.Children.Add(new DoubleAnimation()); Resources.Add("sb", sb); }
//public Func<Texture> GetTex2 { get; set; } = null; public TestComponent() { Resources.Add("tex1", tex1 = @"Resources/Textures/tex1.png".LoadImageToTextureRgba()); Resources.Add(shader = new ReloadableResource <ShaderProgram>("p1r", () => new ShaderProgram( "p1", "vertex", "", true, "testshader.glsl|vert", "testshader.glsl|frag" ), (s) => new ShaderProgram(s))); Resources.Add(vertexBuffer = BufferObject <Vector3> .CreateVertexBuffer("vbuf", ScreenTri.Vertices().ToArray())); Resources.Add(indexBuffer = BufferObject <uint> .CreateIndexBuffer("ibuf", ScreenTri.Indices().ToArray())); ModelMatrix = Matrix4.CreateTranslation(0.0f, 0.0f, -0.1f); ProjectionMatrix = Matrix4.CreateOrthographicOffCenter(0.0f, 1.0f, 0.0f, 1.0f, 0.001f, 2.0f); }
public static async Task SetTheme(ColorThemes?value, DispatcherPriority priority = DispatcherPriority.Background) { if (ThemeField == value) { return; } ThemeField = value; await Application.Current.Dispatcher.InvokeAsync(() => { if (ThemeField != value) { return; } Application.Current.Resources.BeginInit(); var curStyleRes = Resources.Where(r => r.Source != null && Regex.IsMatch(r.Source.OriginalString, StyleDictionaryPattern, RegexOptions.IgnoreCase)).FirstOrDefault(); var curThemeRes = Resources.Where(r => r.Source != null && r.Source.OriginalString.Equals(ThemeDictionaryUri, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault(); if (curThemeRes != null) { Resources.Remove(curThemeRes); } if (curStyleRes != null) { Resources.Remove(curStyleRes); } if (value == null) { return; } Resources.Add(new ResourceDictionary() { Source = new Uri($"/brightsharp;component/themes/style.{value}.xaml", UriKind.RelativeOrAbsolute) }); Resources.Add(new ResourceDictionary() { Source = new Uri(ThemeDictionaryUri, UriKind.RelativeOrAbsolute) }); Application.Current.Resources.EndInit(); ThemeChanged?.Invoke(null, EventArgs.Empty); }, priority); }
public MediaLibraryAudioItem(string baseKey, MediaItem item) : base(baseKey, item) { Genre = new List <string>(); Publisher = new List <string>(); Rights = new List <string>(); var audioAspect = item.Aspects[AudioAspect.ASPECT_ID]; var genreObj = audioAspect.GetCollectionAttribute(AudioAspect.ATTR_GENRES); if (genreObj != null) { Genre.Add(genreObj.ToString()); } var resource = new MediaLibraryResource(item); resource.Initialise(); Resources.Add(resource); }
public Resource(ResourceType type, Point location, int size) : base(new Rectangle(location.X * Rts.map.TileSize, location.Y * Rts.map.TileSize, size * Rts.map.TileSize, size * Rts.map.TileSize)) { ID = idCounter++; ResourceArray[ID] = this; Type = type; Texture = type.NormalTexture; Amount = type.AmountOfResources; Size = size; Radius = (size * Rts.map.TileSize) / 2f; X = location.X; Y = location.Y; setOccupiedPathNodes(); Resources.Add(this); }