Commits

Hosein Yeganloo committed 9297f6a

Run Time Interface inserted

  • Participants
  • Parent commits f00a8fe

Comments (0)

Files changed (6)

File HYLogger/.hgignore

-*.dll
+*.suo
 /bin
 /obj

File HYLogger/HYLogger.sln

 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HYLoggerTest", "HYLoggerTest\HYLoggerTest.csproj", "{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunTimeInterface", "RunTimeInterface\RunTimeInterface.csproj", "{75D89531-E5B6-4FDE-81A1-85131CCF905E}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|Mixed Platforms = Debug|Mixed Platforms
 		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|Mixed Platforms = Release|Mixed Platforms
 		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
 		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Debug|x86.Build.0 = Debug|Any CPU
+		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Release|x86.ActiveCfg = Release|Any CPU
 		{24D0DFE2-7B3B-4722-B09A-4CAB174B169E}.Release|x86.Build.0 = Release|Any CPU
+		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Debug|Mixed Platforms.Build.0 = Debug|x86
 		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Debug|x86.ActiveCfg = Debug|x86
 		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Debug|x86.Build.0 = Debug|x86
+		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Release|Any CPU.ActiveCfg = Release|x86
+		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Release|Mixed Platforms.Build.0 = Release|x86
 		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Release|x86.ActiveCfg = Release|x86
 		{CA9DE579-D0B7-446A-85E0-90CD7EEF810A}.Release|x86.Build.0 = Release|x86
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{75D89531-E5B6-4FDE-81A1-85131CCF905E}.Release|x86.ActiveCfg = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(MonoDevelopProperties) = preSolution
 		StartupItem = HYLoggerTest\HYLoggerTest.csproj

File HYLogger/HYLogger/Model/Config.cs

 		/// <value>
 		/// The string address config file.
 		/// </value>
-		[NonSerialized]
+		
 		public string FileName { get; set;}
 		
 		#endregion

File HYLogger/RunTimeInterface/LogBinder.cs

+namespace FluentInterfaceTest
+{
+    using System;
+    using System.Linq;
+    using System.Collections.Generic;
+    using System.Linq.Expressions;
+using System.Reflection;
+
+    internal class LogBinder
+    {
+        private Dictionary<Type, List<string>> holder;
+        private static LogBinder instance;
+
+        private LogBinder()
+        {
+            this.holder = new Dictionary<Type, List<string>>();
+        }
+
+        public static LogBinder Create()
+        {
+            if (instance == null)
+                instance = new LogBinder();
+            return instance;
+        }
+
+        public LogBinder Bind<T>(params Expression<Func<T, object>>[] expressions)
+        {
+            if (!this.holder.ContainsKey(typeof(T)) || this.holder[typeof(T)] == null)
+            {
+                this.holder[typeof(T)] = 
+                    (from exp in expressions 
+                     where exp.Body is MemberExpression 
+                     select (exp.Body as MemberExpression).Member.Name)
+                     .ToList();
+            }
+            else
+            {                
+                this.holder[typeof(T)].AddRange(
+                    (from exp in expressions 
+                     let name = exp.Body is MemberExpression ? (exp.Body as MemberExpression).Member.Name : string.Empty 
+                     where name != string.Empty && 
+                     !this.holder[typeof(T)].Contains(name) 
+                     select (exp.Body as MemberExpression).Member.Name)
+                     .ToList());
+            }
+
+            return this;
+        }
+
+        internal bool MustLog<T>(string propertyName)
+        {
+            return this.holder[typeof(T)].Contains(propertyName);
+        }
+
+        internal bool MustLog(PropertyInfo prop)
+        {
+            return this.holder[prop.DeclaringType].Contains(prop.Name);
+        }
+
+        //internal object GetInterface<T>()
+        //{
+            
+        //}
+    }
+}

File HYLogger/RunTimeInterface/Properties/AssemblyInfo.cs

+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("RunTimeInterface")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("RunTimeInterface")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c3af2968-2dd3-4cb5-ab87-127b7a9bb0ba")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

File HYLogger/RunTimeInterface/RunTimeInterface.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{75D89531-E5B6-4FDE-81A1-85131CCF905E}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>RunTimeInterface</RootNamespace>
+    <AssemblyName>RunTimeInterface</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="LogBinder.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>