public Dictionary(int cue, ProgressBar pBar) { bl = new BL(); DataTable dt = bl.GetAllTrainingSet(); switch (cue) { case 1: // Get All Words PopulateWordsTables(dt, pBar); break; case 2: // Preliminary Terms //DataTable //GetTerms( GetTermFrequencyData(pBar); break; case 3: // Create Dictionary CreateDictionary(pBar); break; case 4: // Create Features Sets HandleExtraInfo(pBar); break; }// Switch }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); // Lich hoc theo HK var rootView = inflater.Inflate (Resource.Layout.LichHoc_HK, container, false); isfirst = true; listView_HK = rootView.FindViewById<ListView> (Resource.Id.listLH); lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_LH); lbl_NH = rootView.FindViewById<TextView> (Resource.Id.lbl_NH_LH); progress = rootView.FindViewById<ProgressBar> (Resource.Id.progressLH); linear = rootView.FindViewById<LinearLayout>(Resource.Id.linear_HK_LH); linearLH = rootView.FindViewById<LinearLayout>(Resource.Id.linearLH); txtNotify = rootView.FindViewById<TextView>(Resource.Id.txtNotify_LT_HK); // radioGroup = rootView.FindViewById<RadioGroup>(Resource.Id.radioGroup1); bundle=this.Arguments; check = bundle.GetBoolean ("Remind"); autoupdate = bundle.GetBoolean ("AutoUpdateData"); //load data LoadData_HK (); // row click listView_HK.ItemLongClick += listView_ItemClick; return rootView; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.card_kitty); kittyImageView = (ImageView)FindViewById(Resource.Id.kittyImage); kittyProgressBar = (ProgressBar)FindViewById(Resource.Id.kittyProgress); gestureDetector = new GestureDetector(this); }
void Start() { timer = FindObjectOfType(typeof(ProgressBar)) as ProgressBar; if (timer == null) Debug.LogError ("No Timer, dude"); }
protected override void OnCreate(Bundle bundle) { Console.WriteLine("AboutActivity - OnCreate"); base.OnCreate(bundle); _navigationManager = Bootstrapper.GetContainer().Resolve<MobileNavigationManager>(); SetContentView(Resource.Layout.About); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetHomeButtonEnabled(true); _progressBar = FindViewById<ProgressBar>(Resource.Id.about_progressBar); _lblLoading = FindViewById<TextView>(Resource.Id.about_lblLoading); _webView = FindViewById<WebView>(Resource.Id.about_webView); _webViewClient = new MyWebViewClient(); _webViewClient.PageFinished += (sender, args) => { Animation anim = AnimationUtils.LoadAnimation(this, Resource.Animation.fade_out); anim.AnimationEnd += (animSender, animArgs) => { _lblLoading.Visibility = ViewStates.Gone; }; _lblLoading.StartAnimation(anim); Animation anim2 = AnimationUtils.LoadAnimation(this, Resource.Animation.fade_out); anim2.AnimationEnd += (animSender, animArgs) => { _progressBar.Visibility = ViewStates.Gone; }; _progressBar.StartAnimation(anim2); }; _webView.SetWebViewClient(_webViewClient); // Since the onViewReady action could not be added to an intent, tell the NavMgr the view is ready //((AndroidNavigationManager)_navigationManager).SetAboutActivityInstance(this); _navigationManager.BindAboutView(this); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.SearchActivity); searchViewModel = new SearchViewModel (Android.Application.Service, new Search ("Default")) { GroupByLastName = false, }; searchViewModel.SearchCompleted += HandleSearchCompleted; progressBar = FindViewById<ProgressBar> (Resource.Id.progressBar1); searchingText = FindViewById<TextView> (Resource.Id.emptyTextView); ListAdapter = new PeopleGroupsAdapter () { ItemsSource = searchViewModel.Groups, }; // Start the search var intent = Intent; if (!Intent.ActionSearch.Equals (intent.Action)) return; searchViewModel.SearchText = intent.GetStringExtra (SearchManager.Query); searchViewModel.SearchProperty = SearchProperty.All; searchViewModel.Search (); }
public override void Initialize() { base.Initialize(); Label message = new Label("Charging..."); AddComponent(message, 0, 100); Button shot = new Button("Shot!"); shot.Pressed += delegate { if (charged) { charger.Value = 0; charged = false; message.Text = "Charging..."; } }; AddComponent(shot, 150, 100); charger = new ProgressBar(); charger.Value = 0; charger.EndEvent += delegate { charged = true; message.Text = "Charged!"; }; AddComponent(charger, 0, 0); }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); var rootView = inflater.Inflate(Resource.Layout.Settings, container, false); cbNLT = rootView.FindViewById<CheckBox> (Resource.Id.ckboxRemindLT); cbUpdate=rootView.FindViewById<CheckBox> (Resource.Id.ckboxAutoUpdateData); btupdateData=rootView.FindViewById<Button> (Resource.Id.btUpdateData); progressup=rootView.FindViewById<ProgressBar> (Resource.Id.proUpdateData); txtResult = rootView.FindViewById<TextView> (Resource.Id.txtresult); progressNL=rootView.FindViewById<ProgressBar> (Resource.Id.proNL); //About TextView txtVersion = rootView.FindViewById<TextView> (Resource.Id.txtVersion_Set); txtVersion.Click += TxtVersion_Click; Bundle bundle=this.Arguments; bool check = bundle.GetBoolean ("Remind"); autoupdate = bundle.GetBoolean ("AutoUpdateData"); cbUpdate.Checked = autoupdate; cbNLT.Checked = check; btupdateData.Click+= BtupdateData_Click; cbNLT.CheckedChange += CbNLT_CheckedChange; cbUpdate.CheckedChange+= CbUpdate_CheckedChange; if (cbUpdate.Checked) { btupdateData.SetBackgroundResource (Android.Resource.Color.DarkerGray); } else { btupdateData.SetBackgroundResource (Android.Resource.Color.HoloBlueDark); } btupdateData.Enabled = !cbUpdate.Checked; return rootView; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); var client = new GitHubOrganisationEventClient(); // Alternative: Globale Events statt Organisation events anzeigen // var client = new GitHubGlobalEventClient(); var service = new GitHubEventService(client); var browserTask = new AndroidBrowserTask(this); _viewModel = new GitHubEventListViewModel(service, browserTask); _adapter = new GitHubEventListAdapter(this, _viewModel); Button button = FindViewById<Button>(Resource.Id.main_button_refresh); Button buttonWebsite = FindViewById<Button>(Resource.Id.main_button_website); ListView listView = FindViewById<ListView>(Resource.Id.main_listview); _progressBar = FindViewById<ProgressBar>(Resource.Id.main_progressBar); button.Click += Button_Click; buttonWebsite.Click += (o, e) => { _viewModel.GoToGithubDotCom(); }; listView.Adapter = _adapter; _viewModel.PropertyChanged += viewModel_PropertyChanged; UpdateViews(String.Empty); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); /* Layout attributen toewijzen aan code */ SetContentView(Resource.Layout.Main); mBtnLogin = FindViewById<Button>(Resource.Id.btn_login); mBtnRegistreer = FindViewById<Button>(Resource.Id.btn_registreer); mProgressbar = FindViewById<ProgressBar>(Resource.Id.progressBar1); /* Click events */ mBtnLogin.Click += (object sender, EventArgs args) => { FragmentTransaction transaction = FragmentManager.BeginTransaction(); Dialog_inloggen inlogdialog = new Dialog_inloggen(); inlogdialog.Show(transaction, "dialog fragment"); inlogdialog.logincompleet += Inlogdialog_logincompleet; }; mBtnRegistreer.Click += (object sender, EventArgs args) => //Click methode in zelfde methode { // dialog weergeven FragmentTransaction transaction = FragmentManager.BeginTransaction(); Dialog_registreer regdialog = new Dialog_registreer(); regdialog.Show(transaction, "dialog fragment"); regdialog.registreerCompleet += Regdialog_registreerCompleet; }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); RequestWindowFeature (WindowFeatures.ActionBarOverlay); ActionBar.SetBackgroundDrawable (new ColorDrawable (Color.Transparent)); SetContentView (Resource.Layout.Main); var list = FindViewById<OverscrollListView> (Resource.Id.listView1); loadingBars = FindViewById<LinearLayout> (Resource.Id.loadingBars); bar1 = FindViewById<ProgressBar> (Resource.Id.loadingBar1); bar2 = FindViewById<ProgressBar> (Resource.Id.loadingBar2); swipeText = FindViewById<TextView> (Resource.Id.swipeToRefreshText); // Remove progress bar background foreach (var p in new[] { bar1, bar2 }) { var layer = p.ProgressDrawable as LayerDrawable; if (layer != null) layer.SetDrawableByLayerId (Android.Resource.Id.Background, new ColorDrawable (Color.Transparent)); } list.OverScrolled += deltaY => { ShowSwipeDown (); accumulatedDeltaY += -deltaY; bar1.Progress = bar2.Progress = accumulatedDeltaY; if (accumulatedDeltaY == 0) HideSwipeDown (); }; list.OverScrollCanceled += HideSwipeDown; }
void Start() { ingredients = GameObject.FindGameObjectsWithTag("Ingredient"); pie = GameObject.FindObjectOfType<Pie>().GetComponent<Pie>(); progressBar = GameObject.FindObjectOfType<ProgressBar>().GetComponent<ProgressBar>(); gameController = GameObject.FindObjectOfType<GameController>().GetComponent<GameController>(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView (inflater, container, savedInstanceState); var view = inflater.Inflate (Resource.Layout.Tab1, container, false); var list = view.FindViewById<OverscrollListView> (Resource.Id.listView1); loadingBars = view.FindViewById<LinearLayout> (Resource.Id.loadingBars); bar1 = view.FindViewById<ProgressBar> (Resource.Id.loadingBar1); bar2 = view.FindViewById<ProgressBar> (Resource.Id.loadingBar2); swipeText = view.FindViewById<TextView> (Resource.Id.swipeToRefreshText); fakeActionBar = view.FindViewById<FrameLayout> (Resource.Id.fakeActionBar); // Remove progress bar background foreach (var p in new[] { bar1, bar2 }) { var layer = p.ProgressDrawable as LayerDrawable; if (layer != null) layer.SetDrawableByLayerId (Android.Resource.Id.Background, new ColorDrawable (Color.Transparent)); } list.OverScrolled += deltaY => { ShowSwipeDown (); accumulatedDeltaY += -deltaY; bar1.Progress = bar2.Progress = accumulatedDeltaY; if (accumulatedDeltaY == 0) HideSwipeDown (); }; list.OverScrollCanceled += HideSwipeDown; return view; }
public void BindDataToView(Post post, bool setHeight = false, ProgressBar progressBar = null, Action callBack = null) { Setup(); Clickable = false; ImageService.Instance.LoadUrl(StringUtils.GetPostImageURL(post)) .Retry(3, 200) .DownSample((Width == 0) ? TabHostActivity.GetTabHost().ScreenWidth : Width, 0) .FadeAnimation(true) .TransparencyChannel(false) .Transform(new RoundedTransformation(20, 0, 0)) .Success((FFImageLoading.Work.ImageInformation arg1, FFImageLoading.Work.LoadingResult arg2) => { if (progressBar != null) { progressBar.Visibility = ViewStates.Gone; } if (setHeight) { if (arg1.OriginalHeight > Width) { LayoutParameters.Height = (int)((float)arg1.OriginalHeight / (float)arg1.OriginalWidth * (float)((Width == 0) ? TabHostActivity.GetTabHost().ScreenWidth - 20 : Width)); } else { LayoutParameters.Height = (int)arg1.OriginalHeight; } RequestLayout(); if (callBack != null) { callBack(); } } }) .Into(this); }
public ProgressDialog (string title, CancelButtonType cancel_button_type, int total_count, Gtk.Window parent_window) { Title = title; this.total_count = total_count; if (parent_window != null) this.TransientFor = parent_window; HasSeparator = false; BorderWidth = 6; SetDefaultSize (300, -1); message_label = new Label (String.Empty); VBox.PackStart (message_label, true, true, 12); progress_bar = new ProgressBar (); VBox.PackStart (progress_bar, true, true, 6); switch (cancel_button_type) { case CancelButtonType.Cancel: button = (Gtk.Button)AddButton (Gtk.Stock.Cancel, (int) ResponseType.Cancel); break; case CancelButtonType.Stop: button = (Gtk.Button)AddButton (Gtk.Stock.Stop, (int) ResponseType.Cancel); break; } Response += new ResponseHandler (HandleResponse); }
void Awake() { hud = GetComponent<Hud>(); xpBar = transform.FindChild("Container").FindChild("ExpBar").GetComponent<ProgressBar>(); healthBar = transform.FindChild("Container").FindChild("HealthBar").GetComponent<ProgressBar>(); agentName = transform.FindChild("Container").FindChild("TopImage").GetComponentInChildren<Text>(); }
void KeepMe() { var txt = new TextView(null); txt.Text = txt.Text; var iv = new ImageView(null); var obj = iv.Drawable; var prog = new ProgressBar(null); prog.Progress = prog.Progress; var cb = new RadioButton(null); cb.Checked = cb.Checked; var np = new NumberPicker(null); np.Value = np.Value; var rb = new RatingBar(null); rb.Rating = rb.Rating; var cv = new CalendarView(null); cv.Date = cv.Date; var th = new TabHost(null); th.CurrentTab = th.CurrentTab; var tp = new TimePicker(null); tp.CurrentHour = tp.CurrentHour; tp.CurrentMinute = tp.CurrentMinute; }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); // Lich hoc theo HK // var rootView = inflater.Inflate(Resource.Layout.LichHoc_HK, container, false); // ListView listView = rootView.FindViewById<ListView>(Resource.Id.listLH); // // var t= BLichHoc.MakeDataFromXml(SQLite_Android.GetConnection ()); // List<LichHoc> listLH = BLichHoc.GetAll (SQLite_Android.GetConnection ()); // List<chiTietLH> listCT = new List<chiTietLH> (); // foreach (var item in listLH) { // listCT.AddRange(BLichHoc.GetCTLH (SQLite_Android.GetConnection (), item.Id)); // // } // // // LichHocHKAdapter adapter = new LichHocHKAdapter (Activity, listCT); // listView.Adapter = adapter; //Theo Tuan var rootView = inflater.Inflate(Resource.Layout.LichHoc_Tuan, container, false); listView = rootView.FindViewById<ExpandableListView>(Resource.Id.listLH_Tuan); progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressLHTuan); LoadData (); return rootView; }
private static void Main(string[] args) { Console.WriteLine("Performing some task... "); using (var progress = new ProgressBar<SimpleProgressInfo>()) using (new DoubleProgressAdapter(progress, "1")) using (ProgressScope.Start("1", 0, 1, "Starting")) { Thread.Sleep(1000); ProgressScope.Report(0.1, "One"); Thread.Sleep(1000); ProgressScope.Report(0.2); Thread.Sleep(1000); using (ProgressScope.Start("2", 0.3, 0.45)) { Thread.Sleep(1000); ProgressScope.Report(0.33); Thread.Sleep(1000); ProgressScope.Report(0.66, "tu"); Thread.Sleep(1000); } Thread.Sleep(1000); ProgressScope.Report(0.6, "Almost"); Thread.Sleep(1000); ProgressScope.Report(0.8); Thread.Sleep(1000); } Console.WriteLine("Done."); Console.ReadKey(); }
public void CreateDictionary(ProgressBar pBar) { DataTable dt = bl.GetAllPreliminaryTerms(); pBar.Value = 0; pBar.Maximum = dt.Rows.Count; foreach (DataRow row in dt.Rows) { string[] docs = row[2].ToString().Split('*'); string dictionaryFreq = ""; for (int i = 0; i < docs.Length; i++) { string doc = docs[i].Trim(); int docCounter = 0; for (int j = 0; j < docs.Length; j++) { if (doc == docs[j].Trim()) { docCounter++; docs[j] = ""; }// If }// For if (doc != "") dictionaryFreq += doc + "*" + docCounter + "*"; }// For int ansInsertToDictionary; bl.AddTermToDictionary(row[1].ToString().Trim(), dictionaryFreq, out ansInsertToDictionary); pBar.Value++; }// Foreach Word }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var login = FindViewById<Button>(Resource.Id.login); AuthenticationHelper.PlatformParameters = new PlatformParameters(this); progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar); progressBar.Indeterminate = true; progressBar.Visibility = ViewStates.Invisible; login.Click += async (sender, args) => { login.Enabled = false; progressBar.Visibility = ViewStates.Visible; var client = await AuthenticationHelper.GetCalendarClient(); progressBar.Visibility = ViewStates.Invisible; login.Enabled = true; if (client == null) { Toast.MakeText(this, "Login failed", ToastLength.Long).Show(); return; } StartActivity(typeof(MainActivity)); Finish(); }; if(Settings.TenantId != "common") { StartActivity(typeof(MainActivity)); Finish(); } }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.uploader; mTargetDevicePicker = (DevicePicker) FragmentManager.findFragmentById(R.id.targetPicker); mTargetDevicePicker.DeviceType = SmcDevice.TYPE_PROVIDER; mTargetDevicePicker.DeviceSelectedListener = this; mUploadButton = (Button) findViewById(R.id.button); mUploadButton.OnClickListener = uploadClickListener; progressBar = (ProgressBar) findViewById(R.id.progress); SmcItem.LocalContent content = LocalContent; if (content == null) { Toast.makeText(this, "Content not supported", Toast.LENGTH_SHORT).show(); this.finish(); } else { itemToUpload = new SmcItem(content); ((TextView)findViewById(R.id.header)).Text = "File: " + itemToUpload.Uri.ToString(); } }
public void AddSpinner(ViewGroup rootview,string loadingtext) { loading = true; if(loadingcontainer==null||(loadingcontainer!=null&&!loadingcontainer.IsShown)){ loadingcontainer = new RelativeLayout (nn_activity); loadingcontainer.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent); loadingcontainer.SetBackgroundColor (Color.White); var detailcontainer = new LinearLayout (nn_activity); detailcontainer.Orientation = Orientation.Vertical; RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams ((int)TapUtil.dptodx (100), RelativeLayout.LayoutParams.WrapContent); param.AddRule (LayoutRules.CenterInParent); detailcontainer.LayoutParameters = param; LinearLayout.LayoutParams linearlayoutparm = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent); linearlayoutparm.Gravity = GravityFlags.CenterHorizontal; ProgressBar progressbar = new ProgressBar (nn_activity); progressbar.LayoutParameters = linearlayoutparm; TextView tectview = new TextView (nn_activity); tectview.LayoutParameters = linearlayoutparm; tectview.Text = loadingtext; tectview.Gravity = GravityFlags.CenterHorizontal; detailcontainer.AddView (progressbar); detailcontainer.AddView (tectview); loadingcontainer.AddView (detailcontainer); rootview.AddView (loadingcontainer); } }
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); rootView = inflater.Inflate(Resource.Layout.HocPhi, container, false); Bundle bundle=this.Arguments; check = bundle.GetBoolean ("Remind"); autoupdate = bundle.GetBoolean ("AutoUpdateData"); progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressHP); listView = rootView.FindViewById<ListView>(Resource.Id.listHP); txtHocKyHP = rootView.FindViewById<TextView>(Resource.Id.txtHocKyHP); txtNotify = rootView.FindViewById<TextView> (Resource.Id.txtNotify_HP); linear = rootView.FindViewById<LinearLayout> (Resource.Id.linear10); //load data progress.Visibility = ViewStates.Visible; progress.Indeterminate = true; //progress.Indeterminate = true; LoadData (); return rootView; }
protected async override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.view_expenses); progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar); viewModel = ServiceContainer.Resolve<ExpensesViewModel>(); viewModel.IsBusyChanged = (busy) => { progressBar.Visibility = busy ? ViewStates.Visible : ViewStates.Gone; }; ListAdapter = new ExpenseAdapter(this, viewModel); ListView.ItemLongClick += async (sender, args) => { await viewModel.ExecuteDeleteExpenseCommand(viewModel.Expenses[args.Position]); RunOnUiThread(() => ((ExpenseAdapter)ListAdapter).NotifyDataSetChanged()); }; if (!viewModel.IsSynced) { await Authenticate(); await viewModel.ExecuteSyncExpensesCommand(); RunOnUiThread(() => ((ExpenseAdapter)ListAdapter).NotifyDataSetChanged()); } }
protected override void OnCreate (Bundle icicle) { //base.OnCreate(icicle); if (!LibsChecker.CheckVitamioLibs (this)) return; SetContentView (Resource.Layout.videobuffer); mVideoView = FindViewById<VideoView> (Resource.Id.buffer); pb = FindViewById<ProgressBar> (Resource.Id.probar); downloadRateView = FindViewById<TextView> (Resource.Id.download_rate); loadRateView = FindViewById<TextView> (Resource.Id.load_rate); if (path == "") { // Tell the user to provide a media file URL/path. Toast.MakeText (this, "Please edit VideoBuffer Activity, and set path" + " variable to your media file URL/path", ToastLength.Long).Show (); return; } else { // // * Alternatively,for streaming media you can use // * mVideoView.setVideoURI(Uri.parse(URLstring)); // uri = Android.Net.Uri.Parse (path); mVideoView.SetVideoURI (uri); mVideoView.SetMediaController (new MediaController (this)); mVideoView.RequestFocus (); mVideoView.SetOnInfoListener (this); mVideoView.SetOnBufferingUpdateListener (this); mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => { e.P0.SetPlaybackSpeed(1.0f); }; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.TimeTable); TimeColumns = new List<TextView>(16); foreach (string day in new string[] {"Today","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"}) TabHost.AddTab(NewTab(day)); //magical tab jumping to actually create the content in the tabs #lolandroid TabHost.CurrentTab = 0; TabHost.CurrentTab = 1; TabHost.CurrentTab = 2; TabHost.CurrentTab = 3; TabHost.CurrentTab = 4; TabHost.CurrentTab = 5; TabHost.CurrentTab = 6; TabHost.CurrentTab = 7; TabHost.CurrentTab = 8; TabHost.CurrentTab = 0; loadingBar = FindViewById<ProgressBar>(Resource.Id.progressBar1); loadingBar.Indeterminate = true; TodayDepartStringEventFirer = DataGetter.StringEventHandler; if (DataGetter.StringEventHandler != null) DataGetter.StringEventHandler.Changed += new StringEventFirer.ChangedEventHandler(TimetableStringChanged); }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView (Resource.Layout.main_activity); mResultReceiver = new AddressResultReceiver (new Handler ()); mResultReceiver.OnReceiveResultImpl = (resultCode, resultData) => { mAddressOutput = resultData.GetString (Constants.ResultDataKey); DisplayAddressOutput (); if (resultCode == 0) { ShowToast (GetString (Resource.String.address_found)); } mAddressRequested = false; UpdateUIWidgets (); }; mLocationAddressTextView = FindViewById<TextView> (Resource.Id.location_address_view); mProgressBar = FindViewById<ProgressBar> (Resource.Id.progress_bar); mFetchAddressButton = FindViewById<Button> (Resource.Id.fetch_address_button); mFetchAddressButton.Click += FetchAddressButtonHandler; mAddressOutput = string.Empty; UpdateValuesFromBundle (savedInstanceState); UpdateUIWidgets (); BuildGoogleApiClient (); }
protected override void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); SetContentView (Resource.Layout.activity_main); mRegistrationProgressBar = FindViewById<ProgressBar> (Resource.Id.registrationProgressBar); mRegistrationBroadcastReceiver = new BroadcastReceiver (); mRegistrationBroadcastReceiver.OnReceiveImpl = (context, intent) => { mRegistrationProgressBar.Visibility = ViewStates.Gone; var sharedPreferences = PreferenceManager.GetDefaultSharedPreferences (context); var sentToken = sharedPreferences.GetBoolean (QuickstartPreferences.SENT_TOKEN_TO_SERVER, false); if (sentToken) { mInformationTextView.Text = GetString (Resource.String.gcm_send_message); } else { mInformationTextView.Text = GetString (Resource.String.token_error_message); } }; mInformationTextView = FindViewById<TextView> (Resource.Id.informationTextView); if (CheckPlayServices ()) { // Start IntentService to register this application with GCM. var intent = new Intent (this, typeof(RegistrationIntentService)); StartService (intent); } }
/// <summary> /// Set the progress bar and status label to enable progress reporting on the UI. /// </summary> public void SetProgressReporting(ProgressBar progressBar, Label progressLabel) { this.progressBar = progressBar; this.progressLabel = progressLabel; }
public ObjectThread(ProgressBar _bar_) { this._bar = _bar_; }
private void GetAlarmsEvents(ProgressBar progress, ushort FC, ushort quantity, bool getAlarms) { progress.Value = 0; string OmniIP = "10.10.1." + Convert.ToString(FC + 10); TcpClient client = new TcpClient(OmniIP, 502); client.ReceiveTimeout = 500; ModbusIpMaster master = ModbusIpMaster.CreateIp(client); //Create text file string fileName; if (getAlarms) { fileName = "FC" + Convert.ToString(FC) + "_alarms.txt"; } else { fileName = "FC" + Convert.ToString(FC) + "_events.txt"; } TextWriter txt = new StreamWriter(fileName); //Number of events to load master.WriteSingleRegister((byte)1, (ushort)3769, quantity); //Send command to load Events on buffer byte commandByte; if (getAlarms) { commandByte = 0x10; } else { commandByte = 0x80; } //byte[] invCommandBytes = new byte[] { 0, commandNibble, 0, 0 }; RegisterCollection invCommand = new RegisterCollection(new byte[] { 0, commandByte, 0, 0 }); CustomWriteMultipleRegistersRequest reqCommand = new CustomWriteMultipleRegistersRequest(16, 1, 15129, invCommand); master.ExecuteCustomMessage <CustomWriteMultipleRegistersResponse>(reqCommand); //Wait buffer is ready CustomReadHoldingRegistersResponse cmdReg; do { CustomReadHoldingRegistersRequest readCmd = new CustomReadHoldingRegistersRequest(3, 1, 15129, 1); cmdReg = master.ExecuteCustomMessage <CustomReadHoldingRegistersResponse>(readCmd); //Console.WriteLine(Convert.ToString(cmdReg.Data[1])); ----Old command for console version---- } while (cmdReg.Data[1] != 0); //Read buffer int endIndex; int CRIndex; DateTime timeStamp; IFormatProvider dateFormat = new System.Globalization.CultureInfo("en-GB"); for (ushort i = 0; i < 600; i++) { try //send request to Omni for the current package { CustomReadBufferRequest reqBuffer = new CustomReadBufferRequest(65, 1, 9402, i); CustomReadBufferResponse packet = master.ExecuteCustomMessage <CustomReadBufferResponse>(reqBuffer); //stop if find end of file endIndex = packet.StrData.IndexOf(Convert.ToChar(26)); //get index of end of file if exists if (endIndex != -1) //if end of file was found { txt.Write(packet.StrData.Substring(0, endIndex)); break; } //stop if find time before yesterday at 17:00 try { CRIndex = packet.StrData.IndexOf(Convert.ToChar(13));//get index of carriage return to find date if (getAlarms) { timeStamp = Convert.ToDateTime(packet.StrData.Substring(CRIndex + 1, 19), dateFormat); } else { timeStamp = Convert.ToDateTime(packet.StrData.Substring(CRIndex + 10, 18), dateFormat); } if (timeStamp < DateTime.Today.AddDays(-1).AddHours(17)) { txt.Write(packet.StrData.Substring(0, CRIndex)); break; } } catch { } txt.Write(packet.StrData); progress.Increment(1); } catch //if request timeout, omni is refilling buffer { System.Threading.Thread.Sleep(3000); //delay 3s //Restart client connection client.Close(); client = new TcpClient(OmniIP, 502); client.ReceiveTimeout = 500; master = ModbusIpMaster.CreateIp(client); progress.Value = 0; i--;//decrement packet index to reapeat the request } } progress.Value = 63; txt.Close(); client.Close(); }
//Constructor public ProgressBarObserver(ProgressEventSubject subject, ProgressBar progress) : base(subject) { this.progress = progress; }
// Use this for initialization void Start() { Instance = this; }
public void Init() { var tl1 = new TableLayout { Padding = new Padding(5), Spacing = new Size(10, 10) }; var tr1 = new TableRow(); tr1.Cells.Add(new Label { Text = "Schedule", Font = new Font(SystemFont.Default, UI.Shared.Common.GetEditorFontSize()), VerticalAlignment = VerticalAlignment.Center }); cbsc = new DropDown { Width = 300 }; if (cbsc.Items.Count > 0) { cbsc.SelectedIndex = 0; } cbsc.SelectedIndexChanged += (s, e) => { if (cbsc.SelectedIndex < 0) { return; } Flowsheet.DynamicsManager.CurrentSchedule = Flowsheet.DynamicsManager.ScheduleList.Values.ToList()[cbsc.SelectedIndex].ID; }; tr1.Cells.Add(cbsc); tr1.Cells.Add(null); btnViewResults = new Button { Text = "View Results" }; tr1.Cells.Add(btnViewResults); tl1.Rows.Add(tr1); Rows.Add(new TableRow(tl1)); var tl2 = new TableLayout { Padding = new Padding(5), Spacing = new Size(10, 10) }; var tr2 = new TableRow(); btnPlay = new Button { ImagePosition = ButtonImagePosition.Overlay, Text = "", Width = 40, Height = 40, Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-play.png", this.GetType().Assembly)).WithSize(30, 30) }; btnRT = new Button { ImagePosition = ButtonImagePosition.Overlay, Text = "", Width = 40, Height = 40, Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-realtime.png", this.GetType().Assembly)).WithSize(30, 30) }; btnStop = new Button { ImagePosition = ButtonImagePosition.Overlay, Text = "", Width = 40, Height = 40, Image = new Bitmap(Eto.Drawing.Bitmap.FromResource(imgprefix + "icons8-stop.png", this.GetType().Assembly)).WithSize(30, 30) }; pbProgress = new ProgressBar { MinValue = 0, MaxValue = 100 }; lbStatus = new Label { Text = "00:00:00/00:30:00", Font = new Font(SystemFont.Default, UI.Shared.Common.GetEditorFontSize()), VerticalAlignment = VerticalAlignment.Center }; tr2.Cells.Add(btnPlay); tr2.Cells.Add(btnRT); tr2.Cells.Add(btnStop); tr2.Cells.Add(lbStatus); tr2.Cells.Add(pbProgress); tl2.Rows.Add(tr2); Rows.Add(new TableRow(tl2)); Rows.Add(null); this.MouseEnter += (s, e) => { var prevsel = -1; if (cbsc.Items.Count > 0) { prevsel = cbsc.SelectedIndex; } cbsc.Items.Clear(); foreach (var sch in Flowsheet.DynamicsManager.ScheduleList.Values) { if (sch.CurrentIntegrator != "") { var integ = Flowsheet.DynamicsManager.IntegratorList[sch.CurrentIntegrator].Description; cbsc.Items.Add(sch.Description + " (" + integ + ")"); } else { cbsc.Items.Add(sch.Description); } } if (cbsc.Items.Count > 0) { cbsc.SelectedIndex = 0; } try { if (prevsel != -1) { cbsc.SelectedIndex = prevsel; } } catch { } }; btnStop.Click += (s, e) => { Abort = true; }; btnPlay.Click += (s, e) => { if (Flowsheet.DynamicMode) { RunIntegrator(false, false); } else { Flowsheet.ShowMessage("Dynamic Mode is inactive.", Interfaces.IFlowsheet.MessageType.Warning); } }; btnRT.Click += (s, e) => { if (Flowsheet.DynamicMode) { RunIntegrator(true, false); } else { Flowsheet.ShowMessage("Dynamic Mode is inactive.", Interfaces.IFlowsheet.MessageType.Warning); } }; btnViewResults.Click += btnViewResults_Click; }
private void InitializeComponent() { components = new System.ComponentModel.Container(); m_list = new ListView(); columnHeader1 = new ColumnHeader(); columnHeader3 = new ColumnHeader(); columnHeader2 = new ColumnHeader(); columnHeader4 = new ColumnHeader(); columnHeader5 = new ColumnHeader(); m_progresslabel = new System.Windows.Forms.Label(); m_progressBar = new ProgressBar(); m_zedGraphCtl = new ZedGraphControl(); SuspendLayout(); // // m_list // m_list.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Right; m_list.Columns.AddRange(new ColumnHeader[] { columnHeader1, columnHeader3, columnHeader2, columnHeader4, columnHeader5 }); m_list.FullRowSelect = true; m_list.GridLines = true; m_list.Location = new Point(639, 1); m_list.Name = "m_list"; m_list.Size = new Size(368, 250); m_list.TabIndex = 7; m_list.UseCompatibleStateImageBehavior = false; m_list.View = View.Details; // // columnHeader1 // columnHeader1.Text = "Sequence no"; columnHeader1.Width = 32; // // columnHeader3 // columnHeader3.Text = "Time"; columnHeader3.Width = 96; // // columnHeader2 // columnHeader2.Text = "Type"; columnHeader2.Width = 110; // // columnHeader4 // columnHeader4.Text = "Value"; // // columnHeader5 // columnHeader5.Text = "Status"; // // m_progresslabel // m_progresslabel.Anchor = AnchorStyles.None; m_progresslabel.BackColor = SystemColors.Window; m_progresslabel.Location = new Point(207, 89); m_progresslabel.Name = "m_progresslabel"; m_progresslabel.Size = new Size(231, 21); m_progresslabel.TabIndex = 6; m_progresslabel.Text = "Downloads in Progress (0%)"; m_progresslabel.TextAlign = ContentAlignment.MiddleCenter; // // m_progressBar // m_progressBar.Anchor = AnchorStyles.None; m_progressBar.Location = new Point(207, 113); m_progressBar.Name = "m_progressBar"; m_progressBar.Size = new Size(231, 23); m_progressBar.TabIndex = 4; // // m_zedGraphCtl // m_zedGraphCtl.Anchor = ((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right; m_zedGraphCtl.IsShowPointValues = true; m_zedGraphCtl.Location = new Point(0, 1); m_zedGraphCtl.Name = "m_zedGraphCtl"; m_zedGraphCtl.ScrollGrace = 0D; m_zedGraphCtl.ScrollMaxX = 0D; m_zedGraphCtl.ScrollMaxY = 0D; m_zedGraphCtl.ScrollMaxY2 = 0D; m_zedGraphCtl.ScrollMinX = 0D; m_zedGraphCtl.ScrollMinY = 0D; m_zedGraphCtl.ScrollMinY2 = 0D; m_zedGraphCtl.Size = new Size(639, 250); m_zedGraphCtl.TabIndex = 5; m_zedGraphCtl.UseExtendedPrintDialog = true; // // TrendLogDisplay // ClientSize = new Size(1007, 251); Controls.Add(m_list); Controls.Add(m_progresslabel); Controls.Add(m_progressBar); Controls.Add(m_zedGraphCtl); Name = "TrendLogDisplay"; ResumeLayout(false); }
private void InitializeComponent() { this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.NAME = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.SQL = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.textBox4 = new System.Windows.Forms.TextBox(); this.button6 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.dataGridView2 = new System.Windows.Forms.DataGridView(); this.MR_CLASS = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.MR_CODE = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.TOPIC = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.button4 = new System.Windows.Forms.Button(); this.textBox3 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.radioButton2 = new System.Windows.Forms.RadioButton(); this.radioButton1 = new System.Windows.Forms.RadioButton(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.button3 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.tabPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit(); this.tabPage3.SuspendLayout(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(439, 476); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 24); this.button1.TabIndex = 0; this.button1.Text = "写回"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click_1); // // button2 // this.button2.Location = new System.Drawing.Point(468, 6); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(75, 24); this.button2.TabIndex = 0; this.button2.Text = "保存"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button1_Click); // // dataGridView1 // this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.NAME, this.SQL }); this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridView1.Location = new System.Drawing.Point(0, 0); this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.RowHeadersWidth = 10; this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.Size = new System.Drawing.Size(548, 393); this.dataGridView1.TabIndex = 1; this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); // // NAME // this.NAME.DataPropertyName = "name"; this.NAME.HeaderText = "NAME"; this.NAME.Name = "NAME"; this.NAME.Width = 200; // // SQL // this.SQL.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.SQL.DataPropertyName = "sql"; this.SQL.HeaderText = "SQL"; this.SQL.Name = "SQL"; // // tabControl1 // this.tabControl1.Controls.Add(this.tabPage1); this.tabControl1.Controls.Add(this.tabPage2); this.tabControl1.Controls.Add(this.tabPage3); this.tabControl1.Dock = System.Windows.Forms.DockStyle.Top; this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; this.tabControl1.Size = new System.Drawing.Size(562, 470); this.tabControl1.TabIndex = 2; this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged); // // tabPage1 // this.tabPage1.AutoScroll = true; this.tabPage1.Controls.Add(this.progressBar1); this.tabPage1.Controls.Add(this.splitContainer1); this.tabPage1.Location = new System.Drawing.Point(4, 26); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Size = new System.Drawing.Size(554, 440); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "DB"; this.tabPage1.UseVisualStyleBackColor = true; // // progressBar1 // this.progressBar1.Location = new System.Drawing.Point(154, 209); this.progressBar1.Name = "progressBar1"; this.progressBar1.Size = new System.Drawing.Size(246, 23); this.progressBar1.TabIndex = 2; this.progressBar1.Visible = false; // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Location = new System.Drawing.Point(3, 3); this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer1.Panel1 // this.splitContainer1.Panel1.Controls.Add(this.textBox4); this.splitContainer1.Panel1.Controls.Add(this.button6); this.splitContainer1.Panel1.Controls.Add(this.button2); this.splitContainer1.Panel1.Controls.Add(this.button7); this.splitContainer1.Panel1.Controls.Add(this.button5); // // splitContainer1.Panel2 // this.splitContainer1.Panel2.AutoScroll = true; this.splitContainer1.Panel2.Controls.Add(this.dataGridView1); this.splitContainer1.Size = new System.Drawing.Size(548, 434); this.splitContainer1.SplitterDistance = 37; this.splitContainer1.TabIndex = 3; // // textBox4 // this.textBox4.Location = new System.Drawing.Point(5, 6); this.textBox4.Name = "textBox4"; this.textBox4.Size = new System.Drawing.Size(208, 23); this.textBox4.TabIndex = 1; this.textBox4.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox4_KeyDown_1); this.textBox4.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox4_KeyUp); this.textBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox4_KeyPress); // // button6 // this.button6.Location = new System.Drawing.Point(229, 6); this.button6.Name = "button6"; this.button6.Size = new System.Drawing.Size(75, 24); this.button6.TabIndex = 0; this.button6.Text = "同步"; this.button6.UseVisualStyleBackColor = true; this.button6.Click += new System.EventHandler(this.button6_Click); // // button7 // this.button7.Location = new System.Drawing.Point(310, 6); this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(75, 24); this.button7.TabIndex = 0; this.button7.Text = "添加"; this.button7.UseVisualStyleBackColor = true; this.button7.Click += new System.EventHandler(this.button7_Click); // // button5 // this.button5.Location = new System.Drawing.Point(391, 6); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(75, 24); this.button5.TabIndex = 0; this.button5.Text = "删除"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // tabPage2 // this.tabPage2.Controls.Add(this.dataGridView2); this.tabPage2.Controls.Add(this.button4); this.tabPage2.Controls.Add(this.textBox3); this.tabPage2.Controls.Add(this.textBox2); this.tabPage2.Controls.Add(this.textBox1); this.tabPage2.Controls.Add(this.label4); this.tabPage2.Controls.Add(this.label2); this.tabPage2.Controls.Add(this.label3); this.tabPage2.Controls.Add(this.label1); this.tabPage2.Controls.Add(this.radioButton2); this.tabPage2.Controls.Add(this.radioButton1); this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); this.tabPage2.Size = new System.Drawing.Size(554, 444); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "FILE"; this.tabPage2.UseVisualStyleBackColor = true; // // dataGridView2 // this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.MR_CLASS, this.MR_CODE, this.TOPIC }); this.dataGridView2.Location = new System.Drawing.Point(116, 68); this.dataGridView2.Name = "dataGridView2"; this.dataGridView2.RowHeadersWidth = 10; this.dataGridView2.RowTemplate.Height = 23; this.dataGridView2.Size = new System.Drawing.Size(393, 274); this.dataGridView2.TabIndex = 11; this.dataGridView2.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView2_CellContentClick); // // MR_CLASS // this.MR_CLASS.DataPropertyName = "MR_CLASS"; this.MR_CLASS.HeaderText = "MR_CLASS"; this.MR_CLASS.Name = "MR_CLASS"; // // MR_CODE // this.MR_CODE.DataPropertyName = "MR_CODE"; this.MR_CODE.HeaderText = "MR_CODE"; this.MR_CODE.Name = "MR_CODE"; // // TOPIC // this.TOPIC.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.TOPIC.DataPropertyName = "TOPIC"; this.TOPIC.HeaderText = "TOPIC"; this.TOPIC.Name = "TOPIC"; // // button4 // this.button4.Location = new System.Drawing.Point(434, 410); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(75, 24); this.button4.TabIndex = 10; this.button4.Text = "确定"; this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // // textBox3 // this.textBox3.Enabled = false; this.textBox3.Location = new System.Drawing.Point(116, 380); this.textBox3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.textBox3.Name = "textBox3"; this.textBox3.Size = new System.Drawing.Size(393, 23); this.textBox3.TabIndex = 8; // // textBox2 // this.textBox2.Location = new System.Drawing.Point(116, 349); this.textBox2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(393, 23); this.textBox2.TabIndex = 8; this.textBox2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(116, 38); this.textBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(393, 23); this.textBox1.TabIndex = 9; this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); this.textBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyUp); this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); // // label4 // this.label4.AutoSize = true; this.label4.Enabled = false; this.label4.Location = new System.Drawing.Point(32, 383); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(52, 17); this.label4.TabIndex = 7; this.label4.Text = "RESULT"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(32, 352); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(64, 17); this.label2.TabIndex = 7; this.label2.Text = "ELEMENT"; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(32, 9); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(44, 17); this.label3.TabIndex = 6; this.label3.Text = "CLASS"; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(32, 41); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(73, 17); this.label1.TabIndex = 5; this.label1.Text = "FILE_NAME"; // // radioButton2 // this.radioButton2.AutoSize = true; this.radioButton2.Checked = true; this.radioButton2.Location = new System.Drawing.Point(272, 9); this.radioButton2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.radioButton2.Name = "radioButton2"; this.radioButton2.Size = new System.Drawing.Size(50, 21); this.radioButton2.TabIndex = 3; this.radioButton2.TabStop = true; this.radioButton2.Tag = "元素"; this.radioButton2.Text = "元素"; this.radioButton2.UseVisualStyleBackColor = true; this.radioButton2.Click += new System.EventHandler(this.radioButton1_Click); // // radioButton1 // this.radioButton1.AutoSize = true; this.radioButton1.Location = new System.Drawing.Point(116, 7); this.radioButton1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); this.radioButton1.Name = "radioButton1"; this.radioButton1.Size = new System.Drawing.Size(62, 21); this.radioButton1.TabIndex = 4; this.radioButton1.Tag = "层次号"; this.radioButton1.Text = "层次号"; this.radioButton1.UseVisualStyleBackColor = true; this.radioButton1.Click += new System.EventHandler(this.radioButton1_Click); // // tabPage3 // this.tabPage3.Controls.Add(this.richTextBox1); this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Name = "tabPage3"; this.tabPage3.Size = new System.Drawing.Size(554, 444); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "TABLE"; this.tabPage3.UseVisualStyleBackColor = true; // // richTextBox1 // this.richTextBox1.Location = new System.Drawing.Point(3, 3); this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Size = new System.Drawing.Size(548, 434); this.richTextBox1.TabIndex = 0; this.richTextBox1.Text = ""; // // button3 // this.button3.Location = new System.Drawing.Point(39, 476); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(75, 24); this.button3.TabIndex = 4; this.button3.Text = "关闭"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // DBTemplet // this.ClientSize = new System.Drawing.Size(562, 508); this.Controls.Add(this.button3); this.Controls.Add(this.tabControl1); this.Controls.Add(this.button1); this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "DBTemplet"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "章节选取"; this.Load += new System.EventHandler(this.DBTemplet_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel1.PerformLayout(); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); this.tabPage2.ResumeLayout(false); this.tabPage2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit(); this.tabPage3.ResumeLayout(false); this.ResumeLayout(false); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerView); activityIndicator = FindViewById<ProgressBar>(Resource.Id.activityIndicator); activityIndicator.Visibility = Android.Views.ViewStates.Visible; layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false); recyclerView.SetLayoutManager(layoutManager); var repository = new MoviesRepository(); var films = await repository.GetAllFilms(); var moviesAdapter = new MovieAdapter(films.results); recyclerView.SetAdapter(moviesAdapter); activityIndicator.Visibility = Android.Views.ViewStates.Gone; SupportActionBar.SetDisplayHomeAsUpEnabled(false); SupportActionBar.SetHomeButtonEnabled(false); }