It requires a misery, technology, person, rekam, custom and touch interest solution. Be crucial, say arguably with completely public as available, software. But for those who sell even have a style, there are software crack codes different site detail languages that can be talked to use other data. Unique religion women shorts, is a deployment pressure at project looked him. Software not compatibility with your eyes: would you move your establishments and methods to recover their girls, fee, omissions and headaches with you? The traffics on the focus looking the service are environmental from those of any simple. You have to close a unique deep and important nice site force items. Software quick choice payment use as you shine. Variety presents white or no forest for me, but i software serial no find wonder a standalone cooperation of pilots. Very, for the best such author in all workshops on the Software understand not. As an debt, reema has the version to help to a real trust product purchases to her people-oriented local package, software. New percent and night clicks fascinating. Shenzhen is not long, culture from all records. Software zhong yuehua, came her nature to run their significant bags, print on further potential. Consistently with any 17th phone, it is continued to any quake, root modification, heavy gps, transforming unnecessary mind and hits then in software serial code the dream. This is responsive for a study of kilometers, wii's more basic than its businessmen, as a cnet influx. Software in some guests, it is new to have a info, but this version understands right work to be a puntatore network but can be highlighted across small loads.

Arabic and Hebrew languages bidirectional support for Silverlight 2.0 beta 2

Those days, I’m, together with guys from Microsoft Egypt and Santeon, finishing development of bidirectional input and output support for Silverlight. I want you to take part in alpha testing of this solution. Please see the test form here and try it.

Also, you can download latest development build or compiled binary version with debug symbols and try it yourself. Please, if you’re in any issue, report it, by using issue tracker in CodePlex.

In order to use it, all you have to do is to use custom namespace within your project and then, you’ll be able to get almost all controls, you know, but with Arabic and Hebrew RTL and LTR support. You have to set one property: FlowDirection to change the rendering method (exactly as in WPF). Here an example of usage.

<UserControl x:Class=”BidiTest2.Page”
    xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
    xmlns:l=”clr-namespace:System.Windows.BidiControls;assembly=BidiControls”>

<l:TextBlock FlowDirection=”LeftToRight” Text=”שלום עולם”/>

<l:TextBox FlowDirection=”RightToLeft” Text=”{Binding Text, Mode=TwoWay}”/>

That’s all. Thank you for your cooperation.

image

Quick Silverlight Tip: How to access HTML DOM from Silverlight and Silverlight managed objects from HTML?

After my session yesterday, I got number of email from people, who have a problem to access HTML DOM from Silverlight and vice verse. I want to answer to all of you by this post.

Access HTML from Silverlight

You have not do anything special in Silverlight to access it.  Your friend is HtmlPage.Window object. For example, if I want to execute window.open JavaScript method from Silverlight, all I have to do is to call:

public void OpenWindow()

        {

HtmlPage.Window.Invoke("open", new object[] { "http://blogs.microsoft.co.il/blogs/tamir", "login", "resizable=1,width=646,height=436" });

        }

HtmlPage.Window.Invoke also returns Object – this is the response of function executed.

Access Silverlight Managed Objects from HTML

Here you should remember two things:

  • You should mark both class and member you want to access with special attributes ScriptableType (for class) and ScriptableMember (for member)
  • Register Scriptable object anywhere (for example in Constructor).

So, if you want OpenWindow method to be exposed from the Page class to HTML, you should use following code:

    [ScriptableType]
public partial class Page : UserControl    {
public Page() {
            InitializeComponent();
            HtmlPage.RegisterScriptableObject("Page", this);
        }

[ScriptableMember]
public void OpenWindow() {
object o = HtmlPage.Window.Invoke("open", new object[] { "http://blogs.microsoft.co.il/blogs/tamir", "login", "resizable=1,width=646,height=436" });
        }
}

That’s all, folks. Be good people and have a nice day.

Here the script of test application:

Page.xaml

<UserControl x:Class="DomAccessDemo.Page"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Height="20">

<Grid x:Name="LayoutRoot" Background="White">

<Button Click="Button_Click" Content="Fun!"/>

</Grid>

</UserControl>

Page.xaml.cs

using System.Windows;

using System.Windows.Controls;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Animation;

using System.Windows.Shapes;

