Пример #1
0
        private void objectListView_ButtonClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            var obj = (CreatureColorViewObject)e.Model;

            if (e.Column == olvColumnEdit)
            {
                var editForm = new FormEditCreatureColorDialog()
                {
                    Id          = obj.Id,
                    Color       = obj.Color,
                    WurmLogText = obj.WurmLogText,
                    DisplayName = obj.DisplayName
                };
                if (editForm.ShowDialog() == DialogResult.OK)
                {
                    creatureColorDefinitions.UpdateColor(obj.Id, editForm.Color);
                    creatureColorDefinitions.UpdateWurmLogText(obj.Id, editForm.WurmLogText);
                    creatureColorDefinitions.UpdateDisplayName(obj.Id, editForm.DisplayName);
                    RefreshView();
                }
            }
            else if (e.Column == olvColumnRemove)
            {
                if (MessageBox.Show("Removing this color will reset it on all creatures using it. Continue?",
                                    "Warning",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Asterisk) == DialogResult.Yes)
                {
                    creatureColorDefinitions.Remove(obj.Id);
                    RefreshView();
                }
            }
        }
Пример #2
0
 protected virtual void OnCellClick(CellClickEventArgs args)
 {
     if (this.CellClick != null)
     {
         this.CellClick(this, args);
     }
 }
Пример #3
0
        private void treeListFiles_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            if (!(e.Model is FileViewModel fileViewModel))
            {
                return;
            }

            EventBus.Bus.GetEvent <OpenLogFile>().Publish(fileViewModel.LogFile);
        }
Пример #4
0
        private void MessagesListView_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            MessageViewRichTextBox.Clear();
            GMail selectedMail = (GMail)MessagesListView.SelectedObject;

            MessageViewRichTextBox.Text = selectedMail.Body;
            BodyHeaderRichTextBox.Text  = "\n" + selectedMail.From + "   -   " + selectedMail.Subject + "   -   " + selectedMail.Date;
            BodyWebBrowser.DocumentText = selectedMail.HTMLBody;
        }
Пример #5
0
        private void ObjectListView1_ButtonClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            var entry = e.Item.RowObject as ReleaseEntry;

            if (entry != null)
            {
                InstallAsync(entry);
            }
        }
		void tree_CellClick(object sender, CellClickEventArgs e) {
			if (e.RowIndex == -1) return;
			this.syncSymbolAndDataSourceSelectedFromRowIndexClicked(e.RowIndex);
			if (this.SymbolSelected != null) {
				this.RaiseOnSymbolSelected();
			} else {
				this.RaiseOnDataSourceSelected();
			}
		}
		void treeListView_CellClick(object sender, CellClickEventArgs e) {
			if (e.RowIndex == -1) return;
			this.syncFolderStrategySelectedFromRowIndexClicked(e.RowIndex);
			if (this.StrategySelected != null) {
				this.RaiseOnStrategySelected();
			} else {
				this.RaiseOnFolderSelected();
			}
//			???this.Tree.SelectObject(folderOrStrategy);
		}
Пример #8
0
 internal void fOlvCustomers_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         Thread _thread = new Thread(() =>
         {
             CustomerForm customerForm = new CustomerForm(((Customer)e.Model).ID, sqlBuilder);
             Application.Run(customerForm);
         });
         _thread.SetApartmentState(ApartmentState.STA);
         _thread.Start();
     }
 }
Пример #9
0
 private void OnCellClick(object sender, CellClickEventArgs e)
 {
     if(e.ClickCount != 2)
     {
         return;
     }
     var col = e.Column as DiffColumn;
     if( col == null)
     {
         return;
     }
     var clrDumpType = SelectedTypeInstancesAddressList(col.ClrDump);
     TypeInstancesModule.Create(clrDumpType, this, mod => RequestDockModule(mod));
 }
