当前位置: 首页>>代码示例>>C#>>正文


C# ResourceManager.GetString方法代码示例

本文整理汇总了C#中System.Resources.ResourceManager.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceManager.GetString方法的具体用法?C# ResourceManager.GetString怎么用?C# ResourceManager.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Resources.ResourceManager的用法示例。


在下文中一共展示了ResourceManager.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BasicAuthenticationCtrl

        public BasicAuthenticationCtrl()
        {
            try
            {
                this.Font = SystemFonts.MessageBoxFont;
                InitializeComponent();

                resourceManager = new ResourceManager("ESRI.ArcGIS.OSM.Editor.OSMFeatureInspectorStrings", this.GetType().Assembly);

                lblUserName.Text = resourceManager.GetString("OSMEditor_Authentication_UI_labelusername");
                lblPassword.Text = resourceManager.GetString("OSMEditor_Authentication_UI_labelpassword");

                txtUserName.LostFocus += new EventHandler(txtUserName_LostFocus);
                txtUserName.Refresh();
                txtPassword.LostFocus += new EventHandler(txtPassword_LostFocus);
                txtPassword.Refresh();

                m_password = String.Empty;
                m_username = String.Empty;

                this.Refresh();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
            }
        }
开发者ID:weepingdog,项目名称:arcgis-osm-editor,代码行数:28,代码来源:BasicAuthenticationCtrl.cs

示例2: Init

		/// <summary>
		/// Initializes the attribute.
		/// </summary>
        protected void Init(int index, Type itemType, Type resourceType, string itemName, string name, int tabIndex, bool enabled)
        {
            this.Enabled = enabled;
            System.Resources.ResourceManager resources = new ResourceManager(resourceType.Namespace + ".Properties.Resources", resourceType.Assembly);
            string tmpName = resources.GetString(itemName);
            if (tmpName == null || tmpName.Trim().Length == 0)
            {
                m_ItemName = itemName;
            }
            else
            {
                m_ItemName = tmpName;
            }
            tmpName = resources.GetString(name);
            if (tmpName == null || tmpName.Trim().Length == 0)
            {
                m_Name = name;
            }
            else
            {
                m_Name = tmpName;
            }
            m_Index = index;
            m_TabIndex = tabIndex;
            m_ItemType = itemType;
        }
开发者ID:giapdangle,项目名称:Gurux.Device,代码行数:29,代码来源:GXToolboxItemAttribute.cs

示例3: ClearAllNote_Click

        private void ClearAllNote_Click(object sender, RoutedEventArgs e)
        {
            ResourceManager rm = new ResourceManager(typeof(My_Note.Lang.AppResources));
            if (MessageBox.Show(rm.GetString("SettingPageClearAllNoteMessage"), rm.GetString("SettingPageClearButtonMessageTitle"), MessageBoxButton.OKCancel) != MessageBoxResult.OK)
            {
                //ommit
            }
            else
            {
                using (var appStorage = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    string[] filelist = appStorage.GetFileNames("*.txt");

                    foreach (string file in filelist)
                    {
                        appStorage.DeleteFile(file);
                    }

                    string[] jpglist = appStorage.GetFileNames("*.jpg");

                    foreach (string file in jpglist)
                    {
                        appStorage.DeleteFile(file);
                    }
                }
            }
        }
开发者ID:virtualcca,项目名称:My_Note,代码行数:27,代码来源:ClearCache.xaml.cs

示例4: Application_Idle

        private static void Application_Idle(object sender, EventArgs e)
        {
            Application.Idle -= new EventHandler(Application_Idle);
            if (context.MainForm == null)
            {
                ResourceManager rm =new ResourceManager("SoukeyNetget.Resources.globalUI", Assembly.GetExecutingAssembly());

                frmMain mf = new frmMain ();
                context.MainForm = mf;
                frmStart sf = (frmStart)context.Tag;

                //初始化界面信息
                sf.label3.Text = rm.GetString ("Info69");
                Application.DoEvents();
                mf.IniForm();

                //初始化对象并开始启动运行区的任务
                sf.label3.Text =  rm.GetString ("Info70");
                Application.DoEvents();
                mf.UserIni();

                sf.label3.Text = rm.GetString ("Info71");
                Application.DoEvents();
                mf.StartListen();

                rm = null;
                //mf.IniForm();

                sf.Close();                                 //关闭启动窗体
                sf.Dispose();

                mf.Show();                                  //启动主程序窗体

            }
        }
