Posts Tagged ‘.Net’

MS Surface SDK With VS 2010

I have started lately a POC project in the health care filed with the Microsoft surface

And i was trying to integrate SharePoint 2010 with the surface

And i really wanted to use VS 2010 but the problem was that Surface SDK only worked with

Visual C# Expression and actually the C# Expression is one of the dependencies for the sdk

You can find the sdk here

So all i wanted was to get the Surface SDK Project and item templates inside VS 2010

After surfing the net for some time i found that guy talking about modifying the Msi config settings

And copying some files which really didn’t work with me

But you can give it a try any way surface developing in visual studio 2010

Another trial was to do the following

The Surface project templates can be copied from the Visual Studio 2008 installation to the VS2010, note that just copying them will still require the addition of the System.Xaml references mentioned above. At some point if time permits it will be worth modifying the templates to add System.Xaml.

Copy the C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Project Templates\CSharp\Surface directory to C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Surface.
Note however that this contains two zip files:- WpfSurfaceApplication.zip and XnaSurfaceApplication.zip. An additonal file XnaGs3SurfaceApplication.zip can be found in the directory C:\Program Files\Microsoft SDKs\Surface\v1.0\Project Templates, if this additonal template is required then copy this also.
Also the Item Templates for the Surface SDK are missing, copy these from C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Surface to C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Surface.
Note these files can also be found in C:\Program Files\Microsoft SDKs\Surface\v1.0\Item Templates.

Follow the instructions in the link below:
http://msdn.microsoft.com/en-us/library/y3kkate1(VS.100).aspx
Extract of required steps:
Close all instances of Visual Studio.
On the Start menu, click Run, type cmd, and click OK.
At the command prompt, locate the directory that contains devenv.exe (default C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE), and type devenv /setup.
Run Visual Studio.
Note that the Surface Controls are not present in the toolbox when creating a new WPF Surface Application. To add the Surface Controls to the Toolbox open VS2010, open and pin the Toolbox and right click and choose the Add Tab context menu option.

Next enter the text Surface Controls in the newly created tab.
Right clicking in the new tab to add items causes VS2010 to hang. So go to the Tools Menu and select Choose Toolbox Items…
In the Choose Toolbox Items dialog select the WPF Components and then select all of the Surface controls and press the OK button.

Note the icons for the controls do not appear and this is not the proper solution for the lack of Surface Controls in the Toolbox but is a workaround until the time is available to investigate further.

Pasted from <here>

And that also didn’t work except that it did work to add the surface controls to the Controls Box

And you wont believe what actually made it to work was so simple !!

I just copied the surface project templates and item templates from the path

C:\Program Files\Microsoft SDKs\Surface\v1.0\Project Template

C:\Program Files\Microsoft SDKs\Surface\v1.0\Item Templates

To the path

C:\Users\Awaddabd\Documents\Visual Studio 2010\Templates\ProjectTemplates\Visual C#\Surface

C:\Users\Awaddabd\Documents\Visual Studio 2010\Templates\ItemTemplates\Visual C#\Surface

And that was good enough to make every thing works fine in Visual Studio 2010….

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
 

Resources from Surface Training

I promised you a few items ready for download – these are the links:

  • Administrative guidance: here
  • Specific for remote management: here

  • SDK (if you don’t have it already): here
  • Dev environment setup: here

From this it is quite clear that we could do more complex content – this is noted and although I cannot promise anything on this particular subject, we will try to follow-up via online channels or possibly later sessions.

For those who simply cannot wait, I can highly recommend sessions on Channel 9 and/or attending the MIX conference in Las Vegas in March: www.visitmix.com where WPF, Surface, Silver light and general web design & development are the primary/only topics.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
 

jQuery for Everyone

A Very cool Tips and handy Tools to be used with share point can

Be found on those create topics Jquery for everyone :)

Hope you enjoy them

