Example #1
0
        private void initializeFunction()               // To initialize the views
        {
            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            arrayList       = new ArrayList();
            utils           = new Utils();
            progressLoader  = new ProgressLoader(this);
            httpClient      = new HttpClient();
            clickListener   = this;
            searchButton    = FindViewById <Button>(Resource.Id.search_button);
            srTxt           = FindViewById <TextView>(Resource.Id.srtxt);
            alertText       = FindViewById <TextView>(Resource.Id.alertText);
            searchTextValue = FindViewById <TextInputEditText>(Resource.Id.textInput1);


            mRecyclerView = FindViewById <RecyclerView>(Resource.Id.subreddit__list);
            var layoutManager = new LinearLayoutManager(this)
            {
                Orientation = LinearLayoutManager.Vertical
            };

            mRecyclerView.SetLayoutManager(layoutManager);
            mRecyclerView.HasFixedSize = true;
        }
Example #2
0
 /// <summary>
 /// 创建数据库适配器对象,执行用户自定义方法
 /// </summary>
 /// <param name="cmd_str">数据库命令字符串</param>
 /// <param name="conn">连接的数据库对象</param>
 /// <param name="callback">用户自定义方法</param>
 public static void SetMySqlDataAdapter(string cmd_str, MySqlConnection conn, AdapterCallBack callback)
 {
     lock (conn) {
         MySqlDataAdapter adapter = new MySqlDataAdapter(cmd_str, conn);
         callback(adapter);
     }
 }
Example #3
0
 public AdapterChoosingForm(NetworkInterface OldAdapter, AdapterCallBack SetAdapter)
 {
     InitializeComponent();
     this.SetAdapter = SetAdapter;
     NetworkInterface[] AdaptersRange = NetworkInterface.GetAllNetworkInterfaces();
     Adapters = new List <NetworkInterface>();
     for (int i = 0; i < AdaptersRange.Length; ++i)
     {
         if (AdaptersRange[i].OperationalStatus == OperationalStatus.Up && AdaptersRange[i].NetworkInterfaceType != NetworkInterfaceType.Loopback && getAdapterIPAddress(AdaptersRange[i]) != IPAddress.Any)
         {
             Adapters.Add(AdaptersRange[i]);
             AdapterBox.Items.Add(AdaptersRange[i].Name + " Status: " + AdaptersRange[i].OperationalStatus.ToString() + " Type: " + AdaptersRange[i].NetworkInterfaceType);
             if (AdaptersRange[i].Id == OldAdapter.Id)
             {
                 AdapterBox.SelectedIndex = AdapterBox.Items.Count - 1;
                 CurAdapterLab.Text       = AdaptersRange[i].Name + " Status: " + AdaptersRange[i].OperationalStatus.ToString() + " Type: " + AdaptersRange[i].NetworkInterfaceType;
             }
         }
     }
     if (AdapterBox.SelectedIndex == -1 && AdapterBox.Items.Count != 0)
     {
         AdapterBox.SelectedIndex = 0;
     }
 }
Example #4
0
 /// <summary>
 /// 创建数据库适配器对象,执行用户自定义方法
 /// </summary>
 /// <param name="cmd_str">数据库命令字符串</param>
 /// <param name="conn">连接的数据库对象</param>
 /// <param name="callback">用户自定义方法</param>
 public static void SetMySqlDataAdapter(string cmd_str, MySqlConnection conn, ref MySqlAdapter uadapter, AdapterCallBack callback)
 {
     lock (conn) {
         MySqlDataAdapter adapter = new MySqlDataAdapter(cmd_str, conn);
         uadapter.adapter = adapter;
         callback(ref uadapter);
     }
 }
 public MyAdapter(ArrayList items, LoginActivity loginActivity, RecyclerView mRecyclerView, AdapterCallBack clickListener)
 {
     this.items         = items;
     this.clickListener = clickListener;
 }