Пример #10
0
        private void LabelsListView_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            MessagesListView.ClearObjects();
            string selectedLabelId = LabelsListView.SelectedItem.Text;
            IList <Google.Apis.Gmail.v1.Data.Message> currentLabelMessages = gmmailAPIhandler.ListMessages(selectedLabelId);
            IDictionary <string, GMail> extractedMails = GMail.CreateGmailMessage(currentLabelMessages, gmmailAPIhandler);
            List <GMail> mailList = new List <GMail>();

            foreach (KeyValuePair <string, GMail> mail in extractedMails)
            {
                mailList.Add(mail.Value);
            }
            MessagesListView.SetObjects(mailList);
        }
Пример #11
0
 private void objList_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
 {
     if (e.Column == null || e.Column.AspectName != "Name")
     {
         return;
     }
     if (e.HitTest.HitTestLocation == HitTestLocation.Image)
     {
         frmCFL cfl = new frmCFL(objList.BOID);
         cfl.ReturnProc = KeyWordRetProc;
         cfl.MdiParent  = this.MdiParent;
         cfl.Show();
         e.Handled = true;
     }
 }
Пример #12
0
        private void LVLocations_ButtonClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            var location = e.Model as LocationForDisplay;

            if (location == null)
            {
                return;
            }
            var device = CbxDevices.SelectedItem as Device;

            if (device == null)
            {
                return;
            }
            LocationPersistence.Run(device.Id, location.TitleId);
        }
Пример #13
0
 private void objectListView1_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
 {
     if (e.ColumnIndex == 0)
     {
         Task ntask = (Task)this.objectListView1.GetModelObject(e.RowIndex);
         if (ntask.Status == Task.STATUS_TYPES.PENDING)
         {
             ntask.Status = Task.STATUS_TYPES.COMPLETED;
         }
         else if (ntask.Status == Task.STATUS_TYPES.COMPLETED)
         {
             ntask.Status = Task.STATUS_TYPES.PENDING;
         }
         this.objectListView1.RefreshObject(ntask);
         RefreshList();
     }
 }
Пример #14
0
 private void OnCellClick(object sender, CellClickEventArgs e)
 {
     if( e.ClickCount == 2 && e.Model != null)
     {
         var arrayInstance = dlvArrays.SelectedObject<ArrayInstanceInformation>();
         if (arrayInstance != null)
         {
             var address = arrayInstance.Address;
             var type = ClrDump.GetObjectType(address);
             if (type == null)
             {
                 Log($"Can't find type for instance: {address:X}", LogLevelType.Error);
                 return;
             }
             var clrDumpObject = new ClrDumpObject(ClrDump, type, address);
             InstanceDetailsCommand.Display(this, clrDumpObject);
         }
     }
 }
Пример #15
0
        private void objList_CellClick(object sender, CellClickEventArgs e)
        {
            if (e.Column == null)
                return;

            if(e.HitTest.RowIndex == objList.Items.Count - 1 && e.ColumnIndex != 1 && e.ColumnIndex != 0)
            {
                CountryMD cty = (CountryMD)e.HitTest.RowObject;
                if (string.IsNullOrWhiteSpace(cty.Name))
                {
                    GetStatusBar().DisplayMessage(MessageType.Error, "国家名字不能为空!");
                    objList.EditSubItem(objList.GetItem(e.RowIndex), 1);
                    return;
                }
            }
            if(e.ColumnIndex==1 && e.HitTest.HitTestLocation == HitTestLocation.Image)
            {
                frmCFL cfl = new frmCFL(objList.BOID);
                cfl.ReturnProc = CountryRetProc;
                cfl.MdiParent = this.MdiParent;
                cfl.Show();
            }
            
        }
Пример #16
0
        //----------------------------------------------------------------------------------------------------

        private void ShowStatusMenu(CellClickEventArgs e)
        {
            ContextMenuStrip menu = new ContextMenuStrip();
            for (int i = 0; i < (int)ENodeStatus.COUNT; i++)
            {
                ENodeStatus status = (ENodeStatus)i;
                Utils.AddMenuItem(menu, status.Tag(), delegate()
                {
                    ChangeState(new Node[]{(Node)e.Item.RowObject}, status);
                });
            }
            ShowCellComboBox(menu, e);
        }
