public override ModuleSpecificContext GetModuleContext(ModuleDefinition module, ILanguage language)
 {
     V_0 = TypeCollisionWriterContextService.moduleContextsLocker;
     V_1 = false;
     try
     {
         Monitor.Enter(V_0, ref V_1);
         if (!this.cacheService.IsModuleContextInCache(module, language, this.renameInvalidMembers))
         {
             V_2 = this.GetModuleNamespaceUsings(module);
             V_3 = this.GetModuleCollisionTypesData(module, language);
             V_4 = this.GetModuleNamespaceHierarchy(module, language);
             V_5 = this.GetRenamedNamespacesMap(module, language);
             V_6 = this.GetMemberRenamingData(module, language);
             V_7 = new ModuleSpecificContext(module, V_2, V_3, V_4, V_5, V_6.get_RenamedMembers(), V_6.get_RenamedMembersMap());
             this.cacheService.AddModuleContextToCache(module, language, this.renameInvalidMembers, V_7);
             V_8 = V_7;
         }
         else
         {
             V_8 = this.cacheService.GetModuleContextFromCache(module, language, this.renameInvalidMembers);
         }
     }
     finally
     {
         if (V_1)
         {
             Monitor.Exit(V_0);
         }
     }
     return(V_8);
 }
Пример #2
0
		public IServiceProvider CreateContainer(ShellSettings settings, ShellBlueprint blueprint)
		{
			V_0 = this._serviceProvider.CreateChildContainer(this._applicationServices);
			dummyVar0 = ServiceCollectionServiceExtensions.AddSingleton<ShellSettings>(V_0, settings);
			stackVariable8 = V_0;
			stackVariable9 = ShellContainerFactory.u003cu003ec.u003cu003e9__7_0;
			if (stackVariable9 == null)
			{
				dummyVar1 = stackVariable9;
				stackVariable9 = new Func<IServiceProvider, IShellConfiguration>(ShellContainerFactory.u003cu003ec.u003cu003e9.u003cCreateContaineru003eb__7_0);
				ShellContainerFactory.u003cu003ec.u003cu003e9__7_0 = stackVariable9;
			}
			dummyVar2 = ServiceCollectionServiceExtensions.AddSingleton<IShellConfiguration>(stackVariable8, stackVariable9);
			dummyVar3 = ServiceCollectionServiceExtensions.AddSingleton<ShellDescriptor>(V_0, blueprint.get_Descriptor());
			dummyVar4 = ServiceCollectionServiceExtensions.AddSingleton<ShellBlueprint>(V_0, blueprint);
			this.AddCoreServices(V_0);
			V_1 = this._serviceProvider.CreateChildContainer(this._applicationServices);
			stackVariable26 = blueprint.get_Dependencies();
			stackVariable27 = ShellContainerFactory.u003cu003ec.u003cu003e9__7_3;
			if (stackVariable27 == null)
			{
				dummyVar5 = stackVariable27;
				stackVariable27 = new Func<KeyValuePair<Type, FeatureEntry>, bool>(ShellContainerFactory.u003cu003ec.u003cu003e9.u003cCreateContaineru003eb__7_3);
				ShellContainerFactory.u003cu003ec.u003cu003e9__7_3 = stackVariable27;
			}
			V_6 = stackVariable26.Where<KeyValuePair<Type, FeatureEntry>>(stackVariable27).GetEnumerator();
			try
			{
				while (V_6.MoveNext())
				{
					V_7 = V_6.get_Current();
					ServiceCollectionDescriptorExtensions.TryAddEnumerable(V_1, ServiceDescriptor.Singleton(Type.GetTypeFromHandle(// 
Пример #3
0
 private bool TryMakeLoop(IntervalConstruct interval, DominatorTree dominatorTree)
 {
     V_0 = DFSTBuilder.BuildTree(interval);
     if (V_0.get_BackEdges().get_Count() == 0)
     {
         return(false);
     }
     V_2 = this.BuildLoop(V_0, out V_1);
     V_4 = this.DetermineLoopType(V_1, V_2, interval, dominatorTree, out V_3);
     if (V_1.get_Count() > 0)
     {
         V_5 = new LoopLogicalConstruct(interval.get_Entry() as ILogicalConstruct, V_1, V_4, V_3, this.typeSystem);
         this.CleanUpEdges(V_5);
         this.UpdateDominatorTree(dominatorTree, V_5);
         return(true);
     }
     V_6 = V_0.get_BackEdges().GetEnumerator();
     try
     {
         while (V_6.MoveNext())
         {
             V_7 = V_6.get_Current();
             this.MarkAsGotoEdge(V_7.get_Start().get_Construct() as ILogicalConstruct, V_7.get_End().get_Construct() as ILogicalConstruct);
         }
     }
     finally
     {
         ((IDisposable)V_6).Dispose();
     }
     return(false);
 }
Пример #4
0
        private bool GetYieldExceptionData()
        {
            if ((int)this.theDisposeCFG.get_Blocks().Length == 1)
            {
                return(true);
            }
            V_0 = this.theDisposeCFG.get_OffsetToInstruction().get_Item(0);
            if (V_0.get_OpCode().get_Code() != 2)
            {
                return(false);
            }
            V_0 = this.theDisposeCFG.get_OffsetToInstruction().get_Item(1);
            if (V_0.get_OpCode().get_Code() != 120 || V_0.get_Operand() as FieldReference == null || !this.CheckAndSaveStateField(V_0.get_Operand() as FieldReference))
            {
                return(false);
            }
            V_2 = this.theDisposeCFG.get_SwitchBlocksInformation().get_Values().GetEnumerator();
            try
            {
                while (V_2.MoveNext())
                {
                    V_3 = V_2.get_Current();
                    if (this.DetermineExceptionHandlingStatesFromSwitchData(V_3))
                    {
                        continue;
                    }
                    V_4 = false;
                    goto Label0;
                }
            }
            finally
            {
                ((IDisposable)V_2).Dispose();
            }
            this.DetermineExceptionHandlingStatesFromCFGBlocks();
            V_5 = this.handlerToStatesMap.GetEnumerator();
            try
            {
                while (V_5.MoveNext())
                {
                    V_6 = V_5.get_Current();
                    if (this.TryCreateYieldExceptionHandler(V_6.get_Value(), V_6.get_Key()))
                    {
                        continue;
                    }
                    V_4 = false;
                    goto Label0;
                }
                goto Label1;
            }
            finally
            {
                ((IDisposable)V_5).Dispose();
            }
Label0:
            return(V_4);

Label1:
            return(true);
        }
Пример #5
0
		public static RepositoryResponse<string> ExportAttributeToExcel(List<JObject> lstData, string sheetName, string folderPath, string fileName, List<string> headers = null)
		{
			V_0 = new RepositoryResponse<string>();
			try
			{
				if (lstData.get_Count() <= 0)
				{
					V_0.get_Errors().Add("Can not export data of empty list");
					V_16 = V_0;
				}
				else
				{
					V_3 = DateTime.get_Now();
					V_1 = string.Concat(fileName, "-", V_3.ToString("yyyyMMdd"), ".xlsx");
					V_2 = new DataTable();
					if (headers != null)
					{
						V_6 = headers.GetEnumerator();
						try
						{
							while (V_6.MoveNext())
							{
								V_7 = V_6.get_Current();
								dummyVar1 = V_2.get_Columns().Add(V_7, Type.GetTypeFromHandle(// 
								// Current member / type: Mix.Domain.Core.ViewModels.RepositoryResponse`1<System.String> Mix.Cms.Lib.ViewModels.MixAttributeSetDatas.Helper::ExportAttributeToExcel(System.Collections.Generic.List`1<Newtonsoft.Json.Linq.JObject>,System.String,System.String,System.String,System.Collections.Generic.List`1<System.String>)
								// Exception in: Mix.Domain.Core.ViewModels.RepositoryResponse<System.String> ExportAttributeToExcel(System.Collections.Generic.List<Newtonsoft.Json.Linq.JObject>,System.String,System.String,System.String,System.Collections.Generic.List<System.String>)
								// Specified method is not supported.
								// 
								// mailto: [email protected]


		public static async Task<RepositoryResponse<PaginationModel<TView>>> FilterByKeywordAsync<TView>(string culture, string attributeSetName, RequestPaging request, string keyword, Dictionary<string, StringValues> queryDictionary = null, MixCmsContext _context = null, IDbContextTransaction _transaction = null)
Пример #6
0
 private void RemoveTransitiveEdges()
 {
     V_0 = this.GenerateNodeToIndex();
     V_1 = this.GeenrateAdjacencyMatrix(V_0);
     this.WarsawTransitiveClosure(V_1);
     V_2 = this.inferenceGraph.GetEnumerator();
     try
     {
         while (V_2.MoveNext())
         {
             V_3 = V_2.get_Current();
             V_4 = this.inferenceGraph.GetEnumerator();
             try
             {
                 while (V_4.MoveNext())
                 {
                     V_5 = V_4.get_Current();
                     V_6 = this.inferenceGraph.GetEnumerator();
                     try
                     {
                         while (V_6.MoveNext())
                         {
                             V_7  = V_6.get_Current();
                             V_8  = V_0.get_Item(V_3);
                             V_9  = V_0.get_Item(V_5);
                             V_10 = V_0.get_Item(V_7);
                             if (!V_1[V_8, V_9] || !V_1[V_9, V_10] || V_3.get_IsHardNode() && V_7.get_IsHardNode() || !V_3.get_SubTypes().Contains(V_7))
                             {
                                 continue;
                             }
                             this.RemoveSubtype(V_3, V_7);
                         }
                     }
                     finally
                     {
                         if (V_6 != null)
                         {
                             V_6.Dispose();
                         }
                     }
                 }
             }
             finally
             {
                 if (V_4 != null)
                 {
                     V_4.Dispose();
                 }
             }
         }
     }
     finally
     {
         if (V_2 != null)
         {
             V_2.Dispose();
         }
     }
     return;
 }
 private ConditionLogicalConstruct CreateComplexCondition(ConditionLogicalConstruct conditionNode)
 {
     V_0       = conditionNode.get_ConditionExpression();
     V_1       = new HashSet <ILogicalConstruct>();
     V_2       = conditionNode;
     dummyVar0 = V_1.Add(V_2);
     V_3       = V_2.get_TrueSuccessor();
     V_4       = V_2.get_FalseSuccessor();
     while (true)
     {
         if (!this.CanBePartOfComplexCondition(V_3, V_1, V_2.get_FalseCFGSuccessor()))
         {
             if (!this.CanBePartOfComplexCondition(V_4, V_1, V_2.get_TrueCFGSuccessor()))
             {
                 break;
             }
             V_6 = V_4 as ConditionLogicalConstruct;
             if (V_6.get_TrueSuccessor() != V_3)
             {
                 V_6.Negate(this.typeSystem);
             }
             V_8 = 11;
         }
         else
         {
             V_6 = V_3 as ConditionLogicalConstruct;
             if (V_6.get_FalseSuccessor() != V_4)
             {
                 V_6.Negate(this.typeSystem);
             }
             V_8 = 12;
         }
         V_0 = new BinaryExpression(V_8, V_0, V_6.get_ConditionExpression(), this.typeSystem, null, false);
         V_0.set_ExpressionType(this.booleanTypeReference);
         V_2       = V_6;
         V_3       = V_2.get_TrueSuccessor();
         V_4       = V_2.get_FalseSuccessor();
         dummyVar1 = V_1.Add(V_2);
     }
     if (V_1.get_Count() == 1)
     {
         return(conditionNode);
     }
     V_5 = new HashSet <ConditionLogicalConstruct>();
     V_9 = V_1.GetEnumerator();
     try
     {
         while (V_9.MoveNext())
         {
             V_10      = (ConditionLogicalConstruct)V_9.get_Current();
             dummyVar2 = V_5.Add(V_10);
         }
     }
     finally
     {
         ((IDisposable)V_9).Dispose();
     }
     return(new ConditionLogicalConstruct(conditionNode, V_2, V_5, V_0));
 }
Пример #8
0
 private bool TryMatchInternal(StatementCollection statements, int startIndex, out Statement result)
 {
     result = null;
     if (statements.get_Count() < startIndex + 2)
     {
         return(false);
     }
     if (statements.get_Item(startIndex).get_CodeNodeType() != 5 || statements.get_Item(startIndex + 1).get_CodeNodeType() != 3)
     {
         return(false);
     }
     if (!String.IsNullOrEmpty(statements.get_Item(startIndex + 1).get_Label()))
     {
         return(false);
     }
     V_3 = (statements.get_Item(startIndex) as ExpressionStatement).get_Expression() as BinaryExpression;
     if (!this.IsAssignToVariableExpression(V_3, out V_0))
     {
         return(false);
     }
     V_1 = V_3.get_Right();
     V_4 = statements.get_Item(startIndex + 1) as IfStatement;
     if (this.ContainsDummyAssignment(V_4.get_Then(), V_0))
     {
         stackVariable50 = 1;
     }
     else
     {
         stackVariable50 = 0;
     }
     V_5 = stackVariable50;
     if (V_4.get_Else() != null || V_4.get_Then().get_Statements().get_Count() != 1 + V_5 || V_4.get_Then().get_Statements().get_Item(V_5).get_CodeNodeType() != 5 || !String.IsNullOrEmpty(V_4.get_Then().get_Statements().get_Item(V_5).get_Label()))
     {
         return(false);
     }
     V_6 = V_4.get_Condition() as BinaryExpression;
     if (V_6 == null || V_6.get_Operator() != 9 || V_6.get_Left().get_CodeNodeType() != 26 || (object)(V_6.get_Left() as VariableReferenceExpression).get_Variable() != (object)V_0 || V_6.get_Right().get_CodeNodeType() != 22 || (V_6.get_Right() as LiteralExpression).get_Value() != null)
     {
         return(false);
     }
     V_7 = (V_4.get_Then().get_Statements().get_Item(V_5) as ExpressionStatement).get_Expression() as BinaryExpression;
     if (V_7 == null || !this.IsAssignToVariableExpression(V_7, out V_8) || (object)V_8 != (object)V_0)
     {
         return(false);
     }
     V_2 = V_7.get_Right();
     if (!V_1.get_HasType() || !V_2.get_HasType() || String.op_Inequality(V_1.get_ExpressionType().get_FullName(), V_2.get_ExpressionType().get_FullName()))
     {
         return(false);
     }
     V_9              = new BinaryExpression(27, V_1, V_2, this.typeSystem, null, false);
     V_10             = new BinaryExpression(26, new VariableReferenceExpression(V_0, null), V_9, this.typeSystem, null, false);
     stackVariable150 = new ExpressionStatement(V_10);
     stackVariable150.set_Parent(statements.get_Item(startIndex).get_Parent());
     result = stackVariable150;
     this.FixContext(V_0.Resolve(), 1, V_5 + 1, result as ExpressionStatement);
     return(true);
 }
Пример #9
0
 public static TypeReference ResolveParameterType(this ParameterReference param, MethodReference method)
 {
     V_0 = param.get_ParameterType();
     V_1 = V_0 as GenericParameter;
     V_2 = false;
     V_3 = false;
     if (V_0.get_IsByReference())
     {
         V_1 = V_0.GetElementType() as GenericParameter;
         V_2 = true;
     }
     if (V_0.get_IsArray())
     {
         V_1 = V_0.GetElementType() as GenericParameter;
         V_3 = true;
     }
     if (V_1 == null)
     {
         return(V_0);
     }
     V_4 = V_1.get_Position();
     if (V_1.get_Owner() as MethodReference == null || !method.get_IsGenericInstance())
     {
         if (V_1.get_Owner() as TypeReference != null && method.get_DeclaringType().get_IsGenericInstance())
         {
             V_6 = method.get_DeclaringType() as GenericInstanceType;
             if (V_4 >= 0 && V_4 < V_6.get_GenericArguments().get_Count())
             {
                 V_0 = V_6.get_GenericArguments().get_Item(V_4);
                 if (V_6.get_PostionToArgument().ContainsKey(V_4))
                 {
                     V_0 = V_6.get_PostionToArgument().get_Item(V_4);
                 }
             }
         }
     }
     else
     {
         V_5 = method as GenericInstanceMethod;
         if (V_4 >= 0 && V_4 < V_5.get_GenericArguments().get_Count())
         {
             V_0 = V_5.get_GenericArguments().get_Item(V_4);
             if (V_5.get_PostionToArgument().ContainsKey(V_4))
             {
                 V_0 = V_5.get_PostionToArgument().get_Item(V_4);
             }
         }
     }
     if (V_2)
     {
         return(new ByReferenceType(V_0));
     }
     if (!V_3)
     {
         return(V_0);
     }
     return(new ArrayType(V_0));
 }
Пример #10
0
 public List <FileViewModel> GetFilesWithContent(string fullPath)
 {
     this.CreateDirectoryIfNotExist(fullPath);
     V_0 = new List <FileViewModel>();
     V_1 = Directory.GetDirectories(fullPath, "*", 1);
     V_2 = 0;
     while (V_2 < (int)V_1.Length)
     {
         stackVariable15 = new DirectoryInfo(V_1[V_2]);
         V_3             = stackVariable15.get_Name();
         stackVariable17 = stackVariable15.GetFiles();
         stackVariable18 = FileRepository.u003cu003ec.u003cu003e9__29_0;
         if (stackVariable18 == null)
         {
             dummyVar0       = stackVariable18;
             stackVariable18 = new Func <FileInfo, DateTime>(FileRepository.u003cu003ec.u003cu003e9.u003cGetFilesWithContentu003eb__29_0);
             FileRepository.u003cu003ec.u003cu003e9__29_0 = stackVariable18;
         }
         V_4 = ((IEnumerable <FileInfo>)stackVariable17).OrderByDescending <FileInfo, DateTime>(stackVariable18).GetEnumerator();
         try
         {
             while (V_4.MoveNext())
             {
                 V_5 = V_4.get_Current();
                 V_6 = V_5.OpenText();
                 try
                 {
                     V_7 = new FileViewModel();
                     V_7.set_FolderName(V_3);
                     stackVariable33    = new string[2];
                     stackVariable33[0] = fullPath;
                     stackVariable33[1] = V_3;
                     V_7.set_FileFolder(CommonHelper.GetFullPath(stackVariable33));
                     V_7.set_Filename(V_5.get_Name().Substring(0, V_5.get_Name().LastIndexOf('.')));
                     V_7.set_Extension(V_5.get_Extension());
                     V_7.set_Content(V_6.ReadToEnd());
                     V_0.Add(V_7);
                 }
                 finally
                 {
                     if (V_6 != null)
                     {
                         ((IDisposable)V_6).Dispose();
                     }
                 }
             }
         }
         finally
         {
             if (V_4 != null)
             {
                 V_4.Dispose();
             }
         }
         V_2 = V_2 + 1;
     }
     return(V_0);
 }
Пример #11
0
        public void InferTypes()
        {
            V_0 = (new GreedyTypeInferer(this.context, this.offsetToExpression)).InferTypes();
            V_1 = new ClassHierarchyBuilder(this.offsetToExpression, this.context.get_MethodContext().get_ControlFlowGraph().get_OffsetToInstruction(), this.context);
            this.inferenceGraph = V_1.BuildHierarchy(V_0);
            this.MergeConnectedComponents();
            this.RemoveTransitiveEdges();
            this.ProcessSingleConstraints();
            V_2 = null;
            V_4 = this.inferenceGraph.GetEnumerator();
            try
            {
                while (V_4.MoveNext())
                {
                    V_5 = V_4.get_Current();
                    if (!V_5.get_IsHardNode() || !String.op_Equality(V_5.get_NodeType().get_FullName(), "System.Object"))
                    {
                        continue;
                    }
                    V_2 = V_5;
                    goto Label0;
                }
            }
            finally
            {
                if (V_4 != null)
                {
                    V_4.Dispose();
                }
            }
Label0:
            V_3 = new List <ClassHierarchyNode>();
            V_3.Add(V_2);
            V_4 = this.inferenceGraph.GetEnumerator();
            try
            {
                while (V_4.MoveNext())
                {
                    V_6 = V_4.get_Current();
                    if (V_6.get_IsHardNode())
                    {
                        continue;
                    }
                    V_3.Add(V_6);
                }
            }
            finally
            {
                if (V_4 != null)
                {
                    V_4.Dispose();
                }
            }
            this.MergeNodes(V_3);
            this.InferIntegerTypes(V_0);
            this.AddCasts();
            return;
        }
Пример #12
0
 private void AddCastIfNeeded(Expression useExpression, VariableReference variable)
 {
     V_0          = new TypeInferer.u003cu003ec__DisplayClass8_0();
     V_0.variable = variable;
     V_4          = useExpression.get_CodeNodeType();
     if (V_4 == 19)
     {
         V_1 = useExpression as MethodInvocationExpression;
         V_2 = V_1.get_Arguments().FirstOrDefault <Expression>(new Func <Expression, bool>(V_0.u003cAddCastIfNeededu003eb__0));
         if (V_2 == null)
         {
             V_7 = V_1.get_MethodExpression().get_Target();
             if (V_7.get_CodeNodeType() != 26 || (object)(V_7 as VariableReferenceExpression).get_Variable() != (object)V_0.variable)
             {
                 this.AddCastIfNeeded(V_7, V_0.variable);
                 return;
             }
             V_8 = V_1.get_MethodExpression().get_Method().get_DeclaringType();
             if (!this.IsSubtype(V_8, V_0.variable.get_VariableType()))
             {
                 V_1.get_MethodExpression().set_Target(new ExplicitCastExpression(V_7, V_8, null));
                 return;
             }
         }
         else
         {
             V_5 = V_1.get_Arguments().IndexOf(V_2);
             V_6 = V_1.get_MethodExpression().get_Method().get_Parameters().get_Item(V_5).ResolveParameterType(V_1.get_MethodExpression().get_Method());
             if (!this.IsSubtype(V_6, V_0.variable.get_VariableType()))
             {
                 if (V_6.get_IsPrimitive() && V_0.variable.get_VariableType().get_IsPrimitive() && String.op_Equality(ExpressionTypeInferer.GetContainingType(V_6.Resolve(), V_0.variable.get_VariableType().Resolve()).get_FullName(), V_6.get_FullName()))
                 {
                     return;
                 }
                 V_1.get_Arguments().set_Item(V_5, new ExplicitCastExpression(V_2, V_6, null));
                 return;
             }
         }
     }
     else
     {
         if (V_4 != 24)
         {
             return;
         }
         V_3 = useExpression as BinaryExpression;
         if (V_3.get_Operator() == 26 && V_3.get_Right().get_CodeNodeType() == 26 && (object)(V_3.get_Right() as VariableReferenceExpression).get_Variable() == (object)V_0.variable)
         {
             V_9 = V_3.get_Left().get_ExpressionType();
             if (!this.IsSubtype(V_9, V_0.variable.get_VariableType()))
             {
                 V_3.set_Right(new ExplicitCastExpression(V_3.get_Right(), V_9, null));
             }
         }
     }
     return;
 }
Пример #13
0
 private void CreateGraph(IEnumerable <IntervalConstruct> intervals)
 {
     V_0 = intervals.GetEnumerator();
     try
     {
         while (V_0.MoveNext())
         {
             V_1 = V_0.get_Current();
             V_2 = V_1.get_Children().GetEnumerator();
             try
             {
                 while (V_2.MoveNext())
                 {
                     V_3 = (ILogicalConstruct)V_2.get_Current();
                     V_4 = this.GetNodeSuccessors(V_3).GetEnumerator();
                     try
                     {
                         while (V_4.MoveNext())
                         {
                             V_5 = V_4.get_Current();
                             if (!this.nodeToInterval.ContainsKey(V_5) || this.nodeToInterval.get_Item(V_5) == V_1)
                             {
                                 continue;
                             }
                             V_6 = this.nodeToInterval.get_Item(V_5);
                             if (V_1.get_SameParentSuccessors().Contains(V_6))
                             {
                                 continue;
                             }
                             dummyVar0 = V_1.get_SameParentSuccessors().Add(V_6);
                             dummyVar1 = V_6.get_SameParentPredecessors().Add(V_1);
                         }
                     }
                     finally
                     {
                         if (V_4 != null)
                         {
                             V_4.Dispose();
                         }
                     }
                 }
             }
             finally
             {
                 ((IDisposable)V_2).Dispose();
             }
         }
     }
     finally
     {
         if (V_0 != null)
         {
             V_0.Dispose();
         }
     }
     return;
 }
Пример #14
0
 public List <FileViewModel> GetWebFiles(string folder)
 {
     stackVariable1    = new string[3];
     stackVariable1[0] = "wwwroot";
     stackVariable1[1] = "content";
     stackVariable1[2] = folder;
     V_0 = CommonHelper.GetFullPath(stackVariable1);
     this.CreateDirectoryIfNotExist(V_0);
     V_1 = new List <FileViewModel>();
     V_2 = Directory.GetDirectories(V_0, "*", 1);
     V_3 = 0;
     while (V_3 < (int)V_2.Length)
     {
         V_4             = new DirectoryInfo(V_2[V_3]);
         V_5             = V_4.ToString().Replace("\\", "/").Replace("wwwroot", string.Empty);
         stackVariable34 = V_4.GetFiles();
         stackVariable35 = FileRepository.u003cu003ec.u003cu003e9__31_0;
         if (stackVariable35 == null)
         {
             dummyVar0       = stackVariable35;
             stackVariable35 = new Func <FileInfo, DateTime>(FileRepository.u003cu003ec.u003cu003e9.u003cGetWebFilesu003eb__31_0);
             FileRepository.u003cu003ec.u003cu003e9__31_0 = stackVariable35;
         }
         V_6 = ((IEnumerable <FileInfo>)stackVariable34).OrderByDescending <FileInfo, DateTime>(stackVariable35).GetEnumerator();
         try
         {
             while (V_6.MoveNext())
             {
                 V_7             = V_6.get_Current();
                 stackVariable42 = V_1;
                 stackVariable43 = new FileViewModel();
                 stackVariable43.set_FolderName(V_4.get_Name());
                 stackVariable43.set_FileFolder(V_5);
                 if (V_7.get_Name().LastIndexOf('.') >= 0)
                 {
                     stackVariable59 = V_7.get_Name().Substring(0, V_7.get_Name().LastIndexOf('.'));
                 }
                 else
                 {
                     stackVariable59 = V_7.get_Name();
                 }
                 stackVariable43.set_Filename(stackVariable59);
                 stackVariable43.set_Extension(V_7.get_Extension());
                 stackVariable42.Add(stackVariable43);
             }
         }
         finally
         {
             if (V_6 != null)
             {
                 V_6.Dispose();
             }
         }
         V_3 = V_3 + 1;
     }
     return(V_1);
 }
Пример #15
0
 public static void LogException(Exception ex)
 {
     stackVariable0 = Environment.get_CurrentDirectory();
     V_2            = DateTime.get_Now();
     V_0            = string.Concat(stackVariable0, "/logs/", V_2.ToString("dd-MM-yyyy"));
     if (!string.IsNullOrEmpty(V_0) && !Directory.Exists(V_0))
     {
         dummyVar0 = Directory.CreateDirectory(V_0);
     }
     V_1 = string.Concat(V_0, "/log_exceptions.json");
     try
     {
         V_3 = new FileInfo(V_1);
         V_4 = "[]";
         if (V_3.get_Exists())
         {
             V_6 = V_3.OpenText();
             try
             {
                 V_4 = V_6.ReadToEnd();
             }
             finally
             {
                 if (V_6 != null)
                 {
                     ((IDisposable)V_6).Dispose();
                 }
             }
             File.Delete(V_1);
         }
         stackVariable18 = JArray.Parse(V_4);
         stackVariable19 = new JObject();
         stackVariable19.Add(new JProperty("CreatedDateTime", (object)DateTime.get_UtcNow()));
         stackVariable19.Add(new JProperty("Details", JObject.FromObject(ex)));
         stackVariable18.Add(stackVariable19);
         V_4 = stackVariable18.ToString();
         V_7 = File.CreateText(V_1);
         try
         {
             V_7.WriteLine(V_4);
         }
         finally
         {
             if (V_7 != null)
             {
                 ((IDisposable)V_7).Dispose();
             }
         }
     }
     catch
     {
         dummyVar1 = exception_0;
         Console.Write(string.Concat("Cannot write log file ", V_1));
     }
     return;
 }
Пример #16
0
 private bool TryMatchInternal(StatementCollection statements, int startIndex, out Statement result, out int replacedStatementsCount, out VariableDefinition xVariableDef)
 {
     result = null;
     replacedStatementsCount = 0;
     xVariableDef            = null;
     if (statements.get_Count() < 1 || statements.get_Item(startIndex).get_CodeNodeType() != 5)
     {
         return(false);
     }
     V_2 = (statements.get_Item(startIndex) as ExpressionStatement).get_Expression() as BinaryExpression;
     if (!this.IsAssignToVariableExpression(V_2, out V_0) || !this.methodContext.get_StackData().get_VariableToDefineUseInfo().ContainsKey(V_0.Resolve()))
     {
         return(false);
     }
     V_1 = V_2.get_Right();
     V_3 = startIndex + 1;
     while (V_3 < statements.get_Count())
     {
         V_5 = statements.get_Item(V_3);
         if (V_5.get_CodeNodeType() != 5 || !String.IsNullOrEmpty(V_5.get_Label()))
         {
             break;
         }
         V_6 = (V_5 as ExpressionStatement).get_Expression() as BinaryExpression;
         if (V_6 == null || !V_6.get_IsAssignmentExpression() || V_6.get_Right().get_CodeNodeType() != 26 || (object)(V_6.get_Right() as VariableReferenceExpression).get_Variable() != (object)V_0)
         {
             break;
         }
         if (V_6.get_Left().get_CodeNodeType() == 30)
         {
             return(false);
         }
         if (V_6.get_Left().get_CodeNodeType() == 26)
         {
             V_7 = (V_6.get_Left() as VariableReferenceExpression).get_Variable().Resolve();
             if (V_7 == V_0)
             {
                 return(false);
             }
             dummyVar0 = this.variablesToRemove.Add(V_7);
         }
         V_1 = new BinaryExpression(26, V_6.get_Left(), V_1, this.typeSystem, null, false);
         V_3 = V_3 + 1;
     }
     replacedStatementsCount = V_3 - startIndex;
     if (replacedStatementsCount == 1)
     {
         return(false);
     }
     V_4             = new BinaryExpression(26, new VariableReferenceExpression(V_0, null), V_1, this.typeSystem, null, false);
     stackVariable66 = new ExpressionStatement(V_4);
     stackVariable66.set_Parent(statements.get_Item(startIndex).get_Parent());
     result       = stackVariable66;
     xVariableDef = V_0.Resolve();
     return(true);
 }
 protected override string ToString(string constructName, HashSet <CFGBlockLogicalConstruct> printedCFGBlocks, LogicalFlowBuilderContext context)
 {
     V_0       = new StringBuilder(this.GetType().get_Name());
     dummyVar0 = V_0.AppendLine();
     dummyVar1 = V_0.AppendLine("{");
     this.IndentAndAppendString(V_0, (this.get_Entry() as LogicalConstructBase).ToString(context));
     dummyVar2 = V_0.AppendLine();
     if (this.get_DefaultCase() != null)
     {
         this.IndentAndAppendString(V_0, this.get_DefaultCase().ToString(context));
     }
     V_1 = this.get_ConditionCases();
     V_2 = 0;
     while (V_2 < (int)V_1.Length)
     {
         this.IndentAndAppendString(V_0, V_1[V_2].ToString(context));
         V_2 = V_2 + 1;
     }
     V_4 = this.get_NonDominatedCFGSuccessors().GetEnumerator();
     try
     {
         while (V_4.MoveNext())
         {
             V_5       = V_4.get_Current();
             dummyVar3 = V_0.Append("\tCase");
             V_6       = V_5.get_Key().GetEnumerator();
             try
             {
                 while (V_6.MoveNext())
                 {
                     V_7       = V_6.get_Current();
                     dummyVar4 = V_0.Append(" ").Append(V_7);
                 }
             }
             finally
             {
                 ((IDisposable)V_6).Dispose();
             }
             dummyVar5 = V_0.Append(": ").AppendLine(this.NodeILOffset(context, V_5.get_Value()));
         }
     }
     finally
     {
         ((IDisposable)V_4).Dispose();
     }
     if (this.get_DefaultCase() == null)
     {
         dummyVar6 = V_0.Append("\tDefault: ").AppendLine(this.NodeILOffset(context, this.get_DefaultCFGSuccessor()));
     }
     dummyVar7 = V_0.Append("\tFollowNode: ").AppendLine(this.NodeILOffset(context, this.get_CFGFollowNode()));
     dummyVar8 = V_0.AppendLine("}");
     printedCFGBlocks.UnionWith(this.get_CFGBlocks());
     return(V_0.ToString());
 }
		private void GenerateStackData()
		{
			V_0 = new StackUsageData();
			V_1 = this.instructionOffsetToUsedInstructionsMap.GetEnumerator();
			try
			{
				while (V_1.MoveNext())
				{
					V_2 = V_1.get_Current();
					V_3 = new List<VariableDefinition>(V_2.get_Value().Select<int, VariableDefinition>(new Func<int, VariableDefinition>(this.u003cGenerateStackDatau003eb__25_0)));
					V_0.get_InstructionOffsetToUsedStackVariablesMap().set_Item(V_2.get_Key(), V_3);
					V_4 = V_3.GetEnumerator();
					try
					{
						while (V_4.MoveNext())
						{
							V_5 = V_4.get_Current();
							this.GetDefineUseInfo(V_0, V_5).get_UsedAt().Add(V_2.get_Key());
						}
					}
					finally
					{
						((IDisposable)V_4).Dispose();
					}
				}
			}
			finally
			{
				((IDisposable)V_1).Dispose();
			}
			V_6 = this.instructionOffsetToVariableDefinitionMap.GetEnumerator();
			try
			{
				while (V_6.MoveNext())
				{
					V_7 = V_6.get_Current();
					if (V_7.get_Key() >= 0)
					{
						V_0.get_InstructionOffsetToAssignedVariableMap().Add(V_7.get_Key(), V_7.get_Value());
						dummyVar0 = this.GetDefineUseInfo(V_0, V_7.get_Value()).get_DefinedAt().Add(V_7.get_Key());
					}
					else
					{
						V_0.get_ExceptionHandlerStartToExceptionVariableMap().Add(-V_7.get_Key(), V_7.get_Value());
					}
				}
			}
			finally
			{
				((IDisposable)V_6).Dispose();
			}
			this.methodContext.set_StackData(V_0);
			return;
		}
 private void MarkOptimizationAndCaseBlocks(InstructionBlock block, RemoveCompilerOptimizationsStep.SwitchData data)
 {
     V_0 = new Queue <InstructionBlock>();
     V_1 = new HashSet <int>();
     V_2 = block.get_Successors();
     V_3 = 0;
     while (V_3 < (int)V_2.Length)
     {
         V_0.Enqueue(V_2[V_3]);
         V_3 = V_3 + 1;
     }
     while (V_0.get_Count() > 0)
     {
         V_5       = V_0.Dequeue();
         dummyVar0 = V_1.Add(V_5.get_First().get_Offset());
         if (!this.IsOptimizationBlock(this.blockExpressions.get_Item(V_5.get_First().get_Offset()), data.get_OptimizationVariable()))
         {
             if (!this.IsCaseBlock(this.blockExpressions.get_Item(V_5.get_First().get_Offset()), data.get_SwitchExpression()) && !this.IsNullCaseBlock(this.blockExpressions.get_Item(V_5.get_First().get_Offset()), data.get_SwitchExpression()))
             {
                 continue;
             }
             this.switchBlocksToCasesMap.get_Item(block.get_First().get_Offset()).Add(V_5.get_First().get_Offset());
             V_8 = V_5.get_Successors()[1];
             if (this.IsEmptyStringCaseBlock(this.blockExpressions.get_Item(V_8.get_First().get_Offset()), data.get_SwitchExpression()))
             {
                 V_5.set_Last(V_8.get_Last());
                 V_5.set_Successors(V_8.get_Successors());
                 V_9 = this.blockExpressions.get_Item(V_5.get_First().get_Offset()).get_Item(0) as BinaryExpression;
                 V_9.set_Right(new LiteralExpression("", this.methodContext.get_Method().get_Module().get_TypeSystem(), null));
                 V_10 = this.blockExpressions.get_Item(V_8.get_First().get_Offset()).get_Item(0).get_UnderlyingSameMethodInstructions();
                 V_9  = V_9.CloneAndAttachInstructions(V_10) as BinaryExpression;
                 this.blockExpressions.get_Item(V_5.get_First().get_Offset()).set_Item(0, new UnaryExpression(11, V_9, null));
                 this.blocksToBeRemoved.Add(V_8.get_First().get_Offset());
             }
             dummyVar1 = this.MarkSecondSuccessorForRemovalIfItIsUnconditionalJump(V_5);
         }
         else
         {
             V_6 = V_5.get_Successors()[0];
             if (!V_1.Contains(V_6.get_First().get_Offset()))
             {
                 V_0.Enqueue(V_6);
             }
             V_7 = this.MarkSecondSuccessorForRemovalIfItIsUnconditionalJump(V_5);
             if (!V_1.Contains(V_7.get_First().get_Offset()) && this.IsOptimizationBlock(this.blockExpressions.get_Item(V_5.get_First().get_Offset()), data.get_OptimizationVariable()))
             {
                 V_0.Enqueue(V_7);
             }
             this.blocksToBeRemoved.Add(V_5.get_First().get_Offset());
         }
     }
     return;
 }
Пример #20
0
 private void AddBlocks(List <ILBlock.InstructionPair> allBranches)
 {
     V_0 = allBranches.get_Count() - 1;
     while (V_0 >= 0)
     {
         V_1 = allBranches.get_Item(V_0).get_FirstInstruction().get_Offset() + allBranches.get_Item(V_0).get_FirstInstruction().GetSize();
         V_2 = allBranches.get_Item(V_0).get_SecondInstruction().get_Offset();
         if (V_2 < V_1)
         {
             V_3 = null;
             V_4 = allBranches.get_Item(V_0).get_SecondInstruction().get_Previous();
             if (V_4 != null && !OpCodeInfo.IsUnconditionalBranch(V_4.get_OpCode()))
             {
                 V_3 = allBranches.get_Item(V_0).get_SecondInstruction();
             }
             V_5 = false;
             V_6 = allBranches.GetEnumerator();
             try
             {
                 while (V_6.MoveNext())
                 {
                     V_7 = V_6.get_Current();
                     if (V_7.get_FirstInstruction().get_Offset() >= V_2 && V_7.get_FirstInstruction().get_Offset() < V_1 || V_2 > V_7.get_SecondInstruction().get_Offset() || V_7.get_SecondInstruction().get_Offset() >= V_1)
                     {
                         continue;
                     }
                     if (V_3 != null)
                     {
                         if ((object)V_7.get_SecondInstruction() == (object)V_3)
                         {
                             continue;
                         }
                         V_5 = true;
                     }
                     else
                     {
                         V_3 = V_7.get_SecondInstruction();
                     }
                 }
             }
             finally
             {
                 ((IDisposable)V_6).Dispose();
             }
             if (!V_5)
             {
                 dummyVar0 = this.AddNestedBlock(new ILBlock(1, V_2, V_1, V_3));
             }
         }
         V_0 = V_0 - 1;
     }
     return;
 }
		private static ICollection<TypeReference> GetAttributeNamedArgsUsedTypes(TypeDefinition attributeType, Collection<CustomAttributeNamedArgument> namedArguments, bool fields)
		{
			V_0 = new List<TypeReference>();
			V_1 = 0;
			while (V_1 < namedArguments.get_Count())
			{
				if (attributeType != null)
				{
					if (fields)
					{
						stackVariable19 = attributeType.get_Fields();
					}
					else
					{
						stackVariable19 = attributeType.get_Properties();
					}
					V_2 = null;
					V_3 = stackVariable19;
					V_4 = attributeType;
					do
					{
						V_2 = Utilities.FindMemberArgumentRefersTo(V_3, namedArguments.get_Item(V_1));
						if (V_4.get_BaseType() == null)
						{
							break;
						}
						V_4 = V_4.get_BaseType().Resolve();
						if (V_4 == null)
						{
							break;
						}
						if (fields)
						{
							stackVariable40 = V_4.get_Fields();
						}
						else
						{
							stackVariable40 = V_4.get_Properties();
						}
						V_3 = stackVariable40;
					}
					while (V_2 == null);
					if (V_2 != null)
					{
						V_0.Add(V_2.get_DeclaringType());
					}
				}
				V_6 = namedArguments.get_Item(V_1);
				V_0.AddRange(AttributesUtilities.GetAttributeArgumentValueUsedTypes(V_6.get_Argument()));
				V_1 = V_1 + 1;
			}
			return V_0;
		}
 private void InlineAssignmentInNextExpression()
 {
     V_0 = this.methodContext.get_Expressions().get_BlockExpressions().GetEnumerator();
     try
     {
         while (V_0.MoveNext())
         {
             V_1 = V_0.get_Current();
             V_2 = V_1.get_Value();
             V_3 = new Boolean[V_2.get_Count()];
             V_4 = V_2.get_Count() - 2;
             V_5 = V_4 + 1;
             while (V_4 >= 0)
             {
                 V_6 = V_2.get_Item(V_4) as BinaryExpression;
                 if (V_6 == null || !V_6.get_IsAssignmentExpression() || V_6.get_Left().get_CodeNodeType() != 26)
                 {
                     V_5 = V_4;
                 }
                 else
                 {
                     V_7 = (V_6.get_Left() as VariableReferenceExpression).get_Variable().Resolve();
                     if (this.variablesToInline.Contains(V_7))
                     {
                         V_8 = V_6.get_Right();
                         if (!this.inliner.TryInlineVariable(V_7, V_8, V_2.get_Item(V_5), true, out V_9))
                         {
                             V_5 = V_4;
                         }
                         else
                         {
                             this.FixContextAfterInlining(V_7);
                             dummyVar0 = this.variablesToInline.Remove(V_7);
                             V_2.set_Item(V_5, (Expression)V_9);
                             V_3[V_4] = true;
                         }
                     }
                     else
                     {
                         V_5 = V_4;
                     }
                 }
                 V_4 = V_4 - 1;
             }
             this.FastRemoveExpressions(V_2, V_3);
         }
     }
     finally
     {
         ((IDisposable)V_0).Dispose();
     }
     return;
 }
 private HashSet <ILogicalConstruct> GetLogicalConstructsInRange(BlockRange blockRange, out ILogicalConstruct theCommonParent)
 {
     V_0 = new HashSet <ILogicalConstruct>();
     V_1 = new HashSet <ISingleEntrySubGraph>();
     V_2 = blockRange.Start.get_First().get_Offset();
     V_3 = blockRange.End.get_First().get_Offset();
     V_5 = 0;
     while (V_5 < (int)this.context.get_CFG().get_Blocks().Length)
     {
         V_6 = this.context.get_CFG().get_Blocks()[V_5];
         if (V_6.get_First().get_Offset() >= V_2 && V_6.get_First().get_Offset() <= V_3)
         {
             V_7 = this.context.get_CFGBlockToLogicalConstructMap().get_Item(V_6);
             V_8 = 0;
             while (V_8 < (int)V_7.Length)
             {
                 dummyVar0 = V_1.Add((ILogicalConstruct)V_7[V_8].get_Parent());
                 dummyVar1 = V_0.Add(V_7[V_8]);
                 V_8       = V_8 + 1;
             }
         }
         V_5 = V_5 + 1;
     }
     if (V_1.get_Count() == 1)
     {
         theCommonParent = (ILogicalConstruct)V_1.ToArray <ISingleEntrySubGraph>()[0];
         return(V_0);
     }
     theCommonParent = (ILogicalConstruct)LogicalFlowUtilities.FindFirstCommonParent(V_1);
     V_4             = new HashSet <ILogicalConstruct>();
     V_9             = V_0.GetEnumerator();
     try
     {
         while (V_9.MoveNext())
         {
             dummyVar2 = LogicalFlowUtilities.TryGetParentConstructWithGivenParent(V_9.get_Current(), theCommonParent, out V_10);
             dummyVar3 = V_4.Add(V_10);
         }
     }
     finally
     {
         ((IDisposable)V_9).Dispose();
     }
     if (theCommonParent as ExceptionHandlingLogicalConstruct != null)
     {
         V_4.Clear();
         dummyVar4       = V_4.Add(theCommonParent);
         theCommonParent = theCommonParent.get_Parent() as ILogicalConstruct;
     }
     return(V_4);
 }
 private Dictionary <string, List <string> > GetModuleCollisionTypesData(ModuleDefinition module, ILanguage language)
 {
     V_0 = new Dictionary <string, List <string> >(language.get_IdentifierComparer());
     V_1 = new Dictionary <string, string>(language.get_IdentifierComparer());
     this.UpdateCollisionTypesDataWithTypes(V_0, V_1, module.get_Types());
     V_2 = this.GetModuleDependsOnAnalysis(module);
     if (Mono.Cecil.AssemblyResolver.Extensions.IsReferenceAssembly(module))
     {
         stackVariable16 = 1;
     }
     else
     {
         stackVariable16 = 0;
     }
     V_3 = stackVariable16;
     V_4 = V_2.get_Keys().GetEnumerator();
     try
     {
         while (V_4.MoveNext())
         {
             V_5 = V_4.get_Current();
             V_6 = module.get_AssemblyResolver().Resolve(V_5, "", ModuleDefinitionExtensions.GetModuleArchitecture(module), V_3, true);
             if (V_6 == null)
             {
                 this.UpdateCollisionTypesDataWithTypes(V_0, V_1, V_2.get_Item(V_5));
             }
             else
             {
                 V_7 = V_6.get_Modules().GetEnumerator();
                 try
                 {
                     while (V_7.MoveNext())
                     {
                         V_8 = V_7.get_Current();
                         this.UpdateCollisionTypesDataWithTypes(V_0, V_1, V_8.get_Types());
                     }
                 }
                 finally
                 {
                     V_7.Dispose();
                 }
             }
         }
     }
     finally
     {
         ((IDisposable)V_4).Dispose();
     }
     return(V_0);
 }
Пример #25
0
 private string RemoveLeadingLineWhitespaces(string text)
 {
     V_0 = new StringBuilder();
     V_1 = new List <string>();
     V_2 = 0x7fffffff;
     V_3 = new StringReader(text);
     try
     {
         V_4 = V_3.ReadLine();
         while (V_4 != null)
         {
             V_5 = 0;
             while (V_5 < V_4.get_Length())
             {
                 if (Char.IsWhiteSpace(V_4.get_Chars(V_5)))
                 {
                     V_5 = V_5 + 1;
                 }
                 else
                 {
                     V_2 = Math.Min(V_2, V_5);
                     V_1.Add(V_4);
                     break;
                 }
             }
             V_4 = V_3.ReadLine();
         }
     }
     finally
     {
         if (V_3 != null)
         {
             ((IDisposable)V_3).Dispose();
         }
     }
     V_6 = V_1.GetEnumerator();
     try
     {
         while (V_6.MoveNext())
         {
             V_7       = V_6.get_Current();
             dummyVar0 = V_0.AppendLine(V_7.Substring(V_2));
         }
     }
     finally
     {
         ((IDisposable)V_6).Dispose();
     }
     return(V_0.ToString());
 }
Пример #26
0
 private bool CheckLoopBody(BlockStatement loopBody, VariableReference v0Variable, VariableReference v1Variable, string operationName)
 {
     if (loopBody.get_Statements().get_Count() != 3)
     {
         return(false);
     }
     if (!loopBody.get_Statements().get_Item(0).IsAssignmentStatement())
     {
         return(false);
     }
     V_0 = (loopBody.get_Statements().get_Item(0) as ExpressionStatement).get_Expression() as BinaryExpression;
     if (V_0.get_Left().get_CodeNodeType() != 26 || V_0.get_Right().get_CodeNodeType() != 26 || (object)(V_0.get_Right() as VariableReferenceExpression).get_Variable() != (object)v0Variable)
     {
         return(false);
     }
     if ((object)(V_0.get_Left() as VariableReferenceExpression).get_Variable() != (object)v1Variable)
     {
         return(false);
     }
     if (!this.IsDelegateOperationStatement(loopBody.get_Statements().get_Item(1), operationName, out V_1, out V_2) || V_1.get_CodeNodeType() != 26 || V_2.get_CodeNodeType() != 26 || (object)(V_2 as VariableReferenceExpression).get_Variable() != (object)v1Variable)
     {
         return(false);
     }
     V_3 = (V_1 as VariableReferenceExpression).get_Variable();
     if (!loopBody.get_Statements().get_Item(2).IsAssignmentStatement())
     {
         return(false);
     }
     V_4 = (loopBody.get_Statements().get_Item(2) as ExpressionStatement).get_Expression() as BinaryExpression;
     if (V_4.get_Left().get_CodeNodeType() != 26 || (object)(V_4.get_Left() as VariableReferenceExpression).get_Variable() != (object)v0Variable || V_4.get_Right().get_CodeNodeType() != 19)
     {
         return(false);
     }
     V_5 = V_4.get_Right() as MethodInvocationExpression;
     if (String.op_Inequality(V_5.get_MethodExpression().get_Method().get_DeclaringType().get_FullName(), "System.Threading.Interlocked") || V_5.get_MethodExpression().get_Method().get_HasThis() || String.op_Inequality(V_5.get_MethodExpression().get_Method().get_Name(), "CompareExchange") || V_5.get_Arguments().get_Count() != 3 || V_5.get_Arguments().get_Item(0).get_CodeNodeType() != 23)
     {
         return(false);
     }
     V_6 = V_5.get_Arguments().get_Item(0) as UnaryExpression;
     if (V_6.get_Operator() != 7 || V_6.get_Operand().get_CodeNodeType() != 30 || (object)(V_6.get_Operand() as FieldReferenceExpression).get_Field().Resolve() != (object)this.eventField)
     {
         return(false);
     }
     if (V_5.get_Arguments().get_Item(1).get_CodeNodeType() == 26 && (object)(V_5.get_Arguments().get_Item(1) as VariableReferenceExpression).get_Variable() == (object)V_3 && V_5.get_Arguments().get_Item(2).get_CodeNodeType() == 26 && (object)(V_5.get_Arguments().get_Item(2) as VariableReferenceExpression).get_Variable() == (object)v1Variable)
     {
         return(true);
     }
     return(false);
 }
Пример #27
0
 public override ICodeNode VisitMethodReferenceExpression(MethodReferenceExpression node)
 {
     V_0 = node.get_Method().Resolve();
     V_1 = this.context.get_TypeContext().get_CurrentType();
     if (V_0 == null || (object)V_0.get_DeclaringType() != (object)V_1 && !V_0.get_DeclaringType().IsNestedIn(V_1))
     {
         return(this.VisitMethodReferenceExpression(node));
     }
     if (V_0.get_IsGetter() || V_0.get_IsSetter() || !V_0.IsCompilerGenerated(true) && !this.CheckTypeForCompilerGeneratedAttribute(V_0.get_DeclaringType()))
     {
         return(this.VisitMethodReferenceExpression(node));
     }
     V_2 = null;
     if (V_0.get_Body() != null)
     {
         V_5 = this.CreateDecompilationContext(V_0);
         V_2 = V_0.get_Body().DecompileLambda(this.context.get_Language(), V_5);
         if (V_2.get_Statements().get_Count() == 1 && V_2.get_Statements().get_Item(0).get_CodeNodeType() == 5 && (V_2.get_Statements().get_Item(0) as ExpressionStatement).get_Expression().get_CodeNodeType() == 57)
         {
             V_6 = (V_2.get_Statements().get_Item(0) as ExpressionStatement).get_Expression() as ReturnExpression;
             V_7 = new ShortFormReturnExpression(V_6.get_Value(), V_6.get_MappedInstructions());
             V_2 = new BlockStatement();
             V_2.get_Statements().Add(new ExpressionStatement(V_7));
         }
         this.context.get_MethodContext().get_VariableDefinitionToNameMap().AddRange <VariableDefinition, string>(V_5.get_MethodContext().get_VariableDefinitionToNameMap());
         this.context.get_MethodContext().get_VariableNamesCollection().UnionWith(V_5.get_MethodContext().get_VariableNamesCollection());
         this.context.get_MethodContext().AddInnerMethodParametersToContext(V_5.get_MethodContext());
         this.context.get_MethodContext().get_GotoStatements().AddRange(V_5.get_MethodContext().get_GotoStatements());
         this.context.get_MethodContext().get_GotoLabels().AddRange <string, Statement>(V_5.get_MethodContext().get_GotoLabels());
     }
     V_3 = new ExpressionCollection();
     V_4 = LambdaExpressionsHelper.HasAnonymousParameter(V_0.get_Parameters());
     V_8 = V_0.get_Parameters().GetEnumerator();
     try
     {
         while (V_8.MoveNext())
         {
             V_9 = V_8.get_Current();
             V_3.Add(new LambdaParameterExpression(V_9, !V_4, null));
         }
     }
     finally
     {
         V_8.Dispose();
     }
     return(new LambdaExpression(V_3, V_2, V_0.IsAsync(), V_0.IsFunction(), node.get_Method().get_Parameters(), false, node.get_MappedInstructions()));
 }
Пример #28
0
 public BlockStatement Process(DecompilationContext context, BlockStatement body)
 {
     V_0 = new HashSet <Instruction>(body.get_UnderlyingSameMethodInstructions());
     if (context.get_MethodContext().get_IsMethodBodyChanged())
     {
         context.get_MethodContext().get_Method().RefreshBody();
         context.get_MethodContext().set_IsMethodBodyChanged(false);
     }
     V_1 = new List <Instruction>();
     V_2 = context.get_MethodContext().get_Method().get_Body().get_Instructions().GetEnumerator();
     try
     {
         while (V_2.MoveNext())
         {
             V_3 = V_2.get_Current();
             if (V_0.Contains(V_3))
             {
                 continue;
             }
             V_1.Add(V_3);
         }
     }
     finally
     {
         V_2.Dispose();
     }
     if (V_1.get_Count() > 0)
     {
         V_4 = new StringBuilder("Found unmapped instructions.\n");
         V_5 = V_1.GetEnumerator();
         try
         {
             while (V_5.MoveNext())
             {
                 V_6       = V_5.get_Current();
                 dummyVar0 = V_4.AppendLine(V_6.ToString());
             }
         }
         finally
         {
             ((IDisposable)V_5).Dispose();
         }
         throw new Exception(V_4.ToString());
     }
     return(body);
 }
Пример #29
0
 private void RemoveUnreachableBlocks()
 {
     V_0 = new HashSet <InstructionBlock>();
     V_1 = this.theCFG.get_Blocks();
     V_2 = 0;
     while (V_2 < (int)V_1.Length)
     {
         V_3 = V_1[V_2];
         if (!this.reachableBlocks.Contains(V_3))
         {
             V_3.set_Successors(new InstructionBlock[0]);
             dummyVar0 = V_0.Add(V_3);
         }
         V_2 = V_2 + 1;
     }
     if (V_0.get_Count() > 0)
     {
         this.decompilationContext.get_MethodContext().set_IsMethodBodyChanged(true);
     }
     V_4 = 0;
     while (V_4 < this.theCFG.get_RawExceptionHandlers().get_Count())
     {
         V_5 = this.theCFG.get_RawExceptionHandlers().get_Item(V_4);
         if (V_0.Contains(this.theCFG.get_InstructionToBlockMapping().get_Item(V_5.get_TryStart().get_Offset())))
         {
             stackVariable54 = V_4;
             V_4             = stackVariable54 - 1;
             this.theCFG.get_RawExceptionHandlers().RemoveAt(stackVariable54);
         }
         V_4 = V_4 + 1;
     }
     V_6 = V_0.GetEnumerator();
     try
     {
         while (V_6.MoveNext())
         {
             V_7 = V_6.get_Current();
             this.theCFG.RemoveBlockAt(V_7.get_Index());
         }
     }
     finally
     {
         ((IDisposable)V_6).Dispose();
     }
     return;
 }
Пример #30
0
 private bool IsThreadSafeAutoImplOperation(MethodDefinition methodDef, string operationName)
 {
     if (!this.CheckMethodAndDecompile(methodDef, out V_0) || V_0.get_Statements().get_Count() != 3)
     {
         return(false);
     }
     V_1 = null;
     V_2 = null;
     if (!V_0.get_Statements().get_Item(0).IsAssignmentStatement())
     {
         return(false);
     }
     V_3 = (V_0.get_Statements().get_Item(0) as ExpressionStatement).get_Expression() as BinaryExpression;
     if (V_3.get_Left().get_CodeNodeType() != 26 || V_3.get_Right().get_CodeNodeType() != 30 || (object)(V_3.get_Right() as FieldReferenceExpression).get_Field().Resolve() != (object)this.eventField)
     {
         return(false);
     }
     V_1 = (V_3.get_Left() as VariableReferenceExpression).get_Variable();
     if (V_0.get_Statements().get_Item(1).get_CodeNodeType() != 8 || V_0.get_Statements().get_Item(2).get_CodeNodeType() != 5 || (V_0.get_Statements().get_Item(2) as ExpressionStatement).get_Expression().get_CodeNodeType() != 57)
     {
         return(false);
     }
     V_4 = V_0.get_Statements().get_Item(1) as DoWhileStatement;
     V_5 = V_4.get_Condition();
     if (V_5.get_CodeNodeType() == 23 && (V_5 as UnaryExpression).get_Operator() == 11)
     {
         V_5 = (V_5 as UnaryExpression).get_Operand();
     }
     if (V_5.get_CodeNodeType() != 24)
     {
         return(false);
     }
     stackVariable78 = V_5 as BinaryExpression;
     V_6             = stackVariable78.get_Left() as ExplicitCastExpression;
     V_7             = stackVariable78.get_Right() as ExplicitCastExpression;
     if (stackVariable78.get_Operator() != 10 || V_6 == null || String.op_Inequality(V_6.get_TargetType().get_Name(), "Object") || V_6.get_Expression().get_CodeNodeType() != 26 || V_7 == null || V_7.get_Expression().get_CodeNodeType() != 26 || String.op_Inequality(V_7.get_TargetType().get_Name(), "Object"))
     {
         return(false);
     }
     if ((object)(V_6.get_Expression() as VariableReferenceExpression).get_Variable() != (object)V_1)
     {
         return(false);
     }
     V_2 = (V_7.get_Expression() as VariableReferenceExpression).get_Variable();
     return(this.CheckLoopBody(V_4.get_Body(), V_1, V_2, operationName));
 }