GithubHelp home page GithubHelp logo

jeaminw / mugenmvvmtoolkit.fody Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mugenmvvmtoolkit/mugenmvvmtoolkit.fody

0.0 1.0 0.0 1.01 MB

Fody add-in that adds the ability to save the state of asynchronous tasks for WP and WinRT platforms.

C# 90.20% PowerShell 9.80%

mugenmvvmtoolkit.fody's Introduction

MugenMvvmToolkit


This is an add-in for Fody

Adds support for save the state of asynchronous tasks for WP and WinRT platforms. Updates all IAsyncStateMachine in the code so that they passed itself to the IAsyncStateMachineAware interface.

Your Code

[CompilerGenerated]
[StructLayout(LayoutKind.Auto)]
private struct <TestMethod>d__0 : IAsyncStateMachine
{
	public int <>1__state;
	public AsyncVoidMethodBuilder <>t__builder;
	private object <>u__$awaiter1;
	private object <>t__stack;
	void IAsyncStateMachine.MoveNext()
	{
		try
		{
			int num = this.<>1__state;
			IAsyncOperationAwaiter<bool> asyncOperationAwaiter;
			if (num != 0)
			{
				asyncOperationAwaiter = Program.Get().GetAwaiter<bool>();
				if (!asyncOperationAwaiter.IsCompleted)
				{
					this.<>1__state = 0;
					this.<>u__$awaiter1 = asyncOperationAwaiter;
					this.<>t__builder.AwaitOnCompleted<IAsyncOperationAwaiter<bool>, Program.<TestMethod>d__0>(ref asyncOperationAwaiter, ref this);
					return;
				}
			}
			else
			{
				asyncOperationAwaiter = (IAsyncOperationAwaiter<bool>)this.<>u__$awaiter1;
				this.<>u__$awaiter1 = null;
				this.<>1__state = -1;
			}
			asyncOperationAwaiter.GetResult();
			asyncOperationAwaiter = null;
		}
		catch (Exception exception)
		{
			this.<>1__state = -2;
			this.<>t__builder.SetException(exception);
			return;
		}
		this.<>1__state = -2;
		this.<>t__builder.SetResult();
	}
	[DebuggerHidden]
	void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine param0)
	{
		this.<>t__builder.SetStateMachine(param0);
	}
}

What gets compiled

[CompilerGenerated]
[StructLayout(LayoutKind.Auto)]
private struct <TestMethod>d__0 : IAsyncStateMachine
{
	public int <>1__state;
	public AsyncVoidMethodBuilder <>t__builder;
	private object <>u__$awaiter1;
	private object <>t__stack;
	private IAsyncStateMachine $_self_;
	void IAsyncStateMachine.MoveNext()
	{
		try
		{
			int num = this.<>1__state;
			IAsyncOperationAwaiter<bool> asyncOperationAwaiter;
			if (num != 0)
			{
				asyncOperationAwaiter = Program.Get().GetAwaiter<bool>();
				if (!asyncOperationAwaiter.IsCompleted)
				{
					this.<>1__state = 0;
					this.<>u__$awaiter1 = asyncOperationAwaiter;
					IAsyncStateMachineAware asyncStateMachineAware = this.<>u__$awaiter1 as IAsyncStateMachineAware;
					if (asyncStateMachineAware != null && this.$_self_ != null)
					{
						asyncStateMachineAware.SetStateMachine(this.$_self_);
					}
					this.<>t__builder.AwaitOnCompleted<IAsyncOperationAwaiter<bool>, Program.<TestMethod>d__0>(ref asyncOperationAwaiter, ref this);
					return;
				}
			}
			else
			{
				asyncOperationAwaiter = (IAsyncOperationAwaiter<bool>)this.<>u__$awaiter1;
				this.<>u__$awaiter1 = null;
				this.<>1__state = -1;
			}
			asyncOperationAwaiter.GetResult();
			asyncOperationAwaiter = null;
		}
		catch (Exception exception)
		{
			this.<>1__state = -2;
			this.<>t__builder.SetException(exception);
			return;
		}
		this.<>1__state = -2;
		this.<>t__builder.SetResult();
	}
	[DebuggerHidden]
	void IAsyncStateMachine.SetStateMachine(IAsyncStateMachine param0)
	{
		this.<>t__builder.SetStateMachine(param0);
		this.$_self_ = param0;
		IAsyncStateMachineAware asyncStateMachineAware = this.<>u__$awaiter1 as IAsyncStateMachineAware;
		if (asyncStateMachineAware != null)
		{
			asyncStateMachineAware.SetStateMachine(param0);
		}
	}
}

mugenmvvmtoolkit.fody's People

Contributors

vyacheslav-volkov avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.