开发者ID:zhushengwen,项目名称:example-zhushengwen,代码行数:35,代码来源:Program.cs

示例5: UserDisplayMessage

        /// <summary>
        /// This static/utility method will provide a message suitable for display to a user corresponding to a given Rapid Code/language.
        /// </summary>
        /// <param name="errorCode">Rapid API Error Code e.g. "V6023" </param>
        /// <param name="language">Language Code, e.g. "EN" (default) or "ES"</param>
        /// <returns>String with a description for the given code in the specified language</returns>
        public static string UserDisplayMessage(string errorCode, string language)
        {
            ResourceManager rm = new ResourceManager("eWAY.Rapid.Resources.ErrorMessages", Assembly.GetExecutingAssembly());

            string result = null;

            try
            {
                var cultureInfo = new CultureInfo(language);
                return result = rm.GetString(errorCode, cultureInfo);
            }
            catch (CultureNotFoundException)
            {
                var cultureInfo = new CultureInfo(SystemConstants.DEFAULT_LANGUAGE_CODE);
                return result = rm.GetString(errorCode, cultureInfo);
            }
            catch (MissingManifestResourceException)
            {
                var cultureInfo = new CultureInfo(SystemConstants.DEFAULT_LANGUAGE_CODE);
                try
                {
                    return result = rm.GetString(errorCode, cultureInfo);
                }
                catch (MissingManifestResourceException)
                {
                    return SystemConstants.INVALID_ERROR_CODE_MESSAGE;
                }
            }
        }
开发者ID:eWAYPayment,项目名称:eway-rapid-net,代码行数:35,代码来源:RapidClientFactory.cs

示例6: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            facade = new BusinessFacade(myConn);
            int noOfUnread = 0;
            try
            {
                MembershipUser mu = Membership.GetUser();
                string employerId = mu.ProviderUserKey.ToString();

                noOfUnread = facade.NoOfUnread(employerId);
            }
            catch (NullReferenceException)
            {
                FormsAuthentication.SignOut();
            }
            Assembly ass = Assembly.Load("App_GlobalResources");
            ResourceManager rm = new ResourceManager("Resources.Resource", ass);

            if (noOfUnread == 0)
            {
                lbl_NewApply.Text = rm.GetString("Nonewapply");
            }
            else if (noOfUnread > 0)
            {
                lbl_NewApply.Text = noOfUnread + " "+rm.GetString("newapply");
            }

            lbl_firstname.Text = Context.Profile.GetPropertyValue("Employer.Salutation").ToString() + " " + HttpContext.Current.Profile.GetPropertyValue("Employer.FirstName").ToString() + " " + HttpContext.Current.Profile.GetPropertyValue("Employer.LastName").ToString();
        }
开发者ID:chutinhha,项目名称:teachinvietnam,代码行数:29,代码来源:EmployerSite.aspx.cs

示例7: NetworkLayerFactoryAttribute

        /// <summary>
        /// Localizable constructor
        /// </summary>
        /// <param name="name">The localized name</param>
        /// <param name="description">The localized description</param>        
        /// <param name="resourceType">The resource type to load from</param>
        public NetworkLayerFactoryAttribute(string name, string description, Type resourceType)
        {
            ResourceManager manager = new ResourceManager(resourceType);

            Name = manager.GetString(name);
            Description = manager.GetString(description);
        }
开发者ID:michyer,项目名称:canape,代码行数:13,代码来源:NetworkLayerFactoryAttribute.cs

