• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Theme类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Theme的典型用法代码示例。如果您正苦于以下问题:C# Theme类的具体用法?C# Theme怎么用?C# Theme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Theme类属于命名空间,在下文中一共展示了Theme类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddTheme

 internal void AddTheme(Theme theme, DateTime partyDate)
 {
     if (!this.Items.Any(o => o.Product.Guid == theme.Guid))
     {
         this.Items.Add(new CartItem(theme, partyDate));
     }
 }
开发者ID:Brontsy,项目名称:Vintage-Rabbit,代码行数:7,代码来源:Cart.cs


示例2: ApplyTheme

        public static void ApplyTheme(this Application application, Theme? theme, SolidColorBrush accentBrush, SolidColorBrush contrastBrush)
        {
            ValidationHelper.NotNull(application, () => application);

            application.Dispatcher.Invoke(new ApplyThemeToApplicationDelegate(ApplyThemeInternal), DispatcherPriority.Render,
                                          application, theme, accentBrush, contrastBrush);
        }
开发者ID:oysteinkrog,项目名称:MonitorControl,代码行数:7,代码来源:ThemeManager.cs


示例3: GetAttemptId

        /// <summary>
        /// Checks if related to theme package has been already uploaded.
        /// In case it was not uploaded - upload package.
        /// Check attempt has been created and get attempt id.
        /// </summary>
        /// <param name="theme">Theme object represents specified theme.</param>
        /// <returns>Long integer value representing attempt id.</returns>
        public long GetAttemptId(Theme theme)
        {
            GetCurrentUserIdentifier();
            AttemptItemIdentifier attemptId = null;
            ActivityPackageItemIdentifier organizationId;
            var packageId = GetPackageIdentifier(theme.CourseRef.Value);

            // in case package has not been uploaded yet.
            if (packageId == null)
            {
                string zipPath = CourseService.Export(theme.CourseRef.Value);
                Package package = new ZipPackage(zipPath);
                package.CourseID = theme.CourseRef.Value;
                packageId = AddPackage(package);
                organizationId = GetOrganizationIdentifier(packageId);
                attemptId = CreateAttempt(organizationId.GetKey(), theme.Id);
            }
            // otherwise check if attempt was created
            else
            {
                organizationId = GetOrganizationIdentifier(packageId);

                AttemptItemIdentifier attId = GetAttemptIdentifier(organizationId, theme.Id);
                if (attId != null)
                {
                    attemptId = attId;
                }
                else
                {
                    attemptId = CreateAttempt(organizationId.GetKey(), theme.Id);
                }
            }

            return attemptId.GetKey();
        }
开发者ID:supermuk,项目名称:iudico,代码行数:42,代码来源:MlcProxy.cs


示例4: CreateAssets

		public void CreateAssets()
		{
			if (_sandboxProject == null)
			{
				_sandboxProject = SandboxProject;

				_andre = Instance.Get.MemberByID("Member:1000");
				_danny = Instance.Get.MemberByID("Member:1005");

				Theme theme1 = _sandboxProject.CreateTheme("Theme 1");
				Theme theme2 = _sandboxProject.CreateTheme("Theme 2");
				Theme theme11 = theme1.CreateChildTheme("Child Theme 1");

				theme1.Customer = _andre;
				theme1.Source.CurrentValue = "Customer";
				theme1.Risk.CurrentValue = "Medium";
				theme1.Priority.CurrentValue = "Medium";
				theme1.Save();

				theme2.Customer = _danny;
				theme2.Source.CurrentValue = "Sales";
				theme2.Risk.CurrentValue = "Low";
				theme2.Priority.CurrentValue = "Low";
				theme2.Save();

				theme11.Customer = _andre;
				theme11.Source.CurrentValue = "Customer";
				theme11.Risk.CurrentValue = "Medium";
				theme11.Priority.CurrentValue = "Medium";
				theme11.Source.CurrentValue = "Sales";
				theme11.Save();

				_theme1 = theme1;
			}
		}
开发者ID:bigjonroberts,项目名称:VersionOne.SDK.NET.ObjectModel,代码行数:35,代码来源:ThemeFilterTester.cs