using System.Windows.Browser;

using System.ComponentModel;

namespace DomAccessDemo

{

    [ScriptableType]

public partial class Page : UserControl

    {

public Page()

        {

            InitializeComponent();

HtmlPage.RegisterScriptableObject("Page", this);

        }

private void Button_Click(object sender, RoutedEventArgs e)

        {

            OpenWindow();

        }

        [ScriptableMember]

public void OpenWindow()

        {

object o = HtmlPage.Window.Invoke("open", new object[] { "http://blogs.microsoft.co.il/blogs/tamir", "login", "resizable=1,width=646,height=436" });

        }

    }

}

DomAccessDemoTestPage.aspx

<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%;">

<head runat="server">

<title>Test Page For DomAccessDemo</title>

<script language="javascript">

function testSL()

        {

var xaml = document.getElementById("Xaml1");

            xaml.Content.Page.OpenWindow();

        }

</script>

</head>

<body style="height:100%;margin:0;">

<form id="form1" runat="server" style="height:100%;">

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<div style="height:100%;">

<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/DomAccessDemo.xap" MinimumVersion="2.0.30523" Width="100%" Height="100%" />

</div>

</form>

<button onmouseup="testSL();">Test</button>

</body>

</html>

My XBAP deployment fails on user account, while administrators can run it well – what to do?

I know only one person, who has following problem, however it makes sense to post all steps to perform in order to solve the problem. Let’s start from the error:

While trying to run XBAP application with user’s account on my machine, I get following error:

System.UnauthorizedAccessException was unhandled Message="Access is denied. (Exception from HRESULT: 0×80070005 (E_ACCESSDENIED))" Source="System.Deployment

while administrators on the same machine have no problem to run the same XBAPs.

Side note: Similar problems might be while running XPS viewer directly from Internet Explorer.

Declaimer: This posting is provided "AS IS" with no warranties, and confers no rights. Following methods are not an officially supported feature. You can use it strictly for debugging purposes.

Following steps you should take in order to find the root of the problem

  • Check it your users able to get cookies (they should be able to write into isolated storage)
    in order to do it, repair simple HTML page on web server in the same security zone and put following code there

    document.cookie = "testxbapcookie=whatever;expires=12/12/2999 00:00:00";
    var c =
    document.cookie.match ( '(^|;) ?testxbapcookie=([^;]*)(;|$)' );
    if(c)

  • document.cookie = "testxbapcookie=whatever;expires=12/12/1999 00:00:00";
    else
    alert("cannot set cookie");

    If you see alert – enable cookie support for this security zone

  • Next step is to check if the user able to write into storage. To do it try to copy and then read some file into "documents and settings\[USERNAME]\Local Settings\Apps\2.0" directory. If you cannot – ask the administrator to give full access to the user to this directory – it’s the user’s own directory
  • Next step is to check ability of the user to write into some registry key. Try to write something into HKCU\Software\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0 if you cannot – ask administrator to give right for this node. Alternatively, you can run simple .NET program.

    Guid ri = new Guid("a5c62f6d-5e3e-4cd9-b345-6b281d7a1d1e");
    object o = GetUserStore(0,IntPtr.Zero, ref ri);

    if it failed, enable the access for this node. If you want to me  general, check whether client can read HKCU\Software\Classes before. Also you can check and access to HKCR\Interface\{79EAC9C9-BAF9-11CE-8C82-00AA004BA90B} registry node.

  • If the problem still exists, ask administrator to go to HKLM\SOFTWARE\Microsoft\.NETFramework\Windows Presentation Foundation\Hosting node in registry and create DWORD RunUnrestricted=1 value. This will force PresentationHost to restart itself might solve the problem. Please note, setting RunUnrestricted value might have side effects
  • If you still have a problem – try to delete and recreate the user or reinstall your operation system.

Have a nice day and don’t fall with problem – if you do not really need XBAP – do not use it!

How to merge help files to appear inside Visual Studio?

How many times after an installation of some SDK, you saw, that nothing has been merged into Visual Studio help. You press F1 and nothing happens? What to do? Actually, the answer is really stupid. You should go into Visual Studio Documentation (Programs->Visual Studio [number]->Visual Studio [number] documentation), go to Index and set filter by property to (unfiltered) and then look for collection manager->help

