Exemplo n.º 1
0
        string GetModelAdaptorFolder()
        {
            string appSetting = ConfigurationManager.AppSettings["ModelAdaptorPath"];

            if (Directory.Exists(appSetting))
            {
                return(appSetting);
            }
            if (InterfaceBuilder.RuntimeMode && !XpandModuleBase.IsHosted && !Debugger.IsAttached && appSetting != null)
            {
                var userAppDataPath = System.Windows.Forms.Application.UserAppDataPath;
                var xafApplication  = ApplicationHelper.Instance.Application;
                if (xafApplication != null)
                {
                    var methodInfo = xafApplication.GetType().GetMethod("GetFileLocation", BindingFlags.Instance | BindingFlags.NonPublic);
                    var typeInfo   = XafTypesInfo.Instance.FindTypeInfo("DevExpress.ExpressApp.Win.FileLocation");
                    methodInfo = methodInfo.MakeGenericMethod(typeInfo.Type);
                    var values = Enum.GetValues(typeInfo.Type);
                    var value  = values.GetValue(1);
                    var invoke = methodInfo.Invoke(xafApplication, new[] { value, "ModelAdaptorPath" });
                    return((int)invoke != (int)value? userAppDataPath: PathHelper.GetApplicationFolder());
                }
            }
            var folder = InterfaceBuilder.RuntimeMode? AppDomain.CurrentDomain.SetupInformation.ApplicationBase: InterfaceBuilder.GetTempDirectory();

            return(Path.Combine(folder, "ModelAdaptor"));
        }
Exemplo n.º 2
0
        public static string GeneratedDisplayNameCode(string arg3)
        {
            var interfaceBuilder = new InterfaceBuilder();

            return(string.Format(@"[{0}(""{1}"")]", interfaceBuilder.TypeToString(typeof(ModelDisplayNameAttribute)), arg3));
        }
Exemplo n.º 3
0
 protected virtual void ExtendingModelInterfaces(InterfaceBuilder builder, Assembly assembly, ModelInterfaceExtenders extenders)
 {
 }