Пример #17
0
 private void ShowCellComboBox(ContextMenuStrip menu, CellClickEventArgs e)
 {
     menu.Items[0].Select();
     int X = 0;
     for (int i = 0; i <= e.ColumnIndex - 1; i++)
         X += e.ListView.Columns[i].Width;
     menu.Show(e.ListView, new Point(X, e.Item.Position.Y));
 }
Пример #18
0
        void olvDQERuns_ButtonClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            var c = (Catalogue)e.Model;

            new ExecuteCommandRunDQEOnCatalogue(Activator).SetTarget(c).Execute();
        }
Пример #19
0
        private void tvConnections_NodeMouseSingleClick(object sender, CellClickEventArgs e)
        {
            try
            {
                if (e.ClickCount > 1) return;
                var clickedNode = e.Model as ConnectionInfo;

                if (clickedNode == null) return;
                if (clickedNode.GetTreeNodeType() != TreeNodeType.Connection && clickedNode.GetTreeNodeType() != TreeNodeType.PuttySession) return;
                if (Settings.Default.SingleClickOnConnectionOpensIt)
                    ConnectionInitiator.OpenConnection(SelectedNode);

                if (Settings.Default.SingleClickSwitchesToOpenConnection)
                    ConnectionInitiator.SwitchToOpenConnection(SelectedNode);
            }
            catch (Exception ex)
            {
                Runtime.MessageCollector.AddExceptionStackTrace("tvConnections_NodeMouseClick (UI.Window.ConnectionTreeWindow) failed", ex);
            }
        }
Пример #20
0
            private void TreeView_CellClick(object sender, CellClickEventArgs e)
            {
                if (e.Item == null)
                    return;

                Node node = (Node)e.Item.RowObject;

                switch (e.Column.AspectName)
                {
                    case "processName":
                        if (node.preferAction != EAction.NONE)
                        {
                            node.process = !node.process;
                            ApplyChanges(node);
                        }
                        break;

                    case "preferActionName":
                        DoPreferAction(node);
                        return;
                }

                if (e.Item.RowObject != e.ListView.Tag)
                    return;

                if (node.type != ENodeType.TASK)
                    return;

                switch (e.Column.AspectName)
                {
                    case "name":
                        break;

                    case "responsibleName":
                        ShowUserSelectMenu(e, false);
                        break;

                    case "checkerName":
                        ShowUserSelectMenu(e, true);
                        break;

                    case "statusName":
                        ShowStatusMenu(e);
                        break;
                }
            }
Пример #21
0
 private void problemListView_CellClick(object sender, CellClickEventArgs e)
 {
     showProblem();
 }
Пример #22
0
 private void filterCtrl_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
 {
 }
