void upb_ProjectClosed(object sender, PackageEventArgs e) { txtNewSoftDir.DataBindings.Clear(); txtPackagePath.DataBindings.Clear(); rtfPath.DataBindings.Clear(); txtAfterExecuteArgs.DataBindings.Clear(); txtAppName.DataBindings.Clear(); txtAppVersion.DataBindings.Clear(); txtDesc.DataBindings.Clear(); txtPreExecuteArgs.DataBindings.Clear(); txtPublishUrl.DataBindings.Clear(); txtTimeout.DataBindings.Clear(); chkHideBefore.DataBindings.Clear(); chkHideAfter.DataBindings.Clear(); fileAfterExecute.DataBindings.Clear(); filePreExecute.DataBindings.Clear(); txtUrl.DataBindings.Clear(); txtPing.DataBindings.Clear(); chkOptAutoExitProcess.DataBindings.Clear(); chkOptAutoKillProcess.DataBindings.Clear(); chkOptForceUpdate.DataBindings.Clear(); chkOptMustUpdate.DataBindings.Clear(); chkAutoEndAppDirProcesses.DataBindings.Clear(); chkStillProptUserInfo.DataBindings.Clear(); chkAutoCloseSucceed.DataBindings.Clear(); chkOptError.DataBindings.Clear(); chkOptRequireAdminPrivilege.DataBindings.Clear(); txtPackageExtension.DataBindings.Clear(); chkCleanTargetDirectory.DataBindings.Clear(); chkRandomPackageName.DataBindings.Clear(); txtCompFlag.DataBindings.Clear(); }
/// <summary> /// 引发 <see cref="ProjectLoaded" /> 事件 /// </summary> /// <param name="ea">包含此事件的参数</param> protected virtual void OnProjectLoaded(PackageEventArgs ea) { var handler = ProjectLoaded; if (handler != null) { handler(this, ea); } }
void upb_ProjectLoaded(object sender, PackageEventArgs e) { var project = e.AuProject; txtNewSoftDir.AddDataBinding(project, s => s.Text, s => s.ApplicationDirectory); txtPackagePath.AddDataBinding(project, s => s.Text, s => s.DestinationDirectory); rtfPath.AddDataBinding(project, s => s.Text, s => s.UpdateRtfNotePath); fileAfterExecute.AddDataBinding(project, s => s.RootPath, s => s.ApplicationDirectory); filePreExecute.AddDataBinding(project, s => s.RootPath, s => s.ApplicationDirectory); btnBind.Text = string.IsNullOrEmpty(project.VersionUpdateSrc) ? "绑定" : "取消绑定"; txtAppVersion.Enabled = string.IsNullOrEmpty(project.VersionUpdateSrc); lnkBindDescToFile.Text = string.IsNullOrEmpty(project.UpdateContentSrc) ? "绑定到文件" : "已绑定(" + project.UpdateContentSrc + "),点击取消绑定"; txtDesc.Enabled = string.IsNullOrEmpty(project.UpdateContentSrc); var ui = UpdatePackageBuilder.Instance.AuProject.UpdateInfo; txtAfterExecuteArgs.AddDataBinding(ui, s => s.Text, s => s.ExecuteArgumentAfter); txtAppName.AddDataBinding(ui, s => s.Text, s => s.AppName); txtAppVersion.AddDataBinding(ui, s => s.Text, s => s.AppVersion); txtDesc.AddDataBinding(ui, s => s.Text, s => s.Desc); txtPreExecuteArgs.AddDataBinding(ui, s => s.Text, s => s.ExecuteArgumentBefore); txtPublishUrl.AddDataBinding(ui, s => s.Text, s => s.PublishUrl); txtTimeout.AddDataBinding(ui, s => s.Text, s => s.ExecuteTimeout.ToString()); chkHideBefore.AddDataBinding(ui, s => s.Checked, s => s.HideBeforeExecuteWindow); chkHideAfter.AddDataBinding(ui, s => s.Checked, s => s.HideAfterExecuteWindow); fileAfterExecute.AddDataBinding(ui, s => s.SelectedFileName, s => s.FileExecuteAfter); filePreExecute.AddDataBinding(ui, s => s.SelectedFileName, s => s.FileExecuteBefore); txtUrl.AddDataBinding(ui, s => s.Text, s => s.WebUpdateNote); txtPing.AddDataBinding(ui, s => s.Text, s => s.UpdatePingUrl); project.PropertyChanged += (ss, ee) => { var p = ss as AuProject; if (ee.PropertyName == "VersionUpdateSrc") { btnBind.Text = string.IsNullOrEmpty(p.VersionUpdateSrc) ? "绑定" : "取消绑定"; txtAppVersion.Enabled = string.IsNullOrEmpty(p.VersionUpdateSrc); } else if (ee.PropertyName == "UpdateContentSrc") { lnkBindDescToFile.Text = string.IsNullOrEmpty(p.UpdateContentSrc) ? "绑定到文件" : "取消绑定"; txtDesc.Enabled = string.IsNullOrEmpty(p.UpdateContentSrc); } }; ui.PropertyChanged += (ss, se) => { var u = (ss as UpdateInfo); if (se.PropertyName == "ExecuteTimeout") { txtTimeout.Text = u.ExecuteTimeout.ToString(); } }; txtTimeout.Text = ui.ExecuteTimeout.ToString(); UpdatePackageBuilder.Instance.AutoLoadInformations(); }
void upb_ProjectClosed(object sender, PackageEventArgs e) { var project = e.AuProject; txtNewSoftDir.DataBindings.Clear(); txtPackagePath.DataBindings.Clear(); rtfPath.DataBindings.Clear(); txtAfterExecuteArgs.DataBindings.Clear(); txtAppName.DataBindings.Clear(); txtAppVersion.DataBindings.Clear(); txtDesc.DataBindings.Clear(); txtPreExecuteArgs.DataBindings.Clear(); txtPublishUrl.DataBindings.Clear(); txtTimeout.DataBindings.Clear(); chkHideBefore.DataBindings.Clear(); chkHideAfter.DataBindings.Clear(); fileAfterExecute.DataBindings.Clear(); filePreExecute.DataBindings.Clear(); txtUrl.DataBindings.Clear(); txtPing.DataBindings.Clear(); }
void upb_ProjectLoaded(object sender, PackageEventArgs e) { var project = e.AuProject; txtNewSoftDir.AddDataBinding(project, s => s.Text, s => s.ApplicationDirectory); txtPackagePath.AddDataBinding(project, s => s.Text, s => s.DestinationDirectory); rtfPath.AddDataBinding(project, s => s.Text, s => s.UpdateRtfNotePath); fileAfterExecute.AddDataBinding(project, s => s.RootPath, s => s.ApplicationDirectory); filePreExecute.AddDataBinding(project, s => s.RootPath, s => s.ApplicationDirectory); btnBind.Text = string.IsNullOrEmpty(project.VersionUpdateSrc) ? "绑定" : "取消绑定"; txtAppVersion.Enabled = string.IsNullOrEmpty(project.VersionUpdateSrc); lnkBindDescToFile.Text = string.IsNullOrEmpty(project.UpdateContentSrc) ? "绑定到文件" : "已绑定(" + project.UpdateContentSrc + "),点击取消绑定"; txtDesc.Enabled = string.IsNullOrEmpty(project.UpdateContentSrc); var ui = UpdatePackageBuilder.Instance.AuProject.UpdateInfo; txtAfterExecuteArgs.AddDataBinding(ui, s => s.Text, s => s.ExecuteArgumentAfter); txtAppName.AddDataBinding(ui, s => s.Text, s => s.AppName); txtAppVersion.AddDataBinding(ui, s => s.Text, s => s.AppVersion); txtDesc.AddDataBinding(ui, s => s.Text, s => s.Desc); txtPreExecuteArgs.AddDataBinding(ui, s => s.Text, s => s.ExecuteArgumentBefore); txtPublishUrl.AddDataBinding(ui, s => s.Text, s => s.PublishUrl); txtTimeout.Text = ui.ExecuteTimeout.ToString(); chkHideBefore.AddDataBinding(ui, s => s.Checked, s => s.HideBeforeExecuteWindow); chkHideAfter.AddDataBinding(ui, s => s.Checked, s => s.HideAfterExecuteWindow); fileAfterExecute.AddDataBinding(ui, s => s.SelectedFileName, s => s.FileExecuteAfter); filePreExecute.AddDataBinding(ui, s => s.SelectedFileName, s => s.FileExecuteBefore); txtUrl.AddDataBinding(ui, s => s.Text, s => s.WebUpdateNote); txtPing.AddDataBinding(ui, s => s.Text, s => s.UpdatePingUrl); chkOptAutoExitProcess.AddDataBinding(ui, s => s.Checked, s => s.AutoExitCurrentProcess); chkOptAutoKillProcess.AddDataBinding(ui, s => s.Checked, s => s.AutoKillProcesses); chkOptForceUpdate.AddDataBinding(ui, s => s.Checked, s => s.ForceUpdate); chkOptMustUpdate.AddDataBinding(ui, s => s.Checked, s => s.MustUpdate); chkAutoEndAppDirProcesses.AddDataBinding(ui, s => s.Checked, s => s.AutoEndProcessesWithinAppDir); chkStillProptUserInfo.AddDataBinding(ui, s => s.Checked, s => s.PromptUserBeforeAutomaticUpgrade); chkAutoCloseSucceed.AddDataBinding(ui, s => s.Checked, s => s.AutoCloseSucceedWindow); chkOptError.AddDataBinding(ui, s => s.Checked, s => s.TreatErrorAsNotUpdated); chkOptRequireAdminPrivilege.AddDataBinding(ui, s => s.Checked, s => s.RequreAdminstrorPrivilege); txtPackageExtension.AddDataBinding(project, s => s.Text, s => s.PackageExtension); chkCleanTargetDirectory.AddDataBinding(project, s => s.Checked, s => s.CleanBeforeBuild); chkRandomPackageName.AddDataBinding(project, s => s.Checked, s => s.UseRandomPackageNaming); txtCompFlag.AddDataBinding(project, s => s.Text, s => s.ComponentFlags); project.PropertyChanged += (ss, ee) => { var p = ss as AuProject; if (ee.PropertyName == "VersionUpdateSrc") { btnBind.Text = string.IsNullOrEmpty(p.VersionUpdateSrc) ? "绑定" : "取消绑定"; txtAppVersion.Enabled = string.IsNullOrEmpty(p.VersionUpdateSrc); } else if (ee.PropertyName == "UpdateContentSrc") { lnkBindDescToFile.Text = string.IsNullOrEmpty(p.UpdateContentSrc) ? "绑定到文件" : "取消绑定"; txtDesc.Enabled = string.IsNullOrEmpty(p.UpdateContentSrc); } }; ui.PropertyChanged += (ss, se) => { var u = (ss as UpdateInfo); if (se.PropertyName == "ExecuteTimeout") { txtTimeout.Text = u.ExecuteTimeout.ToString(); } }; txtTimeout.Text = ui.ExecuteTimeout.ToString(); UpdatePackageBuilder.Instance.AutoLoadInformations(); }
/// <summary> /// 引发 <see cref="ProjectClosed" /> 事件 /// </summary> /// <param name="ea">包含此事件的参数</param> protected virtual void OnProjectClosed(PackageEventArgs ea) { var handler = ProjectClosed; if (handler != null) handler(this, ea); }