示例8: Setup

        public override void Setup()
        {
            base.Setup();

              // Replace existing listeners with listener for testing.
              Trace.Listeners.Clear();
              Trace.Listeners.Add(this.asertFailListener);

              ResourceManager r = new ResourceManager("MySql.Data.Entity.Tests.Properties.Resources", typeof(BaseEdmTest).Assembly);
              string schema = r.GetString("schema");
              MySqlScript script = new MySqlScript(conn);
              script.Query = schema;
              script.Execute();

              // now create our procs
              schema = r.GetString("procs");
              script = new MySqlScript(conn);
              script.Delimiter = "$$";
              script.Query = schema;
              script.Execute();

              //ModelFirstModel1
              schema = r.GetString("ModelFirstModel1");
              script = new MySqlScript(conn);
              script.Query = schema;
              script.Execute();

              MySqlCommand cmd = new MySqlCommand("DROP DATABASE IF EXISTS `modeldb`", rootConn);
              cmd.ExecuteNonQuery();
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:30,代码来源:BaseEdmTest.cs

示例9: BindTabs

        private void BindTabs()
        {
            ResourceManager LocRM = new ResourceManager("Mediachase.Ibn.WebResources.App_GlobalResources.Calendar.Resources.strCalendar", Assembly.Load(new AssemblyName("Mediachase.Ibn.WebResources")));

            UserLightPropertyCollection pc = Security.CurrentUser.Properties;

            if (Tab != null)
            {
                if (Tab == "SharedCalendars" || Tab == "MyCalendar")
                    pc["Calendar1_CurrentTab"] = Tab;
            }
            else if (pc["Calendar1_CurrentTab"] == null)
                pc["Calendar1_CurrentTab"] = "MyCalendar";

            using (IDataReader rdr = Mediachase.IBN.Business.CalendarView.GetListPeopleForCalendar())
            {
                if (!rdr.Read() && pc["Calendar1_CurrentTab"] == "SharedCalendars")
                    pc["Calendar1_CurrentTab"] = "MyCalendar";
            }

            string controlName = "CalendarViewMy.ascx";

            if (pc["Calendar1_CurrentTab"] == "MyCalendar")
                ((Mediachase.UI.Web.Modules.PageTemplateNew)this.Parent.Parent.Parent.Parent).Title = LocRM.GetString("tMyCalendar");
            else if (pc["Calendar1_CurrentTab"] == "SharedCalendars")
                ((Mediachase.UI.Web.Modules.PageTemplateNew)this.Parent.Parent.Parent.Parent).Title = LocRM.GetString("tSharedCalendars");

            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phItems.Controls.Add(control);
        }
开发者ID:0anion0,项目名称:IBN,代码行数:30,代码来源:Calendar1.ascx.cs

示例10: OnStartup

        public Autodesk.Revit.UI.Result OnStartup(UIControlledApplication application)
        {
            try
            {
                //TAF load english_us TODO add a way to localize
                res = Resource_en_us.ResourceManager;
                // Create new ribbon panel
                RibbonPanel ribbonPanel = application.CreateRibbonPanel(res.GetString("App_Description")); //MDJ todo - move hard-coded strings out to resource files

                //Create a push button in the ribbon panel

                PushButton pushButton = ribbonPanel.AddItem(new PushButtonData("Dynamo",
                    res.GetString("App_Name"), m_AssemblyName, "Dynamo.Applications.DynamoRevit")) as PushButton;

                System.Drawing.Bitmap dynamoIcon = Dynamo.Applications.Properties.Resources.Nodes_32_32;

                BitmapSource bitmapSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
                         dynamoIcon.GetHbitmap(),
                         IntPtr.Zero,
                         System.Windows.Int32Rect.Empty,
                         System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());

                pushButton.LargeImage = bitmapSource;
                pushButton.Image = bitmapSource;

                // MDJ = element level events and dyanmic model update
                // MDJ 6-8-12  trying to get new dynamo to watch for user created ref points and re-run definition when they are moved

                IdlePromise.RegisterIdle(application);

                updater = new DynamoUpdater(application.ActiveAddInId, application.ControlledApplication);
                if (!UpdaterRegistry.IsUpdaterRegistered(updater.GetUpdaterId())) UpdaterRegistry.RegisterUpdater(updater);

                ElementClassFilter SpatialFieldFilter = new ElementClassFilter(typeof(SpatialFieldManager));
                ElementClassFilter familyFilter = new ElementClassFilter(typeof(FamilyInstance));
                ElementCategoryFilter refPointFilter = new ElementCategoryFilter(BuiltInCategory.OST_ReferencePoints);
                ElementClassFilter modelCurveFilter = new ElementClassFilter(typeof(CurveElement));
                ElementClassFilter sunFilter = new ElementClassFilter(typeof(SunAndShadowSettings));
                IList<ElementFilter> filterList = new List<ElementFilter>();

                filterList.Add(SpatialFieldFilter);
                filterList.Add(familyFilter);
                filterList.Add(modelCurveFilter);
                filterList.Add(refPointFilter);
                filterList.Add(sunFilter);

                ElementFilter filter = new LogicalOrFilter(filterList);

                UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeAny());
                UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeElementDeletion());
                UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), filter, Element.GetChangeTypeElementAddition());

                return Result.Succeeded;
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.ToString());
                return Result.Failed;
            }
        }
