NSTokenField for WinForms - winforms

Is there an available NSTokenField replacement from Mac OS X that I can use with WinForms? I would like to be able to add them by just manipulating the string with my tokens like this: "$MyToken$" and be replaced with "My Token" (I would have a data structure with this information) with the highlighted token. Like this: NSTokenField with mixed token/string input, possible?
Also, I would like it to have have a little X button to remove the token.
Thanks!
edit: I do have a preference for commercially avaiable or FOSS, only with certain licenses (Apache, MS-PL).

Related

How to access the search bar in a Firefox 57+ ("Quantum") web extension

I try to write my very first webextension, following this tutorial. I wrote a manifest.json and added a background script as I want to provide global functionality: I want to clear the search bar once the search was performed - basically it's this, but for Firefox 57+.
My question: How can I access the search bar at all?
I found a list of available APIs, including the tabs, the menus, and so on, but no search bar...
Currently it is not possible. You might want to file a bug for it: https://bugzilla.mozilla.org/
I filed a bug request as #Smile4ever suggested, which was declined yesterday. The extension team suggested to file a feature request for what "my" extension should have done, but from the perspective of this question: It is and will not be possible to access the search bar from an extension.
For sake of completeness, here is the URL of the bug (feature request) for FF in order to offer functionality (probably optionable) to clear contents of search bar after a search is performed: Bugzilla 253331
It appears that the search bar has been deliberately removed from Fire Fox Quantum and the address bar doubles as a search bar. So from now on use the address bar to type in your search. You will notice that when no web address is typed into the address bar. The address bar, By Default, has text in it that reads. SEARCH OR ENTER ADDRESS,

Can you test foreign language strings like Arabic or Russian?

My website has the ability to be viewed in different languages. Is it possible to use sendKeys with a var that looks like this:
var arabic = "صباح الخير
I have tried using:
element(by.css(...)).sendKeys(arabic);
however question marks are the only characters sent to the text box.
Is this possible?
From Protractor point of view, if you see only ??? in input or whatever you are filling the extended chars in, it is probably a bug in that webpage, because generally sendKeys('باح الخير') works absolutely fine.
By the way, silly question, but have you tried pasting those extended chars to input directly, without protractor?

format document WebPage via Windows Forms Application?

So, I'm building a windows forms application that uses a StreamReader/StreamWriter to read each line of the .aspx, .ascx and .master pages on our asp.net website. It then removes certain properties and such from the controls through string manipulation, and writes the result back (overriding the page's markup with the edited markup). The problem is some of these pages are being written as one continuous line.
I've been unable to find anyway to call the visual studios 'Format Document' function. I found this question that would likely accomplish my goal if I weren't trying to do this from my Windows Form Application (as it's an automated process).
Any tips or points in the right direction would be appreciated.
A quick-and-dirty-solution would be (and I don't recommend it):
content = content.Replace("></", ">></").Replace("><", ">\n\t<").Replace(">></", "></");
content is the string that holds the web content.
First and last replacements are to avoid the second replacement to add newlines between something like this <tag></tag>. The above code of course has some flaws. Something like <tag1><tag2 /></tag1> will not be formatted correctly. You could avoid this by pre-replacing /></ with something you can safely re-replace at the end.
You may also want to replace \n with \r\n perhaps.

how to determine which profiles are assigned to a record type

I have 90 profiles,and a bunch of record types. Business wants to know who has access to a current record type (picklists..)
the only way i know how to do this, is to go profile by profile and check the Record Type Settings and see if it's listed.
is there a way to just generate a list or something? either through the point and click or apex?
EDIT:
I tried doing a search on the .profiles but eclipse doesn't support multi-line searches. Though it does support regexes i can't get my regular expression right, OR eclipse doesn't like me. Given my poor programming skills (and how I yell at my computer) it might be the latter. This is the string I want to search on.
<recordType>Event.RTEvent</recordType>
<visible>false</visible>
For something like this, I find that Notepad++ is a huge help. It supports multi-line searches if you enable the extended search mode (a simple radio button at the bottom of the Find menu), allowing you to grab line breaks (\r, \n, etc.). Pretty simple to do this across all of your profiles as well by navigating to the profiles folder of the Eclipse project in Windows Explorer, selecting all files, then right-click and select "Edit with Notepad++". Once they're all open, hit ctrl-F, enable the extended search mode, and search for something like this:
Event.RTEvent</recordType>\n <visible>false
Note that you may need to adjust the number of spaces after the \n depending on how far the data is indented. Click "Find All in All Opened Documents", and it'll give you a list of all occurrences of that string in your profiles files.

how to structure an asp.net app to have language in the address bar?

I want to have all addresses in my asp.net(web forms) application contain the selected language to allow search engines to index both language content. So I want it to be something like www.mysite.com/en/items/35
So what should I do to have it like that, I don't want to create page version for each of my language. I can set the page routing but how then I will understand what language to show in my page? should I analyse the address string and search for "/en/", "/ee/" and etc???
The easiest way is to use a rewriting engine so that the url
www.mysite.com/en/items/35
Is rewritten to:
www.mysite.com/items.aspx?lang=en&id=35
Then you simply write some code to look at the query string.

Resources