本文整理汇总了C#中Microsoft.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.ToString方法的具体用法?C# Microsoft.ToString怎么用?C# Microsoft.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft
的用法示例。
在下文中一共展示了Microsoft.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitIdentifierName
public override void VisitIdentifierName(Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax node)
{
if (node.ToString() == identifier)
{
var symbol = model.GetSymbolInfo(node).Symbol;
if (symbol != null)
{
symbols.Add(symbol);
}
}
base.VisitIdentifierName(node);
}
示例2: ChangeState
public void ChangeState(Microsoft.Transactions.Wsat.StateMachines.State newState)
{
if (this.history != null)
{
this.history.AddState(newState.ToString());
}
if (this.current != null)
{
if (DebugTrace.Info)
{
DebugTrace.TxTrace(TraceLevel.Info, this.enlistment.EnlistmentId, "Leaving [{0}]", this.current);
}
this.current.Leave(this);
}
if (DebugTrace.Info)
{
DebugTrace.TxTrace(TraceLevel.Info, this.enlistment.EnlistmentId, "Entering [{0}]", newState);
}
this.current = newState;
this.current.Enter(this);
}
示例3: TranslateAzureServiceBusReceiveModeValueToConfigurationValue
public static MessageReceiveMode TranslateAzureServiceBusReceiveModeValueToConfigurationValue(Microsoft.ServiceBus.Messaging.ReceiveMode azureServiceBusReceiveMode)
{
MessageReceiveMode result;
switch(azureServiceBusReceiveMode)
{
case Microsoft.ServiceBus.Messaging.ReceiveMode.PeekLock:
result = MessageReceiveMode.PeekLock;
break;
case Microsoft.ServiceBus.Messaging.ReceiveMode.ReceiveAndDelete:
result = MessageReceiveMode.ReceiveAndDelete;
break;
default:
throw new ArgumentOutOfRangeException("azureServiceBusReceiveMode", "Unexpected ReceiveMode value specified: " + azureServiceBusReceiveMode.ToString());
}
return result;
}
示例4: TriggerEquals
public static bool TriggerEquals(Microsoft.Win32.TaskScheduler.Trigger a, Microsoft.Win32.TaskScheduler.Trigger b)
{
return (a.ToString() == b.ToString()) && (a.StartBoundary == b.StartBoundary) && (a.EndBoundary == b.EndBoundary) && (a.ExecutionTimeLimit == b.ExecutionTimeLimit);
}
示例5: SetWhich
/// <summary>
/// Sets ComboBox to TaskScheduler.WhichWeek
/// </summary>
/// <param name="aWitch">TaskScheduler.WhichWeek</param>
private void SetWhich(Microsoft.Win32.TaskScheduler.WhichWeek aWitch)
{
this.WhichComboBox.SelectedItem = aWitch.ToString().Replace("Week", string.Empty);
}
示例6: VerifyRegistryKeyPermission
/// <summary>
/// Verify that a specific user has access rights to a specific Registry Key
/// </summary>
/// <param name="userName">Name of the user to check for</param>
/// <param name="root">Root key for the registry key</param>
/// <param name="subKey">Registry key to check for</param>
/// <param name="rights">Expected access rights</param>
public static void VerifyRegistryKeyPermission(string userName, Microsoft.Win32.RegistryKey root, string subKey, RegistryRights rights)
{
RegistryKey registryKey = root.OpenSubKey(subKey);
RegistrySecurity registrySecurity = registryKey.GetAccessControl();
AuthorizationRuleCollection accessRules = registrySecurity.GetAccessRules(true, true, typeof(NTAccount));
foreach (RegistryAccessRule accessRule in accessRules)
{
if (userName.ToLowerInvariant().Equals(accessRule.IdentityReference.Value.ToLowerInvariant()))
{
if ((accessRule.RegistryRights & rights) == rights)
{
return;
}
}
}
Assert.True(false, string.Format("User '{0}' do not have the correct permessions to RegistryKey '{1}/{2}'.", userName, root.ToString(), subKey));
}
示例7: InputManager_KeyPressedCallback
private void InputManager_KeyPressedCallback(Microsoft.Xna.Framework.Input.Keys key)
{
if(!HasKeyboardFocus || !IsEditable)
{
return;
}
Keys prevKey = Key;
Key = key;
Text = key.ToString();
OnTextModified.Invoke(Text);
OnKeyModified.Invoke(prevKey, Key, this);
}
示例8: GetSectionName
public static string GetSectionName(Microsoft.Office.Interop.Visio.VisSectionIndices value)
{
string s = value.ToString();
return s.Substring(10); // Get Rid of the visSection prefix
}
示例9: CheckDirectionMenu
private void CheckDirectionMenu(Microsoft.Msagl.Drawing.LayerDirection dir) {
Check(this.direction.ToString(), false);
this.direction = dir;
Check(dir.ToString(), true);
}
示例10: GetText
private string GetText(Microsoft.Msagl.Drawing.DrawingObject drawingObject) {
if (drawingObject == null)
return "null";
return drawingObject.ToString();
}
示例11: UpdateExecutionPolicy
public void UpdateExecutionPolicy(Microsoft.PowerShell.ExecutionPolicy policy)
{
log.Info("Attempting to update Powershell Execution policy");
using (PWS ps = PWS.Create())
{
ps.AddScript("Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy " + policy.ToString());
//ps.AddScript("./Scripts/PowerShell/UpdateExecutionPolicy.ps1 -policy " + policy.ToString());
var result = ps.Invoke();
if (ps.Streams.Error.Count > 0)
{
log.Error(ps.Streams.Error[0].ErrorDetails.Message);
}
//log.Info("Current Powershell execution policy changed from '" + result[0].Members["CurrentPolicy"].Value.ToString() + "' to '"+ result[0].Members["NewPolicy"].Value.ToString()+"'");
}
}
示例12: AdControl_ErrorOccurred
private void AdControl_ErrorOccurred(object sender, Microsoft.Advertising.AdErrorEventArgs e)
{
Console.Write(e.ToString());
}
示例13: OnKeyDown
public override bool OnKeyDown(Microsoft.Xna.Framework.Input.Keys k)
{
if ((_visible) && (_focus))
{
switch (k)
{
case Keys.Back:
if ((_text.Length + 1 > _cursor) && (_cursor > 0))
{
_text = _text.Remove(_cursor - 1, 1);
_cursor -= 1;
}
return true;
case Keys.Delete:
if (_text.Length + 1 > _cursor + 1)
_text = _text.Remove(_cursor, 1);
return true;
case Keys.Space:
_text = _text.Insert(_cursor++, " ");
return true;
case Keys.Insert:
_overwrite = !_overwrite;
return true;
case Keys.Enter:
_parent.HandleEvent(false, Backend.Events.TextEntered);
return true;
case Keys.Left:
if (_cursor > 0)
_cursor -= 1;
return true;
case Keys.Right:
if (_cursor < _text.Length)
_cursor += 1;
return true;
case Keys.Home:
_cursor = 0;
return true;
case Keys.End:
_cursor = _text.Length - 1;
return true;
case Keys.D0:
_text = _text.Insert(_cursor++, "0");
break;
case Keys.D1:
_text = _text.Insert(_cursor++, "1");
break;
case Keys.D2:
_text = _text.Insert(_cursor++, "2");
break;
case Keys.D3:
_text = _text.Insert(_cursor++, "3");
break;
case Keys.D4:
_text = _text.Insert(_cursor++, "4");
break;
case Keys.D5:
_text = _text.Insert(_cursor++, "5");
break;
case Keys.D6:
_text = _text.Insert(_cursor++, "6");
break;
case Keys.D7:
_text = _text.Insert(_cursor++, "7");
break;
case Keys.D8:
_text = _text.Insert(_cursor++, "8");
break;
case Keys.D9:
_text = _text.Insert(_cursor++, "9");
break;
default:
if (k.ToString().Length == 1)
{
if ((Keyboard.GetState().IsKeyDown(Keys.LeftShift)) || (Keyboard.GetState().IsKeyDown(Keys.RightShift)))
_text = _text.Insert(_cursor, k.ToString().ToUpper());
else
_text = _text.Insert(_cursor, k.ToString().ToLower());
_cursor += 1;
return true;
}
break;
//.........这里部分代码省略.........