Beispiel #1
0
        public override bool AreRepositoriesEquivalent(IConnectionInfo c1, IConnectionInfo c2)
        {
            var p1 = new Linq2AzureProperties(c1);
            var p2 = new Linq2AzureProperties(c2);

            return(string.Equals(p1.PublishSettingsPath, p2.PublishSettingsPath, StringComparison.InvariantCultureIgnoreCase));
        }
Beispiel #2
0
        internal static List <ExplorerItem> GetSchemaAndBuildAssembly(Linq2AzureProperties props, AssemblyName name,
                                                                      ref string nameSpace, ref string typeName)
        {
            string dllName    = Path.GetFileName(name.CodeBase);
            string simpleName = Path.GetFileNameWithoutExtension(dllName);
            string folder     = Path.GetDirectoryName(name.CodeBase);

            AppDomain          appDomain    = AppDomain.CurrentDomain;
            AssemblyBuilder    assemBuilder = appDomain.DefineDynamicAssembly(new AssemblyName(simpleName), AssemblyBuilderAccess.RunAndSave, folder);
            ModuleBuilder      modBuilder   = assemBuilder.DefineDynamicModule(dllName);
            TypeBuilder        tb           = modBuilder.DefineType(nameSpace + "." + typeName, TypeAttributes.Public, typeof(Subscription));
            ConstructorBuilder c            = tb.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new Type[] { typeof(string) });
            var gen = c.GetILGenerator();

            gen.Emit(OpCodes.Ldarg_0);
            gen.Emit(OpCodes.Ldarg_1);
            ConstructorInfo baseConstr = typeof(Subscription).GetConstructor(new Type[] { typeof(string) });

            gen.Emit(OpCodes.Call, baseConstr);
            gen.Emit(OpCodes.Ret);

            tb.CreateType();
            assemBuilder.Save(dllName);

            return(GetSchema(typeof(Subscription), 0));
        }
Beispiel #3
0
        internal static List<ExplorerItem> GetSchemaAndBuildAssembly(Linq2AzureProperties props, AssemblyName name,
            ref string nameSpace, ref string typeName)
        {
            string dllName = Path.GetFileName(name.CodeBase);
            string simpleName = Path.GetFileNameWithoutExtension(dllName);
            string folder = Path.GetDirectoryName(name.CodeBase);

            AppDomain appDomain = AppDomain.CurrentDomain;
            AssemblyBuilder assemBuilder = appDomain.DefineDynamicAssembly(new AssemblyName (simpleName), AssemblyBuilderAccess.RunAndSave, folder);
            ModuleBuilder modBuilder = assemBuilder.DefineDynamicModule(dllName);
            TypeBuilder tb = modBuilder.DefineType(nameSpace + "." + typeName, TypeAttributes.Public, typeof (Subscription));
            ConstructorBuilder c = tb.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, new Type[] { typeof (string) });
            var gen = c.GetILGenerator();
            gen.Emit(OpCodes.Ldarg_0);
            gen.Emit(OpCodes.Ldarg_1);
            ConstructorInfo baseConstr = typeof(Subscription).GetConstructor(new Type[] { typeof (string) });
            gen.Emit(OpCodes.Call, baseConstr);
            gen.Emit(OpCodes.Ret);

            tb.CreateType();
            assemBuilder.Save(dllName);

            return GetSchema(typeof(Subscription), 0);
        }
Beispiel #4
0
 public ConnectionDialog(IConnectionInfo cxInfo)
 {
     _cxInfo     = cxInfo;
     DataContext = _props = new Linq2AzureProperties(cxInfo);
     InitializeComponent();
 }
Beispiel #5
0
        public ConnectionDialog(IConnectionInfo cxInfo)
		{
			_cxInfo = cxInfo;
            DataContext = _props = new Linq2AzureProperties(cxInfo);
            InitializeComponent();
        }