示例5: ChangeTheme

        void ChangeTheme()
        {
            if (currentTheme == Theme.Dark)
            {
                // remove old theme
                Application.Current.Resources.MergedDictionaries.Remove(
                    Application.Current.Resources.MergedDictionaries.FirstOrDefault(
                        x => x.Source.OriginalString.Equals(DarkThemePath)
                        )
                    );

                // apply new theme
                var newTheme = new ResourceDictionary();
                newTheme.Source = new Uri(LightThemePath, UriKind.Relative);
                Application.Current.Resources.MergedDictionaries.Add(newTheme);

                currentTheme = Theme.Light;
            }
            else
            {
                // remove old theme
                Application.Current.Resources.MergedDictionaries.Remove(
                    Application.Current.Resources.MergedDictionaries.FirstOrDefault(
                        x => x.Source.OriginalString.Equals(LightThemePath)
                        )
                    );

                // apply new theme
                var newTheme = new ResourceDictionary();
                newTheme.Source = new Uri(DarkThemePath, UriKind.Relative);
                Application.Current.Resources.MergedDictionaries.Add(newTheme);

                currentTheme = Theme.Dark;
            }
        }
开发者ID:pr3sto,项目名称:CryptoMessenger,代码行数:35,代码来源:WindowStyle.cs


示例6: ThemeChooser

        public ThemeChooser()
        {
            var theme1 = new Theme("/Content/Images/Application/MainViewPanoramaBackgrounds/empty_background.png",
                                   "/Content/Images/Application/MainViewPanoramaBackgrounds/CroppedImages/empty_background.png")
            {
                AccentColor1 = new PortableSolidColorBrush(255, 128, 0, 128),
                AccentColor2 = new PortableSolidColorBrush(255, 0, 128, 0),
                AccentColor3 = new PortableSolidColorBrush(255, 155, 165, 0),
                AppBarBackgroundBrush = new PortableSolidColorBrush("#FF333333"),
                AppBarButtonBrush = new PortableSolidColorBrush("#FFFFFFFF"),
                AppBarButtonClickBrush = new PortableSolidColorBrush("#FFFFFFFF"),
            };

            var theme2 = new Theme("/Content/Images/Application/MainViewPanoramaBackgrounds/MainViewPanorama_cats_blue.png",
                                   "/Content/Images/Application/MainViewPanoramaBackgrounds/CroppedImages/MainViewPanorama_cats_blue_small.png")
            {
                AccentColor1 = new PortableSolidColorBrush(255, 128, 0, 128),
                AccentColor2 = new PortableSolidColorBrush(255, 0, 128, 0),
                AccentColor3 = new PortableSolidColorBrush(255, 155, 165, 0),
                AppBarBackgroundBrush = new PortableSolidColorBrush(255, 50, 50, 50)
            };

            var theme3 = new Theme("/Content/Images/Application/MainViewPanoramaBackgrounds/MainViewPanorama_cats_pink.png",
                                   "/Content/Images/Application/MainViewPanoramaBackgrounds/CroppedImages/MainViewPanorama_cats_pink_small.png")
            {
                AccentColor1 = new PortableSolidColorBrush(255, 128, 0, 128),
                AccentColor2 = new PortableSolidColorBrush(255, 0, 128, 0),
                AccentColor3 = new PortableSolidColorBrush(255, 155, 165, 0),
                AppBarBackgroundBrush = new PortableSolidColorBrush(255, 50, 50, 50)
            };

            _themes = new ObservableCollection<Theme>() {theme1, theme2, theme3};

            _selectedTheme = _themes[0];
        }
开发者ID:Catrobat,项目名称:CatrobatForWindows,代码行数:35,代码来源:ThemeChooser.cs


示例7: ChangeTheme

        public static void ChangeTheme(Application app, Accent newAccent, Theme newTheme)
        {
            if (app == null) throw new ArgumentNullException("app");

            var oldTheme = DetectTheme(app);
            ChangeTheme(app.Resources, oldTheme, newAccent, newTheme);
        }
开发者ID:pdsullivan,项目名称:MahApps.Metro,代码行数:7,代码来源:ThemeManager.cs