Entries in this series:

  • JQuery for Everyone: Accordion Left Nav
  • JQuery for Everyone: Print (Any) Web Part
  • JQuery for Everyone: HTML Calculated Column
  • JQuery for Everyone: Dressing-up Links Pt1
  • JQuery for Everyone: Dressing-up Links Pt2
  • JQuery for Everyone: Dressing-up Links Pt3
  • JQuery for Everyone: Cleaning Windows Pt1
  • JQuery for Everyone: Cleaning Windows Pt2
  • JQuery for Everyone: Fixing the Gantt View
  • JQuery for Everyone: Dynamically Sizing Excel Web Parts
  • JQuery for Everyone: Manually Resizing Web Parts
  • JQuery for Everyone: Total Calculated Columns
  • JQuery for Everyone: Total of Time Differences
  • JQuery for Everyone: Fixing Configured Web Part Height
  • JQuery for Everyone: Expand/Collapse All Groups
  • JQuery for Everyone: Preview Pane for Multiple Lists
  • JQuery for Everyone: Preview Pane for Calendar View
  • JQuery for Everyone: Degrading Dynamic Script Loader
  • JQuery for Everyone: Force Checkout
  • JQuery for Everyone: Replacing [Today]
  • JQuery for Everyone: Whether They Want It Or Not
  • JQuery for Everyone: Linking the Attachment Icon
  • JQuery for Everyone: Aspect-Oriented Programming with jQuery
  • JQuery for Everyone: AOP in Action – loadTip Gone Wild
  • JQuery for Everyone: Wiki Outbound Links
  • JQuery for Everyone: Collapse Text in List View
  • JQuery for Everyone: AOP in Action – Clone List Header
  • JQuery for Everyone: $.grep and calcHTML Revisited
  • JQuery for Everyone: Evolution of the Preview
  • JQuery for Everyone: Create a Client-Side Object Model
  • JQuery for Everyone: Print (Any) Web Part(s) Plugin
  • JQuery for Everyone: Minimal AOP and Elegant Modularity
  • JQuery for Everyone: Cookies and Plugins
  • JQuery for Everyone: Live Events vs. AOP
  • JQuery for Everyone: Live Preview Pane
  • JQuery for Everyone: Pre-populate Form Fields
  • JQuery for Everyone: Get XML List Data with OWSSVR.DLL (RPC)
  • Use Firebug in IE
  • JQuery for Everyone: Extending OWS API for Calculated Columns
  • JQuery for Everyone: Accordion Left-nav with Cookies Speed Test
  • JQuery for Everyone: Email a List of People with OWS
  • JQuery for Everyone: Faster than Document.Ready
  • jQuery for Everyone: Collapse or Prepopulate Form Fields
  • jQuery for Everyone: Hourly Summary Web Part
  • jQuery for Everyone: "Read More…" On a Blog Site
  • jQuery for Everyone: Slick Speed Test
  • jQuery for Everyone: The SharePoint Game Changer
  • JQuery For Everyone: Live LoadTip

Inserted from <here>

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
 

SharePoint 2010 Developer Overview ( part 1)

Developer Productivity

Visual Studio 2010
  • Web Part, BDC and Workflow designers
  • Package and Deploy SharePoint projects
  • Generate WSP for Production Deployment
  • View SharePoint site in Server Explorer
  • Team Foundation Server Integration
  • Support for SharePoint Sandboxed Solutions
  • Import WSP from SharePoint Designer including Workflow
  • Build Workflow Steps for SharePoint Designer
  • Extensibility for Development of Additional SharePoint Artifacts
  • SharePoint Business Connectivity Services support
New Tools
  • BDC Entities
  • List Schema
  • Custom Actions
  • Task / Approval Designer
Developer Dashboard

stsadm -o setproperty -pn developer-dashboard -pv ondemand

Rich Platform Services

Business Connectivity Services
  • SharePoint List with External Data
  • Read / Write
  • SharePoint Foundation
  • Built on the SharePoint 2007 Business Data Catalog