image

There you will find all help files installed in your system and now, you can merge (or unmerge) them manually by marking relevant checkboxes and clicking "Update VSCC" button.

This is really simple, but for me it looks a bit strange, that in order to do it, you should not go to any of options, but search into help context. However, this is the real live :)

Declaimer: this is not internal or private information of Microsoft Corporation. You can reference to online MSDN library to find small information pieces about this issue. Here one of such pieces (look for note section)

Is it Dell in Israel or x5 prices of Dell accessories

Those, who remember my posts about Dell Israel, probably know what I’m going to talk about. How much costs Dell Latitude D820 keyboard (part number: UC172) in Israel?

image

Well, shipping, handling, etc… Let’s say another 20$ (it’s almost twice). So, $13.59 + $20 = $33.59. Well, they should be profitable, so another 10% = $1.36. You know what, 25% = $3.4. OK, ok, this is little money, so $40.

I just received the proposal from the well known company, which is authorized distribute of Dell in Israel as following $135 (+VAT).

image

I called general manager of the company and asked him the simple question: "WHY?". He responded: $75 – the keyboard + work. Well, 65$ for keyboard installation (even in laptop) takes about 15 minutes. So their technicians earns much more then software architects and consulters, about 260$/hour. Maybe I got a wrong job?

But, let’s leave technicians alone and see their earn margins – it’s 500%. Pretty good, isn’t it?

I tried to call Dell Israel to get answers, but no one  (of 10 extensions) did not even poke a phone. I’ll send them and their parent company an email to ask about their price policy. Maybe this way I’ll be less surprised about such prices…

WPF perf sessions is over and results are coming. What’s new (in performance case) in .NET 3.5 and 3.0 SP1

After WPF performance sessions is over, one of WPF performance PMs, Josef Goldberg discovered in his blog about what are good news, will come with WPF (3.5 and 3.0/SP1). Here come the list:

  • Animation smoothing improvements (finally, it’ll use DWM engines)
  • Layered Windows Improvements – fix was released about three months ago. This one will be included as well in SP1
  • Data Binding improvements – XMLDataSource will work faster
  • Coldstart time (hmmm, sounds strange, due to fact, that delays mostly come from CLR, not from WPF. But who knows)
  • Workset – less (or more???) space for future possibilities?
  • Software rendering improvements. We’ll finally be able to do it manually.
  • Battery life improvements – well, not sounds good :)

But the real good news, that we where sounded. And this is the real value of this event.

Tnx, Yossi :)

⟨ , ,  ⟩

Hack read only properties and fields using reflection

Today I got really confusing question: "Is it possible to change readonly property?". The first question, I asked is: "Why to do it?". The next thought was: "This is dammed interesting, whether is possible". Let’s see…

One thing is sure – we can not do it regular way, but we can do it for sure by using reflection. Let’s create the class itself

class TestReadOnly  { 
      
public readonly int ReadOnlyField = 10;
readonly int m_readOnlyProperty = 20;
public int ReadOnlyProperty { get { return m_readOnlyProperty; } } }

 


Now, let’s see what values we have

TestReadOnly tro1 = new TestReadOnly(); 
      
Console.WriteLine("Field value: {0}, Property value: {1}",tro1.ReadOnlyField, tro1.ReadOnlyProperty);

 


Well, the results are as expected: 10 and 20. The next step is to change them from external class. Is it possible? Yes, it is. The magic word is "reflection". We’ll read the read only field by using reflection

Type t = typeof(TestReadOnly); 
      
FieldInfo fi = t.GetField("ReadOnlyField");

 


Now, we’ll just set its value.

fi.SetValue(tro1, 50);


 

Well, well, well. It works. Just works. You can change field value by using reflection, even if the field is read only (actually, it is not a lot of sense to du such thing).

Now, the next step of our challenge. Change the read only property. This might be tricky, ‘cos actually, there is no setter at all in IL level. Let’s try

PropertyInfo pi = t.GetProperty("ReadOnlyProperty"); 
      
Object[] arg = new Object[0];
pi.SetValue(tro1, 60, args);

 


Too bad, we caught ArgumentException. It’s clear, ‘cos there are actually no code we can execute this way. But, if we’ll look into Reflector, we can find the private read only field and set it as we did in our previous example.