示例8: FakeThemesByCurriculumId

 // SelectTheme
 public static List<Theme> FakeThemesByCurriculumId()
 {
     Theme fakeTheme = new Theme();
     fakeTheme.Id = 1;
     fakeTheme.Name = "Тема1";
     return new List<Theme>() { fakeTheme };
 }
开发者ID:supermuk,项目名称:iudico,代码行数:8,代码来源:FakeDataQualityTest.cs


示例9: BuildLink

 public ActionLink BuildLink(Theme theme)
 {
     RouteValueDictionary routeValueDictionary = new RouteValueDictionary();
     routeValueDictionary.Add("id", theme.Id);
     ActionLink actionLink = new ActionLink("Play", "Training", routeValueDictionary);
     return actionLink;
 }
开发者ID:supermuk,项目名称:iudico,代码行数:7,代码来源:TestingService.cs


示例10: MenuItem

 public MenuItem(Theme theme, TextFormat font, float x, float y, float width, float height, Menu parentMenu, string text, string extraData)
     : base(theme, font, x, y, width, height)
 {
     this.parentMenu = parentMenu;
     this.Text = text;
     this.extraData = extraData;
 }
开发者ID:nkarpey,项目名称:Zat-s-External-CSGO-Multihack,代码行数:7,代码来源:MenuItem.cs


示例11: UpdateTheme

 internal static void UpdateTheme(ResourceDictionary resourceDictionary, Theme theme)
 {
     ResourceDictionary brushResourceDictionary = resourceDictionary.FindDictionary(BrushDictionaryUri.ToString());
     if (brushResourceDictionary != null)
     {
         if (theme == Theme.Dark)
         {
             brushResourceDictionary.ReplaceDictionary(LightColorDictionaryUri, DarkColorDictionaryUri);
         }
         else
         {
             brushResourceDictionary.ReplaceDictionary(DarkColorDictionaryUri, LightColorDictionaryUri);
         }
     }
     else
     {
         if (theme == Theme.Dark)
         {
             resourceDictionary.MergedDictionaries.Add(
                 new ResourceDictionary()
                 {
                     Source = DarkColorDictionaryUri
                 });
         }
         else
         {
             resourceDictionary.MergedDictionaries.Add(
                 new ResourceDictionary()
                 {
                     Source = LightColorDictionaryUri
                 });
         }
     }
 }
开发者ID:ruisebastiao,项目名称:Elysium-Extra,代码行数:34,代码来源:ThemeManager.cs


示例12: Initialize

        protected override void Initialize(System.Web.Routing.RequestContext requestContext) {
            base.Initialize(requestContext);
            HttpContext ctx = System.Web.HttpContext.Current;

            ViewBag.year = UDF.GetYearCookie(ctx);
            ViewBag.make = UDF.GetMakeCookie(ctx);
            ViewBag.model = UDF.GetModelCookie(ctx);
            ViewBag.style = UDF.GetStyleCookie(ctx);
            ViewBag.vehicleID = UDF.GetVehicleCookie(ctx);

            // Get the theme ID
            int themeID = new Theme().getTheme(ctx);
            ViewBag.themeID = themeID;

            if (themeID > 0) {
                // if there is an active theme, get the files
                string cname = this.ControllerContext.Controller.ToString();
                Dictionary<int, List<ThemeFile>> themefiles = new Theme().getFiles(ctx,UDF.GetControllerName(cname));
                ViewBag.themefiles = themefiles;
            }

            // We're gonna dump our Customer Session object out
            Customer customer = new Customer();
            customer.GetFromStorage(ctx);


            Settings settings = new Settings();
            ViewBag.settings = settings;

            ViewBag.customer = customer;
        }
开发者ID:curt-labs,项目名称:CURTeCommerce,代码行数:31,代码来源:BaseController.cs


示例13: ChangeTheme

 public static void ChangeTheme(ResourceDictionary r, Accent accent, Theme theme)
 {
     ThemeIsDark = (theme == Theme.Dark);
     var themeResource = (theme == Theme.Light) ? LightResource : DarkResource;
     Util.ApplyResourceDictionary(themeResource, r);
     Util.ApplyResourceDictionary(accent.Resources, r);
 }
开发者ID:eolandezhang,项目名称:Diagram,代码行数:7,代码来源:ThemeManager.cs


