Spreadsheet Gear migration errors - winforms

I am migrating Spreadsheet gear of my application from 6.0.3.190 to
7.4.1.104.I am getting my issues with Color property.Can any one help me in this.Now I am using using Color = System.Drawing.Color; and also ToSGColor().This became very hectic to do in all places where ever we use color.I expect we should have some shortcut to do this.Can any one suggest me How can i get all functionalities with few changes only.I am also getting exceptions to c onvert IColorFormat.LineColor to system.drawing.Color.

Note the "Breaking Changes" page in the SpreadsheetGear 2012 documentation, which lists this particular change:
In order to support WPF and Silverlight, the core API has been
separated from the GDI+ and Windows Forms APIs and therefore uses the
new SpreadsheetGear.Color type rather than
SpreadsheetGear.Drawing.Color. SpreadsheetGear.Drawing.Color has been
moved to SpreadsheetGear2012.Drawing.dll. See
SpreadsheetGear.Drawing.Color for an example which uses the implicit
and static converters to convert between SpreadsheetGear.Color,
SpreadsheetGear.Drawing.Color and System.Drawing.Color.
SpreadsheetGear.Colors and SpreadsheetGear.SystemColors provide
helpful predefined colors to replace the use of predefined colors in
System.Drawing.Color.
So you'll need to ensure than any place where you were previously using System.Drawing colors now use SpreadsheetGear.Drawing colors, including API like IColorFormat.LineColor.
There aren't really any "migration" tools to automatically convert such instances to the new API. So you'll need to resolve these errors for each code file. Doing a Find/Replace keyword search for "System.Drawing" and "SpreadsheetGear.Drawing" could possibly speed up the process, though this would depend on what using statements you have added to each code file.

Related

Read data for Inteliprompts in RadSyntaxEditor from dll or xml

RadSyntaxControl is newly created control from Telerik and has a feature for InteliPrompts but in every sample, I found out the user must manually populate CompletionInfoCollection, as you can see in this example.
CompletionInfoCollection completionList = new CompletionInfoCollection()
{
new CompletionInfo("Achitect", "A software developer expert.", Image.FromFile(#"../../SyntaxEditor/ Achitect.png")),
};
this.radSyntaxEditor1.SyntaxEditorElement.IntelliPrompts.CompletionListWindow.Presenter.CompletionListItems = completionList;
It is ok if there are just a few items for autocomplete but what in a case if I want to autocomplete for language like C#. Telerik has a syntax highlight for C#, but I cannot find a way to populate IntelliPromts with data in that manner.
The sample code is from Telerik Blogs
Thank you :)
Nenad,
As you have already found out, RadSyntaxEditor uses a CompletionInfoCollection to define intelliprompts which aim to speed up coding by reducing typos and other common mistakes. It is just necessary to define a separate CompletionInfo for each item that you want in the completion list window. It is up to you what list to be displayed and how you will get this information. This job is not intended to be done by the RadSyntaxEditor control. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/syntax-editor/features/intelliprompts
I have researched in the forums and since the English version of IntelliSense files are embedded in Visual Studio, I have found the following MSDN article which offers different language packs for the IntelliSense. Hence, you can at least use it to investigate what are the keywords and replace the translation according to your needs: https://learn.microsoft.com/en-us/dotnet/core/install/localized-intellisense
I hope this information helps.

Is it possible to insert unicode strings with input VB6 control's in a SQL Database?

I am trying to Insert Unicode strings into a table using the Internal vb6 controls(text,List,ect..) .
But when I try to do that , VB6 Control's convert that string , and different string is stored.
Am I forgetting something or is it a visual studio issue?
I found a reference to a software package(3rd-party controls) :
http://www.cyberactivex.com/UniSuiteFree.htm
I used This package and it done , but would also be curious to hear feedback from anyone who has used these or other ones :)
Original VB6 forms components did not do a good job with Unicode, although once you get Unicode strings into VB6 code you are mostly ok. You need to use the 'B' forms of string operators, like midb(), lenb() etc if you are doing any string maniputaion. You also may want to check your SQL parameter declarations to ensure you are using the unicode options. Otherwise it is all do-able.
Try the advise at this MS Support article.
Edit: After prompting from #Bob I read the MS Support article I linked to in more detail and take the point that forms2 is not a great bet for VB6 forms unless you have a more-than-usual level of control over the target machines.
In my own case I used a commercial component named Unitools from Woodbridge Associates but I cannot find their website today. Unitools included Unicode-aware label, text box, combo and list controls. Anyone able to provide a link ?

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.

What's a good, affordable "knob" library?

