コード例 #1
0
ファイル: EntryForm.cs プロジェクト: ShomreiTorah/Utilities
        public static XElement Show(UpdatableAttribute product, UpdateInfo oldUpdate, ReadOnlyCollection<string> updateFiles, string baseDir)
        {
            using (var form = new EntryForm()) {
                if (oldUpdate == null) {
                    form.ClientSize = new Size(form.splitContainerControl1.Panel2.Width, form.ClientSize.Height);
                    form.splitContainerControl1.PanelVisibility = SplitPanelVisibility.Panel2;
                } else {
                    form.oldUpdate.ShowOldFiles(oldUpdate, updateFiles, baseDir);
                }
                form.newUpdate.ShowNewFiles(product.CurrentVersion, DefaultDescription, updateFiles, baseDir, oldUpdate);

                form.Text = "Update " + product.ProductName;

                if (form.ShowDialog() == DialogResult.Cancel)
                    return null;

                var newVersion = new UpdateVersion(DateTime.Now, product.CurrentVersion, form.newUpdate.Description);

                return new XElement("Update",
                    new XAttribute("Name", product.ProductName),

                    new XElement("Versions",
                        newVersion.ToXml(),
                        oldUpdate == null ? null : oldUpdate.Versions.Select(v => v.ToXml())
                    )
                    //The new files are added later
                );
            }
        }
コード例 #2
0
		///<summary>Creates a new UpdateChecker for the product described by an UpdatableAttribute instance.</summary>
		///<returns>An UpdateChecker instance that for the program described by the attribute, or null if updates are not configured in ShomreiTorahConfig.xml.</returns>
		public static UpdateChecker Create(UpdatableAttribute attribute) {
			if (attribute == null) throw new ArgumentNullException("attribute");

			if (UpdateConfig.Standard == null)
				return null;

			return new UpdateChecker(attribute);
		}
コード例 #3
0
ファイル: Publisher.cs プロジェクト: ShomreiTorah/Utilities
        public Publisher(UpdatableAttribute product, UpdateInfo oldUpdate, XElement xml, ReadOnlyCollection<string> updateFiles, string basePath)
        {
            this.oldUpdate = oldUpdate;
            this.xml = xml;
            this.updateFiles = updateFiles;
            this.basePath = basePath;
            this.product = product;

            remoteBaseFolder = Combine(UpdateConfig.Standard.RemotePath, product.ProductName + "/");
        }
コード例 #4
0
		private UpdateChecker(UpdatableAttribute attribute) {
			ProductName = attribute.ProductName;
			CurrentVersion = attribute.CurrentVersion;
		}