Пример #23
0
        /// <summary>
        /// Check to see if we need to start editing a cell
        /// </summary>
        /// <param name="e"></param>
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);

            if (!this.Created)
                return;

            if (e.Button == MouseButtons.Right) {
                this.OnRightMouseUp(e);
                return;
            }

            // What event should we listen for to start cell editing?
            // ------------------------------------------------------
            //
            // We can't use OnMouseClick, OnMouseDoubleClick, OnClick, or OnDoubleClick
            // since they are not triggered for clicks on subitems without Full Row Select.
            //
            // We could use OnMouseDown, but selecting rows is done in OnMouseUp. This means
            // that if we start the editing during OnMouseDown, the editor will automatically
            // lose focus when mouse up happens.
            //

            // Tell the world about a cell click. If someone handles it, don't do anything else
            CellClickEventArgs args = new CellClickEventArgs();
            this.BuildCellEvent(args, e.Location);
            args.ClickCount = this.lastMouseDownClickCount;
            this.OnCellClick(args);
            if (args.Handled)
                return;

            // Did the user click a hyperlink?
            if (this.UseHyperlinks &&
                args.HitTest.HitTestLocation == HitTestLocation.Text &&
                args.SubItem != null &&
                !String.IsNullOrEmpty(args.SubItem.Url)) {
                // We have to delay the running of this process otherwise we can generate
                // a series of MouseUp events (don't ask me why)
                this.BeginInvoke((MethodInvoker)delegate { ProcessHyperlinkClicked(args); });
            }

            // No one handled it so check to see if we should start editing.
            // We only start the edit if the user clicked on the image or text.
            if (this.ShouldStartCellEdit(e) &&
                args.HitTest.HitTestLocation != HitTestLocation.Nothing) {

                // We don't edit the primary column by single clicks -- only subitems.
                if (this.CellEditActivation != CellEditActivateMode.SingleClick || args.ColumnIndex > 0)
                    this.EditSubItem(args.Item, args.ColumnIndex);
            }
        }
        //  CAPTURO EVENTO CLICK CON LA CELDA QUE A CLICKADO Y SI ES LA COLUMNA LIKE
        //  OBTENGO EL OBJETO Y LE SUMO 1 LIKE
        private async void objectListView1_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            datos.Clear();
            if (e.Column == Column7)
            {
                if (listaAMostrar.Equals("enlaces"))
                {
                    Enlaces enlace = (Enlaces)e.Model;
                    Dictionary <string, string> datos = new Dictionary <string, string>();
                    datos.Add("id", enlace.id);
                    datos.Add("credenciales", UsuarioConectado.credenciales);
                    int estadoCorrecto = await mfc.cambiarActivoRevisionDesactivo(UsuarioConectado.nombre, datos);

                    if (estadoCorrecto != -1)
                    {
                        enlace.reportarFallo = estadoCorrecto;
                        objectListView1.RefreshObject(enlace);
                    }
                    else
                    {
                        MsgBox.Show("Ha ocurrido un error al actualizar la Base de datos", "ATENCIÓN", MsgBox.Buttons.OK, MsgBox.Icon.Error, MsgBox.AnimateStyle.FadeIn);
                    }
                }
            }
            else if (e.Column == Column6)
            {
                if (listaAMostrar.Equals("usuarios"))
                {
                    Usuario usuario = (Usuario)e.Model;
                    if (usuario.Credenciales.Equals("admin") && !UsuarioConectado.nombre.Equals("admin"))
                    {
                    }
                    else
                    {
                        bool   cambiar = false;
                        string newRango;
                        if (usuario.Credenciales.Equals("normal"))
                        {
                            newRango = "admin";
                        }
                        else
                        {
                            newRango = "normal";
                        }

                        datos.Add("id", usuario.Id);
                        datos.Add("nombre", usuario.Nombre);
                        datos.Add("newRango", newRango);

                        if (UsuarioConectado.nombre.Equals("admin"))
                        {
                            cambiar = true;
                        }
                        else
                        {
                            DialogResult respuesta = MsgBox.Show("¿Está seguro de que desea conceder privilegios de Admin al usuario " + usuario.User +
                                                                 "? Una vez tenga privilegios de Admin no podrá quitarselos usted, tendrá que mandar un correo al administrador para que los quite.", "Conceder privilegios", MsgBox.Buttons.YesNo, MsgBox.Icon.Question, MsgBox.AnimateStyle.FadeIn);
                            if (respuesta == DialogResult.Yes)
                            {
                                cambiar = true;
                            }
                        }
                        if (cambiar)
                        {
                            if (await mfa.cambiarRango(UsuarioConectado.nombre, datos))
                            {
                                usuario.Credenciales = newRango;
                                objectListView1.RefreshObject(usuario);
                            }
                            else
                            {
                                MsgBox.Show("Ha ocurrido un error al actualizar la Base de datos", "ATENCIÓN", MsgBox.Buttons.OK, MsgBox.Icon.Error, MsgBox.AnimateStyle.FadeIn);
                            }
                        }
                    }
                }
            }
            else if (e.Column == Column8)
            {
                if (listaAMostrar.Equals("enlaces"))
                {
                    Enlaces enlace = (Enlaces)e.Model;

                    DialogResult respuesta = MsgBox.Show("¿Está seguro de que desea eliminar el enlace con id " + enlace.id + "?", "Eliminar", MsgBox.Buttons.YesNo, MsgBox.Icon.Question, MsgBox.AnimateStyle.FadeIn);

                    if (respuesta == DialogResult.Yes)
                    {
                        Dictionary <string, string> datos = new Dictionary <string, string>();
                        datos.Add("id", enlace.id);

                        bool correcto = await mfa.borrarEnlace(UsuarioConectado.nombre, datos);

                        if (correcto)
                        {
                            objectListView1.RemoveObject(enlace);
                            objectListView1.BuildList();
                        }
                        else
                        {
                            MsgBox.Show("Ha ocurrido un error al borrar el enlace", "Error al borrar", MsgBox.Buttons.OK, MsgBox.Icon.Error, MsgBox.AnimateStyle.FadeIn);
                        }
                    }
                }
                else
                {
                    Usuario usuario = (Usuario)e.Model;
                    if (usuario.Credenciales.Equals("admin") && !UsuarioConectado.nombre.Equals("admin"))
                    {
                    }
                    else
                    {
                        DialogResult respuesta = MsgBox.Show("¿Está seguro de que desea eliminar al usuario " + usuario.User + "?", "Eliminar", MsgBox.Buttons.YesNo, MsgBox.Icon.Question, MsgBox.AnimateStyle.FadeIn);

                        if (respuesta == DialogResult.Yes)
                        {
                            Dictionary <string, string> datos = new Dictionary <string, string>();
                            datos.Add("credenciales", UsuarioConectado.credenciales);
                            datos.Add("idBorrar", usuario.Id);
                            bool correcto = await mfa.borrarUsuario(UsuarioConectado.nombre, datos);

                            if (correcto)
                            {
                                objectListView1.RemoveObject(usuario);
                                objectListView1.BuildList();
                            }
                            else
                            {
                                MsgBox.Show("Ha ocurrido un error al borrar al Usuario", "Error al borrar", MsgBox.Buttons.OK, MsgBox.Icon.Error, MsgBox.AnimateStyle.FadeIn);
                            }
                        }
                    }
                }
            }
        }
