Soyo Topaz S - Hacking Native Widescreen Resolution on an Intel 945GM Express
May 10, 2008 on 12:31 am | In Uncategorized | 1 CommentThis evening started out disappointing, but here lies the key to a simple, relatively safe hack that helped me. I’ll start at the beginning…
I was so stoked today when my new 24″ monitor came in! A Soyo 24″ Widescreen 1920×1200! Nothing fancy of course, but it was a whopping $200 at geeks.com. First thing that happened was I plugged it in to the external monitor slot on my home laptop - a Dell XPS M1210.
It came right on, but hmmm… I couldn’t set anything but 1024×768 resolution! WTF!?!
I tried everything, tweaking the registry settings, hacking the inf file, installed PowerStrip… nothing worked.
I searched google one last time hoping to turn something up before I was going to just return the damned thing. Lo and behold I stumbled on this:
http://www.ryosa.com/widescreendrivers.html
That link explains how to use the Intel Embedded driver development kit to create custom drivers. I know it sounds daunting, but really, it’s simple. They have a wizard for the whole thing.
A quick run through the instructions at the above link, and I had it all working. I also used the linux documentation project to find the Modeline for the monitor, which is a good key to use to figure out what the timers should be. In case you happen to be using this exact same Soyo Topaz S 1920 x 1200 on an Intel 945GM Express chipset, then you’ll want the following settings:
linux kids can just copy this line directly:
Modeline “1920×1200@SOYO” 154 1920 1968 2000 2080 1200 1203 1209 1235 -HSync +Vsync
The rest have to use it to find these other settings:
154000 - Pixel Clock in Khz
1920 - Horizontal Active Area
1968 - Start of the Sync Pulse
2000 - End of the Sync Pulse
2080 - End of the Blanking Interval
Horizontal Sync Offset = 1968 - 1920 = 48
Horizontal Sync Pulse Width = 2000 - 1968 = 32
Horizontal Blank Width = 2080 - 1920 = 160
1200 - Vertical Active Area
1203 - Start of the Sync Pulse
1209 - End of the Sync Pulse
1235 - End of the Blanking Interval
Vertical Sync Offset = 1203 - 1200 = 3
Vertical Sync Pulse Width = 1209 - 1203 = 6
Vertical Blank Width = 1235 - 1200 = 35
I’d have really liked to have found that somewhere before digging around. Thanks to the modeline on tldp, it worked on the FIRST TRY of this trick because I had the right numbers. It’s beautiful, and I’m happy! YAY! Hopefully this helps at least one other person out of a jam. I’m just contributing to the massive store of knowledge google can bring to you and your kin by posting this. Feel free to ignore it if has nothing to do with you, your laptop, or your monitor.
Context-Aware SharePoint Designer Custom Workflow Activities
May 7, 2008 on 4:11 pm | In .NET Coding | 2 CommentsI had this nice little idea that I could teach the guys in my department how to do workflow with the Sharepoint designer so I wouldn’t have to do all that myself with the big Visual Studio Guns. All was going well until they needed to send out an email containing the URL of the site from which we were sending it. Not a link to an item in the site, the actual URL of the site itself.
“Simple!,” said I. I’ll just get it from the sharepoint object model with a custom activity. I wrote it all up, tried to use SPContext.Current.Web… and got it to puke nicely on a Null reference to Current. Of course! Why would a workflow activity have any reference at all to sharepoint? Technically a workflow activity doesn’t care where it’s hosted. But mine were to be hosted in Sharepoint, and that’s what I wanted to access. So, I looked around on the web and found nothing. I knew it had to be possible to get the context somehow, because other Sharepoint Designer Activities that came in-the-box were using it… so I looked for a clue.
I cracked open Microsoft.SharePoint.WorkflowActions.dll in Lutz Roeder’s Reflector, and lo-and behold there is a very cheap trick at work here!
Microsoft has implemented a custom dependency property by the name of __Context that is picked up as a Microsoft.SharePoint.WorkflowActions.WorkflowContext object IF it exists in your code. If you don’t implement such a property then it’s just not there, and nobody’s the wiser. This WorkflowContext object has a reference to .Site and .Web as properties, so it’s really handy to have at from within your custom activities that need to know where they are.
I’d like to post the code I found directly, but I can’t since it’s not mine. I will show you, however, what my code looks like.
public static System.Workflow.ComponentModel.DependencyProperty __ContextProperty =
System.Workflow.ComponentModel.DependencyProperty.Register("__Context", typeof(WorkflowContext), typeof(FooActivity));
[Description("Context")]
[ValidationOption(ValidationOption.Required)]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Microsoft.SharePoint.WorkflowActions.WorkflowContext __Context
{
get
{
return ((Microsoft.SharePoint.WorkflowActions.WorkflowContext)base.GetValue(FooActivity.__ContextProperty));
}
set
{
base.SetValue(FooActivity.__ContextProperty, value);
}
}
That’s a lot of typing if you write a bunch of these activities, so I made a codesnippet just for all of you out there to have and keep forever so you don’t have to do this. (Warning, do not just make this into a base class and derive your activities from it. It will throw an exception when you try to use it. I’m not sure why, but it does. You have to add this to every single activity you create for SPD that needs to know the sharepoint context.)
Here’s the code snippet I made:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>spwfactivity</Title>
<Shortcut>spwfactivity</Shortcut>
<Description>Code snippet for creating a Sharepoint-Aware Workflow Activity</Description>
<Author>Dolan</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>classname</ID>
<ToolTip>Class Name</ToolTip>
<Default>Activity1</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[public partial class $classname$: System.Workflow.ComponentModel.Activity
{
public static System.Workflow.ComponentModel.DependencyProperty __ContextProperty =
System.Workflow.ComponentModel.DependencyProperty.Register("__Context", typeof(WorkflowContext), typeof($classname$));
[Description("Context")]
[ValidationOption(ValidationOption.Required)]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public Microsoft.SharePoint.WorkflowActions.WorkflowContext __Context
{
get
{
return ((Microsoft.SharePoint.WorkflowActions.WorkflowContext)base.GetValue($classname$.__ContextProperty));
}
set
{
base.SetValue($classname$.__ContextProperty, value);
}
}
public $classname$()
{
InitializeComponent();
}
}]]>
You’ll also have to add a Parameter value to the .actions file with your activity that specifies the __Context property as an Input property.
.
.
.
<Parameters>
<Parameter Name="__Context" Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext, Microsoft.SharePoint.WorkflowActions" Direction="In"/>
.
.
.
</Parameters>
This one took me a while to figure out, but finally it worked!
If you want some more info on adding your own actions to designer (my article has thus far assumed you’re familiar with the process,) check out this link.
Update: I forgot to mention that just about the DAY after I figured this out on my own, I stumbled onto this codeproject article that dealt with this exact topic.
Just for fun I’ve also attached the snippet file so you don’t have to copy and paste it. Just save it into “%ProgramFiles%\Microsoft Visual Studio 9.0\VC#\Snippets\1033\Visual C#.”
Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds.
Valid XHTML and CSS. ^Top^