SharePoint List Improvements
  • Relationships with Cascade or Block
  • Transacted Cascading Deletion
  • Restriction of Deletion
  • Validation with Excel Like Formula
    • Formula-based Validation
    • Ensure Uniqueness
  • Lookup to Multiple Columns
  • List Index Auto-Creation
  • Scalability and Performance
  • List Query Throttling
    XSLT Views for Lists
    • Replaces CAML for Views
    • CAML Still Used for Queries
  • Better Performance
  • Ribbon UX: sort/filter/group,                                             
  • conditional formatting,…
  • Simpler Coding Experience
  • XSLT-based views are now default
    Workflow Improvements
    SharePoint Events Improvements
    Silver Light , Ribbon and Dialog Framework

    Flexible Deployment

    Sandboxed Solutions
    SharePoint Online
  • Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     

    What is New In C# 2.0 , 3.0 , 3.5, 4.0 ( road map)

    What is New In C# 4.0

    Dynamic lookup

    dynamic d = 7;

    d = “Abdel-Rahman”;

    Named and optional parameters
    public void M(int x, int y = 5, int z = 7);

    M(1, 2, 3); // ordinary call of M 

    M(1, 2); // omitting z – equivalent to 

    M(1, 2, 7) 

    M(1); // omitting both y and z – equivalent to M(1, 5, 7) 

     

    M(1, z: 3); // passing z by name 

    M(x: 1, z: 3); // passing both x and z by name 

    M(z: 3, x: 1); // reversing the order of arguments

    COM specific interop features

    This means that you can easily access members directly off a returned object, or you can assign it to a strongly typed local variable without having to cast. To illustrate, you can now say

    excel.Cells[1, 1].Value = "Hello"; 

     

    // instead of 

     

    ((Excel.Range)excel.Cells[1, 1]).Value2 = "Hello"; 

     

    Excel.Range range = excel.Cells[1, 1]; 

     

    // instead of 

     

    Excel.Range range = (Excel.Range)excel.Cells[1, 1];

    Variance

    // ToDo : 1.0 Add Example.

    What is New In C# 3.0 , C# 3.5

    you can see my old post about C# 3.0 here , but i think i ll write about it here in more details.

    Automatic  Properties
    public int MyProperty { get; set; }

    Implicitly Typed Local Variables
    var n = 5;

    var s = “LINQ rules”;

    var b = new[] { 1, 1.5, 2, 2.5 };

    var c = new[] { "hello", null, "world" };

    Anonymous Types

    var anonType = new {X = 1, Y = 2};

    var NewTempClass = new {FirstName = "name" , Age = 32 };

    string x = NewTempClass.FirstName;

    Object Initializes
    Contact contact = new Contact { LastName = “Magennis”, Age = 9 };

    Collection Initializers
    List<int> digits = new List<int> { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };

    List<Contact> contacts = new List<Contact>

    { new Contact {LastName = “Doherty”, DOB =55},new Contact {LastName = “Wilcox”, DOB = 66} };

    Extension Methods

    They made a new generic methods so you can extend the functionality of any class you want

    public static int NewExtensionMethod(this string s) {return Int32.Parse(s); }

    Partial Methods
    Query Expressions
    var result = from item in List.items Where item.Title = ”Abdel”

    select item;

    Lambda Expressions
    IEnuerable <Person> results = People.Where( P => P.LastName ="Abdel");

    double Averageage = People.Average(P => P.Age);

    Expression Trees

     

    What is New In C# 2.0

    Generics
    class BaseNode { }

    class BaseNodeGeneric<T> { }

    class NodeConcrete<T> : BaseNode { }

    class NodeClosed<T> : BaseNodeGeneric<int> { }

    class NodeOpen<T> : BaseNodeGeneric<T> { }

    class BaseNodeMultiple<T, U> { }

    class Node4<T> : BaseNodeMultiple<T, int> { }

    class Node5<T, U> : BaseNodeMultiple<T, U> { }

    class SuperKeyType<K, V, U>  where U : System.IComparable<U>  where V : new() { }

    static void Swap<T>(ref T lhs, ref T rhs)

    class SampleClass<T> 

    { 

     void Swap(ref T lhs, 

    ref T rhs) { } 

    }

    Iterators
    • An iterator is a section of code that returns an ordered sequence of values of the same type.

    • An iterator can be used as the body of a method, an operator, or a get accessor.

    • The iterator code uses the yield return statement to return each element in turn. yield break ends the iteration. For more information, see yield.

    • Multiple iterators can be implemented on a class. Each iterator must have a unique name just like any class member, and can be invoked by client code in a foreach statement as follows: foreach(int x in SampleClass.Iterator2){}

    • The return type of an iterator must be IEnumerable, IEnumerator, IEnumerable<T>, or IEnumerator<T>.

    The yield keyword is used to specify the value, or values, returned. When the yield return statement is reached, the current location is stored. Execution is restarted from this location the next time the iterator is called.

    Iterators are especially useful with collection classes, providing an easy way to iterate non-trivial data structures such as binary trees.

    Partial Classes
    Nullable Types

    example int? x = null; int y = x ?? -1;

    Use the System.Nullable.GetValueOrDefault

    The syntax T?

    Anonymous Methods

    Del d = delegate(int k) { /* … */ };

    Static Classes
    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     

    “Microsoft.SharePoint.dll” with Visual Studio 2010 Beta 1

    So yester day i was trying to upgrade to visual studio 2010 beta1 and i opened up our current SharePoint project, but surprisingly it complained about it cant see the SharePoint API class even if i remove the dll references and add them back it still complains about it

    and then i found that blog post by VS team telling that they will solve that issue with VS 2010 beta 2 , here to see in details

    now i have installed VS 2010 Beta 2 and i compiled my project and walaah !! it works just like the good old days..

    now i ll start looking into the new VS 2010 features with SharePoint hope they have made a good progress ( looks like it form what i saw in the videos )

    a good starting point could be Visual Studio New Features  and Getting Started with SharePoint 2010 , more on this is coming up so stay tuned ; – )

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     

    SharePoint Sending Email

    Here you go the code for sending email within the SP context

     

    using Microsoft.SharePoint.Utilities;SPUtility.SendEmail(SPContext.Current.Web, false, false, "to-address@mail.com", "E-mail title", "E-mail body");

    more details here

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     

    MasterPage PlaceHolders

    I was searching for a good description of each of the SharePoint master page placeholders and the names of each one and i found that good Link

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     

    InfoPath to SharePoint with Relative Data Connection

    I was trying to automate the deployment process of the InfoPath form to a SharePoint list and also make the dataconnetion relative to the server and the site collection it is deployed to and i have found a very good links to do that

    InfoPath List

    InfoPath DataConnection

    InfoPath Feature

    Xml From InfoPath

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     

    Deploy to /Bin

    must admit that deploying to the /Bin is healthy since any dlls deployed to the GAC directory is granted "Full trust " permissions by default…so the /bin is more secure however it needs more configurations and settings to make sure your dlls are granted the right permissions to work

    That required some special way to make the packages work still with the new structure and making it generate the Code Access Security (CAS) Automatically and add it by default to the web.config

    so here is a small explanation of what we did :)

    each project have AssemblyInfo.cs under properties folder example

    you can set the needed permission for that assembly in that file example

    [assembly: SharePointPermission(SecurityAction.RequestMinimum, ObjectModel = true, Unrestricted = true)]

    [assembly: SecurityPermission(SecurityAction.RequestMinimum, Execution = true, Unrestricted = true)]

    [assembly: WebPartPermission(SecurityAction.RequestMinimum, Connections = true)]

    [assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted = true)]

    [assembly: EnvironmentPermission(SecurityAction.RequestMinimum, Unrestricted = true)]

    [assembly: AspNetHostingPermission(SecurityAction.RequestMinimum, Level = AspNetHostingPermissionLevel.High)]

    [assembly: WebPermission(SecurityAction.RequestMinimum, Unrestricted = true)]

    [assembly: AllowPartiallyTrustedCallers()]

    I use the post build event to copy the generated dlls to the 80/bin folder located in the project structure

    and build the WSP package using the WSPBuilder Also from the build events

    Which automatically define the dlls located in the 80/bin folder and generate the CAS permissions and add them to the web.config when deployed and it uses the ASsemblyInfo.cs as reference for that

    but i know for fact that there is no way we can deploy list event receiver to the bin it have to be deployed to the gac . that is even how it is defined in the SP API

    also please consider that any feature scoped to web application its receiver should be deployed to the GAC , or else the package should also be deployed to the central administration site

    since the web application features are activated form the central administration site .. it will look into the gac or the bin folder of the CA site for the feature receiver

    hope that was clear enough

    Digg This
    Reddit This
    Stumble Now!
    Buzz This
    Vote on DZone
    Share on Facebook
    Bookmark this on Delicious
    Kick It on DotNetKicks.com
    Shout it
    Share on LinkedIn
    Bookmark this on Technorati
    Post on Twitter
    Google Buzz (aka. Google Reader)
     

     

    View Abdel-Rahman Awad's profile on LinkedIn

    Archives

     

    Rss Feed Tweeter button Facebook button Linkedin button Delicious button Digg button