Пример #25
0
 private void objList_CellClick(object sender, CellClickEventArgs e)
 {
     CountryMD cty = (CountryMD)e.HitTest.RowObject;
     if (cty != null && e.HitTest.ColumnIndex != 1 && string.IsNullOrWhiteSpace(cty.Name))
     {
         GetStatusBar().DisplayMessage(MessageType.Error, "国家名字不能为空!");
         objList.EditSubItem(objList.GetItem(e.RowIndex), 1);
     }
 }
 private async void objUpdates_CellClick(object sender, CellClickEventArgs e)
 {
     if ((e.ColumnIndex == olvUpdateDown.Index) && (objUpdates.SelectedIndex == e.RowIndex))
     {
         Episode ep=(Episode)objUpdates.SelectedObject;
         AddDownloadEpisode(ep);
     }
     else if ((e.ColumnIndex == olvUpdateFollow.Index) && (objUpdates.SelectedIndex == e.RowIndex) &&
              (!_follow_start))
     {
         Episode ep = (Episode) objUpdates.SelectedObject;
         Show sel = null;
         foreach (Show s in objShows.Objects)
         {
             if (s.Id == ep.ShowId)
             {
                 sel = s;
                 break;
             }
         }
         if (sel != null)
         {
             if (Follows.Instance.IsFollow(sel.Id, sel.PluginName))
             {
                 DeleteFollow(sel);
             }
             else
             {
                 _follow_start = true;
                 Episodes result = await DownloadPluginHandler.Instance.Episodes(sel.PluginName, sel);
                 if (result.Status == ResponseStatus.Ok)
                 {
                     if (result.Items.Count > 0 &&
                         result.Items[0].ShowId == sel.Id)
                     {
                         FollowRequester(sel, result);
                     }
                 }
                 _follow_start = false;
             }
             RefreshStatus(ep.ShowId,ep.PluginName);
         }
     }
 }