开发者ID:Tadwork,项目名称:Dynamo,代码行数:60,代码来源:DynamoRevit.cs

示例11: ShowInfo

        /// <summary>
        /// 显示 信息.
        /// 
        /// 1.工程添加资源文件
        ///   资源文件命名方式 [资源文件主题名].[语言区域.].resx   
        ///   这里是 Resource1.en.resx 与 Resource1.zh-CN.resx
        ///   资源文件 默认为 “不复制”  “嵌入的资源”
        /// 
        ///
        /// 2.获取资源文件管理器
        ///   资源文件名的构成为 [项目命名空间].[资源文件主题名]
        ///   这里是 A0410_Globalization.Resource1
        /// 
        /// 3.获取当前进程的语言区域
        /// 
        /// 4.从资源文件中按项目名获取值
        /// 
        ///
        /// 
        /// 前台国际化环境的选择(改变当前程序进程中的区域信息的方式达到改变)
        /// Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("zh-CN");
        /// Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-us");
        /// Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ja-JP");
        /// 
        /// </summary>
        public void ShowInfo()
        {
            // 获取资源文件管理器
            ResourceManager rm = new ResourceManager("A0410_Globalization.Resource1", Assembly.GetExecutingAssembly());

            // 获取当前进程的语言区域
            CultureInfo ci = Thread.CurrentThread.CurrentCulture;

            // 从资源文件中按项目名获取值
            String hello = rm.GetString("Hello", ci);
            String desc = rm.GetString("Desc", ci);

            Console.WriteLine("使用 {0} 的情况下:{1}, {2}", ci, hello, desc);



            // 换一种 语言区域
            CultureInfo ciEn = new System.Globalization.CultureInfo("en-us");

            // 从资源文件中按项目名获取值
            hello = rm.GetString("Hello", ciEn);
            desc = rm.GetString("Desc", ciEn);

            Console.WriteLine("使用 {0} 的情况下:{1}, {2}", ciEn, hello, desc);
        }
开发者ID:mahuidong,项目名称:my-csharp-sample,代码行数:50,代码来源:GlobalizationSample1.cs

示例12: UpdateLanguage

 public void UpdateLanguage(ResourceManager man)
 {
     label1.Text = man.GetString("name");
     maleBox.Text = man.GetString("male");
     femaleBox.Text = man.GetString("female");
     label2.Text = man.GetString("server");
 }
开发者ID:grang5,项目名称:rulotrosign,代码行数:7,代码来源:Step1.cs

