本文整理汇总了C#中System.Resources.ResourceManager.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# System.Resources.ResourceManager.GetString方法的具体用法?C# System.Resources.ResourceManager.GetString怎么用?C# System.Resources.ResourceManager.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Resources.ResourceManager
的用法示例。
在下文中一共展示了System.Resources.ResourceManager.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegularExpressionLocalizedAttribute
public RegularExpressionLocalizedAttribute(Type ResourceType, string valueToCompareName, string errorMessageResourceName)
{
base.ErrorMessageResourceName = errorMessageResourceName;
base.ErrorMessageResourceType = ResourceType;
string displayName = "";
var resman = new System.Resources.ResourceManager(ResourceType);
//error message
displayName = resman.GetString(errorMessageResourceName);
//base.ErrorMessage = string.IsNullOrEmpty(displayName)
// ? string.Format("[[{0}]]", errorMessageResourceName)
// : displayName;
//value To Compare
displayName = resman.GetString(valueToCompareName);
_valueToCompare = string.IsNullOrEmpty(displayName)
? string.Format("[[{0}]]", valueToCompareName)
: displayName;
//ignore it
_condition = Condition.EqualTo;
}
示例2: Form1
public Form1()
{
InitializeComponent();
rm = Properties.Resources.ResourceManager;
textBoxConsole.Text = rm.GetString("Introduction") + "\r\n";
Console.WriteLine(rm.GetString("ConsoleIntroduction"));
GuiStatusUpdate();
}
示例3: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager( typeof( EncodingError ) );
this.txLog = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// txLog
//
this.txLog.AccessibleDescription = resources.GetString( "txLog.AccessibleDescription" );
this.txLog.AccessibleName = resources.GetString( "txLog.AccessibleName" );
this.txLog.Anchor = ((System.Windows.Forms.AnchorStyles) (resources.GetObject( "txLog.Anchor" )));
this.txLog.AutoSize = ((bool) (resources.GetObject( "txLog.AutoSize" )));
this.txLog.BackgroundImage = ((System.Drawing.Image) (resources.GetObject( "txLog.BackgroundImage" )));
this.txLog.Dock = ((System.Windows.Forms.DockStyle) (resources.GetObject( "txLog.Dock" )));
this.txLog.Enabled = ((bool) (resources.GetObject( "txLog.Enabled" )));
this.txLog.Font = ((System.Drawing.Font) (resources.GetObject( "txLog.Font" )));
this.txLog.ImeMode = ((System.Windows.Forms.ImeMode) (resources.GetObject( "txLog.ImeMode" )));
this.txLog.Location = ((System.Drawing.Point) (resources.GetObject( "txLog.Location" )));
this.txLog.MaxLength = ((int) (resources.GetObject( "txLog.MaxLength" )));
this.txLog.Multiline = ((bool) (resources.GetObject( "txLog.Multiline" )));
this.txLog.Name = "txLog";
this.txLog.PasswordChar = ((char) (resources.GetObject( "txLog.PasswordChar" )));
this.txLog.ReadOnly = true;
this.txLog.RightToLeft = ((System.Windows.Forms.RightToLeft) (resources.GetObject( "txLog.RightToLeft" )));
this.txLog.ScrollBars = ((System.Windows.Forms.ScrollBars) (resources.GetObject( "txLog.ScrollBars" )));
this.txLog.Size = ((System.Drawing.Size) (resources.GetObject( "txLog.Size" )));
this.txLog.TabIndex = ((int) (resources.GetObject( "txLog.TabIndex" )));
this.txLog.Text = resources.GetString( "txLog.Text" );
this.txLog.TextAlign = ((System.Windows.Forms.HorizontalAlignment) (resources.GetObject( "txLog.TextAlign" )));
this.txLog.Visible = ((bool) (resources.GetObject( "txLog.Visible" )));
this.txLog.WordWrap = ((bool) (resources.GetObject( "txLog.WordWrap" )));
//
// EncodingError
//
this.AccessibleDescription = resources.GetString( "$this.AccessibleDescription" );
this.AccessibleName = resources.GetString( "$this.AccessibleName" );
this.AutoScaleBaseSize = ((System.Drawing.Size) (resources.GetObject( "$this.AutoScaleBaseSize" )));
this.AutoScroll = ((bool) (resources.GetObject( "$this.AutoScroll" )));
this.AutoScrollMargin = ((System.Drawing.Size) (resources.GetObject( "$this.AutoScrollMargin" )));
this.AutoScrollMinSize = ((System.Drawing.Size) (resources.GetObject( "$this.AutoScrollMinSize" )));
this.BackgroundImage = ((System.Drawing.Image) (resources.GetObject( "$this.BackgroundImage" )));
this.ClientSize = ((System.Drawing.Size) (resources.GetObject( "$this.ClientSize" )));
this.Controls.Add( this.txLog );
this.Enabled = ((bool) (resources.GetObject( "$this.Enabled" )));
this.Font = ((System.Drawing.Font) (resources.GetObject( "$this.Font" )));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Icon = ((System.Drawing.Icon) (resources.GetObject( "$this.Icon" )));
this.ImeMode = ((System.Windows.Forms.ImeMode) (resources.GetObject( "$this.ImeMode" )));
this.Location = ((System.Drawing.Point) (resources.GetObject( "$this.Location" )));
this.MaximumSize = ((System.Drawing.Size) (resources.GetObject( "$this.MaximumSize" )));
this.MinimumSize = ((System.Drawing.Size) (resources.GetObject( "$this.MinimumSize" )));
this.Name = "EncodingError";
this.RightToLeft = ((System.Windows.Forms.RightToLeft) (resources.GetObject( "$this.RightToLeft" )));
this.StartPosition = ((System.Windows.Forms.FormStartPosition) (resources.GetObject( "$this.StartPosition" )));
this.Text = resources.GetString( "$this.Text" );
this.ResumeLayout( false );
}
示例4: Invoke
public void Invoke(object Sender, object Element)
{
if (Element is CommandParameters)
{
CommandParameters cp = (CommandParameters)Element;
string[] checkedElems = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]);
ArrayList alMas = new ArrayList();
foreach (string elem in checkedElems)
{
string[] elemMas = elem.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries);
//type, id, _containerName, _containerKey
if (elemMas.Length != 4)
continue;
if (elemMas[0] == "2")
{
int id = Convert.ToInt32(elemMas[1], CultureInfo.InvariantCulture);
alMas.Add(id);
}
UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties;
System.Resources.ResourceManager LocRM = new System.Resources.ResourceManager("Mediachase.UI.Web.App_GlobalResources.Modules.Resources.strTemplate", typeof(CopySelectedHandler).Assembly);
int iCount = 10;
if (pc["ClipboardItemsCount"] != null)
iCount = int.Parse(pc["ClipboardItemsCount"].ToString());
string ss = String.Empty;
try
{
foreach (int iFileId in alMas)
{
string sNewFileClip = "";
if (pc["ClipboardFiles"] != null)
sNewFileClip = pc["ClipboardFiles"].ToString();
sNewFileClip = WorkWithClipboard(iCount, iFileId.ToString() + "|" + sNewFileClip);
pc["ClipboardFiles"] = sNewFileClip;
}
ss = String.Format(LocRM.GetString("tFilesAdded"), alMas.Count.ToString());
}
catch
{
ss = LocRM.GetString("tFilesNotAdded");
}
CommandManager cm = Sender as CommandManager;
if (cm != null && !String.IsNullOrEmpty(ss))
cm.InfoMessage = ss;
}
}
}
示例5: Collections
public Collections(CollectionItem item)
{
InitializeComponent();
_item = item;
collectionRequests = new CollectionRequests(Constants.BaseApiUrl);
collectionRequests.ItemsReceived += collectionRequests_ItemsReceived;
this.FoundedStoryBoard.Completed += FoundedStoryBoard_Completed;
this.HighlightFoundedStoryBoard.Completed += HighlightFoundedStoryBoard_Completed;
rm = new System.Resources.ResourceManager(typeof(Earthwatchers.UI.Resources.Labels));
this.PrizeText.Text = rm.GetString(_item.Name).ToUpper();
this.CollectionNameText.Text = rm.GetString(_item.CollectionName);
this.Image3.Source = Earthwatchers.UI.Resources.ResourceHelper.GetBitmap(string.Format("/Resources/Images/Collections/{0}", _item.Icon));
ToolTipService.SetToolTip(this.Image3Border, rm.GetString(_item.Name));
}
示例6: ToString
public override string ToString()
{
//LANGFILE
var resman = new System.Resources.ResourceManager(typeof(Strings).FullName, typeof(Strings).Assembly);
return base.ToString() + this.TypeOfMaterial + " " + this.NameOfMaterial + " " + this.Weight + " " + resman.GetString("Weight");
}
示例7: DisplayNoMatches
public void DisplayNoMatches()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(NoiFolderMessage));
this.richTextBox2.Text = resources.GetString("richTextBox2.NoMatchesText");
this.richTextBox3.Visible = this.richTextBox4.Visible = false;
this.pictureBox1.Visible = this.pictureBox2.Visible = false;
}
示例8: ValidateIntraPolicy
/// <summary>
/// Evaluate the file type expressions within a collection of IPolicyObjects to determine whether they are valid.
/// For now, we assume that the collection of IPolicyObjects will consist of IConditionGroups only. If there are
/// other IPolicyObject types in the collection, these will not be validated.
/// </summary>
/// <param name="conditions">The IPolicyObject to evaluate</param>
/// <returns>True if all file type expressions with the IPolicyObject collection are valid, otherwise False</returns>
public static bool ValidateIntraPolicy(string policyName, IPolicyObject policyObject, PolicySetValidator.AddViolationMessageHandler AddMessage)
{
if (policyObject is IConditionGroup)
{
if (!ValidateIntraPolicyConditionGroup((IConditionGroup)policyObject))
{
if (null != AddMessage)
{
AddMessage(policyName, Properties.Resources.VALIDATION_INTRAPOLICY_FILETYPE_CONFLICT, false);
}
return false;
}
}
else
{
//the following is for the developer - we are only expecting to find expressions in a
//Policy -> ConditionGroup -> Condition structure. You're in this code because presumably
//we have now changed the way we structure expressions
System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("Workshare.Policy.Properties.Resources", typeof(PolicySuites).Assembly);
string message = resourceManager.GetString("VALIDATION_INTRAPOLICY_EXPRESSIONS_UNSUPPORTEDSTRUCTURE", System.Globalization.CultureInfo.InvariantCulture);
Logger.LogError(message);
System.Diagnostics.Debug.Assert(false, message);
}
return true;
}
示例9: ValidateIntraPolicyConditionGroup
/// <summary>
/// Evaluates the file type expressions within a condition group to determine whether they are all valid.
/// For now, we assume that the conditionGroup.Conditions collection contains only ICondition objects. If there
/// are any IPolicyObject objects within the collection that are not ICondition, these will not be validated.
/// Validation is only performed on ConditionGroups with AND logic.
/// </summary>
/// <param name="conditionGroup">The condition group to evaluae</param>
/// <returns></returns>
private static bool ValidateIntraPolicyConditionGroup(IConditionGroup conditionGroup)
{
//For now, we only validate on AND logic
if (ConditionLogic.AND == conditionGroup.Logic)
{
List<Workshare.Policy.FileType> fileTypesInConditionGroup = new List<Workshare.Policy.FileType>();
foreach (IPolicyObject policyObject in conditionGroup.Conditions)
{
if (policyObject is ICondition)
{
if (!ValidateIntraPolicyCondition((ICondition)policyObject, fileTypesInConditionGroup))
{
return false;
}
}
else
{
//the following is for the developer - we are only expecting to find expressions in a
//Policy -> ConditionGroup -> Condition structure. You're in this code because presumably
//we have now changed the way we structure expressions
System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager("Workshare.Policy.Properties.Resources", typeof(PolicySuites).Assembly);
string message = resourceManager.GetString("VALIDATION_INTRAPOLICY_EXPRESSIONS_UNSUPPORTEDSTRUCTURE", System.Globalization.CultureInfo.InvariantCulture);
Logger.LogError(message);
System.Diagnostics.Debug.Assert(false, message);
}
}
}
return true;
}
示例10: Form1
public Form1()
{
InitializeComponent();
rm = BpsConvWin.Properties.Resources.ResourceManager;
textBoxOutput.Text = rm.GetString("PleasePressBrowseButton") + "\r\n";
Text = string.Format(CultureInfo.CurrentCulture, "BpsConvWin {0}", AssemblyVersion);
}
示例11: About
public About()
{
InitializeComponent();
System.Resources.ResourceManager resourceManager = new System.Resources.ResourceManager(typeof(About));
title.Text = string.Format(resourceManager.GetString("title.Text"), Application.ProductVersion);
centerString(title);
centerString(label3);
}
示例12: Form1
public Form1()
{
InitializeComponent();
rm = WavSynchro.Properties.Resources.ResourceManager;
textBoxConsole.Text = rm.GetString("Introduction") + "\r\n";
GuiStatusUpdate();
}
示例13: Main
static void Main(string[] args)
{
System.Resources.ResourceManager rs = new System.Resources.ResourceManager("Con_Proj.Resource1", typeof(Resource1).Assembly);
var title = rs.GetString("String2");//获取资源名为title的字符串
Console.WriteLine(title);
Console.ReadKey();
}
示例14: Authenticate
internal static string Authenticate(IWin32Window dialogOwner, FlickrContext context)
{
object frob;
FlickrNet.Flickr.CacheDisabled = true;
System.Resources.ResourceManager mgr = new System.Resources.ResourceManager(typeof(Properties.Resources));
FlickrNet.Flickr flickrProxy = new FlickrNet.Flickr(mgr.GetString("ApiKey"), mgr.GetString("SharedSecret"));
// Leverage proxy settings if they are there.
System.Net.WebProxy proxySettings = (System.Net.WebProxy)WindowsLive.Writer.Api.PluginHttpRequest.GetWriterProxy();
if (proxySettings != null)
{
flickrProxy.Proxy = proxySettings;
}
using (AuthForm authf = new AuthForm(flickrProxy))
{
if (authf.ShowDialog(dialogOwner) != DialogResult.OK)
{
return null;
}
frob = authf.Frob;
}
using (CompletedAuth complete = new CompletedAuth(flickrProxy, frob))
{
if (complete.ShowDialog(dialogOwner) != DialogResult.OK)
{
// auth failed
MessageBox.Show(@"Authorization has failed. Please try again", @"Authorization Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
return null;
}
context.FlickrAuthToken = complete.AuthToken;
context.FlickrAuthTokenSecret = complete.AuthTokenSecret;
return complete.AuthToken;
}
}
示例15: get_CRMTicketProcessFlag_Description
}//get_CRMTicketGrade_Description
public static string get_CRMTicketProcessFlag_Description(CRMTicketProcessFlag enu)
{
System.Resources.ResourceManager rm = new System.Resources.ResourceManager(typeof(CRMTicket));
System.Globalization.CultureInfo cInfo = System.Globalization.CultureInfo.CurrentCulture;
string enuName = string.Format("{0}.{1}.{2}", typeof(CRMTicketProcessFlag).BaseType.Name, typeof(CRMTicketProcessFlag).Name, enu.ToString());
try
{
return rm.GetString(enuName, cInfo); ;
}
catch
{
throw new Exception("Enum Error");
}
}//get_CRMTicketProcessFlag_Description