示例14: Create

        public ActionResult Create(int stageId, CreateThemeModel model)
        {
            try
            {
                Theme theme = new Theme
                {
                    CourseRef = model.CourseId == Constants.NoCourseId ? (int?)null : model.CourseId,
                    StageRef = model.StageId,
                    ThemeTypeRef = model.ThemeTypeId,
                    Name = model.ThemeName
                };

                AddValidationErrorsToModelState(Validator.ValidateTheme(theme).Errors);

                if (ModelState.IsValid)
                {
                    Storage.AddTheme(theme);

                    return RedirectToAction("Index", new { StageId = model.StageId });
                }
                else
                {
                    SaveValidationErrors();

                    return RedirectToAction("Create");
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
开发者ID:supermuk,项目名称:iudico,代码行数:32,代码来源:ThemeController.cs


示例15: CreateTheme

        public long CreateTheme(string bgColor, string fColor, string hColor, string mColor, int userId)
        {
            long themeId = 0;
            string result = string.Empty;
            try
            {
                Theme theme = new Theme()
                {
                    UserId = userId,
                    BackgroundColor = System.Drawing.ColorTranslator.FromHtml(String.Format("{0}", bgColor)),
                    HighlightColor = System.Drawing.ColorTranslator.FromHtml(String.Format("{0}", hColor)),
                    FontColor = System.Drawing.ColorTranslator.FromHtml(String.Format("{0}", fColor)),
                    MagnificationColor = System.Drawing.ColorTranslator.FromHtml(String.Format("{0}", mColor))
                };

                result = OBSDataSource.CreateTheme(theme, out themeId);
                if (string.IsNullOrEmpty(result))
                {
                    return themeId;
                }
            }
            catch (Exception ex)
            {
                ExceptionLogger.LogException(ex, "AccountController.CreateTheme");
            }
            return 0;
        }
开发者ID:jeffrschneider,项目名称:OpenBookSystem,代码行数:27,代码来源:AccountController.cs


示例16: EmbedVideoWithOptions

        /// <summary>
        /// Embed a YouTube video with the Player API options
        /// https://developers.google.com/youtube/youtube_player_demo
        /// </summary>
        /// <param name="videoItem">The video item</param>
        /// <param name="width">The width of the video the height will be automatically calculated at 16:9 ratio. Default is 640</param>
        /// <param name="autoPlay">A boolean to enable the video to autoplay. Default is false</param>
        /// <param name="showControls">A boolean to show or hide the controls. Default is true</param>
        /// <param name="enableJsApi">A boolean to enable the video to be controlled with the JS API. Default is false</param>
        /// <param name="loop">A boolean to enable the video to loop when finished. Default is false</param>
        /// <param name="modestBranding">A boolean to show more modest YouTube branding & logos. Default is false</param>
        /// <param name="rel">A boolean to enable related videos to be displaed at the end of the video playing. Default is true</param>
        /// <param name="showInfo">A boolean to display the video title & rating before the video plays. Default is true</param>
        /// <param name="theme">An enum of styles that change the control styles</param>
        /// <returns>A raw string with the iframe embed HTML with the appeneded options</returns>
        public static string EmbedVideoWithOptions(this Video videoItem, int width = 640, bool autoPlay = false, bool showControls = true, bool enableJsApi = false, bool loop = false, bool modestBranding = false, bool rel = true, bool showInfo = true, Theme theme = Theme.dark)
        {
            // From width calculate height (16:9 ratio)
            // 640 width = 340 height
            // 640 / 16 = 40
            // 40 * 9 = 340
            var height = (width/16) * 9;

            //Convert booleans to 0 or 1 strings for YouTube querystring params
            var autoPlayString          = autoPlay ? "1" : "0";
            var showControlsString      = showControls ? "1" : "0";
            var enableJsApiString       = enableJsApi ? "1" : "0";
            var loopString              = loop ? "1" : "0";
            var modestBrandingString    = modestBranding ? "1" : "0";
            var relString               = rel ? "1" : "0";
            var showInfoString          = showInfo ? "1" : "0";

            //If we use JS API ensure the ID for the iframe is unique
            var uniqueHtmlId            = string.Format("youtubevideo-{0}", videoItem.Id);

            var embedHtml = string.Format("<iframe id='{0}' type='text/html' width='{1}' height='{2}' src='https://www.youtube.com/embed/{3}?autoplay={4}&controls={5}&enablejsapi={6}&loop={7}&modestbranding={8}&rel={9}&showinfo={10}&theme={11}' frameborder='0' allowfullscreen></iframe>",
                uniqueHtmlId, width, height, videoItem.Id, autoPlayString, showControlsString, enableJsApiString, loopString, modestBrandingString, relString, showInfoString, theme);

            return embedHtml;
        }
开发者ID:Jeavon,项目名称:YouTube-Umbraco,代码行数:40,代码来源:YouTubeExtensionMethods.cs


示例17: GeneralOptions

 public GeneralOptions(Theme theme, bool highlightTail, double highlightTailDuration, int scale)
 {
     Theme = theme;
     HighlightTail = highlightTail;
     HighlightDuration = highlightTailDuration;
     Scale = scale;
 }
开发者ID:ItsJustSean,项目名称:TailBlazer,代码行数:7,代码来源:GeneralOptions.cs


示例18: ThemeListItemViewModel

 public ThemeListItemViewModel(Theme theme)
 {
     this.Guid = theme.Guid;
     this.Title = theme.Title;
     this.Cost = theme.Cost;
     this.ImageUrl = theme.Images.First().Url;
 }
开发者ID:Brontsy,项目名称:Vintage-Rabbit,代码行数:7,代码来源:ThemeListItemViewModel.cs


示例19: ChangeTheme

        public static void ChangeTheme(Window window, Accent newAccent, Theme newTheme)
        {
            if (window == null) throw new ArgumentNullException("window");

            var oldTheme = DetectTheme(window);
            ChangeTheme(window.Resources, oldTheme, newAccent, newTheme);
        }
开发者ID:ZyshchykMaksim,项目名称:MahApps.Metro,代码行数:7,代码来源:ThemeManager.cs


示例20: Setup

        public static void Setup()
        {
            var theme = new Theme();
            CurrentTheme = theme;
            CodeFramework.iOS.Theme.CurrentTheme = theme;
			RepositoryCellView.RoundImages = false;
			MonoTouch.Dialog.StyledStringElement.DefaultTitleFont = UIFont.SystemFontOfSize(15f);
			MonoTouch.Dialog.NameTimeStringElement.NameColor = Theme.CurrentTheme.MainTitleColor;

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
            UINavigationBar.Appearance.TintColor = UIColor.White;
            UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(50, 50, 50);
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes { TextColor = UIColor.White, Font = UIFont.SystemFontOfSize(18f) });
            CodeFramework.iOS.Utils.Hud.BackgroundTint = UIColor.FromRGBA(228, 228, 228, 128);

            UserVoice.UVStyleSheet.Instance.NavigationBarTintColor = UIColor.White;
            UserVoice.UVStyleSheet.Instance.NavigationBarTextColor = UIColor.White;

            UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(110, 110, 117);
            UITableViewHeaderFooterView.Appearance.TintColor = UIColor.FromRGB(228, 228, 228);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).TextColor = UIColor.FromRGB(136, 136, 136);
            UILabel.AppearanceWhenContainedIn(typeof(UITableViewHeaderFooterView)).Font = UIFont.SystemFontOfSize(13f);

            UIToolbar.Appearance.BarTintColor = UIColor.FromRGB(245, 245, 245);

            UIBarButtonItem.AppearanceWhenContainedIn(typeof(UISearchBar)).SetTitleTextAttributes(new UITextAttributes {TextColor = UIColor.White}, UIControlState.Normal);

//            CodeFramework.Elements.NewsFeedElement.LinkColor = theme.MainTitleColor;
//            CodeFramework.Elements.NewsFeedElement.TextColor = theme.MainTextColor;
//            CodeFramework.Elements.NewsFeedElement.NameColor = theme.MainTitleColor;
        }
开发者ID:jrschumacher,项目名称:CodeHub,代码行数:31,代码来源:Theme.cs



注:本文中的Theme类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Thickness类代码示例发布时间:2022-05-24
下一篇:
C# The类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap