Code Visual Studio (Preview)
Last night, I went to the .Net User Group in Brisbane. The speaker introduced the new product from Microsoft, Code. That is a visual studio style code editor. Well, that is not very impressive at all.
You are not right, that is an very interesting product. It can run in OSX,Linux and WIndows. It provides a tool to work on interface codes outside from Windows. It made my life easier, I can do all js and shtml in OSX and leave only a bit little c# code which I can do in visual studio in windows VM.
Although it is a code editor, it still has some debugging features, it can debug node and mono application.
Lastly, even you only require to use Windows, that is still good to try this. This is without all heavy weighted features from Visual Studio. It load up so quick and less chances to break! That is very cool to use!
Preview Visual Studio 2015
Yesterday, I fired a Virtual Machine with Visual Studio 2015 RC. This is the best way to try out this. Unless you need to download the installation files and install them. I think it requires about an hour, firing a VM is only about 3 minutes.
I tried it for a little while, that is not bad at all. The major improvements are in mobile app development, it has a better integration with xamarin. However, you still need to download xamarin.
Display Objects in MultiAutoCompleteTextView
To display object value in MultiAutoCompleteTextView, you have to build a custom adapter:
For example, I have a tag class, which has Id field and name field.
Firstly, you need to have an adapter
Code
public View getView(int position, View convertView, ViewGroup parent) { | |
View v = convertView; | |
Holder holder; | |
if (v == null) { | |
LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
v = vi.inflate(R.layout.autocomplete_layout, null); | |
holder= new Holder(); | |
| |
holder.Name=(TextView)v.findViewById(R.id.tagText); | |
convertView = v; | |
convertView.setTag(holder); | |
}else{ | |
holder=(Holder)convertView.getTag(); | |
} | |
Tag tag = items.get(position); | |
if (tag != null) { | |
holder.Name.setText(""+items.get(position).getTitle()); | |
TextView tagLabel = (TextView) v.findViewById(R.id.tagText); | |
if (tagLabel != null) { | |
tagLabel.setText(tag.getTitle()); | |
} | |
} | |
return v; | |
} | |
| |
private class Holder{ | |
| |
| |
public TextView Name; | |
| |
| |
} |
Then you need to change in CreateView at the fragment class
multiAutoCompleteTextView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
List tagList = app.GetTags();
TagAdapter tagAdapter= new TagAdapter((Context)getActivity(),tagList);
multiAutoCompleteTextView.setThreshold(1);
multiAutoCompleteTextView.setAdapter(tagAdapter);
ck -->
Stream 13 is a lifesaver
I bought stream 13 in Hong Kong for only HKD$2100. Well, that is not good enough to be a develop box. However, that is very lightweight(around 1.5kg), long battery life and inexpensive. That is very suitable to carry around. Although that is not very powerful, it is still good enough to remote desktop to my pc at our office for work and a server in a data center. I used it to do a few times for restarting servers. It already saved me a number of times to drive back to home. The fuel and time has already paid the cost to buy this laptop!
Custom ASP.NET Identity MVC 5 - Part 1
I am working a new version of AdvGen CMS. I found the ApplicationUserManager has to use their Entity Framework. I cannot just build our own ApplicationUserManager to switch a different ORM layer. You have to build your own IUserStore like this:
public class AdvGenUserStroe : IUserStore
-->
And then build your own ApplicationUserManager which is using this custom user store.
This is the only way to have a Custom ASP.NET Identity in MVC 5