本文整理汇总了C#中System.Local类的典型用法代码示例。如果您正苦于以下问题:C# Local类的具体用法?C# Local怎么用?C# Local使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Local类属于System命名空间,在下文中一共展示了Local类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditVariableForm
public EditVariableForm(Local local)
{
InitializeComponent();
cbTypeSpecification.SelectedIndex = 0;
RestoreVariable(local);
}
示例2: EmitDerivation
public IEnumerable<Instruction> EmitDerivation(MethodDef method, ConfuserContext ctx, Local dst, Local src)
{
for (int i = 0; i < 0x10; i++) {
yield return Instruction.Create(OpCodes.Ldloc, dst);
yield return Instruction.Create(OpCodes.Ldc_I4, i);
yield return Instruction.Create(OpCodes.Ldloc, dst);
yield return Instruction.Create(OpCodes.Ldc_I4, i);
yield return Instruction.Create(OpCodes.Ldelem_U4);
yield return Instruction.Create(OpCodes.Ldloc, src);
yield return Instruction.Create(OpCodes.Ldc_I4, i);
yield return Instruction.Create(OpCodes.Ldelem_U4);
switch (i % 3) {
case 0:
yield return Instruction.Create(OpCodes.Xor);
break;
case 1:
yield return Instruction.Create(OpCodes.Mul);
break;
case 2:
yield return Instruction.Create(OpCodes.Add);
break;
}
yield return Instruction.Create(OpCodes.Stelem_I4);
}
}
示例3: GetMethodInfo
public void GetMethodInfo(MethodKey key, out Parameter[] parameters, out Local[] locals, out ILVariable[] decLocals) {
parameters = null;
locals = null;
decLocals = null;
foreach (var textView in MainWindow.Instance.AllTextViews) {
if (parameters != null && decLocals != null)
break;
var cm = textView.CodeMappings;
if (cm == null)
continue;
MemberMapping mapping;
if (!cm.TryGetValue(key, out mapping))
continue;
var method = mapping.MethodDefinition;
if (mapping.LocalVariables != null && method.Body != null) {
locals = method.Body.Variables.ToArray();
decLocals = new ILVariable[method.Body.Variables.Count];
foreach (var v in mapping.LocalVariables) {
if (v.IsGenerated)
continue;
if (v.OriginalVariable == null)
continue;
if ((uint)v.OriginalVariable.Index >= decLocals.Length)
continue;
decLocals[v.OriginalVariable.Index] = v;
}
}
parameters = method.Parameters.ToArray();
}
}
示例4: CreateRoom
public void CreateRoom(string TilemapName)
{
uint entityID = Entity.NextEntity();
/*Texture2D spriteSheet = game.Content.Load<Texture2D>("");
spriteSheet.Name = "";*/
Position position = new Position()
{
EntityID = entityID,
// Center and Radius TBD Later
Center = new Vector2(0, 0),
Radius = 32f,
};
game.PositionComponent[entityID] = position;
Local local = new Local()
{
EntityID = entityID,
};
game.LocalComponent[entityID] = local;
Room room = new Room()
{
EntityID = entityID,
Tilemap = TilemapName,
};
game.RoomComponent[entityID] = room;
}
示例5: InitSettings
public void InitSettings(Local.Settings settings)
{
this.Settings = settings;
this.SniffDirectoryListPanel.UpdateViewer();
this.SniffListPanel.UpdateViewer();
}
示例6: GetMethodInfo
public void GetMethodInfo(SerializedDnToken key, out Parameter[] parameters, out Local[] locals, out IILVariable[] decLocals) {
parameters = null;
locals = null;
decLocals = null;
foreach (var tab in fileTabManager.VisibleFirstTabs) {
if (parameters != null && decLocals != null)
break;
var uiContext = tab.UIContext as ITextEditorUIContext;
var cm = uiContext.TryGetCodeMappings();
if (cm == null)
continue;
var mapping = cm.TryGetMapping(key);
if (mapping == null)
continue;
var method = mapping.Method;
if (mapping.LocalVariables != null && method.Body != null) {
locals = method.Body.Variables.ToArray();
decLocals = new IILVariable[method.Body.Variables.Count];
foreach (var v in mapping.LocalVariables) {
if (v.GeneratedByDecompiler)
continue;
if (v.OriginalVariable == null)
continue;
if ((uint)v.OriginalVariable.Index >= decLocals.Length)
continue;
decLocals[v.OriginalVariable.Index] = v;
}
}
parameters = method.Parameters.ToArray();
}
}
示例7: Update
public Local Update(Local local)
{
DbEntityEntry entry = context.Entry(local);
entry.State = EntityState.Modified;
context.SaveChanges();
return local;
}
示例8: GetMethodInfo
public void GetMethodInfo(ModuleTokenId key, out Parameter[] parameters, out Local[] locals, out SourceLocal[] decompilerLocals) {
parameters = null;
locals = null;
decompilerLocals = null;
foreach (var tab in documentTabService.VisibleFirstTabs) {
if (parameters != null && decompilerLocals != null)
break;
var uiContext = tab.UIContext as IDocumentViewer;
var methodDebugService = uiContext.TryGetMethodDebugService();
if (methodDebugService == null)
continue;
var info = methodDebugService.TryGetMethodDebugInfo(key);
if (info == null)
continue;
var method = info.Method;
if (info.Locals.Length != 0 && method.Body != null) {
locals = method.Body.Variables.ToArray();
decompilerLocals = new SourceLocal[method.Body.Variables.Count];
foreach (var v in info.Locals) {
if ((uint)v.Local.Index >= decompilerLocals.Length)
continue;
decompilerLocals[v.Local.Index] = v;
}
}
parameters = method.Parameters.ToArray();
}
}
示例9: Encrypt
public string Encrypt(string msg, int key, Local local)
{
SetLocal(local);
var stringBuilder = new StringBuilder(msg.Length);
int n = _abc.Length / 2;
foreach (var item in msg)
{
var k = _abc.IndexOf(item);
if (k != -1)
{
k = (k + key) % n;
if (char.IsLower(item))
{
k += n;
}
stringBuilder.Append(_abc[k]);
}
else
{
stringBuilder.Append(item);
}
}
return stringBuilder.ToString();
}
示例10: EmitDerivation
public IEnumerable<Instruction> EmitDerivation(MethodDef method, ConfuserContext ctx, Local dst, Local src) {
var ret = new List<Instruction>();
var codeGen = new CodeGen(dst, src, method, ret);
codeGen.GenerateCIL(derivation);
codeGen.Commit(method.Body);
return ret;
}
示例11: Create
public Local Create(Local local)
{
Validator.Validate(local);
var savedLocal = _localRepository.Save(local);
return savedLocal;
}
示例12: SourceLocal
/// <summary>
/// Constructor
/// </summary>
/// <param name="local">Local</param>
/// <param name="name">Name used by the decompiler</param>
public SourceLocal(Local local, string name) {
if (local == null)
throw new ArgumentNullException(nameof(local));
if (name == null)
throw new ArgumentNullException(nameof(name));
Local = local;
Name = name;
}
示例13: Update
public Local Update(Local local)
{
Validator.Validate(local);
var updatedLocal = _localRepository.Update(local);
return updatedLocal;
}
示例14: Init
public void Init(CilBody body) {
if (inited)
return;
stateVar = new Local(ctx.Method.Module.CorLibTypes.Int32);
body.Variables.Add(stateVar);
body.InitLocals = true;
Compile(body);
inited = true;
}
示例15: Var
protected virtual Local Var(Variable var) {
Local ret;
if (!localMap.TryGetValue(var.Name, out ret)) {
ret = new Local(Method.Module.CorLibTypes.UInt32);
ret.Name = var.Name;
localMap[var.Name] = ret;
}
return ret;
}