Пример #27
0
        private void olvApartments_CellClick(object sender, CellClickEventArgs e)
        {
            OLVColumn col = e.Column;
            //?? e.ListView.GetColumn(3);
            if (e.Model != null)
            {
                string stringValue = col.GetStringValue(e.Model);

                // Open Ad
                if (col.Index == 3)
                {
                    string url = ((RentedApartment)(e.Model)).AdUrl;
                    Process.Start( url);
                } // Open user Ads
                else if (col.Index == 1)
                {
                    string url = ((RentedApartment)(e.Model)).AdOwnerUserUrl;
                    Process.Start(url);
                }
            }
        }
        private void objEpisode_CellClick(object sender, CellClickEventArgs e)
        {
            if ((e.ColumnIndex == olvDownloadBut.Index) && (objEpisode.SelectedIndex == e.RowIndex) )
            {
                Episode ep = (Episode)objEpisode.SelectedObject;
                AddDownloadEpisode(ep);
                objEpisode.RefreshObject(objEpisode.SelectedObject);

            }
        }
Пример #29
0
 private void histListview_CellClick(object sender, CellClickEventArgs e)
 {
     var z = (Trade)histListview.GetSelectedObject();
     Debug.WriteLine(z.Position);
 }
 private void objShows_CellClick(object sender, CellClickEventArgs e)
 {
     if ((e.ColumnIndex == olvDownAll.Index) && (objShows.SelectedIndex == e.RowIndex))
     {
         ADBaseLibrary.Show s = (Show)objShows.SelectedObject;
         if (_selected_episodes != null && _selected_episodes.Items.Count > 0 && _selected_episodes.Items[0].ShowId == s.Id)
         {
             MultiSelect m = new MultiSelect(false, s.Name);
             m.FileFormats = Settings.Instance.DefaultFormat;
             m.FileQuality = Settings.Instance.DefaultQuality;
             m.Episodes = _selected_episodes;
             DialogResult f = m.ShowDialog();
             if (f == DialogResult.OK)
             {
                 foreach (Episode ep in m.Active)
                 {
                     AddDownloadEpisode(ep, m.FileQuality, m.FileFormats);
                 }
             }
         }
     }
     else if ((e.ColumnIndex == olvFollow.Index) && (objShows.SelectedIndex == e.RowIndex))
     {
         ADBaseLibrary.Show s = (Show) objShows.SelectedObject;
         if (Follows.Instance.IsFollow(s.Id, s.PluginName))
         {
             DeleteFollow(s);
         }
         else
         {
             if (_selected_episodes != null && _selected_episodes.Items.Count > 0 &&
                 _selected_episodes.Items[0].ShowId == s.Id)
             {
                 FollowRequester(s, _selected_episodes);
             }
         }
         RefreshStatus(s.Id,s.PluginName);
     }
 }
Пример #31
0
 private void objList_CellClick(object sender, CellClickEventArgs e)
 {
     ProductGroupMD pg = (ProductGroupMD)e.HitTest.RowObject;
     if (pg!=null && !(e.HitTest.ColumnIndex == 1 || e.HitTest.ColumnIndex == 0) && string.IsNullOrWhiteSpace(pg.Name))
     {
         GetStatusBar().DisplayMessage(MessageType.Error, "分组名称不能为空!");
         objList.EditSubItem(objList.GetItem(e.RowIndex), 1);
     }
 }
Пример #32
0
 private void PokemonListButton_Click(object sender, CellClickEventArgs e)
 {
     try
     {
         PokemonData pokemon = (PokemonData)e.Model;
         if (e.ColumnIndex == 6)
         {
             TransferPokemon(pokemon);
         }
         else if (e.ColumnIndex == 7)
         {
             PowerUpPokemon(pokemon);
         }
         else if (e.ColumnIndex == 8)
         {
             EvolvePokemon(pokemon);
         }
     }
     catch (Exception ex) { ColoredConsoleWrite(Color.Red, ex.ToString()); client2 = null; ReloadPokemonList(); }
 }
Пример #33
0
 private void list_CellClick(object sender, CellClickEventArgs e) {
     //on_mouse_click();
 }
