DCSIMG
Thoughts

Reminder - MSDN Webcast: Developing .NET Applications with SAP Enterprise Explorer for Visual Studio

Don't forget to join us today 3/11/2008 17:00 (Israel time)

joint Webcast with SAP about SAP Enterprise Services Explorer for .NET

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032371999&Culture=en-US

Posted by dudub | with no comments
תגים:,

Sneak Preview: SAP Enterprise Services Explorer for Microsoft .NET

Enterprise Services Explorer for Microsoft .NET (ES Explorer) from SAP has been made available through SDN as an early sneak preview.

The ES Explorer is an add in for Visual Studio 2005 & 2008 that lets you search, browse and consume SAP web services that are published and categorized in the Enterprise Services Registry that is part from the upcoming NetWeaver CE 7.1.

The ES Explorer can be considered a successor to the .NET Connector and it is consistent with SAP moving into the Enterprise SOA (ESOA) space.

With this wizard like tool a .NET developer can find an SAP web service more easily then ever and consume it by a simple right click from within the development environment. The web service can be consumed as a regular .asmx web service or as a WCF service.

The tool also has an integrated help documentation and a very ease way to configure it using a custom Tools -> Options page in VS development environment.

The ES Explorer is the outcome of the continued collaboration between SAP & Microsoft.

Posted by dudub | 7 comment(s)
תגים:

Visual Studio 2005 Service Pack 1 Update for Windows Vista

The final release of the VS2005 SP1 update for Vista is released.

It can be downloaded from:

http://www.microsoft.com/downloads/details.aspx?FamilyID=90e2942d-3ad1-4873-a2ee-4acc0aace5b6&DisplayLang=en

the enhancements made by windows vista impacted VS2005 therefor you will need this fix.

 

if you have a beta version of this fix installed on your machine, please uninstall it first.

to do this you need to enter Control Panel -> Uninstall a program

on the Tasks you need to choose View installed updates

and you need to uninstall the: Hotfix for Microsoft Visual Studio 2005... - (KB929470).

Have fun...

Posted by dudub | 4 comment(s)
תגים:

WPF Binding to a CLR Dictionary.

I have needed to bind a TextBox text property to a CLR Generic Dictionary<>, as it turns out this is a problem because Dictionary does not propagate the item changes and we need to bind to an INotifyPropertyChanged object.

So we implement an INotifyPropertyChanged class (a generic class) with only one property, and we will call it Value:

public class WPFValue<TValue> : INotifyPropertyChanged

{
   private TValue _value;
   public TValue Value
   {
     get { return _value; }
     set
        {
          _value = value;
          OnPropertyChanged("Value");
        }
   }
 
   public WPFValue(TValue value)
   {
     Value = value;
   }
 
   public event PropertyChangedEventHandler PropertyChanged;
   protected virtual void OnPropertyChanged(string strPropertyName)
   {
     if (PropertyChanged != null)
     {
       PropertyChanged(this, 
                 new PropertyChangedEventArgs(strPropertyName));
     }
   }
}
 
Now we can use this to create our Dictionary:
Dictionary<string, WPFValue<string>> a = 
    new Dictionary<string, WPFValue<string>>();
 
adding an item is simple:
    a.Add("text1", new WPFValue<string>("Foo"));
 
for the binding part we will create a Binding object and
pass the binding Path to the constructor:
    Binding b = new Binding("Value");
 
the binding Source will be the Dictionary item of key: "text1"
    b.Source = a["text1"];
 
we will make the binding Mode to be TwoWay:
    b.Mode = BindingMode.TwoWay;
 
set the UpdateSourceTrigger to be a PropertyChanged,
so when ever someone writes into our text box the 
binding source will update immediately:
    b.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
 
now we will set binding and we are done.
    textBox1.SetBinding(TextBox.TextProperty, b);
 
The final window looks like that:
 
public partial class Window1 : System.Windows.Window
{
    Dictionary<string, WPFValue<string>> a = 
       new Dictionary<string, WPFValue<string>>();
 