示例13: Buy

        public ActionResult Buy(string id)
        {
            ResourceManager resourceManager = new ResourceManager("NetPing_modern.Resources.Views.InnerPages.Buy", typeof(InnerPagesController).Assembly); ;
            switch (id)
            {
                case "":
                case null:
                    ViewBag.Text = _repository.SiteTexts.FirstOrDefault(t => t.Tag == "Buy").Text;
                    break;
                case "dealers":
                    resourceManager = new ResourceManager("NetPing_modern.Resources.Views.InnerPages.Dealers", typeof(InnerPagesController).Assembly);
                    ViewBag.Text = _repository.SiteTexts.FirstOrDefault(t => t.Tag == "Dealers").Text;
                    break;
                case "partnership-how-to":
                    resourceManager = new ResourceManager("NetPing_modern.Resources.Views.InnerPages.Partnership", typeof(InnerPagesController).Assembly);
                    ViewBag.Text = _repository.SiteTexts.FirstOrDefault(t => t.Tag == "Partnership-how").Text;
                    break;

                default:
                    return HttpNotFound();
            }
            ViewBag.Head = resourceManager.GetString("Page_head", System.Globalization.CultureInfo.CurrentCulture);
            ViewBag.Title = resourceManager.GetString("Page_title", System.Globalization.CultureInfo.CurrentCulture);
            ViewBag.Description = resourceManager.GetString("Page_description", System.Globalization.CultureInfo.CurrentCulture);
            ViewBag.Keywords = resourceManager.GetString("Page_keywords", System.Globalization.CultureInfo.CurrentCulture);
            return View("InnerPage");
        }
开发者ID:Netping,项目名称:Netping_modern,代码行数:27,代码来源:InnerPagesController.cs

示例14: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (User.IsInRole("Employee"))
                {
                    lbl_Username.Text = Context.Profile.GetProfileGroup("Employee").GetPropertyValue("FirstName").ToString();
                }
                else if (User.IsInRole("Organization"))
                {
                    Assembly ass = Assembly.Load("App_GlobalResources");
                    ResourceManager rm = new ResourceManager("Resources.Resource", ass);

                    lbl_Username.Text = Context.Profile.GetPropertyValue("Employer.FirstName").ToString();
                    HyperLink2.Text = rm.GetString("Pleaseclickheretoyourmanagement");
                    HyperLink2.NavigateUrl = "~/Employer/EmployerSite.aspx";
                    HyperLink1.Text = rm.GetString("Pleaseclickheretopostajob");
                    HyperLink1.NavigateUrl = "~/memberArea/AdsAJob.aspx";
                }
                else
                {
                    lbl_Username.Visible = false;
                    HyperLink1.Visible = false;
                    HyperLink2.Visible = false;
                }
            }
            catch (Exception)
            {
                Response.Redirect("~/publicArea/errorpages/Error404.aspx");
            }
        }
开发者ID:chutinhha,项目名称:teachinvietnam,代码行数:31,代码来源:Welcome.aspx.cs

示例15: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            ResourceManager LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.FileLibrary.Resources.strFileLibrary", Assembly.GetExecutingAssembly());
            secHeader.Title = LocRM.GetString("tDownloadLinkTitle");
            int lifeTime = 0;
            try
            {
                lifeTime = Convert.ToInt32(PortalConfig.WebDavSessionLifeTime);
            }
            catch (Exception)
            {
            }

            string sTime = String.Format("{0:D2}:{1:D2}", lifeTime / 60, lifeTime % 60);
            string sLink = WebDavUrlBuilder.GetWebDavUrl(_id);
            lblDownloadLink.Text = String.Format(LocRM.GetString("tDownLoadLink"), "javascript:FileDownload();", sTime);

            StringBuilder sb = new StringBuilder();
            sb.AppendLine("var global_DownloadFlag = true;");
            sb.AppendLine("function FileDownload()");
            sb.AppendLine("{");
            sb.AppendLine("global_DownloadFlag = false;");
            sb.AppendFormat("window.location.href='{0}'", sLink);
            sb.AppendLine("}");
            sb.AppendLine("function AutoFileDownload()");
            sb.AppendLine("{");
            sb.AppendLine("if(!global_DownloadFlag) return;");
            sb.AppendFormat("window.location.href='{0}'", sLink);
            sb.AppendLine("}");
            sb.AppendLine("setTimeout('AutoFileDownload()', 3000);");
            ClientScript.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString("N"),
                sb.ToString(), true);
        }
开发者ID:0anion0,项目名称:IBN,代码行数:33,代码来源:DownloadLink.ascx.cs


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