Пример #34
0
        private void objectListView2_CellClick(object sender, CellClickEventArgs e)
        {
            if (objectListView2.SelectedObject != null)
            {
                if (objectListView2.Tag == null || objectListView2.SelectedObject != objectListView2.Tag)
                {
                    objectListView1.Tag = null;
                    objectListView1.SelectedObject = null;                                  // jdg 8/12/15
                    DocumentTemplate dt = (DocumentTemplate)objectListView2.SelectedObject;

                    if (string.IsNullOrEmpty(dt.htmlPath))
                    {
                        if (!string.IsNullOrEmpty(dt.documentFileName))
                        {
                            webBrowser1.DocumentText = "Preview is not available for Word documents";
                        }
                    }
                    else
                    {
                        dt.SetPatient(SessionManager.Instance.GetActivePatient());
                        dt.OpenHTML();
                        webBrowser1.DocumentText = dt.htmlText;
                        objectListView2.Tag = objectListView2.SelectedObject;
                        groupBox1.Text = "Preview - " + dt.documentName;
                        splitContainer2.Enabled = false;
                        backgroundWorker1.RunWorkerAsync(dt);
                    }
                }
            }
        }
        private void Params_CellClick(object sender, CellClickEventArgs e)
        {
            // Only process the Description column
            if (e.RowIndex == -1 || startup || e.ColumnIndex != 4)
                return;

            try
            {
                string descStr = e.SubItem.ModelValue.ToString();
                ConfigRawParams.CheckForUrlAndLaunchInBrowser(descStr);
            }
            catch { }
        }
Пример #36
0
        //  CAPTURO EVENTO CLICK CON LA CELDA QUE A CLICKADO Y SI ES LA COLUMNA LIKE
        //  OBTENGO EL OBJETO Y LE SUMO 1 LIKE
        private async void listadoEnlaces_CellClick(object sender, BrightIdeasSoftware.CellClickEventArgs e)
        {
            if (e.Column == columnaLike)
            {
                if (UsuarioConectado.credenciales.Equals("invitado"))
                {
                    MsgBox.Show("Estas funciones solo estan disponibles para usuarios registrados, por favor regístrate o logueate para disfrutar de estas ventajas", "Funciones solo para usuarios", MsgBox.Buttons.OK, MsgBox.Icon.Error, MsgBox.AnimateStyle.FadeIn);
                }
                else
                {
                    Enlaces enlace = (Enlaces)e.Model;
                    if (!enlace.like && !enlace.dontLike)
                    {
                        //Object linkSeleccionado = objectListView1.SelectedObject;
                        Dictionary <string, string> datos = new Dictionary <string, string>();
                        datos.Add("id", enlace.id);
                        datos.Add("operacion", "sumar");
                        string likeCorrecto = await m.sumarYRestarValoracion(UsuarioConectado.nombre, datos);

                        if (likeCorrecto.Equals("true"))
                        {
                            enlace.like = true;
                            listadoEnlaces.RefreshObject(enlace);
                        }
                        else
                        {
                            //¿¿MENSAJE??
                        }
                    }
                }
            }
            else if (e.Column == columnaDontLike)
            {
                if (UsuarioConectado.credenciales.Equals("invitado"))
                {
                    MsgBox.Show("Estas funciones solo estan disponibles para usuarios registrados, por favor regístrate o logueate para disfrutar de estas ventajas", "Funciones solo para usuarios", MsgBox.Buttons.OK, MsgBox.Icon.Error, MsgBox.AnimateStyle.FadeIn);
                }
                else
                {
                    Enlaces enlace = (Enlaces)e.Model;
                    if (!enlace.dontLike && !enlace.like)
                    {
                        Dictionary <string, string> datos = new Dictionary <string, string>();
                        datos.Add("id", enlace.id);
                        datos.Add("operacion", "restar");

                        string dontlikeCorrecto = await m.sumarYRestarValoracion(UsuarioConectado.nombre, datos);

                        if (dontlikeCorrecto.Equals("true"))
                        {
                            enlace.dontLike = true;
                            listadoEnlaces.RefreshObject(enlace);
                        }
                        else
                        {
                            //¿¿MENSAJE??
                        }
                    }
                }
            }
            else if (e.Column == columnaReportarFallo)
            {
                if (UsuarioConectado.credenciales.Equals("invitado"))
                {
                    MsgBox.Show("Estas funciones solo estan disponibles para usuarios registrados, por favor regístrate o logueate para disfrutar de estas ventajas", "Funciones solo para usuarios", MsgBox.Buttons.OK, MsgBox.Icon.Error, MsgBox.AnimateStyle.FadeIn);
                }
                else
                {
                    Enlaces enlace = (Enlaces)e.Model;
                    if (enlace.reportarFallo == 1)
                    {
                        DialogResult respuesta = MsgBox.Show("¿Seguro que quieres reportar que el link esta caído?", "Reportar link",
                                                             MsgBox.Buttons.YesNo, MsgBox.Icon.Question, MsgBox.AnimateStyle.FadeIn);


                        if (respuesta == DialogResult.Yes)
                        {
                            Dictionary <string, string> datos = new Dictionary <string, string>();
                            datos.Add("id", enlace.id);
                            datos.Add("credenciales", UsuarioConectado.credenciales);
                            int estadoCorrecto = await m.cambiarActivoRevisionDesactivo(UsuarioConectado.nombre, datos);

                            if (estadoCorrecto != -1)
                            {
                                enlace.reportarFallo = estadoCorrecto;
                                listadoEnlaces.RefreshObject(enlace);
                            }
                            else
                            {
                                //¿¿MENSAJE??
                            }
                        }
                    }
                }
            }
        }