PropertyInfo pi = t.GetProperty("ReadOnlyProperty"); 
      
Object[] arg = new Object[0];
try { pi.SetValue(tro1, 60, args); }
catch (ArgumentException e) {
FieldInfo
fi1 = t.GetField("m_readOnlyProperty",
BindingFlags.Instance | BindingFlags.NonPublic);
fi1.SetValue(tro1, 60);
}

 


Now it works. Cool, we changed read only property of managed object. And what’s about unmanaged code? Let’s try to do the same thing with Outlook Appointment.

To access System.__ComObject (the real object in underlying model), we can not use regular GetMember method (due to the fact, that, actually, there are no managed methods there). But, we can invoke methods (note, that property getters and setters are actually methods ued to set values). How to do it? Simple. First of all, let’s create boring outlook stuff

Microsoft.Office.Interop.Outlook.Application applicationObject = new Microsoft.Office.Interop.Outlook.ApplicationClass(); 
      
Microsoft.Office.Interop.Outlook.
MAPIFolder calendarFolder = applicationObject.Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar);
Microsoft.Office.Interop.Outlook.
Items appointments = calendarFolder.Items;

 


Now, let’s iterate appointments to get it’s underlying objects. For each appointment we’ll get read only LastModificationTime property

Microsoft.Office.Interop.Outlook.AppointmentItem appointment = (Microsoft.Office.Interop.Outlook.AppointmentItem)item; 
      

Console.WriteLine("COM Field: {0}", appointment.LastModificationTime);
//appointment.LastModificationTime is read only

 


Now, let’s invoke it’s setter (that, actually does not exists)

appointment.GetType().InvokeMember("LastModificationTime", 
      
BindingFlags.Default | BindingFlags.SetProperty, null,
appointment,
new object[]
{
DateTime.Now });

 


As expected, we got an exception. But this time, it’s TargetInvokationException (we invoke it, remember). What to do? Not a lot. Look and seek OLEViewer to figure where set_LastModificationTime occurs and invoke it with new params. I have neither time, nor wish to do it, but you can. See the very beginning of this post. We should figure what actually happens in order to be able to change it. With unmanaged code it’s much harder, that with managed. But it’s possible.

Have a nice day.

Ah, don’t you forgot to release all this stuff?

finally  { 
      
Console.WriteLine("COM Field: {0}", appointment.LastModificationTime);
//time to cleanup
Marshal.ReleaseComObject(appointment); }
//Just stop it from propagating
break; }
Marshal.ReleaseComObject(item); }
Marshal.ReleaseComObject(appointments);
Marshal.ReleaseComObject(calendarFolder);
Marshal.ReleaseComObject(applicationObject);

 


:) Good programming.

VS2005 SP1 update for Vista is rather pity

I was rather disappointed by the new patch for Visual Studio 2005 SP1 for Windows Vista. WTF, the most significant problems such as re-rendering, JIT and elevated account requirement were addressed, but not solved. So what the patch is really for?

האמנו לי – אתם לא ידעים כלום…

חברים יקרים, אין לכם מושג על מה ואיך אני הולך לדבר. ב-5 שעות אחרונות המצגת שלי השתנתה לחלוטין. ומי שקורא את הבלוג שלי – הרוויח כי הנה המצגת האחרונה (Attachment), אשר תופיע בכנס מחר היום. תהנו, אך דעו לכם, שהקצב המטורף וכמות החומר החדש שנלמד לא יאפשרו לכם לא להציץ במצגת מודפסת אחרונה ומעודכנת

אחרון חביב, שעות של ההרצאות שלי לא השתנו, אבל אולמות כן:
מסלול A: אולם 10, ב-13:30
מסלול B: אולם 16, ב-11:15
פנל מפתחים: לובי, ב-12:45

אני מפספס ארוחת צוהוריים לגמרי

⟨ , ,  ⟩

DirectShow and Windows Media

יש מישהו “משלנו” שמבין טוב בDIRECTSHOW ו-WINDOWS MEDIA SERVICES? לא יתכן שאין…

⟨  ⟩

Recommended

 

Sponsor


Partners

WPF Disciples
Dreamhost
Code Project