2016/07/26

How to generate C# classes from xml in Visual Studio ?


  1. Copy xml to clipboard
  2. Open Visual Studio -> create class file -> remove class definition -> edit menu -> Paste special -> Paste XML As Classes
  3. Replace typeA[][] to List<TypeA>

2016/06/17

How to create windows forms application using visual studio 2015 c++ ?


  1. Create new project: CLR Empty Project ?
  2. Add new item: UI -> Windows Form
  3. Set this options in project properties: Configuration Properties -> Linker -> System -> SubSystem -> WINDOWS (/SUBSYSTEM:WINDOWS); Configuration Properties -> Linker -> Entry Point: main
  4. Your form .cpp file you should look like this:

    -------------------------------------------------------------
    #include "MyForm.h"

    using namespace System;
    using namespace System::Windows::Forms;

    [STAThread]
    void main(array^ args)
    {
       Application::EnableVisualStyles();
     Application::SetCompatibleTextRenderingDefault(false);
     mach2gamessnake::MyForm form;
     Application::Run(%form);
    }
    -------------------------------------------------------------

2016/06/12

How to create remote Git repository in Visul Studio using visualstudio.com ?

[Attention: This is not full description]
1/ Create online repository
2/ Connect to repo from Visual Studio
3/ Clone repo locally to empty folder
4/ Create solution under repo control (add manually or create from TeamFoundation tab)

2016/05/25

How to run Remote Desktop under Windows 10 ?

1/ Run Windows command prompt: Ctrl + Windows 2/ From command prompt run command: mstsc.exe

2016/05/09

How to add existing resource file to project in c# ?

1. Install Add-in for Visual Studio: File nesting 2. Add root file and designer file 3. Right click on slave file -> File nesting -> Nest item

How to add existing WinForm to poject in C# ?

1. Select project -> Right click -> Add -> Existing item.. -> select root file -> Add as link

2016/02/21

How to force prestashop see all css from theme and moduls running

Change
- /themes/.htaccess 
- /modules/.htaccess
from

<FilesMatch "\.tpl$">
Deny from all
</FilesMatch>

to

#<FilesMatch "\.tpl$">
#Deny from all
#</FilesMatch>


2016/02/14

How to generate c# classes from xml ?

xsd is available in systems with .net installed.
Usually here: C:\Program Files (x86)\Microsoft SDKs\Windows\
fg. C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\xsd.exe

D:\temp>xsd test.xml
D:\temp>xsd test.xsd /classes

Solution found here: http://stackoverflow.com/a/4203551

Sometimes you will have to change generated cs files fg change double dimension array type [][] to []

2016/02/11

Resharper shortcuts

Shortcut Meaning
ctrl + shift + v Recent clipboard items
alt+end | Ctrl + click on class, method -> derived symbols | Navigate -> Derived symbosl Show all object that inherit from class or override methods

2016/02/10

How to compare sql server databases structure and data ?


  1. Install SQL Server Data Tools component https://msdn.microsoft.com/en-us/library/hh272686(v=vs.103).aspx in your Visual Studio version. 
  2. Show Sql Server Object Explorer in Visual Studio - View -> SQL Server Object Explorer
  3. Connect to server where one of your db is maintained in SQL Server Object Explorer Window
  4. Right click on the database and choose "Schema compare.." or "Data comparison"

How to read \ write to windows registry in c# ?

Run application with administartor privilages.