public GDMRecord GetSelectedRecordEx() { GDMRecordType recType = GetSelectedRecordType(); IListView rView = GetRecordsViewByType(recType); return((rView == null) ? null : (rView.GetSelectedData() as GDMRecord)); }
public ListControlPresenter(IListView listView, FileSystem fileSystem) { this.listView = listView; this.fileSystem = fileSystem; SubscribeToViewEvents(); }
public static void FillShopsLV(IListView listView, IModel model) { try { listView.Clear(); listView.AddColumn(Localizer.LS(LSID.Name), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Address), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Telephone), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.WebSite), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Email), 120, true, BSDTypes.HorizontalAlignment.Left); var records = model.QueryShops(); foreach (Shop rec in records) { var item = listView.AddItem(rec, rec.Name, rec.Address, rec.Telephone, rec.WebSite, rec.Email ); } listView.Sort(0, BSDTypes.SortOrder.Ascending); } catch (Exception ex) { fLogger.WriteError("FillShopsLV()", ex); } }
public static void FillScheduleLV(IListView listView, IModel model) { try { listView.Clear(); listView.AddColumn(Localizer.LS(LSID.Aquarium), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Date), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Event), 100, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Reminder), 80, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Type), 80, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Status), 80, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Note), 250, true, BSDTypes.HorizontalAlignment.Left); var records = model.QuerySchedule(); foreach (Schedule rec in records) { Aquarium aqm = model.GetRecord <Aquarium>(rec.AquariumId); string aqmName = (aqm == null) ? "" : aqm.Name; string strType = Localizer.LS(ALData.ScheduleTypes[(int)rec.Type]); string strStatus = Localizer.LS(ALData.TaskStatuses[(int)rec.Status]); var item = listView.AddItem(rec, aqmName, ALCore.GetTimeStr(rec.Timestamp), rec.Event, rec.Reminder.ToString(), strType, strStatus, rec.Note ); } } catch (Exception ex) { fLogger.WriteError("FillScheduleLV()", ex); } }
public static void FillNotesLV(IListView listView, IModel model) { try { listView.Clear(); listView.AddColumn(Localizer.LS(LSID.Aquarium), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Date), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Event), 100, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Text), 250, true, BSDTypes.HorizontalAlignment.Left); var records = model.QueryNotes(); foreach (Note rec in records) { Aquarium aqm = model.GetRecord <Aquarium>(rec.AquariumId); string aqmName = (aqm == null) ? "" : aqm.Name; var item = listView.AddItem(rec, aqmName, ALCore.GetTimeStr(rec.Timestamp), rec.Event, rec.Content ); } } catch (Exception ex) { fLogger.WriteError("FillNotesLV()", ex); } }
public static void FillMaintenancesLV(IListView listView, IModel model, string selectedAquarium) { try { listView.Clear(); listView.AddColumn(Localizer.LS(LSID.Aquarium), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Date), 120, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Type), 100, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Value), 100, true, BSDTypes.HorizontalAlignment.Right); listView.AddColumn(Localizer.LS(LSID.Note), 250, true, BSDTypes.HorizontalAlignment.Left); var records = model.QueryMaintenances(); foreach (Maintenance rec in records) { Aquarium aqm = model.Cache.Get <Aquarium>(ItemType.Aquarium, rec.AquariumId); string aqmName = (aqm == null) ? "" : aqm.Name; if (selectedAquarium != "*" && selectedAquarium != aqmName) { continue; } string strType = Localizer.LS(ALData.MaintenanceTypes[(int)rec.Type].Name); var item = listView.AddItem(rec, aqmName, ALCore.GetTimeStr(rec.Timestamp), strType, ALCore.GetDecimalStr(rec.Value), rec.Note ); } } catch (Exception ex) { fLogger.WriteError("FillMaintenancesLV()", ex); } }
public static void FillTSPointsLV(IListView listView, IModel model) { try { listView.Clear(); listView.AddColumn(Localizer.LS(LSID.Name), 140, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Unit), 80, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Min), 80, true, BSDTypes.HorizontalAlignment.Right); listView.AddColumn(Localizer.LS(LSID.Max), 80, true, BSDTypes.HorizontalAlignment.Right); listView.AddColumn(Localizer.LS(LSID.Deviation), 80, true, BSDTypes.HorizontalAlignment.Right); listView.AddColumn("SID", 140, true, BSDTypes.HorizontalAlignment.Left); listView.AddColumn(Localizer.LS(LSID.Value), 80, true, BSDTypes.HorizontalAlignment.Right); TSDatabase tsdb = model.TSDB; var records = tsdb.GetPoints(); foreach (TSPoint rec in records) { var item = listView.AddItem(rec, rec.Name, rec.MeasureUnit, ALCore.GetDecimalStr(rec.Min), ALCore.GetDecimalStr(rec.Max), ALCore.GetDecimalStr(rec.Deviation), rec.SID, string.Empty ); } } catch (Exception ex) { fLogger.WriteError("FillTSPointsLV()", ex); } }
public Backend(IListView view) { view.NotifyLoadItems += View_NotifyLoadItems; itemsList = new List <Model> { new Model { id = 1, name = "juan", value = "298" }, new Model { id = 2, name = "pedro", value = "100" }, new Model { id = 3, name = "coco", value = "8" }, new Model { id = 4, name = "nico", value = "34234242" }, new Model { id = 5, name = "emi", value = "644" }, new Model { id = 6, name = "gera", value = "4342" } }; }
/// <summary> /// Constructor as before, but allows a UIDefName to be specified /// </summary> /// <param name="listView">The ListView object to map</param> /// <param name="classDef">the class defintion of the class that this controller is setting up the list view for</param> /// <param name="uiDefName">The ui definition that the list view be set up for i.e. the properties that will be shown in the list view</param> public ListViewCollectionController(IListView listView,ClassDef classDef, string uiDefName) { _listView = listView; _classDef = classDef; _uiDefName = uiDefName; //_listItemsHash = new Hashtable(); }
private void Connect(ListViewEXT listView1, IListView info) { Method.Progress(listView1, () => { Config.Camera.CameraName = Config.Admin.CameraName; if (!Config.Camera.IsOpen) { Config.Camera.Connect(); Config.Camera.SetTriggerMode(Config.Admin.IsTrigger); Config.Admin.ExposureTime = Config.Camera.ExposureTime; Method.Invoke(listView1, () => { info.Image = new ImageEXT(new BitmapImage(new Uri("pack://application:,,,/DetectionPlus.Sign;component/Images/disconnect.png")), new BitmapImage(new Uri("pack://application:,,,/DetectionPlus.Sign;component/Images/disconnect_s.png"))); }); } else { Config.Camera.CameraStop(); Config.Camera.CameraClose(); Method.Invoke(listView1, () => { info.Image = new ImageEXT(new BitmapImage(new Uri("pack://application:,,,/DetectionPlus.Sign;component/Images/connect.png")), new BitmapImage(new Uri("pack://application:,,,/DetectionPlus.Sign;component/Images/connect_s.png"))); }); } }); }
public static void MapListProperty(IViewHandler viewHandler, IListView virtualView) { var nativeView = (UWPListView)viewHandler.NativeView; var sections = virtualView?.Sections() ?? 0; for (var s = 0; s < sections; s++) { var section = virtualView?.HeaderFor(s); if (section != null) { nativeView.Items?.Add(new ListViewHandlerItem((ListViewHandler)viewHandler, section)); } var rows = virtualView.Rows(s); for (var r = 0; r < rows; r++) { var v = virtualView.ViewFor(s, r); nativeView.Items?.Add(new ListViewHandlerItem((ListViewHandler)viewHandler, v)); } var footer = virtualView?.FooterFor(s); if (footer != null) { nativeView.Items?.Add(new ListViewHandlerItem((ListViewHandler)viewHandler, footer)); } } }
/// <summary> /// Constructor as before, but allows a UIDefName to be specified /// </summary> /// <param name="listView">The ListView object to map</param> /// <param name="classDef">the class defintion of the class that this controller is setting up the list view for</param> /// <param name="uiDefName">The ui definition that the list view be set up for i.e. the properties that will be shown in the list view</param> public ListViewCollectionController(IListView listView, ClassDef classDef, string uiDefName) { _listView = listView; _classDef = classDef; _uiDefName = uiDefName; //_listItemsHash = new Hashtable(); }
public void SelectRecordByXRef(string xref, bool delayedTransition = false) { GDMRecord record = fContext.Tree.XRefIndex_Find(xref); if (delayedTransition) { fDelayedTransitionRecord = record; return; } if (fDelayedTransitionRecord != null) { record = fDelayedTransitionRecord; fDelayedTransitionRecord = null; } IListView rView = (record == null) ? null : GetRecordsViewByType(record.RecordType); if (rView != null) { fView.ShowRecordsTab(record.RecordType); rView.Activate(); rView.SelectItem(record); } }
public static bool Equals(IListView <ILType> a, ILType[] b) { if (a == null && b == null) { return(true); } if (a == null && b.Length != 0) { return(false); } if (b == null && a.Count != 0) { return(false); } if (a.Count != b.Length) { return(false); } var count = a.Count; for (var i = 0; i < count; i++) { if (a[i] != b[i]) { return(false); } } return(true); }
public static void GetItem <T>(this IListView list, Action <RowClickedEventArgs <T> > data) { list.RowClicked += (sender, e) => { data?.Invoke(e.Model as RowClickedEventArgs <T>); }; }
public ListViewModel(IListView view, IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; View = view; View.DataContext = this; }
private void OnJumpToPlayingTrack(object o, EventArgs args) { ITrackModelSource track_src = ServiceManager.PlaybackController.Source; Source src = track_src as Source; if (track_src != null && src != null) { int i = track_src.TrackModel.IndexOf(ServiceManager.PlaybackController.CurrentTrack); if (i != -1) { // TODO clear the search/filters if there are any, since they might be hiding the currently playing item? // and/or switch to the track's primary source? what if it's been removed from the library all together? IListView <TrackInfo> track_list = src.Properties.Get <IListView <TrackInfo> > ("Track.IListView"); if (track_list != null) { ServiceManager.SourceManager.SetActiveSource(src); track_src.TrackModel.Selection.Clear(false); track_src.TrackModel.Selection.Select(i); track_src.TrackModel.Selection.FocusedIndex = i; track_list.CenterOn(i); track_list.GrabFocus(); } } } }
public CometRecyclerViewHolder( ViewGroup parent, IListView listView) : base(new CometView(parent.Context)) { Parent = parent; this.listView = listView; CometView.Click += HandleClick; }
public RecyclerViewHolder(FrameLayout itemView, ViewGroup parent, IListView listView) : base(itemView) { Container = itemView; Parent = parent; this.listView = listView; Container.Click += HandleClick; }
protected override object OnGetCustomItem(ICustomItem item, iLayer layer, IListView view, object recycledCell) { var cell = GetNativeObject <FrameworkElement>(Converter.ConvertToCell(item, layer.LayerStyle, view, null), "item", true); if (CustomItemRequested != null) { return(CustomItemRequested(item, layer)); } return(cell); }
protected override object OnGetCustomItem(ICustomItem item, iLayer layer, IListView view, object recycledCell) { if (CustomItemRequested == null) { return(base.OnGetCustomItem(item, layer, view, recycledCell)); } var custom = recycledCell as CustomItemContainer; return(CustomItemRequested(item, custom?.CustomItem as View, layer)); }
protected void AddColumn(IListView list, string caption, int width, bool autoSize, byte colType, byte colSubtype) { if (list == null) { throw new ArgumentNullException("list"); } list.AddColumn(caption, width, autoSize); fColumnsMap.Add(new MapColumnRec(colType, colSubtype)); }
protected void SetModel <T> (IListView <T> view, IListModel <T> model) { if (model == null) { view.SetModel(null); return; } view.SetModel(model, 0.0); }
public CometRecyclerViewHolder( ViewGroup parent, IListView listView, IMauiContext mauiContext) : base(new CometView(mauiContext)) { MauiContext = MauiContext; Parent = parent; this.listView = listView; CometView.Click += HandleClick; }
public void ChangeListItem(IListView sender) { GDMRecord rec = sender.GetSelectedData() as GDMRecord; if (rec != null) { NavAdd(rec); } ShowRecordInfo(rec); }
public LayoutController(IListView owner, ListViewModel model) { this.owner = owner; this.modelGenerator = new ItemModelGenerator(this.owner.ContainerGenerator); this.strategy = new StackLayoutStrategy(this.modelGenerator, owner); this.model = model; }
public ListViewModel(IListView view, bool shouldExecuteSyncroniously) { this.executeOperationsSyncroniously = shouldExecuteSyncroniously; this.View = view; this.BufferScale = 1; this.layoutController = new LayoutController(this.View, this); this.InitializeDescriptors(); }
public void RefreshRecordsView(GDMRecordType recType) { IListView rView = GetRecordsViewByType(recType); if (rView != null) { rView.UpdateContents(); AppHost.Instance.UpdateControls(false); } }
public bool RecordIsFiltered(GDMRecord record) { bool result = false; if (record != null) { IListView rView = GetRecordsViewByType(record.RecordType); result = (rView != null && rView.ListMan.IndexOfRecord(record) >= 0); } return(result); }
public void SetView(View view) { listView = view as ListView; if (listView == null) { return; } cellIdentifier = listView.GetType().Name; TableView.ReloadData(); TableView.SizeLastColumnToFit(); }
private void RenderListView(IListView listView) { if (listView.ItemsControls == null) { return; } foreach (var listViewItemsControl in listView.ItemsControls) { RenderListViewItem(listViewItemsControl); } }
public ListPresenter(PersonService service, IListView view) { _service = service; View = view; if (_service == null) { throw new ArgumentNullException(nameof(service)); } if (View == null) { throw new ArgumentNullException(nameof(View)); } _service.AddPerson(new Person(1) {FirstName = "Max", LastName = "Mustermann"}); _service.AddPerson(new Person(2) { FirstName = "Hans", LastName = "Joerg" }); wireEvents(); }
public ExploreRepositoriesController(IListView<RepositoryDetailedModel> view) : base(view, string.Empty, "ExploreController") { }
public RepoEventsController(IListView<EventModel> view, string username, string slug) : base(view, username) { Slug = slug; }
public FollowingRepositoriesController(IListView<RepositoryDetailedModel> view) : base(view, string.Empty) { }
protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); Notifications.RegisterChangeNotify(this.Handle, ShellNotifications.CSIDL.CSIDL_DESKTOP, true); this._UnvalidateTimer.Interval = 350; this._UnvalidateTimer.Tick += _UnvalidateTimer_Tick; this._UnvalidateTimer.Stop(); this._MaintenanceTimer.Interval = 1000 * 15; this._MaintenanceTimer.Tick += _MaintenanceTimer_Tick; this._MaintenanceTimer.Start(); this._SearchTimer.Interval = 750; this._SearchTimer.Enabled = false; this._SearchTimer.Tick += (sender, args) => { if (this.Items.Count > 0) { this._Smre.Reset(); this.Items = this.Items.OrderBy(o => o.DisplayName).ToList(); for (Int32 j = 0; j < this.Items.Count; j++) { this.Items[j].ItemIndex = j; } this._IIListView.SetItemCount(this.Items.Count, 0x2); this._Smre.Set(); } }; this._SearchTimer.Stop(); this._NavWaitTimer.Tick += (sender, args) => { this.BeginInvoke((Action)(() => { this._IsDisplayEmptyText = true; this._IIListView.ResetEmptyText(); })); }; this._NavWaitTimer.Stop(); var icc = new ComCtl32.INITCOMMONCONTROLSEX() { dwSize = Marshal.SizeOf(typeof(ComCtl32.INITCOMMONCONTROLSEX)), dwICC = 1 }; var res = ComCtl32.InitCommonControlsEx(ref icc); this.LVHandle = User32.CreateWindowEx(0, "SysListView32", "", User32.WindowStyles.WS_CHILD | User32.WindowStyles.WS_CLIPCHILDREN | User32.WindowStyles.WS_CLIPSIBLINGS | (User32.WindowStyles)User32.LVS_EDITLABELS | (User32.WindowStyles)User32.LVS_OWNERDATA | (User32.WindowStyles)User32.LVS_SHOWSELALWAYS | (User32.WindowStyles)User32.LVS_AUTOARRANGE, 0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height, this.Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); User32.ShowWindow(this.LVHandle, User32.ShowWindowCommands.Show); this.AddDefaultColumns(true); IntPtr headerhandle = User32.SendMessage(this.LVHandle, MSG.LVM_GETHEADER, 0, 0); for (Int32 i = 0; i < this.Collumns.Count; i++) { this.Collumns[i].SetSplitButton(headerhandle, i); } this.IsViewSelectionAllowed = false; this.View = ShellViewStyle.Medium; User32.SendMessage(this.LVHandle, MSG.LVM_SetExtendedStyle, (Int32)ListViewExtendedStyles.HeaderInAllViews, (Int32)ListViewExtendedStyles.HeaderInAllViews); User32.SendMessage(this.LVHandle, MSG.LVM_SetExtendedStyle, (Int32)ListViewExtendedStyles.LVS_EX_DOUBLEBUFFER, (Int32)ListViewExtendedStyles.LVS_EX_DOUBLEBUFFER); User32.SendMessage(this.LVHandle, MSG.LVM_SetExtendedStyle, (Int32)ListViewExtendedStyles.FullRowSelect, (Int32)ListViewExtendedStyles.FullRowSelect); User32.SendMessage(this.LVHandle, MSG.LVM_SetExtendedStyle, (Int32)ListViewExtendedStyles.HeaderDragDrop, (Int32)ListViewExtendedStyles.HeaderDragDrop); User32.SendMessage(this.LVHandle, MSG.LVM_SetExtendedStyle, (Int32)ListViewExtendedStyles.LabelTip, (Int32)ListViewExtendedStyles.LabelTip); User32.SendMessage(this.LVHandle, MSG.LVM_SetExtendedStyle, (Int32)ListViewExtendedStyles.InfoTip, (Int32)ListViewExtendedStyles.InfoTip); User32.SendMessage(this.LVHandle, MSG.LVM_SetExtendedStyle, (Int32)ListViewExtendedStyles.UnderlineHot, (Int32)ListViewExtendedStyles.UnderlineHot); User32.SendMessage(this.LVHandle, MSG.LVM_SetExtendedStyle, (Int32)ListViewExtendedStyles.AutosizeColumns, (Int32)ListViewExtendedStyles.AutosizeColumns); IntPtr iiListViewPrt = IntPtr.Zero; var iid = typeof(IListView).GUID; User32.SendMessage(this.LVHandle, 0x10BD, ref iid, out iiListViewPrt); this._IIListView = (IListView)Marshal.GetTypedObjectForIUnknown(iiListViewPrt, typeof(IListView)); this._IIListView.SetSelectionFlags(1, 1); this.Focus(); User32.SetForegroundWindow(this.LVHandle); UxTheme.SetWindowTheme(this.LVHandle, "Explorer", 0); ShellItem.MessageHandle = this.LVHandle; this.IsViewSelectionAllowed = true; }
//private IBusinessObjectCollection _collection; //private readonly Hashtable _listItemsHash; /// <summary> /// Constructor to initialise a new mapper. Sets the UIDefName to /// "default". /// </summary> /// <param name="listView">The ListView object to map</param> /// <param name="classDef">the class defintion of the class that this controller is setting up the list view for</param> public ListViewCollectionController(IListView listView,ClassDef classDef) : this(listView, classDef, "default") { }