This version of the page http://lvivcommunity.net/ (0.0.0.0) stored by archive.org.ua. It represents a snapshot of the page as of 2007-12-16. The original page over time could change.
Lviv .NET Community - (Lviv community of .NET developers)
(Lviv community of .NET developers)
Home News
  • Archive
  • About
  • Conferences
  • |  
  • Sign in / Register

News


European Silverlight Challenge

октября 4, 2007 08:44

Believe in your talent and join the “European Silverlight Challenge” Competition – Dare to participate with us on the European Development Competition about Silverlight and win fabulous prizes, and of course the recognizement of wining one of the first places ;)

At INETA EUROPE (http://europe.ineta.org), in collaboration with Microsoft, we have prepared a development competition with the name “European Silverlight Challenge”, starting at November and ending at the end of January. For more information please check the European Silverlight Challenge page.

source: http://europe.ineta.org/


Actions: Comments (0)

Recent posts

Custom web.config sections

декабря 14, 2007 17:55 by alexk
How to create custom config sections in web.config file?

Step 1: Declare section group

<?xml version="1.0"?>
<configuration>
  <!-- Definition of config file sections -->
  <configSections>

    <!-- define your custom section here -->
    <section name="proxies" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
                             <!-- System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 -->
  </configSections>
</configuration>


Step 2: Declare own values in web.config 
<?xml version="1.0"?>
<configuration>
  <!-- Know to the system Proxy classes for remote Lines connections -->
  <proxies>
    <add key="LOCAL" value="Artfulbits.Proxy.LocalProxyAdapter"/>
    <add key="AB-REMOTE" value="Artfulbits.Proxy.AbRemoteProxyAdapter"/>
  </proxies>
</configuration>


Step 3: How to access defined values in web.config from ASP.NET code?

  /// <summary></summary>
  /// <returns></returns>
  public static NameValueCollection GetProxiesDictionary()
  {
    return ConfigurationManager.GetSection( "proxies" ) as NameValueCollection;
  }



Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: web.config, xml, configsections, section, proxy
Categories: ASP.NET
Actions: Permalink | Comments (0) | RSS

Activator for App_Code assemblies

декабря 14, 2007 17:38 by alexk
I want to implement "proxy" pattern in my ASP.NET application is it possible?

why not?!

First question:
which pattern you want to use for instance of proxy class creation? if it looks like written below, then you are looking on right article.

 protected void Page_Load( object sender, EventArgs e )
{
    Assembly appCodeAssembly = FindAppCodeAssembly();
    string proxyType = "Artfulbits.Proxy.LocalProxyAdapter";
    Type type = appCodeAssembly.GetType( proxyType );
    IProxyAdapter proxy = ( IProxyAdapter )Activator.CreateInstance( type, null );

    // TODO: use proxy as you want here
}


Where to place proxy classes implementation?

I recommend to use App_Code folder in ASP.NET web site. One from the many greates pluses is that you can change code at runtime. ASP.NET application recompile itself on any changes. And this is very good :)

How to find App_Code assembly in ASP.NET AppDomain?


try to use this simple method written below. It's not very performance optimized, but it works fine for me.

  private static readonly Regex s_expression = new Regex( "App_Code*", RegexOptions.Compiled | RegexOptions.IgnoreCase );

  public static Assembly FindAppCodeAssembly()
  {
    Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();

    foreach( Assembly asm in assemblies )
    {
      if( s_expression.IsMatch( asm.FullName ) )
      {
        return asm;
      }
    }

    return null;
  }
 

Here we use specifics of ASP.NET implementation and assemblies names creation. I can not guaranty that this code will fork fine for every scenario, but in 80% of asp.net application development it's will work without any troubles. Enjoy

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: reflection, proxy, activator, app_code, fullname
Categories: General | ASP.NET
Actions: Permalink | Comments (0) | RSS

ASPNET user & DB security

декабря 14, 2007 17:26 by alexk
How-to configure DB security for ASP.NET applications?

answer is simple. You have to grant access to the DB for MACHINENAME\ASPNET user. This can be done in several ways, but easiest is to use this simple script written below. Place code into *.cmd file and enjoy. Script is well configurable by variables: OSQL, SQL_USER, SQL_PWD, SQL_DB;

