Ejemplo n.º 1
0
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        foreach (UploadItem i in ConflictUploadItems)
        {
            // Delete the new package from disk since the user has decided not to go through with overwriting the old package.
            PackageCache.DeleteTemplatePackage(i.PackageID);

            CanceledUploadItems.Add(i);                 // Add the item to the list of canceled items.
        }

        ConflictUploadItems.Clear();         // Remove all conflict items.
        UpdatePanelVisibility();
    }
Ejemplo n.º 2
0
        /// <summary>
        /// Updates 'index.xml' the new title, description, and packageID passed in.
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="title"></param>
        /// <param name="desc"></param>
        /// <param name="packageID"></param>
        public void UpdateTemplate(string filename, string title, string desc, string packageID)
        {
            DataView dv    = null;
            FileInfo finfo = new FileInfo(filename);

            switch (finfo.Extension.ToLower())
            {
            case ".url":
                dv = SelectTitle(title, finfo.Extension);
                break;

            default:
                dv = SelectFile(filename);
                break;
            }
            string curPkgID = dv[0]["PackageID"].ToString();

            if (packageID != null)
            {
                if (curPkgID != packageID)
                {
                    // If the packageID is different than the old one, delete the old package from disk.
                    PackageCache.DeleteTemplatePackage(curPkgID);
                }

                dv[0]["PackageID"] = packageID;
            }
            // pass null if you don't want something changed
            if (filename != null)
            {
                dv[0]["Filename"] = filename;
            }
            if (title != null)
            {
                dv[0]["Title"] = title;
            }
            if (desc != null)
            {
                dv[0]["Description"] = desc;
            }
            FlushUpdates();
        }