void AddContronToPannel(Fwk.UI.Controls.Menu.Tree.MenuItem item, object obj) { using (WaitCursorHelper w = new WaitCursorHelper(this)) { Xtra_UC_Base ctrl = null; Type T = Fwk.HelperFunctions.ReflectionFunctions.CreateType(item.AssemblyInfo); if (!controls.Contains(string.Concat(T.Name, item.ID))) { ctrl = (Xtra_UC_Base)Fwk.HelperFunctions.ReflectionFunctions.CreateInstance(item.AssemblyInfo); ctrl.Tag = item.Tag; ctrl.Key = string.Concat(T.Name, item.ID); this.panelControl1.Controls.Add(ctrl); controls.Add(ctrl.Key); ctrl.Dock = System.Windows.Forms.DockStyle.Fill; ctrl.OnExitControlEvent += new EventHandler(ctrl_OnExitControlEvent); ctrl.Populate(obj); //ctrl.Populate(null); } else { int i = this.panelControl1.Controls.IndexOfKey(T.Name); ctrl = (Xtra_UC_Base)this.panelControl1.Controls[i]; } btnClose.Visible = ctrl.ShowClose; btnSaveChanges.Visible = ctrl.ShowSave; CurrentControl = ctrl; ctrl.BringToFront(); ctrl.Refresh(); } }
public bool ChangePassword() { //Validamos que no haya errores en el UserControl if (!dxErrorProvider1.HasErrors && ValidateUC()) { using (WaitCursorHelper waitn = new WaitCursorHelper(this)) { //Cambiamos el Password try { SecurityController.UserChangePassword(UserName, txtOldPassword.Text, txtNewPassword.Text); MessageViewer.Show("Su contraseƱa fue cambiada exitosamente"); } catch (Exception ex) { this.ExceptionViewer.Show(ex); return(false); } } return(true); } else { return(false); } }
public void AddContronToPannel(PanelEnum panelEnum, Xtra_UC_Base userControl, object obj) { var panel = ((IfrmMainBase)_ParentForm).Get_Panel(panelEnum); using (WaitCursorHelper w = new WaitCursorHelper(_ParentForm)) { Type T = userControl.GetType(); ///Si no fue agregado lo agega al contenedor if (!controls.Contains(userControl.Key)) { userControl.ParentPanel = panel; panel.Controls.Add(userControl); controls.Add(userControl.Key); userControl.Dock = System.Windows.Forms.DockStyle.Fill; userControl.OnExitControlEvent += new ExitControlHandler(ctrl_OnExitControlEvent); userControl.OnLunchUserControlEvent += ctrl_OnLunchUserControlEvent; userControl.Populate(obj); } CurrentControl = userControl; userControl.BringToFront(); userControl.Refresh(); } }
private void frm_Profesional_Shifts_Load(object sender, EventArgs e) { if (profesional == null) { return; } if (DesignMode) { return; } using (WaitCursorHelper w = new WaitCursorHelper(this)) { uc_TimeLine1.SelectedProfesionalBE = new Profesional_FullViewBE(); uc_TimeLine1.SelectedProfesionalBE.Nombre = profesional.Persona.Nombre; uc_TimeLine1.SelectedProfesionalBE.Apellido = profesional.Persona.Apellido; uc_TimeLine1.SelectedProfesionalBE.IdProfesional = profesional.IdProfesional; uc_TimeLine1.SelectedProfesionalBE.NombreEspecialidad = profesional.NombreEspecialidad; uc_TimeLine1.SelectedProfesionalBE.Matricula = profesional.Matricula; uc_TimeLine1.SelectedProfesionalBE.UserName = profesional.UserName; uc_TimeLine1.SelectedProfesionalBE.UserId = profesional.Persona.UserId; uc_TimeLine1.SelectedProfesionalBE.Foto = profesional.Persona.Foto; //this.uc_AllShiftGrid1.profesional = profesional; //this.uc_AllShiftGrid1.Refresh(); uc_TimeLine1.Set_ProfesionalChanged(); } }
public override void Refresh() { using (WaitCursorHelper fr = new WaitCursorHelper(this)) { uc_Profesionales_Grid1.Refresh(); } base.Refresh(); }
public override void Refresh() { using (WaitCursorHelper w = new WaitCursorHelper(this)) { this.uc_event_view1.MedicalEventId = this.MedicalEventId; this.uc_event_view1.Populate(null); base.Refresh(); } }
public void AddContronToPannel(DevExpress.XtraEditors.PanelControl panel, Fwk.UI.Controls.Menu.Tree.MenuItem item, object obj) { using (WaitCursorHelper w = new WaitCursorHelper(_ParentForm)) { Xtra_UC_Base ctrl = null; Type T = null; try { T = Fwk.HelperFunctions.ReflectionFunctions.CreateType(item.AssemblyInfo); } catch (FileNotFoundException fe) { TechnicalException te = new Fwk.Exceptions.TechnicalException(String.Concat("No se puede cargar el user control por q falta el archivo ", fe.FileName, "\r\n o alguna dependencia")); throw te; } catch (System.TypeLoadException) { TechnicalException te = null; if (item.AssemblyInfo.Split(',').Count() == 2) { te = new Fwk.Exceptions.TechnicalException(String.Concat("No se puede cargar el user control [", item.AssemblyInfo.Split(',')[0], "] en el archivo ", item.AssemblyInfo.Split(',')[1])); } te = new Fwk.Exceptions.TechnicalException(String.Concat("No se puede cargar el user control definido en [", item.AssemblyInfo, "]")); throw te; } catch (Exception ex) { TechnicalException te = new TechnicalException(String.Concat("No se puede cargar el user control ", item.AssemblyInfo, " ", ex.Message)); throw te; } if (!controls.Contains(string.Concat(T.FullName, item.ID))) { ctrl = (Xtra_UC_Base)Fwk.HelperFunctions.ReflectionFunctions.CreateInstance(item.AssemblyInfo); ctrl.ParentPanel = panel; ctrl.Tag = item.Tag; ctrl.Key = item.ID.ToString(); panel.Controls.Add(ctrl); controls.Add(ctrl.Key); ctrl.Dock = System.Windows.Forms.DockStyle.Fill; ctrl.OnExitControlEvent += new ExitControlHandler(ctrl_OnExitControlEvent); ctrl.OnLunchUserControlEvent += ctrl_OnLunchUserControlEvent; ctrl.Populate(obj); } else { ctrl = GetControlFromPanel(string.Concat(T.FullName, item.ID), panel); } CurrentControl = ctrl; ctrl.BringToFront(); ctrl.Refresh(); } }
private void btnSaveChanges_Click(object sender, EventArgs e) { if (CurrentControl != null) { using (WaitCursorHelper c = new WaitCursorHelper(this)) { CurrentControl.AceptChanges(false); } } }
private void gridView1_MouseDown(object sender, MouseEventArgs e) { _HitInfo = gridView1.CalcHitInfo(new Point(e.X, e.Y)); _Event = ((MedicalEvent_ViewBE)gridView1.GetRow(_HitInfo.RowHandle)); if (_Event != null) { using (WaitCursorHelper w = new WaitCursorHelper(this)) { uc_docprontviewer_11.Pupulate(Create_Doc()); } } }
public void Populate(ConsultaBE filter) { using (WaitCursorHelper whait = new WaitCursorHelper(this)) { if (filter.GetType().Equals(typeof(ConsultaBE))) { _ConsultaGridList = Controller.SearchByParams(filter); } this.gridControl1.DataSource = _ConsultaGridList; this.gridControl1.Refresh(); } }
public void Populate() { ConsultaBE wConsultaBE = uC_FitroConsultaHorizontal1.GetFilter(); using (WaitCursorHelper whait = new WaitCursorHelper(this)) { _Rpt_Consulta_FullList = Controller.Search_Consulta_FullView_ByParams(wConsultaBE); this.pivotGridControl1.DataSource = _Rpt_Consulta_FullList; this.pivotGridControl1.Refresh(); } }
private void frmPatientAtencion_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5) { if (CurrentControl != null) { using (WaitCursorHelper c = new WaitCursorHelper(this)) { CurrentControl.Refresh(); } } } }
private void frmBase_Dialog_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F5) { using (WaitCursorHelper frm = new WaitCursorHelper(this)) { this.Refresh(); } } if (e.KeyCode == Keys.Escape) { this.Close(); } }
protected override void OnKeyDown(KeyEventArgs e) { base.OnKeyDown(e); if (e.KeyCode == Keys.F5) { using (WaitCursorHelper frm = new WaitCursorHelper(this)) { this.Refresh(); } } if (e.KeyCode == Keys.Escape) { DialogResult = DialogResult.Cancel; this.Close(); } }
private void showvalueEditor_handler(object ss, ShowValueEditorEventArgs ee) { using (WaitCursorHelper.NewWaitCursor()) { // be sere fc is created make_fc(); if (_ds.AttributesCache.ContainsKey(_fc.CurrentFieldName)) { foreach (CustomAttribute a in _ds.AttributesCache[_fc.CurrentFieldName]) { a.applyCustomEditShownFilterControl(_ds, ee); } } } }
private void aceptCancelButtonBar1_ClickOkCancelEvent(object sender, DialogResult result) { if (result == DialogResult.OK) { using (WaitCursorHelper waitn = new WaitCursorHelper(this)) { //Validamos el valor que devuelve AcceptForm para ver si debemos cerrar o no el Formulario de Login if (AcceptForm(false)) { this.Close(); } } } else { this.Close(); } }
public void Pupulate() { //box.LoadFile(FileName, RichTextBoxStreamType.RichText); try { template = Fwk.HelperFunctions.FileFunctions.OpenTextFile(this.FileName); } catch (Exception ex) { MessageBox.Show(ex.Message); } box.Rtf = Create_Doc(); link.CreateDocument(); using (WaitCursorHelper w = new WaitCursorHelper(this)) { printingSystem1.Graph.PageUnit = GraphicsUnit.Pixel; } }
private void aceptCancelButtonBar1_ClickOkCancelEvent(object sender, DialogResult result) { if (result == System.Windows.Forms.DialogResult.OK) { using (WaitCursorHelper waitn = new WaitCursorHelper(this)) { try { SecurityController.UserResetPassword(_userName, txtnewPassword.Text); } catch (Exception ex) { this.MessageViewer.Show(ex); } } } if (result == System.Windows.Forms.DialogResult.Cancel) { this.DialogResult = System.Windows.Forms.DialogResult.Cancel; } }
void RemoveControlFromPannel(Xtra_UC_Base ctrl) { if (ctrl != null) { ctrl.Exit(); if (this.panelControl1.Contains(ctrl)) { this.panelControl1.Controls.Remove(ctrl); controls.Remove(ctrl.Key); if (this.panelControl1.Controls.Count != 0) { using (WaitCursorHelper w = new WaitCursorHelper(this)) { btnClose.Visible = ctrl.ShowClose; btnSaveChanges.Visible = ctrl.ShowSave; ctrl = (Xtra_UC_Base)this.panelControl1.Controls[0]; ctrl.Refresh(); } } } } }
public DialogResult CheckCloseForm() { string str = string.Concat("Finalizar la atencion de ", ServiceCalls.CurrentPatient.Persona.ApellidoNombre, "?"); this.MessageViewer.Title = "AtenciĆ³n de pacientes"; this.MessageViewer.MessageBoxButtons = MessageBoxButtons.YesNo; this.MessageViewer.MessageBoxIcon = Fwk.UI.Common.MessageBoxIcon.Question; DialogResult res = this.MessageViewer.Show(str); this.SetMessageViewInfoDefault(); if (CurrentControl != null) { using (WaitCursorHelper c = new WaitCursorHelper(this)) { //al pasarle true en AceptChanges, no se llama metodo estatico PopulateAsync que es innecesario dado q cera cerrado este formulario CurrentControl.AceptChanges(true); } } return(res); }
public override void Populate(object filter) { if (this.DesignMode) { return; } using (WaitCursorHelper whait = new WaitCursorHelper(this)) { if (filter.GetType().Equals(typeof(ConsultaBE))) { _ConsultaGridList = Controller.SearchByParams(((ConsultaBE)filter)); } if (filter.GetType().Equals(typeof(DateTime))) { _ConsultaGridList = Controller.SearchByParams(((DateTime)filter)); } this.gridControl1.DataSource = _ConsultaGridList; this.gridControl1.Refresh(); } }
public void RemoveControlFromPannel(Xtra_UC_Base ctrl) { PanelControl panel = ctrl.ParentPanel; if (ctrl != null) { ctrl.Exit(); if (panel.Contains(ctrl)) { panel.Controls.Remove(ctrl); controls.Remove(ctrl.Key); if (panel.Controls.Count != 0) { using (WaitCursorHelper w = new WaitCursorHelper(ParentForm)) { ctrl = (Xtra_UC_Base)ctrl.ParentPanel.Controls[0]; ctrl.Refresh(); } } } } }
/// <summary> /// The DoOperation method begins the entire refactoring process. /// The launch point for the refactoring operation must call this method. /// overall flow /// 1) UI flows input into an instance of a derivation of this class ... (ctor) /// 2) The class may present its own UI (cancel) /// 3) It creates an ContributorInput object /// 4) Feeds it to the manager (or base class, depending on how you look at it) /// 5) Proposals returned /// 6) Merge proposals /// 7) Preview UI (optional)kind /// 8) Apply changes (or cancel or fail) /// </summary> public void DoOperation() { try { // If we don't have a ContributorInput yet, call OnGetContributorInput method to get ContributorInput for this operation. if (ContributorInput == null) { ContributorInput = OnGetContributorInput(); } if (ErrorOccurred || IsCancelled) { return; } if (ContributorInput == null) { // If not cancelled and contributorInput is null, throw exception. throw new InvalidOperationException(); } // Collect the list of files to change FileChanges = GetFileChanges(); using (var cursor = WaitCursorHelper.NewWaitCursor()) { if (HasPreviewWindow) { // Log names of files with error to event log OnBeforeShowPreviewWindow(); if (ErrorOccurred || IsCancelled) { return; } if (PreviewData.ChangeList == null || PreviewData.ChangeList.Count == 0) { if (System.Windows.MessageBox.Show( Resources.RefactoringOperation_NoChangesToPreview, Resources.RefactoringOperation_NoChangesToPreviewTitle, MessageBoxButton.OKCancel) == MessageBoxResult.OK) { ApplyChanges(); } } else { // After feed the preview window with PreviewChangesEngine, the engine will call back the ApplyChanges // method in this Operation if user clicks Apply button. ShowPreviewWindow(); } } else { // If no preview needed, apply the changes. ApplyChanges(); } } if (ErrorOccurred || IsCancelled) { return; } } catch (InvalidOperationException ex) { OnError(string.Format(CultureInfo.CurrentCulture, Resources.Error_FailedOperation, ex.Message)); } catch (OperationCanceledException ex) { var errorMessage = ex.Message; if (string.IsNullOrEmpty(errorMessage)) { errorMessage = Resources.Dialog_CancelRefactoring; } CancelOperation(); CommonVsUtilities.ShowMessageBoxEx( Resources.RefactorDialog_Title, errorMessage, MessageBoxButtons.OK, MessageBoxDefaultButton.Button1, MessageBoxIcon.Error); } finally { UnregisterEvents(); } }
protected override IList <FileChange> GetFileChanges() { var fileChangeMap = new Dictionary <string, FileChange>(); using (WaitCursorHelper.NewWaitCursor()) { var artifact = _contributorInput.ObjectToBeRenamed.Artifact; var artifactProjectItem = VsUtils.GetProjectItemForDocument(artifact.Uri.LocalPath, Services.ServiceProvider); if (artifactProjectItem != null) { // Run the custom tool to ensure the generated code is up-to-date VsUtils.RunCustomTool(artifactProjectItem); var generatedCodeProjectItem = VsUtils.GetGeneratedCodeProjectItem(artifactProjectItem); if (generatedCodeProjectItem != null) { var generatedItemPath = generatedCodeProjectItem.get_FileNames(1); var objectSearchLanguage = FileExtensions.VbExt.Equals( Path.GetExtension(generatedItemPath), StringComparison.OrdinalIgnoreCase) ? ObjectSearchLanguage.VB : ObjectSearchLanguage.CSharp; var codeElements = generatedCodeProjectItem.FileCodeModel.CodeElements.OfType <CodeElement2>(); CodeElementRenameData renameData = null; // Check if we're refactoring an EntityType or Property var entityType = _contributorInput.ObjectToBeRenamed as EntityType; var property = _contributorInput.ObjectToBeRenamed as Property; if (entityType != null) { var newEntitySetName = _contributorInput.NewName; var pluralize = ModelHelper.GetDesignerPropertyValueFromArtifactAsBool( OptionsDesignerInfo.ElementName, OptionsDesignerInfo.AttributeEnablePluralization, OptionsDesignerInfo.EnablePluralizationDefault, artifact); // Pluralize the entity set name if the setting it turned on if (pluralize) { var pluralizationService = DependencyResolver.GetService <IPluralizationService>(); newEntitySetName = pluralizationService.Pluralize(_contributorInput.NewName); } renameData = new CodeElementRenameData( _contributorInput.NewName, newEntitySetName, _contributorInput.OldName, entityType.EntitySet.Name.Value); } else if (property != null) { if (property.EntityType != null) { renameData = new CodeElementRenameData( _contributorInput.NewName, _contributorInput.OldName, property.EntityType.Name.Value); } } if (renameData != null) { var codeElementsToRename = new Dictionary <CodeElement2, Tuple <string, string> >(); CodeElementUtilities.FindRootCodeElementsToRename( codeElements, renameData, generatedItemPath, objectSearchLanguage, ref codeElementsToRename); var changeProposals = new List <ChangeProposal>(); // We may need to rename more than one object, as type names affect functions and entity set properties. This means we need to loop through and // process each root item change in the generated code designer file. foreach (var codeElementToRename in codeElementsToRename.Keys) { var nameTuple = codeElementsToRename[codeElementToRename]; CodeElementUtilities.CreateChangeProposals( codeElementToRename, nameTuple.Item1, nameTuple.Item2, generatedItemPath, changeProposals, objectSearchLanguage); } // Now sort the change proposals by filename so that we can return a list of file changes foreach (var changeProposal in changeProposals) { FileChange fileChange; HashSet <ChangeProposal> fileChangeProposals; if (fileChangeMap.TryGetValue(changeProposal.FileName, out fileChange)) { fileChangeProposals = fileChange.ChangeList.Values.First(); } else { fileChange = new FileChange(changeProposal.FileName); fileChangeProposals = new HashSet <ChangeProposal>(); fileChange.ChangeList.Add( new KeyValuePair <RefactoringPreviewGroup, HashSet <ChangeProposal> >( new RefactoringPreviewGroup(Resources.RefactorPreviewGroupName), fileChangeProposals)); fileChangeMap.Add(changeProposal.FileName, fileChange); } if (!fileChangeProposals.Contains(changeProposal)) { fileChangeProposals.Add(changeProposal); } } } } } } return(fileChangeMap.Values.ToList()); }