OSQL - location of the command line utility for SQL Server (2000 and 2005 known by script - look carefully on comments)
SQL_USER and SQL_PWD - place login and password if you server used mixed security model
SQL_DB - place here name of the DB that must be accessible for ASPNET user.



@echo off

:: for MS SQL Server 2005 command line utility is "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\sqlcmd.exe"
set OSQL="%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\sqlcmd.exe"
::set OSQL="%ProgramFiles%\Microsoft SQL Server\80\Tools\Binn\osql.exe"
set SQL_SRV=(local)\SQLEXPRESS
::set SQL_SRV=(local)
set SQL_USER=
set SQL_PSWD=
set SQL_DB=master

if not exist %OSQL% (
  goto :error
  goto :EOF
)

:: detect what kind of connection required for server
set _TRUST=-E
set _IN_ACC=-U %SQL_USER% -P %SQL_PSWD%

if "%SQl_USER%"=="" (
  if "%SQl_PSWD%"=="" (
    set _IN=%_TRUST%
  ) else (
    set _IN=%_IN_ACC%
  )
) else (
  set _IN=%_IN_ACC%
)

:: declare @login nvarchar(100)
:: set @login = HOST_NAME() + N'\ASPNET'
:: IF NOT EXISTS (SELECT * FROM dbo.sysusers WHERE name = @login)
:: exec sp_grantlogin @login
:: -- Grant the login access to the membership database
:: exec sp_grantdbaccess @login
:: -- Add user to database role
:: exec sp_addrolemember 'db_owner', @login

call :runSQL2 "IF NOT EXISTS (SELECT * FROM dbo.sysusers WHERE name = '%COMPUTERNAME%\ASPNET') exec sp_grantlogin '%COMPUTERNAME%\ASPNET'"
call :runSQL2 "exec sp_grantdbaccess '%COMPUTERNAME%\ASPNET'"
call :runSQL2 "exec sp_addrolemember 'db_owner', '%COMPUTERNAME%\ASPNET'"

goto :EOF

:: error message echo
:error
echo -= ERROR:
echo -= Can not find OSQL.EXE utility required for TSQL scripts execution
echo -= please check SQL Server Instance installation path and modify
echo -= in CMD file OSQL variable if needed
goto :EOF

:: method execute TSQL script on server
:runSQL2
%OSQL% -S %SQL_SRV% %_IN% -d %SQL_DB% -Q %1 >>configure_db.log
goto :EOF


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: sql server 2000, sql server 2005, sql server express, script, aspnet user, security
Categories: .NET | General | ASP.NET
Actions: Permalink | Comments (0) | RSS

Microsoft Expression Blend 2 December Preview

декабря 7, 2007 11:33 by rat

I am glad to announce that the new CTP of the Blend 2 is out

... >>>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: blend, wpf
Categories: WinFx
Actions: Permalink | Comments (0) | RSS

ClickOnce, локализация и GAC

ноября 23, 2007 13:01 by rat

Недавно столкнулся с такой вот проблемой: есть контролы в отдельной ассембле, есть сателитные ассембли с локализированными версиями ресурсов для контролов, и то и другое лежит в GAC.
Есть проэкт в котором используется контрол из вышеупомянутой ассембли, и потому есть референс на ассемблю с контролом (естественно на GAC, соответственно в референсе есть только название ассембли - никаких путей).
Нужно задеплоить программу через ClickOnce.

И вот сама проблема: при деплойменте сателитные ассембли студия не находит, и потому не деплоит. Если добавить локализированные ресурсы в референсы, то ассемблю деплоймент положит не в папку с нужным языком, а просто рядом с программой, что собственно проблему не решит.


Но решение было найдено :)

Оказывается студия начинает понимать факт того что у ассембли могут быть сателитные ассембли только в том случае если она как-то найдёт данную ассемблю на диске. Можно конечно сделать референс тупо на файл , но это в данном случае не подходит - нужен именно GAC.

