private List <ProductAssembly> GetDummyProductAssembly()
        {
            List <ProductAssembly> productAssemblyList = new List <ProductAssembly>();
            ProductAssembly        objProductAssembly  = new ProductAssembly();

            objProductAssembly.ProductAssemblyID = 1;
            objProductAssembly.AssemblyID        = 800;
            objProductAssembly.ComponentID       = 518;
            objProductAssembly.Name           = "ML Road Seat Assembly";
            objProductAssembly.PerAssemblyQty = 1.00M;
            objProductAssembly.EndDate        = null;
            objProductAssembly.ComponentLevel = 0;
            productAssemblyList.Add(objProductAssembly);

            ProductAssembly objProductAssembly1 = new ProductAssembly();

            objProductAssembly1.ProductAssemblyID = 2;
            objProductAssembly1.AssemblyID        = 800;
            objProductAssembly1.ComponentID       = 806;
            objProductAssembly1.Name           = "ML Headset";
            objProductAssembly1.PerAssemblyQty = 1.00M;
            objProductAssembly1.EndDate        = null;
            objProductAssembly1.ComponentLevel = 0;
            productAssemblyList.Add(objProductAssembly1);
            return(productAssemblyList);
        }
예제 #2
0
        /// <summary>
        ///  Initializes a new instance of the <see cref="ProductInfo" /> class.
        /// </summary>
        /// <param name="includeGac">Indicates whether to include assemblies from Global Assembly Cache. Default is false.</param>
        public ProductInfo(bool includeGac = false)
        {
            var assemblies =
                from assembly in AppDomain.CurrentDomain.GetAssemblies()
                let name = assembly.GetName()
                           where includeGac || !assembly.GlobalAssemblyCache
                           select name;

            this.Assemblies =
                assemblies.Select(a => new ProductAssembly {
                Name = a.Name, Version = a.Version, Location = a.EscapedCodeBase
            })
                .ToList();

            this.Assembly = this.Assemblies.FirstOrDefault(a => a.Name == "Adxstudio.Xrm");
        }
예제 #3
0
        public static string GetStoragePath()
        {
            string basePath  = "";
            bool   isWindows = OperatingSystem.IsWindows();

            if (isWindows)
            {
                var userPath = Environment.GetEnvironmentVariable(
                    RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
                    "LOCALAPPDATA" : "Home");
                ProductAssembly proAss = GetProductAssembly();
                basePath = Path.Combine(Path.Combine(userPath, proAss.CompanyName), proAss.ProductName);
                if (Constants.DebugMode)
                {
                    basePath = Path.Combine(basePath, "Test");
                }
                else
                {
                    basePath = Path.Combine(basePath, "Prod");
                }
            }
            return(basePath);
        }