    public Window1()
    {
        InitializeComponent();
 
        // add a TextBox
        TextBox textBox1 = new TextBox();
        textBox1.Name = "textBox1";
        textBox1.Width = 100;
        textBox1.Height = 20;
        Content = textBox1;
 
        a.Add("text1", new WPFValue<string>("Foo"));
 
        Binding b = new Binding("Value");
        b.Source = a["text1"];
        b.Mode = BindingMode.TwoWay;
        b.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
        textBox1.SetBinding(TextBox.TextProperty, b);
 
        textBox1.TextChanged += 
           new TextChangedEventHandler(textBox1_TextChanged);
    }
 
    void textBox1_TextChanged(object sender, TextChangedEventArgs e)
    {
        MessageBox.Show(a["text1"].Value);
    }
}
 
That's it we are done, we have a TextBox which is bounded to an item
from a generic Dictionary.
 
Have fun...
Posted by dudub | with no comments
תגים:

Stopwatch

Cool thing I found in Framework 2.0, a new Class in System.Diagnostics called : Stopwatch

Until now, when I wanted to know how much time a piece of my code worked I would do:

TimeSpan start = DateTime.Now.TimeOfDay;

//do some work.
System.Threading.Thread.Sleep(1000);
TimeSpan end = DateTime.Now.TimeOfDay;
 
double totalMilliseconds = end.Subtract(start).TotalMilliseconds;
 
 
But now I found myself doing this:
 
Stopwatch stopWatch = Stopwatch.StartNew();
//do some work.
System.Threading.Thread.Sleep(1000);
stopWatch.Stop();
 
double elapsedMilliseconds = stopWatch.ElapsedMilliseconds;
 
I find this to be very cool...
 
 
More of the functionality of Stopwatch are:
Start() , Reset()
 
You can get values for:
Elapsed, ElapsedMilliseconds, ElapsedTicks, IsRunning
 
Posted by dudub | 2 comment(s)
תגים:

What is an XBAP ?

Simply put it, it's a WPF application that resides inside a browser.

XBAP - XAML Browser Application.

Create an XBAP application:

Where to start ? Just open VS2005 and create a project of type : "XAML Browser Application".

There is actually not much information in the Windows SDK documentation about this kind of a project.

But a good place to start:

Some restrictions apply, and you will find that you can live with them, the main issue to consider is the security module, XBAP runs inside of a "sandbox" so in terms of CAS it uses Internet zone only, and if you think about this for a minute you will realize that it is actually a good thing. 

XBAP uses the "Page" object instead of a "Window" object as in regular WPF applications, which is pretty cool, you can take your code and slap it onto XAMLPad and see the results.

Simple Hello sample:

<Page x:Class="XAMLBrowserApplication2.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Page1"
    >
    <Grid>
      <TextBlock FontWeight="UltraBlack" >Hello XBAP!</TextBlock>
    </Grid>
</Page>

 

Deploy:

After you build your application notice two special files in your bin folder:

  • .exe.manifest
  • .xbap

the .exe.manifest file gives out the "secret", XBAP's are actually ClickOnce applications, the .xbap file is like the .deploy file that is created for regular ClickOnce applications.

This follows the same rules of a ClickOnce application and thus it requires that you sign you application using a .pfx key file.

All you need to do now is to create a virtual folder inside IIS, copy all the files from you bin folder and you are done, almost... 

Configure MIME type in your IIS web server ( or any other kind of web servers that you may have: J2EE, Apache ... ) and now you are done.

note: in the MIME type configuration instructions, you may choose to use the VBScript that is offer there in order to do this work for you, just so you know the script does work, but if you look at the MIME types table in IIS after running it, the table does not show any thing. This is a known issue , but don't worry the MIME types were configured.

 

Happy XBAP - ing......... 

Posted by dudub | 1 comment(s)
תגים:

My Start

So how do you start witting a blog:

  • You think of something really smart to say ?
  • You think of something really funny to say ?
  • You think of something really interesting to say ?

well, I don't know.

I guess you just start witting.....

Posted by dudub | with no comments