И вот для того, чтобы студия могла найти ассемблю на диске и заодно найти её сателитную ассемблю в папке рядом, нужно эту ассемблю и её сателиты, кроме того что в гак запихнуть,  положить в какую-то не путающуюся под ногами/руками папка и сказать студии искать там ассембли перед тем как искать их в GAC. Для этого нужно в реестре создать ключ с произвольным названием в ключе HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders, и в его дефолтовом значении проставить путь на папку с ассемблями.
Кстати такие дефствия приводят к тому что ассембля появляется в списке сборок в Add Reference диалоге в студии.

После таких действий студия начинает понимать что сателитные ассембли таки существуют и разрешит их задеплоить через ClickOnce.

Надеюсь это кому-то поможет :)


Currently rated 5,0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: clickonce, gac, deployment, satelite assemblies
Categories: .NET | General
Actions: Permalink | Comments (0) | RSS

Markup Extensions

октября 25, 2007 10:36 by rat

First of all, what is this misterious thing, MarkupExtension? As it follows from it's name, this is some kind of the extension for the XAML markup syntax, and in our case that is an the extension that allows user to shorten or simplify some operations in XAML, or at least provide some non-string data in case TypeConverter can not be used. One of the most common examples of the MarkupExtension is a shortened declaration of a data binding, like {Binding Path}. {StaticResource key} is also widely used, and that is also a MarkupExtension. Both of them can be declared in element syntax, but that is not widely used because the amount of XAML needed in such case is a bit larger, so I will use attribute syntax in my samples.

... >>>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: wpf, markup extensions
Categories: WinFx
Actions: Permalink | Comments (0) | RSS

ASP.Net AJAX Control ToolKit Extender for CardSpace

октября 25, 2007 09:56 by rat

Нарыл вот в блогах интересный пост, мож кому нада будет..

Цытирую:

I've created a control based on the ASP.NET AJAX Control Toolkit that gives a web site the ability to easily add cross browser support for CardSpace and othe Identity Selectors.

The concept comes is loosely based on dominick baier's CardSpace Control for ASP.NET, however I think that you'll find that it should be more flexible in regards to the UI abilities.

I have offered the control to the ASP.NET AJAX Control Toolkit team and they are considering its inclusion in the project.

This prototype code is attached to this blog entry.

CsAjax.zip


Currently rated 5,0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: ajax, cardspace
Categories: .NET | ASP.NET
Actions: Permalink | Comments (0) | RSS

Дні розробників 2007, Львів (осінь)

октября 22, 2007 03:50 by RredCat

Компанія Microsoft запрошує вас відвідати семінар для розробників і системних архітекторів, які створюють рішення з використанням технологій Microsoft.

... >>>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: event, microsoft, l'viv, ua
Categories: .NET
Actions: Permalink | Comments (3) | RSS

Полезные ссылки - Part 4

октября 9, 2007 08:03 by alexk

A Pure .NET Single Application Instance/Instancing Solution
http://www.codeproject.com/useritems/SingleInstancingWithIpc.asp

Интересное решение, позволяющее контролировать сколько инстансов запущенно, а также показывает, как сделать комуникацию между инстансами программ - передача данных между процессами. Построенно на Named Pipes + Mutex.
... >>>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: links, patterns, template, generics, ideas, design, architecture, ado.net
Categories: .NET | General | WinForms | SQL | Links
Actions: Permalink | Comments (0) | RSS

Робота з ItemsSource y WPF

октября 8, 2007 06:52 by rredcat
При написанні механізму перетягуванні (Drag & Drop) чайлдів (Children)  в середині контролу, важливу роль грає утримання елемента у логічному дереві контрола ( ну щоб як мінімум уналідувані (inherit) атач (attached) проперті коректно працювали ;) ). Припустимо в темпліті контролу (в самих чайлдах, в чайлдах чайдів... ) знаходиться інший контрол, що наслідується від ItemsControl (на ваш смак). Нам потрібно приєднати до нього кілька чайлдів. Який механізм краще застосувати?
... >>>

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags: ua, itemscontrol, itemssource, items, wpf
Categories: .NET | WinFx
Actions: Permalink | Comments (0) | RSS
<< Previous posts