Example #1
0
        private void CreateIndexFile()
        {
            var indexManager = new IndexFileManager();

            var deployment  = new DeploymentManager(MobilePath);
            var productList = deployment.Products;

            productList.Reverse();

            var products = new List <string>();

            if (productList.Contains("argos-saleslogix"))
            {
                products.Add("argos-saleslogix");
            }

            products.AddRange(productList.Where(prod => prod != "argos-saleslogix").ToList());

            foreach (string product in products)
            {
                indexManager.Packages.Add(new ResourcePackage {
                    Repository = product
                });
            }

            indexManager.CreateIndex(MobilePath);
        }
        private void FormLaunchWeb_Load(object sender, EventArgs e)
        {
            var iisexpress = new IISExpressManager();
            if (!iisexpress.IsInstalled)
            {
                panelError.Location = new Point(12, 76);
                panelError.Visible = true;
                WireControlMove(panelError);
                return;
            }

            var deployment = new DeploymentManager(Program.Path);
            var productList = deployment.Products;
            productList.Reverse();

            foreach (var prod in productList.Where(prod => prod != "argos-saleslogix"))
            {
                AddProduct(prod);
            }

            if (productList.Contains("argos-saleslogix"))
                AddProduct("argos-saleslogix");

            labelPath.Text = string.Format("Path:  {0}", Program.Path);
            toolTip1.SetToolTip(labelPath, "Mobile Environment Path:\r\n" + Program.Path);
        }
        private void buttonBrowse_Click(object sender, EventArgs e)
        {
            using (var dlg = new FolderBrowserDialog())
            {
                dlg.Description = "Select root of mobile development environment";
                if (textProductPath.Text != string.Empty) dlg.SelectedPath = textProductPath.Text;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    textProductPath.Text = dlg.SelectedPath;

                    var deployment = new DeploymentManager(textProductPath.Text);
                    panelWarning.Visible = !(deployment.HasSDK && deployment.HasProducts);
                }
            }
        }
        private void buttonCreateProduct_Click(object sender, EventArgs e)
        {
            if (textProductName.Text == "") return;
            if (textProductPath.Text == "") return;

            var deployment = new DeploymentManager(textProductPath.Text);

            if (option12.Checked && deployment.Version != MobileVersion.Version12 && deployment.HasSDK)
            {
                MessageBox.Show("You've selected to create a version 1.2 product but the target environment is a mobile 2.0 system. Change the version or select a different location.", "Mobile Version Does Not Match", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (option20.Checked && deployment.Version == MobileVersion.Version12 && deployment.HasSDK)
            {
                MessageBox.Show("You've selected to create a version 2.0 product but the target environment is a mobile 1.2 system. Change the version or select a different location.", "Mobile Version Does Not Match", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (deployment.ProductExists(textProductName.Text))
            {
                MessageBox.Show("The product '" + textProductName.Text + "' already exists at the selected path. Choose another name.", "Product Already Exists", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            progressBar1.Visible = true;
            labelStatus.Visible = true;
            buttonCreateProduct.Enabled = false;

            var product = new ProductManager(textProductPath.Text, option12.Checked ? MobileVersion.Version12 : MobileVersion.Version20);
            product.ProductCreateProgress += product_ProductCreateProgress;
            product.ProductCreateInitializing += product_ProductCreateInitializing;
            product.ProductCreateComplete += product_ProductCreateComplete;
            product.Create(textProductName.Text);
        }
        private void buttonCreateDevEnv_Click(object sender, EventArgs e)
        {
            if (textProductPath.Text == string.Empty)
                return;

            var deployment = new DeploymentManager(textProductPath.Text);
            if (deployment.HasSDK)
            {
                MessageBox.Show("The selected path already has a mobile environment. Choose another path.", "Mobile Already Exists", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            labelStatus.Visible = true;
            progressBar1.Visible = true;
            buttonCreateDevEnv.Enabled = false;

            var version = MobileVersion.Version35;
            if (option12.Checked) version = MobileVersion.Version12;
            if (option20.Checked) version = MobileVersion.Version20;
            if (option30.Checked) version = MobileVersion.Version30;
            if (option31.Checked) version = MobileVersion.Version31;
            if (option32.Checked) version = MobileVersion.Version32;
            if (option33.Checked) version = MobileVersion.Version33;
            if (option34.Checked) version = MobileVersion.Version34;
            if (option35.Checked) version = MobileVersion.Version35;

            var mobileResources = new MobileResourceManager(textProductPath.Text, version);
            mobileResources.IncludeArgosSample = checkIncludeSample.Checked;
            mobileResources.IncludeArgos754Compatability = checkIncludeBackCompat.Checked;
            mobileResources.ResourceInstallInitializing += mobileResources_ResourceInstallInitializing;
            mobileResources.ResourceInstallProgress += mobileResources_ResourceInstallProgress;
            mobileResources.ResourceInstallStepUpdate += mobileResources_ResourceInstallStepUpdate;
            mobileResources.ResourceInstallComplete += mobileResources_ResourceInstallComplete;
            mobileResources.Install();

            Program.CurrentDevSite = textProductPath.Text;
            Program.CurrentDevMobileVersion = version;
        }
        private void CreateIndexFile()
        {
            var indexManager = new IndexFileManager();

            var deployment = new DeploymentManager(MobilePath);
            var productList = deployment.Products;
            productList.Reverse();

            var products = new List<string>();

            if (productList.Contains("argos-saleslogix"))
                products.Add("argos-saleslogix");

            products.AddRange(productList.Where(prod => prod != "argos-saleslogix").ToList());

            foreach (string product in products)
                indexManager.Packages.Add(new ResourcePackage {Repository = product});

            indexManager.CreateIndex(MobilePath);
        }