public CustomListViewAdapter(Activity context, CustomListView view) : base() { this.context = context; //inflater = LayoutInflater.From(context); this.context = context; var res = view.Items.ToList(); tableItems = res.OrderBy(o => o.FirstName).ToList(); alphaIndex = new Dictionary <string, int>(); for (int i = 0; i < tableItems.Count; i++) { var item = tableItems[i]; var key = item.FirstName.Substring(0, 1); if (!alphaIndex.ContainsKey(key)) { alphaIndex.Add(key, i); } } sections = new string[alphaIndex.Keys.Count]; alphaIndex.Keys.CopyTo(sections, 0); sectionsObjects = new Java.Lang.Object[sections.Length]; for (int i = 0; i < sections.Length; i++) { sectionsObjects[i] = new Java.Lang.String(sections[i]); } }
protected override void OnElementChanged(ElementChangedEventArgs <ListView> e) { base.OnElementChanged(e); this.Control.SeparatorInset = UIEdgeInsets.Zero; this.Control.LayoutMargins = UIEdgeInsets.Zero; this.Control.PreservesSuperviewLayoutMargins = false; list = e.NewElement as CustomListView; if (list == null || Control == null) { return; } longPressGestureRecognizer = new UILongPressGestureRecognizer(LongPressMethod) { MinimumPressDuration = 1.0f }; if (e.NewElement == null) { if (longPressGestureRecognizer != null) { this.RemoveGestureRecognizer(longPressGestureRecognizer); } } if (e.OldElement == null) { this.AddGestureRecognizer(longPressGestureRecognizer); } }
protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { base.OnElementPropertyChanged(sender, e); _listView = Element as CustomListView; if (e.PropertyName == CustomListView.CartTransactionProperty.PropertyName) { var items = (Control.Source as CustomiOSListViewSource).Items; var transaction = _listView.CartTransaction; if (transaction.TransactionType == "Add") { items.Insert(transaction.TransactionAtIndex, transaction.item); } else if (transaction.TransactionType == "Delete") { items.RemoveAt(transaction.TransactionAtIndex); } else if (transaction.TransactionType == "Update") { items[transaction.TransactionAtIndex] = transaction.item; } else if (transaction.TransactionType == "Clear") { var count = items.Count; for (int i = 0; i < count; i++) { items.RemoveAt(0); } } Control.ReloadData(); } }
private View CreateList(bool hasTitle = false) { var listView = new CustomListView { RowHeight = Device.OnPlatform(40, 50, 80), HasUnevenRows = true, BackgroundColor = Color.Transparent }; var cell = new DataTemplate(() => new NewsCell());//(App.ViewModel)); listView.ItemTemplate = cell; listView.ItemSelected += async(sender, e) => { if (listView.SelectedItem == null) { return; } var newsItem = (NewsPublish)e.SelectedItem; App.CurrentNews = newsItem; var newsDetailPage = new NewsDetailPage(); await Navigation.PushAsync(newsDetailPage); listView.SelectedItem = null; }; return(listView); }
public SpeakersPage() { Title = "Speakers List"; Icon = Device.OnPlatform(Utils.GetFile("slideout.png"), Utils.GetFile("slideout.png"), Utils.GetFile("slideout.png")); BackgroundImage = "background.png"; NavigationPage.SetHasNavigationBar(this, true); BindingContext = App.ViewModel; //_viewModel.Error += (sender, args) => DisplayAlert("Sorry about the mess.", args.ErrorMessage, "OK"); var listView = new CustomListView { RowHeight = Device.OnPlatform(90, 70, 125), ItemTemplate = new DataTemplate(typeof(SpeakerCell)), HasUnevenRows = true, IsGroupingEnabled = false, GroupDisplayBinding = new Binding("Speakers"), GroupHeaderTemplate = new DataTemplate(typeof(SpeakerHeaderCell)), BackgroundColor = Color.Transparent //GroupShortNameBinding = new Binding("Key")//Remove for now as it causes crash on iOS if you scroll too fast:( }; listView.SetBinding <MainViewModel>(ListView.ItemsSourceProperty, x => x.Speakers); listView.ItemSelected += async(sender, e) => { if (listView.SelectedItem == null) { return; } var speaker = (Speaker)e.SelectedItem; App.CurrentSpeaker = speaker; var speakerPage = new SpeakerPage(); await Navigation.PushAsync(speakerPage); listView.SelectedItem = null; }; var mainStack = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand, Children = { listView } }; //mainStack.SetBinding<SpeakersViewModel>(IsBusyProperty, x => x.IsBusy); //if (Device.OS == TargetPlatform.WinPhone) //{ // mainStack.Padding = new Thickness(20, 10, 20, 0); // mainStack.Children.Insert(0, // new Label // { // Text = "SPEAKERS", // Font = Font.SystemFontOfSize(NamedSize.Medium) // } // ); //} Content = mainStack; }
public MainPageCS() { customListView = new CustomListView { Items = DataSource.GetList(), VerticalOptions = LayoutOptions.FillAndExpand }; Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0); Content = new Grid { RowDefinitions = { new RowDefinition { Height = GridLength.Auto }, new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } }, Children = { new Label { Text = "I am a custom ListView", HorizontalTextAlignment = TextAlignment.Center }, customListView } }; customListView.ItemSelected += OnItemSelected; }
private void Initialize() { this.InitializeComponent(); this.dataGridView = this.xmlComponentLoader1.GetControlByName <CustomStyleDataGrid>("customStyleDataGrid1"); this.toolStrip1 = this.xmlComponentLoader1.GetControlByName <ToolStrip>("toolStrip1"); this.label1 = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("label1"); this.label2 = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("label2"); this.labelReportType = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("labelReportType"); this.labelFromFile = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("labelFromFile"); this.groupBox1 = this.xmlComponentLoader1.GetControlByName <AisinoGRP>("groupBox1"); this.labelTotal = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("labelTotal"); this.labelFail = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("labelFail"); this.labelDuplicate = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("labelDuplicate"); this.labelInvalid = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("labelInvalid"); this.lableCorrect = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("lableCorrect"); this.label10 = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("label10"); this.label9 = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("label9"); this.label8 = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("label8"); this.label7 = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("label7"); this.label6 = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("label6"); this.statusStrip1 = this.xmlComponentLoader1.GetControlByName <StatusStrip>("statusStrip1"); this.toolStripStatusLabel1 = this.xmlComponentLoader1.GetControlByName <ToolStripStatusLabel>("toolStripStatusLabel1"); this.StatusLabel2 = this.xmlComponentLoader1.GetControlByName <ToolStripStatusLabel>("StatusLabel2"); this.toolStripStatusLabel2 = this.xmlComponentLoader1.GetControlByName <ToolStripStatusLabel>("toolStripStatusLabel2"); this.StatusLabel3 = this.xmlComponentLoader1.GetControlByName <ToolStripStatusLabel>("StatusLabel3"); this.label5 = this.xmlComponentLoader1.GetControlByName <AisinoLBL>("label5"); this.listView1 = this.xmlComponentLoader1.GetControlByName <CustomListView>("listView1"); this.toolStripPrint = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("toolStripPrint"); this.toolStripSave = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("toolStripSave"); this.toolStripPrint.Click += new EventHandler(this.Print_Click); this.toolStripSave.Click += new EventHandler(this.Save_Click); this.listView1.ItemSelectionChanged += new ListViewItemSelectionChangedEventHandler(this.listView1_ItemSelectionChanged); }
public override void ViewDidLoad() { base.ViewDidLoad(); CustomListView.RegisterNibForCellReuse(CircleImageViewCell.Nib, nameof(CircleImageViewCell)); CustomListView.Source = new CustomListViewSource(); images = System.IO.Directory.GetFiles("monkeys", "*.jpg"); AddButton.TouchUpInside += (sender, e) => { var item = new TableItem { Main = $"Item_{rnd.Next()}", Sub = $"Description_{rnd.Next()}", ImagePath = images[rnd.Next(0, 4)] }; // 新規アイテムを追加して再読み込みさせる var src = CustomListView.Source as CustomListViewSource; src.Items.Add(item); CustomListView.ReloadData(); }; RemoveButton.TouchUpInside += (sender, e) => { // 末尾のアイテムを削除して再読み込みさせる var src = CustomListView.Source as CustomListViewSource; if (src.Items.Count < 1) { return; } src.Items.RemoveAt(src.Items.Count - 1); CustomListView.ReloadData(); }; }
protected override void Init () { CustomListView lv = new CustomListView () { ItemsSource = Enumerable.Range (0, 10) }; Content = new StackLayout { Children = { new Label { Text = "If the ListView does not have green Cells, this test has failed." }, lv } }; }
public async Task CreateCustomList(string NameCustomList) { Models.User user = await _userService.FindUser(User); CustomListView customList = _customListService.CreateCustomList(user, NameCustomList); Response.ContentType = "application/json"; await Response.WriteAsync(JsonConvert.SerializeObject(customList, jsonSerializerSettings)); }
public FirstPageViewModel() { TestCommand = new DelegateCommand(Test); customListView = new CustomListView { Items = MockListData.GetList(), VerticalOptions = LayoutOptions.FillAndExpand }; }
public override Widget build(BuildContext context) { var bloggerIds = this.widget.viewModel.bloggerIds; Widget content; if (this.widget.viewModel.bloggerLoading && bloggerIds.isEmpty()) { content = new GlobalLoading(); } else if (bloggerIds.Count <= 0) { content = new BlankView( "暂无博主", "image/default-following", true, () => { this.widget.actionModel.startFetchBlogger(); this.widget.actionModel.fetchBlogger(arg: firstPageNumber); } ); } else { var enablePullUp = this.widget.viewModel.bloggerHasMore; content = new CustomListView( controller: this._refreshController, enablePullDown: true, enablePullUp: enablePullUp, onRefresh: this._onRefresh, itemCount: bloggerIds.Count, itemBuilder: this._buildUserCard, footerWidget: enablePullUp ? null : CustomListViewConstant.defaultFooterWidget ); } return(new Container( color: CColors.White, child: new CustomSafeArea( bottom: false, child: new Container( color: CColors.Background, child: new Column( children: new List <Widget> { this._buildNavigationBar(), new Flexible( child: content ) } ) ) ) )); }
protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.ListView> e) { base.OnElementChanged(e); if (Control != null && Element != null) { _element = Element as CustomListView; _list = Control as ListView; (_element as ICustomListView).ScrollToEnd = async() => await ScrollToBottom(); } }
public override Widget build(BuildContext context) { var followers = this.widget.viewModel.followers; Widget content; if (this.widget.viewModel.followerLoading && followers.isEmpty()) { content = new GlobalLoading(); } else if (followers.Count <= 0) { content = new BlankView( $"暂无{this._title}用户", "image/default-following", true, () => { this.widget.actionModel.startFetchFollower(); this.widget.actionModel.fetchFollower(0); } ); } else { var enablePullUp = this.widget.viewModel.followersHasMore; content = new CustomListView( controller: this._refreshController, enablePullDown: true, enablePullUp: enablePullUp, onRefresh: this._onRefreshFollower, itemCount: followers.Count, itemBuilder: this._buildUserCard, footerWidget: enablePullUp ? null : CustomListViewConstant.defaultFooterWidget ); } return(new Container( color: CColors.White, child: new CustomSafeArea( bottom: false, child: new Container( color: CColors.Background, child: new Column( children: new List <Widget> { this._buildNavigationBar(), new Expanded( child: content ) } ) ) ) )); }
public Bugzilla41205() { var listView = new CustomListView { ItemsSource = new [] { new ViewModel(), new ViewModel(), } }; Content = listView; }
protected override void Init() { var listView = new CustomListView { ItemsSource = new[] { new ViewModel(), new ViewModel(), } }; Content = listView; }
private void ThumbnailControl_MouseDown(object sender, MouseEventArgs e) { CustomListView listvew = sender as CustomListView; if (listvew != null) { listvew.MouseUpEventDisabled = false; } m_dragging = false; m_hitPoint = e.Location; }
protected override void Init() { CustomListView lv = new CustomListView() { ItemsSource = Enumerable.Range(0, 10) }; Content = new StackLayout { Children = { new Label { Text = "If the ListView does not have green Cells, this test has failed." }, lv } }; }
public override Widget build(BuildContext context) { var homeEvents = this.widget.viewModel.homeEvents; Widget content; if (this.widget.viewModel.homeEventLoading && homeEvents.isEmpty()) { content = new GlobalLoading(); } else if (homeEvents.Count == 0) { content = new BlankView( "暂无推荐活动", "image/default-event", true, () => { this.widget.actionModel.startFetchHomeEvent(); this.widget.actionModel.fetchHomeEvents(arg: firstPageNumber); } ); } else { var enablePullUp = this.widget.viewModel.homeEventHasMore; content = new CustomListView( controller: this._refreshController, enablePullDown: true, enablePullUp: enablePullUp, onRefresh: this._onRefresh, itemCount: homeEvents.Count, itemBuilder: this._buildEventCard, footerWidget: enablePullUp ? null : CustomListViewConstant.defaultFooterWidget ); } return(new Container( color: CColors.White, child: new CustomSafeArea( bottom: false, child: new Container( color: CColors.Background, child: new Column( children: new List <Widget> { this._buildNavigationBar(), new Expanded(child: content) } ) ) ) )); }
//find custom list by Id and set option return/not retun completed tasks //if IsCompleted == true list will include completed tasks public async Task <CustomListView> FindCustomList(int id, bool IsCompleted) { var customList = await db.customLists.Include(p => p.Tasks).ThenInclude(p => p.Importance) .FirstOrDefaultAsync(p => p.Id == id); CustomListView customListView = new CustomListView { Id = customList.Id, Name = customList.Name, taskViews = _taskManager.createTaskViewListFromTaskList(customList.Tasks, IsCompleted) }; return(customListView); }
protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.ListView> e) { base.OnElementChanged(e); if (Control != null) { CustomListView view = (CustomListView)e.NewElement; Control.ItemLongClick += (s, args) => { Control.SetItemChecked(args.Position, true); Java.Lang.Object item = Control.GetItemAtPosition(args.Position); view.OnLongTapped(item.GetType().GetProperty("Instance").GetValue(item)); }; } }
public void addItems(CustomListView customlistview, String[] _vaules) { customlistview.BeginUpdate(); ListViewItem _item = new ListViewItem(_vaules); customlistview.Items.Add(_item); if (customlistview.Items.Count * 35 >= customlistview.Height) { customlistview.Columns[customlistview.Columns.Count - 1].Width = 0; } customlistview.EndUpdate(); }
protected override void OnElementChanged(ElementChangedEventArgs <ListView> e) { base.OnElementChanged(e); if (Control != null && Element != null) { _element = Element as CustomListView; _itemCount = Element.ItemsSource.Cast <object>().Count(); _table = Control as UITableView; _table.Delegate = null; _table.Scrolled += _table_Scrolled; (_element as ICustomListView).ScrollToEnd = async() => await ScrollToBottom(); } }
Widget _buildArticleList(BuildContext context) { Widget content; var recommendArticleIds = this.widget.viewModel.recommendArticleIds; if (!this._hasBeenLoadedData || this.widget.viewModel.articlesLoading && recommendArticleIds.isEmpty()) { content = ListView.builder( physics: new NeverScrollableScrollPhysics(), itemCount: 6, itemBuilder: (cxt, index) => new ArticleLoading() ); } else if (0 == recommendArticleIds.Count) { content = new Container( padding: EdgeInsets.only(bottom: CConstant.TabBarHeight + CCommonUtils.getSafeAreaBottomPadding(context: context)), child: new BlankView( "哎呀,暂无推荐文章", "image/default-article", true, () => { this.widget.actionModel.startFetchArticles(); this.widget.actionModel.fetchArticles(arg1: this.widget.viewModel.currentUserId, arg2: initOffset); } ) ); } else { var enablePullUp = this.widget.viewModel.hottestHasMore; content = new CustomListView( controller: this._refreshController, enablePullDown: true, enablePullUp: enablePullUp, onRefresh: this._onRefresh, hasBottomMargin: true, itemCount: recommendArticleIds.Count, itemBuilder: this._buildArticleCard, footerWidget: enablePullUp ? null : new EndView(hasBottomMargin: true), hasScrollBar: false ); } return(new CustomScrollbar(child: content)); }
protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.ListView> e) { base.OnElementChanged(e); if (e.OldElement is CustomListView oldListView && Control != null) { oldListView.StopScroll -= StopScroll; oldListView.Scrolled -= SharedListViewOnScrolled; } if (e.NewElement is CustomListView newListView && Control != null) { m_list = newListView; newListView.StopScroll += StopScroll; newListView.Scrolled += SharedListViewOnScrolled; } }
public void addWrite(CustomListView writeList, String path) { writeList.Items.Clear(); try { foreach (String _word in File.ReadAllText(path, System.Text.Encoding.Default).Split(new String[] { "----" }, StringSplitOptions.None)) { if (_word.Contains("제목 :")) { String _title = Regex.Split(Regex.Split(_word, "제목 :")[1], "\n")[0].Trim(); String _subject = Regex.Split(_word, _title)[1].Trim(); writeList.BeginUpdate(); ListViewItem item = new ListViewItem(""); item.SubItems.Add(Convert.ToString(writeList.Items.Count + 1)); item.SubItems.Add(_title); item.SubItems.Add(_subject); writeList.Items.Add(item); if (writeList.Items.Count >= 8) { writeList.Columns[1].Width = writeList.Columns[1].Width - 17; } if (writeList.Items.Count % 2 == 0) { writeList.Items[item.Index].BackColor = Color.FromArgb(26, 26, 23); } else { writeList.Items[item.Index].BackColor = Color.FromArgb(30, 32, 33); } writeList.EndUpdate(); } } } catch (IndexOutOfRangeException ex) { MessageBox.Show("잘못된 형식의 텍스트파일을 불러왔습니다.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ThumbnailControl_MouseMove(object sender, MouseEventArgs e) { if (!m_dragging && e.Button == MouseButtons.Left) { Size dragSize = SystemInformation.DragSize; if (Math.Abs(m_hitPoint.X - e.X) >= dragSize.Width || Math.Abs(m_hitPoint.Y - e.Y) >= dragSize.Height) { m_dragging = true; } } if (m_dragging) { Uri hitItem = GetClickedItemUri(m_hitPoint); if (hitItem != null) { List <string> paths = new List <string>(); foreach (Uri uri in GetSelectedItemUris()) { paths.Add(uri.LocalPath); } if (paths.Count > 0) { CustomListView listvew = sender as CustomListView; if (listvew != null) { listvew.MouseUpEventDisabled = true; } Control ctrl = (Control)sender; // Create the DataObject and fill it with an array of paths // of the clicked and/or selected objects IDataObject dataObject = new DataObject(); dataObject.SetData(DataFormats.FileDrop, true, paths.ToArray()); ctrl.DoDragDrop(dataObject, DragDropEffects.Move); } } } }
Widget _buildContent() { var followArticleIds = this.widget.viewModel.followArticleIds; var followings = this.widget.viewModel.followings; var hotArticleIds = this.widget.viewModel.hotArticleIds; var followArticleLoading = this.widget.viewModel.followArticlesLoading && followArticleIds.isEmpty() && hotArticleIds.isEmpty(); var followingLoading = this.widget.viewModel.followingLoading && followings.isEmpty(); Widget content; if (followArticleLoading || followingLoading) { content = new FollowArticleLoading(); } else { var isHot = this.widget.viewModel.hotArticlePage > 0; var itemCount = isHot ? hotArticleIds.Count : followArticleIds.Count; var enablePullUp = isHot ? this.widget.viewModel.hotArticleHasMore : this.widget.viewModel.followArticleHasMore; content = new CustomListView( controller: this._refreshController, enablePullDown: true, enablePullUp: enablePullUp, onRefresh: up => this._onRefresh(up: up, isHot: isHot), hasBottomMargin: true, itemCount: itemCount, itemBuilder: (cxt, index) => this._buildFollowArticleCard(context: cxt, index: index, isFollow: !isHot), headerWidget: followings.isEmpty() ? null : this._buildFollowingList(), footerWidget: enablePullUp ? null : new EndView(hasBottomMargin: true), hasScrollBar: false ); } return(new Container( color: CColors.Background, child: new CustomScrollbar(child: content) )); }
private void InitializeComponents(List<User> users, string ownName) { Color brownColor = ColorTranslator.FromHtml("#6B260B"); BackColor = brownColor; Panel rootPanel = new Panel(); rootPanel.Size = new Size(ClientSize.Width - 10, ClientSize.Height - 10); rootPanel.Location = new Point(5, 5); rootPanel.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom; rootPanel.BackColor = brownColor; TableLayoutPanel generalTlp = new TableLayoutPanel(); generalTlp.RowStyles.Add(new RowStyle(SizeType.Percent, 70)); generalTlp.RowStyles.Add(new RowStyle(SizeType.AutoSize)); generalTlp.Dock = DockStyle.Fill; generalTlp.BackColor = brownColor; teamList = new CustomListView(); teamList.Columns.Add("Team Yellow", 132); teamList.Columns.Add("Team Red", 132); teamList.View = View.Details; teamList.GridLines = true; teamList.Dock = DockStyle.Fill; teamList.DrawSubItem += teamList_DrawSubItem; UpdateUserList(users); switchButton = new Button(); switchButton.Text = "Switch Team"; switchButton.AutoSize = true; switchButton.Anchor = AnchorStyles.None; switchButton.Cursor = Cursors.Hand; switchButton.BackColor = Control.DefaultBackColor; switchButton.Click += switchButton_Click; generalTlp.Controls.Add(teamList, 0, 0); generalTlp.Controls.Add(switchButton, 0, 1); rootPanel.Controls.Add(generalTlp); Controls.Add(rootPanel); }
void ReleaseDesignerOutlets() { if (AddButton != null) { AddButton.Dispose(); AddButton = null; } if (CustomListView != null) { CustomListView.Dispose(); CustomListView = null; } if (RemoveButton != null) { RemoveButton.Dispose(); RemoveButton = null; } }
public MasterDetailPage1Detail() { InitializeComponent(); CustomListView listView = new CustomListView(); ImageService.Instance.Config.MaxMemoryCacheSize = 1000; this.Appearing += async(sender, e) => { images = await DependencyService.Get <IPicturePicker>().GetImageStreamAsync(); }; listView.ItemsSource = images; listView.ItemTemplate = new DataTemplate(typeof(CachedImageCell)); listView.IsPullToRefreshEnabled = true; listView.HasUnevenRows = true; listView.Refreshing += delegate { listView.ItemsSource = images; listView.EndRefresh(); }; Content = listView; }
private void Initialize() { this.InitializeComponent(); this.toolBtnBack = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("toolBtnBack"); this.toolBtnGenerate = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("toolBtnGenerate"); this.toolBtnCancel = this.xmlComponentLoader1.GetControlByName <ToolStripButton>("toolBtnCancel"); this.btnBack = this.xmlComponentLoader1.GetControlByName <AisinoBTN>("btnBack"); this.btnGenerate = this.xmlComponentLoader1.GetControlByName <AisinoBTN>("btnGenerate"); this.btnCancel = this.xmlComponentLoader1.GetControlByName <AisinoBTN>("btnCancel"); this.listView1 = this.xmlComponentLoader1.GetControlByName <CustomListView>("listView1"); this.btnBack.Click += new EventHandler(this.btnBack_Click); this.btnGenerate.Click += new EventHandler(this.btnGenerate_Click); this.btnCancel.Click += new EventHandler(this.btnCancel_Click); this.toolBtnBack.Click += new EventHandler(this.btnBack_Click); this.toolBtnGenerate.Click += new EventHandler(this.btnGenerate_Click); this.toolBtnCancel.Click += new EventHandler(this.btnCancel_Click); this.listView1.MouseClick += new MouseEventHandler(this.listView1_MouseClick); this.listView1.Font = new Font("宋体", 12f); this.listView1.FullRowSelect = true; this.listView1.GridLines = true; }
private void InitializeComponent() { m_container = (IContainer)new Container(); Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance(); UltraStatusPanel ultraStatusPanel1 = new UltraStatusPanel(); UltraStatusPanel ultraStatusPanel2 = new UltraStatusPanel(); UltraStatusPanel ultraStatusPanel3 = new UltraStatusPanel(); UltraStatusPanel ultraStatusPanel4 = new UltraStatusPanel(); UltraStatusPanel ultraStatusPanel5 = new UltraStatusPanel(); UltraStatusPanel ultraStatusPanel6 = new UltraStatusPanel(); UltraStatusPanel ultraStatusPanel7 = new UltraStatusPanel(); UltraStatusPanel ultraStatusPanel8 = new UltraStatusPanel(); this.tableLayoutPanel = new TableLayoutPanel(); this.pagePanel = new Panel(); this.customListView = new CustomListView(); m_timer = new System.Windows.Forms.Timer(m_container); menuStrip = new MenuStrip(); fileToolStripMenuItem = new ToolStripMenuItem(); exitToolStripMenuItem = new ToolStripMenuItem(); viewToolStripMenuItem = new ToolStripMenuItem(); showStatusBarToolStripMenuItem = new ToolStripMenuItem(); showListViewToolStripMenuItem = new ToolStripMenuItem(); toolStripSeparator1 = new ToolStripSeparator(); fullScreenToolStripMenuItem = new ToolStripMenuItem(); windowToolStripMenuItem = new ToolStripMenuItem(); setupToolStripMenuItem = new ToolStripMenuItem(); diagnosticsToolStripMenuItem = new ToolStripMenuItem(); monitorsToolStripMenuItem = new ToolStripMenuItem(); dashboardToolStripMenuItem = new ToolStripMenuItem(); logsToolStripMenuItem = new ToolStripMenuItem(); connectionToolStripMenuItem = new ToolStripMenuItem(); connectToolStripMenuItem = new ToolStripMenuItem(); disconnectToolStripMenuItem = new ToolStripMenuItem(); toolsToolStripMenuItem = new ToolStripMenuItem(); vehicleManagerToolStripMenuItem = new ToolStripMenuItem(); sensorCalibrationToolStripMenuItem = new ToolStripMenuItem(); userDefinedPIDsToolStripMenuItem = new ToolStripMenuItem(); pluginManagerToolStripMenuItem = new ToolStripMenuItem(); toolStripSeparatorToolsMenu = new ToolStripSeparator(); pidInspectorToolStripMenuItem = new ToolStripMenuItem(); powerSaveSetupToolStripMenuItem = new ToolStripMenuItem(); toolStripSeparatorToolsMenu2 = new ToolStripSeparator(); preferencesToolStripMenuItem = new ToolStripMenuItem(); toolStripContainer = new ToolStripContainer(); m_statusPortECU = new UltraStatusBar(); tableLayoutPanel.SuspendLayout(); menuStrip.SuspendLayout(); toolStripContainer.ContentPanel.SuspendLayout(); toolStripContainer.TopToolStripPanel.SuspendLayout(); this.toolStripContainer.SuspendLayout(); ((ISupportInitialize)this.m_statusPortECU).BeginInit(); this.SuspendLayout(); this.tableLayoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; this.tableLayoutPanel.ColumnCount = 2; this.tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 84f)); tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f)); tableLayoutPanel.Controls.Add(pagePanel, 1, 0); tableLayoutPanel.Controls.Add(customListView, 0, 0); tableLayoutPanel.Dock = DockStyle.Fill; tableLayoutPanel.Location = new Point(0, 0); tableLayoutPanel.Margin = new Padding(2); tableLayoutPanel.Name = "tableLayoutPanel"; tableLayoutPanel.RowCount = 1; tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100f)); tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 434f)); tableLayoutPanel.Size = new Size(763, 435); tableLayoutPanel.TabIndex = 1; pagePanel.Dock = DockStyle.Fill; pagePanel.Location = new Point(86, 1); pagePanel.Margin = new Padding(0); pagePanel.Name = "pagePanel"; pagePanel.Size = new Size(676, 433); pagePanel.TabIndex = 2; customListView.Dock = DockStyle.Fill; customListView.ItemSpacing = ListViewItemSpacing.f00009d; customListView.Location = new Point(3, 3); customListView.Margin = new Padding(2); customListView.Name = "customListView"; customListView.Size = new Size(80, 429); customListView.TabIndex = 3; m_timer.Enabled = true; m_timer.Interval = 1000; m_timer.Tick += new EventHandler(m_timer_Tick); menuStrip.Dock = DockStyle.None; menuStrip.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem, viewToolStripMenuItem, windowToolStripMenuItem, connectionToolStripMenuItem, toolsToolStripMenuItem }); menuStrip.Location = new Point(0, 0); menuStrip.Name = "menuStrip"; menuStrip.Size = new Size(763, 24); menuStrip.TabIndex = 0; fileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[1] { exitToolStripMenuItem }); fileToolStripMenuItem.Name = "fileToolStripMenuItem"; fileToolStripMenuItem.Size = new Size(37, 20); fileToolStripMenuItem.Text = "&File"; exitToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.p000031; exitToolStripMenuItem.Name = "exitToolStripMenuItem"; exitToolStripMenuItem.Size = new Size(92, 22); exitToolStripMenuItem.Text = "E&xit"; exitToolStripMenuItem.Click += new EventHandler(exitToolStripMenuItem_Click); viewToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { showStatusBarToolStripMenuItem, showListViewToolStripMenuItem, toolStripSeparator1, fullScreenToolStripMenuItem }); viewToolStripMenuItem.Name = "viewToolStripMenuItem"; viewToolStripMenuItem.Size = new Size(44, 20); viewToolStripMenuItem.Text = "&View"; viewToolStripMenuItem.DropDownOpening += new EventHandler(viewToolStripMenuItem_DropDownOpening); showStatusBarToolStripMenuItem.Name = "showStatusBarToolStripMenuItem"; showStatusBarToolStripMenuItem.Size = new Size(131, 22); showStatusBarToolStripMenuItem.Text = "&Status Bar"; showStatusBarToolStripMenuItem.Click += new EventHandler(showStatusBarToolStripMenuItem_Click); showListViewToolStripMenuItem.Name = "showListViewToolStripMenuItem"; showListViewToolStripMenuItem.Size = new Size(131, 22); showListViewToolStripMenuItem.Text = "&List View"; showListViewToolStripMenuItem.Click += new EventHandler(showListViewToolStripMenuItem_Click); toolStripSeparator1.Name = "toolStripSeparator1"; toolStripSeparator1.Size = new Size(128, 6); fullScreenToolStripMenuItem.Name = "fullScreenToolStripMenuItem"; fullScreenToolStripMenuItem.Size = new Size(131, 22); fullScreenToolStripMenuItem.Text = "&Full Screen"; fullScreenToolStripMenuItem.Click += new EventHandler(fullScreenToolStripMenuItem_Click); windowToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[5] { setupToolStripMenuItem, diagnosticsToolStripMenuItem, monitorsToolStripMenuItem, dashboardToolStripMenuItem, logsToolStripMenuItem }); windowToolStripMenuItem.Name = "windowToolStripMenuItem"; windowToolStripMenuItem.Size = new Size(63, 20); windowToolStripMenuItem.Text = "&Window"; setupToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000074; setupToolStripMenuItem.Name = "setupToolStripMenuItem"; setupToolStripMenuItem.Size = new Size(135, 22); setupToolStripMenuItem.Text = "&Setup"; setupToolStripMenuItem.Click += new EventHandler(setupToolStripMenuItem_Click); diagnosticsToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000025; diagnosticsToolStripMenuItem.Name = "diagnosticsToolStripMenuItem"; diagnosticsToolStripMenuItem.Size = new Size(135, 22); diagnosticsToolStripMenuItem.Text = "&Diagnostics"; diagnosticsToolStripMenuItem.Click += new EventHandler(diagnosticsToolStripMenuItem_Click); monitorsToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000044; monitorsToolStripMenuItem.Name = "monitorsToolStripMenuItem"; monitorsToolStripMenuItem.Size = new Size(135, 22); monitorsToolStripMenuItem.Text = "&Monitors"; monitorsToolStripMenuItem.Click += new EventHandler(monitorsToolStripMenuItem_Click); dashboardToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000014; dashboardToolStripMenuItem.Name = "dashboardToolStripMenuItem"; dashboardToolStripMenuItem.Size = new Size(135, 22); dashboardToolStripMenuItem.Text = "&D&ashboard"; dashboardToolStripMenuItem.Click += new EventHandler(dashboardToolStripMenuItem_Click); logsToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000042; logsToolStripMenuItem.Name = "logsToolStripMenuItem"; logsToolStripMenuItem.Size = new Size(135, 22); logsToolStripMenuItem.Text = "&Logs"; logsToolStripMenuItem.Click += new EventHandler(logsToolStripMenuItem_Click); connectionToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[2] { connectToolStripMenuItem, disconnectToolStripMenuItem }); connectionToolStripMenuItem.Name = "connectionToolStripMenuItem"; connectionToolStripMenuItem.Size = new Size(81, 20); connectionToolStripMenuItem.Text = "&Connection"; connectToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p00000e; connectToolStripMenuItem.Name = "connectToolStripMenuItem"; connectToolStripMenuItem.Size = new Size(133, 22); connectToolStripMenuItem.Text = "&Connect"; connectToolStripMenuItem.Click += new EventHandler(connectToolStripMenuItem_Click); disconnectToolStripMenuItem.Image = (Image)OCTech.OBD2.Applications.Properties.Resources.p000027; disconnectToolStripMenuItem.Name = "disconnectToolStripMenuItem"; disconnectToolStripMenuItem.Size = new Size(133, 22); disconnectToolStripMenuItem.Text = "&Disconnect"; disconnectToolStripMenuItem.Click += new EventHandler(disconnectToolStripMenuItem_Click); toolsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[9] { vehicleManagerToolStripMenuItem, sensorCalibrationToolStripMenuItem, userDefinedPIDsToolStripMenuItem, pluginManagerToolStripMenuItem, toolStripSeparatorToolsMenu, pidInspectorToolStripMenuItem, powerSaveSetupToolStripMenuItem, toolStripSeparatorToolsMenu2, preferencesToolStripMenuItem }); toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; toolsToolStripMenuItem.Size = new Size(48, 20); toolsToolStripMenuItem.Text = "&Tools"; vehicleManagerToolStripMenuItem.Name = "vehicleManagerToolStripMenuItem"; vehicleManagerToolStripMenuItem.Size = new Size(179, 22); vehicleManagerToolStripMenuItem.Text = "Vehicle &Manager"; vehicleManagerToolStripMenuItem.Click += new EventHandler(vehicleManagerToolStripMenuItem_Click); sensorCalibrationToolStripMenuItem.Name = "sensorCalibrationToolStripMenuItem"; sensorCalibrationToolStripMenuItem.Size = new Size(179, 22); sensorCalibrationToolStripMenuItem.Text = "Sensor &Calibration"; sensorCalibrationToolStripMenuItem.Click += new EventHandler(sensorCalibrationToolStripMenuItem_Click); userDefinedPIDsToolStripMenuItem.Name = "userDefinedPIDsToolStripMenuItem"; userDefinedPIDsToolStripMenuItem.Size = new Size(179, 22); userDefinedPIDsToolStripMenuItem.Text = "&User-Defined PIDs"; userDefinedPIDsToolStripMenuItem.Click += new EventHandler(userDefinedPIDsToolStripMenuItem_Click); pluginManagerToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.p00005a; pluginManagerToolStripMenuItem.Name = "pluginManagerToolStripMenuItem"; pluginManagerToolStripMenuItem.Size = new Size(179, 22); pluginManagerToolStripMenuItem.Text = "Plugin Manager"; pluginManagerToolStripMenuItem.Click += new EventHandler(pluginManagerToolStripMenuItem_Click); toolStripSeparatorToolsMenu.Name = "toolStripSeparatorToolsMenu"; toolStripSeparatorToolsMenu.Size = new Size(176, 6); pidInspectorToolStripMenuItem.Enabled = false; pidInspectorToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.p000057; pidInspectorToolStripMenuItem.Name = "pidInspectorToolStripMenuItem"; pidInspectorToolStripMenuItem.Size = new Size(179, 22); pidInspectorToolStripMenuItem.Text = "PID Inspector"; pidInspectorToolStripMenuItem.Click += new EventHandler(pidInspectorToolStripMenuItem_Click); powerSaveSetupToolStripMenuItem.Enabled = false; powerSaveSetupToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.PowerSave16x16; powerSaveSetupToolStripMenuItem.Name = "powerSaveSetupToolStripMenuItem"; powerSaveSetupToolStripMenuItem.Size = new Size(179, 22); powerSaveSetupToolStripMenuItem.Text = "Power Save Settings"; powerSaveSetupToolStripMenuItem.Click += new EventHandler(powerSaveSetupToolStripMenuItem_Click); toolStripSeparatorToolsMenu2.Name = "toolStripSeparatorToolsMenu2"; toolStripSeparatorToolsMenu2.Size = new Size(176, 6); preferencesToolStripMenuItem.Image = OCTech.OBD2.Applications.Properties.Resources.p00005d; preferencesToolStripMenuItem.Name = "preferencesToolStripMenuItem"; preferencesToolStripMenuItem.Size = new Size(179, 22); preferencesToolStripMenuItem.Text = "&Preferences"; preferencesToolStripMenuItem.Click += new EventHandler(preferencesToolStripMenuItem_Click); toolStripContainer.ContentPanel.Controls.Add(tableLayoutPanel); toolStripContainer.ContentPanel.Padding = new Padding(0, 0, 0, 23); toolStripContainer.ContentPanel.Size = new Size(763, 458); toolStripContainer.Dock = DockStyle.Fill; toolStripContainer.Location = new Point(0, 0); toolStripContainer.Name = "toolStripContainer"; toolStripContainer.Size = new Size(763, 482); toolStripContainer.TabIndex = 0; toolStripContainer.TopToolStripPanel.Controls.Add(menuStrip); m_statusPortECU.Location = new Point(0, 459); m_statusPortECU.Name = "ultraStatusBar"; appearance.TextHAlignAsString = "Center"; m_statusPortECU.PanelAppearance = appearance; ultraStatusPanel1.Key = "InterfacePanel"; ultraStatusPanel1.SizingMode = PanelSizingMode.Automatic; ultraStatusPanel1.Style = PanelStyle.ControlContainer; ultraStatusPanel1.Width = 90; ultraStatusPanel2.Key = "ECUPanel"; ultraStatusPanel2.SizingMode = PanelSizingMode.Automatic; ultraStatusPanel2.Style = PanelStyle.ControlContainer; ultraStatusPanel2.Width = 75; ultraStatusPanel3.Key = "CurrentOperationPanel"; ultraStatusPanel3.SizingMode = PanelSizingMode.Automatic; ultraStatusPanel3.Visible = false; ultraStatusPanel3.Width = 90; ultraStatusPanel4.Key = "ErrorPanel"; ultraStatusPanel4.SizingMode = PanelSizingMode.Spring; ultraStatusPanel5.Key = "CalPanel"; ultraStatusPanel5.SizingMode = PanelSizingMode.Automatic; ultraStatusPanel5.Visible = false; ultraStatusPanel6.Key = "PlaybackTimePanel"; ultraStatusPanel6.SizingMode = PanelSizingMode.Automatic; ultraStatusPanel6.Visible = false; ultraStatusPanel7.Key = "PIDTimingPanel"; ultraStatusPanel7.Width = 85; ultraStatusPanel8.Key = "ClockPanel"; ultraStatusPanel8.SizingMode = PanelSizingMode.Automatic; ultraStatusPanel8.Style = PanelStyle.Time; m_statusPortECU.Panels.AddRange(new UltraStatusPanel[] { ultraStatusPanel1, ultraStatusPanel2, ultraStatusPanel3, ultraStatusPanel4, ultraStatusPanel5, ultraStatusPanel6, ultraStatusPanel7, ultraStatusPanel8 }); m_statusPortECU.Size = new Size(763, 23); m_statusPortECU.SizeGripVisible = DefaultableBoolean.False; m_statusPortECU.TabIndex = 1; m_statusPortECU.ViewStyle = ViewStyle.VisualStudio2005; this.AutoScaleDimensions = new SizeF(6f, 13f); AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new Size(763, 482); this.Controls.Add(m_statusPortECU); this.Controls.Add(toolStripContainer); this.MainMenuStrip = menuStrip; this.Margin = new Padding(2); this.Name= "MainForm"; StartPosition = FormStartPosition.CenterScreen; this.WindowState = FormWindowState.Maximized; tableLayoutPanel.ResumeLayout(false); menuStrip.ResumeLayout(false); menuStrip.PerformLayout(); toolStripContainer.ContentPanel.ResumeLayout(false); toolStripContainer.TopToolStripPanel.ResumeLayout(false); toolStripContainer.TopToolStripPanel.PerformLayout(); toolStripContainer.ResumeLayout(false); toolStripContainer.PerformLayout(); ((ISupportInitialize)m_statusPortECU).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Adds a user list as a CustomListView to the information panel. /// </summary> /// <param name="users"></param> /// <param name="ownName"></param> public void AddUserList(List<User> users, string ownName) { this.ownName = ownName; teamList = new CustomListView(); teamList.Name = "TeamList"; teamList.Size = new Size(200, 68); teamList.Columns.Add("Team Yellow", teamList.ClientSize.Width/2 + 2); teamList.Columns.Add("Team Red", teamList.ClientSize.Width/2 + 2); teamList.Dock = DockStyle.Right; teamList.View = View.Details; teamList.BorderStyle = System.Windows.Forms.BorderStyle.None; teamList.GridLines = true; teamList.BackColor = ColorTranslator.FromHtml("#6B260B"); teamList.ForeColor = Color.White; RefreshUserList(users); GeneralTlp.Controls.Add(teamList, 1, 0); Refresh(); }