Пример #37
0
        private void tvConnections_NodeMouseDoubleClick(object sender, CellClickEventArgs e)
        {
            if (e.ClickCount < 2) return;
            var clickedNodeAsContainer = e.Model as ContainerInfo;
            if (clickedNodeAsContainer != null)
            {
                olvConnections.ToggleExpansion(clickedNodeAsContainer);
            }

            var clickedNode = e.Model as ConnectionInfo;
            if (clickedNode?.GetTreeNodeType() == TreeNodeType.Connection |
                clickedNode?.GetTreeNodeType() == TreeNodeType.PuttySession)
            {
                ConnectionInitiator.OpenConnection(SelectedNode);
            }
        }
Пример #38
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="args"></param>
 protected virtual void OnCellClick(CellClickEventArgs args) {
     if (this.CellClick != null)
         this.CellClick(this, args);
 }
Пример #39
0
 //tag expand/collapse by clicking on icon
 private void tree_CellClick(object sender, CellClickEventArgs e)
 {
     if (e.Location.X < 16) {
     if (e.Model is TagItem) tree.ToggleExpansion(e.Model);
       }
 }
Пример #40
0
 /// <summary>
 /// Tell the world that a hyperlink was clicked and if the event isn't handled,
 /// do the default processing.
 /// </summary>
 /// <param name="e"></param>
 protected virtual void ProcessHyperlinkClicked(CellClickEventArgs e)
 {
     HyperlinkClickedEventArgs args = new HyperlinkClickedEventArgs();
     args.HitTest = e.HitTest;
     args.ListView = this;
     args.Location = new Point(-1, -1);
     args.Item = e.Item;
     args.SubItem = e.SubItem;
     args.Model = e.Model;
     args.ColumnIndex = e.ColumnIndex;
     args.Column = e.Column;
     args.RowIndex = e.RowIndex;
     args.ModifierKeys = Control.ModifierKeys;
     args.Url = e.SubItem.Url;
     this.OnHyperlinkClicked(args);
     if (!args.Handled) {
         this.StandardHyperlinkClickedProcessing(args);
     }
 }
Пример #41
0
 private void activitiyListView_CellClick(object sender, CellClickEventArgs e)
 {
     // stop button clicked
     if (e.Column == stopColumn && e.HitTest.HitTestLocation == HitTestLocation.Image)
     {
         StopActionEvent();
     }
 }