I'm currently thinking of a new pet project, an "editor" for MIDI-enabled synths. I've got the MIDI side covered, I suppose, but what I'm looking for right now is something that can pass for nice "dials" and "knobs" like you see in Ableton Live, Reason, Reaktor, and so forth.
Putting my form full of trackbars, is sort of wasteful, y'know?
So, what is a nice affordable .NET 2.0 library that has that sort of graphical components?
1- http://www.codeproject.com/KB/cs/industrial_controls.aspx has some related controls (C#)
2- http://www.c-sharpcorner.com/UploadFile/desaijm/KnobControlusingWindowsForms11182005004925AM/KnobControlusingWindowsForms.aspx is another C# based Knob Control
Used the (2) personally on one project and it worked great (though not visually very strong). (1) looks cooler but havn't explored
Check out some of these. If none just do search for ".net gauges". Most of the major UI control libraries have a gauge or dashboard library.
http://www.perpetuumsoft.com/Product.aspx?lang=en&pid=44
http://www.brothersoft.com/software_developer/microsoft_.net/.net_dashboard_suite_56186.html
http://www.componentone.com/SuperProducts/GaugesSilverlight/
http://www.dundas.com/
I've never used this myself, but found KineticaRT controls. $67.06.
(source: eclipse.co.uk)
GMSI.Net Knob v2.0. $169.00.
alt text http://www.globalmajic.com/mc_images/product/thumbnail/net_knob150.jpg

How do you build a multi-language web site?

A friend of mine is now building a web application with J2EE and Struts, and it's going to be prepared to display pages in several languages.
I was told that the best way to support a multi-language site is to use a properties file where you store all the strings of your pages, something like:
welcome.english = "Welcome!"
welcome.spanish = "¡Bienvenido!"
...
This solution is ok, but what happens if your site displays news or something like that (a blog)? I mean, content that is not static, that is updated often... The people that keep the site have to write every new entry in each supported language, and store each version of the entry in the database. The application loads only the entries in the user's chosen language.
How do you design the database to support this kind of implementation?
Thanks.
Warning: I'm not a java hacker, so YMMV but...
The problem with using a list of "properties" is that you need a lot of discipline. Every time you add a string that should be output to the user you will need to open your properties file, look to see if that string (or something roughly equivalent to it) is already in the file, and then go and add the new property if it isn't. On top of this, you'd have to hope the properties file was fairly human readable / editable if you wanted to give it to an external translation team to deal with.
The database based approach is useful for all your database based content. Ideally you want to make it easy to tie pieces of content together with their translations. It only really falls down for all the places you may want to output something that isn't out of a database (error messages etc.).
One fairly old technology which we find still works really well, is to use gettext. Gettext or some variant seems to be available for most languages and platforms. The basic premise is that you wrap your output in a special function call like so:
echo _("Please do not press this button again");
Then running the gettext tools over your source code will extract all the instances wrapped like that into a "po" file. This will contain entries such as:
#: myfolder/my.source:239
msgid "Please do not press this button again"
msgstr ""
And you can add your translation to the appropriate place:
#: myfolder/my.source:239
msgid "Please do not press this button again"
msgstr "s’il vous plaît ne pas appuyer sur le bouton ci-dessous à nouveau"
Subsequent runs of the gettext tools simply update your po files. You don't even need to extract the po file from your source. If you know you may want to translate your site down the line, then you can just use the format shown above (the underscored function) with all your output. If you don't provide a po file it will just return whatever you put in the quotes. gettext is designed to work with locales so the users locale is used to retrieve the appropriate po file. This makes it really easy to add new translations.
Gettext Pros
Doesn't get in your way while coding
Very easy to add translations
PO files can be compiled down for speed
There are libraries available for most languages / platforms
There are good cross platform tools for dealing with translations. It is actually possible to get your translation team set up with a tool such as poEdit to make it very easy for them to manage translation projects
Gettext Cons
Solves your site "furniture" needs, but you would usually still want a database based approach for your database driven content
For more info on gettext see this wikipedia page
They way I have designed the database before is to have an News-table containing basic info like NewsID (int), NewsPubDate (datetime), NewsAuthor (varchar/int) and then have a linked table NewsText that has these columns: NewsID(int), NewsText(text), NewsLanguageID(int). And at last you have a Language-table that has LanguageID(int) and LanguageName(varchar).
Then, when you want to show your users the news-page you do:
SELECT NewsText FROM News INNER JOIN NewsText ON News.NewsID = NewsText.NewsID
WHERE NewsText.NewsLanguageID = <<Session["UserLanguageID"]>>
That Session-bit is a local variable where you store the users language when they log in or enters the site for the first time.
Java web applications support internationalization using the java standard tag library.
You've really got 2 problems. Static content and dynamic content.
for static content you can use jstl. It uses java ResourceBundles to accomplish this. I managed to get a Databased backed bundle working with the help of this site.
The second problem is dynamic content.
To solve this problem you'll need to store the data so that you can retrieve different translations based on the user's Locale. (Locale includes Country and Language).
It's not trivial, but it is something you can do with a little planning up front.
#Auron
thats what we apply it to. Our apps are all PHP, but gettext has a long heritage.
Looks like there is a good Java implementation
Tag libraries are fine if you're using JSP, but you can also achieve I18N using a template-based technology such as FreeMarker.

Resources