public static bool CheckInItem(ISiteSetting siteSetting, IItem item, IConnectorExplorer connector) { CheckInForm checkInForm = new CheckInForm(); checkInForm.Initialize(siteSetting, item); if (checkInForm.ShowDialog(null, Languages.Translate("Check In Item")) == true) { string comment = checkInForm.Comments; CheckinTypes checkinType = checkInForm.CheckInType; IServiceManager serviceManager = ServiceManagerFactory.GetServiceManager(siteSetting.SiteSettingType); Result result; if (result = serviceManager.CheckInFile(siteSetting, item, comment, checkinType)) { if (checkInForm.KeepDocumentCheckedOut == true) { serviceManager.CheckOutFile(siteSetting, item); } else { if (connector != null) { item.Properties["ows__Level"] = "1"; //connector.ContentExplorer.UpdateItem(item.GetID(), item); } } } else { MessageBox.Show(result.detailResult, result.messageResult, MessageBoxButton.OK, MessageBoxImage.Error); return(false); } } return(true); }
private bool DoCheckIn(IEnumerable <IResource> resources) { if (!CanUseSourceControl) { return(false); } using (var dialog = new CheckInForm(SourceControlService, resources)) { dialog.Icon = m_mainForm.Icon; dialog.ShowDialog(m_mainForm); } return(true); }
/// <summary> /// Handles the Clicked event of the checkIn control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remarks>Documented by CFI, 2011-01-07</remarks> public void checkIn_Clicked(object sender, EventArgs e) { CheckInForm checkIn = new CheckInForm(Manager, GetPaths()); if (checkIn.ShowDialog() == DialogResult.OK) { foreach (ITabbedDocument document in PluginBase.MainForm.Documents) { if (checkIn.CheckedInChanges.FirstOrDefault(c => c.LocalItem == document.FileName) != null) { document.Reload(false); } } } }