Example #1
0
        /// <summary> Existing JSON Manifest</summary>
        /// <param name="fileName">File name </param>
        private void ExistingManifest(string fileName)
        {
            // Get the manifest and store for later use
            CustomizationManifest = JObject.Parse(File.ReadAllText(fileName));

            // Properties
            txtPackageId.Text                = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertyPackageId);
            txtCustomizationName.Text        = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertyName);
            txtCustomizationDescription.Text = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertyDescription);
            txtCompanyName.Text              = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertyBusinessPartnerName);
            txtCompatibility.Text            = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertySageCompatibility);
            txtVersion.Text = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertyVersion);

            txtBootstrapper.Text = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertyBootstrapper);
            txtAssembly.Text     = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertyAssembly);

            // Build project name
            txtProject.Text = txtCompanyName.Text.Replace(" ", "").Replace(Resources.Dot, "") +
                              Resources.Dot +
                              txtCustomizationName.Text.Replace(" ", "").Replace(Resources.Dot, "");

            // Get location from folder where found
            var path = Path.GetDirectoryName(fileName);

            txtFolderName.Text = path;

            var eula = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.Constants.PropertyEula);

            txtEula.Text = eula;

            // Store the file name for later update
            CustomizationFileName = fileName;
        }
Example #2
0
        /// <summary> Existing JSON Manifest</summary>
        /// <param name="fileName">File name </param>
        private void ExistingManifest(string fileName)
        {
            // Get the manifest and store for later use
            CustomizationManifest = JObject.Parse(File.ReadAllText(fileName));

            // Properties
            txtPackageId.Text                = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertyPackageId);
            txtCustomizationName.Text        = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertyName);
            txtCustomizationDescription.Text = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertyDescription);
            txtCompanyName.Text              = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertyBusinessPartnerName);
            txtCompatibility.Text            = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertySageCompatibility);
            txtVersion.Text = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertyVersion);

            txtBootstrapper.Text = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertyBootstrapper);
            txtAssembly.Text     = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertyAssembly);

            // Assign name or default name
            if (string.IsNullOrEmpty(txtAssembly.Text.Trim()))
            {
                // Default module
                txtModule.Text = CustomizationModule;
                // Default project company concatenated with customization name
                txtProject.Text = txtCompanyName.Text.Replace(" ", "") +
                                  Resources.Dot +
                                  txtCustomizationName.Text.Replace(" ", "");
            }
            else
            {
                // Get segments of assembly
                var segments = txtAssembly.Text.Trim().Split('.');
                // Pull out module
                txtModule.Text = segments[segments.Length - 3];
                // Build project
                var project = string.Empty;
                for (int i = 0; i < segments.Length - 3; i++)
                {
                    // Append dot before next segment
                    if (!string.IsNullOrEmpty(project))
                    {
                        project += Resources.Dot;
                    }
                    project += segments[i];
                }
                txtProject.Text = project;
            }

            // Get location from folder where found
            var path = Path.GetDirectoryName(fileName);

            txtFolderName.Text = path;

            var eula = (string)CustomizationManifest.SelectToken(Sage300UICustomizationUserInterface.PropertyEula);

            txtEula.Text = eula;

            // Store the file name for later update
            CustomizationFileName = fileName;
        }