|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NIỆM SINH GIỚI – ĐỊNH – TUỆ (Better Policies for Better lives)
A Better way to Read A Better way to Success
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The IIS Live Smooth Streaming extension for Internet Information Services (IIS) allows you to set up a web server as a Live Smooth Streaming server that delivers compelling, uninterrupted live video streams that instantly adjust quality (bitrate) to match changing network and CPU conditions at the client.
Live Smooth Streaming enables adaptive streaming of live events to Smooth Streaming-compatible clients, such as Microsoft Silverlight. Using HTTP to deliver a live web broadcast leverages the scale of existing HTTP networks by keeping content close to the user and making true HD (720p+) a realistic option for web broadcasts. The additional advantage of using HTTP-based delivery for live events is that the existing HTTP infrastructure provides much more availability. For many popular live web broadcasts, content providers and content distribution networks (CDNs) want to know how much capacity they can dedicate on their resource-constrained streaming networks. By using their primary HTTP networks, which are typically 10-to-20-times larger than their streaming networks, they don’t have to worry about maximizing network capacity and limiting the number of users for live events.
A Live Smooth Streaming server sources content from Live Smooth Streaming-capable encoders for delivery to Smooth-Streaming compatible clients. In addition to Microsoft Expression Encoder, there are many third-party encoding solutions available for encoding both live and on-demand Smooth Streaming video in production environments. To help you determine which encoding solution is best-suited for your Smooth Streaming configuration, see our list of encoding parters.
In this walkthrough:
To install IIS Live Smooth Streaming, see the IIS Media Services Readme Installation Notes. This walkthrough describes how to set up a Live Smooth Streaming server using IIS Live Smooth Streaming in IIS Media Services 4.0, so be sure to select this version of IIS Media Services for installation.
After installation is completed, to verify that the Live Smooth Streaming extension is installed correctly, click the server name in the Connections pane in IIS Manager and then locate the Live Smooth Streaming icon in the Media Services area.
Note If IIS Manager was running during the installation process, you might need to restart it to see Live Smooth Streaming.
This section describes how to create a publishing point that can accept a live broadcast from a Live Smooth Streaming-capable encoder.
This section describes how to create a Live Smooth Streaming broadcast in Microsoft Expression Encoder 4 and push it to the Live Smooth Streaming publishing point that you configured in the previous section. The steps in this section outline a general workflow, with details only on the specific tasks that you need to create Live Smooth Streaming output. For detailed information about how to create a live broadcast from various live and file-based sources in Expression Encoder 4, including how to assemble a complete program, encode it, encrypt it with Digital Rights Management (DRM), and instantly distribute it to your audience using Smooth Streaming technology, see Creating a Live Broadcasting Project.
Important If you enabled the publishing point to stream content to Apple devices, such as iPhone® and iPad™ devices, be sure to review the encoding requirements and settings outlined in Apple HTTP Live Streaming with IIS Media Services.
Note Live Smooth Streaming is available only in Microsoft Expression Encoder Pro.
This section describes how to use the Microsoft Silverlight Media Framework 2.0 SmoothStreamingPlayer.XAP, a sample player that can easily be embedded in your website to enable client playback of Smooth Streaming media.
Important Apple devices use an HTML 5 webpage to play the Live Smooth Streaming presentation. If you enabled the publishing point to stream content to Apple devices, see Creating an HTML 5 page for use in Safari.
Note The latest version of Microsoft Silverlight must be installed on the client computer that you want to use to observe Live Smooth Streaming.
For more information about how to to build rich Silverlight user experiences that take full advantage of live and on-demand IIS Smooth Streaming capabilities, see Smooth Streaming Client.
To create a theme extension, you must do the following:
Visual Studio Professional 2012
Visual Studio 2012 SDK
LightSwitch Extensibility Toolkit for Microsoft Visual Studio 2012
Create a Theme Extension Project
The first step is to create a project and add a LightSwitch Theme template.
On the menu bar in Visual Studio, choose File, New Project.
In the New Project dialog box, select the LightSwitch node, and then select LightSwitch Extension Library (Visual Basic) or LightSwitch Extension Library (C#).
In the Name field, type TestThemeExtension as the name for your extension library. This name will appear on the Extensions tab of the LightSwitch Application Designer.
Choose the OK button to create a solution that contains the seven projects that are required for the extension.
In Solution Explorer, select the TestThemeExtension.Lspkg project.
On the menu bar, choose Project, Add New Item.
In the Add New Item dialog box, select LightSwitch Theme.
In the Name field, enter TestTheme as the name for your extension.
Choose the OK button. Files will be added to several projects in your solution.
Specify the Display Name and Description
The default name for your theme is “TestTheme” and the default description is “TestTheme description.” Both of these will appear in the Application Designer at design time. Therefore, you will change them to something more meaningful.
In Solution Explorer, choose the TestThemeExtension.Common project.
Expand the Metadata and Themes nodes, and open the TestTheme.lsml file.
In the Theme element, replace the DisplayName value with Test Theme, and replace the Description value with This is my first try at creating a theme. As follows.
<Theme Name="TestTheme"> <Theme.Attributes> <DisplayName Value="Test Theme"/> <Description Value="This is my first try at creating a theme."/> </Theme.Attributes> </Theme>
These are the values that developers will see when they select your theme on the General Properties tab of the application designer.
At this point you have created a theme, and you can test it in a LightSwitch application.
The LightSwitch Theme project template added a TestTheme.xaml file to the TestThemeExtension.Client project. This file contains the resource directory for the LightSwitch shell; the default values and styles define the appearance of the LightSwitch Blue Theme (Default) theme that is the default for LightSwitch applications. You define your own theme by modifying some or all of the values in this file. For more information on the available styles, see Control Elements for LightSwitch Themes.
In Solution Explorer, choose the TestThemeExtension.Client project.
Expand the Presentation and Themes nodes, and open the TestTheme.xaml file.
On the menu bar, choose Edit, Find and Replace, Quick Replace.
In the Find and Replace dialog box, enter Segoe UI, Arial in the Find what field, and enter Segoe Script in the Replace with field.
Choose Current Document in the Look in list, and then choose Replace All.
Eleven occurrences will be replaced, defining Segoe Script for all of the font values.
In the TestTheme.xaml file, locate the TextBoxBackgroundBrush element, and replace <SolidColorBrush x:Key=”TextBoxBackgroundBrush” Color=”White”/> with <SolidColorBrush x:Key=”TextBoxBackgroundBrush” Color=”Yellow”/>.
Locate the ToolbarBackgroundBrush element and replace <SolidColorBrush x:Key=”ToolbarBackgroundBrush” Color=”#FFE9EDF1″/ with <SolidColorBrush x:Key=”ToolbarBackgroundBrush” Color=”Red”/.
Note that the color values can be entered as either a System.Drawing.Color value or a hexadecimal color value.
Tip
You can also open the .xaml file in Microsoft Expression Blend 4 and change the colors in a visual designer.
At this point you have created a rudimentary theme, and you can test it in a LightSwitch application.
You can test the theme extension in an experimental instance of Visual Studio. If you have not already tested another LightSwitch extensibility project, you have to enable the experimental instance first.
In Solution Explorer, select the TestThemeExtension.Vsix project.
On the menu bar, choose Project, TestThemeExtension.Vsix Properties.
On the Debug tab, under Start Action, choose Start external program.
Enter the path of the Visual Studio executable, devenv.exe.
By default on a 32-bit system, the path is C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe; on a 64-bit system, it is C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe.
In the Command line arguments field, type /rootsuffix Exp as the command-line argument.
Note
All subsequent LightSwitch extensibility projects will also use this setting, by default.
On the menu bar, choose Debug, Start Debugging. An experimental instance of Visual Studio opens.
In the experimental instance, on the menu bar, choose File, Open Project.
In the Open Project dialog box, select any existing LightSwitch application project and open it.
On the menu bar, choose Project, ProjectName Properties.
In the project designer, on the Extensions tab, check the TestThemeExtension check box.
Select the General Properties tab, and in the Theme list, choose Test Theme.
On the menu bar, choose Debug, Start Debugging. Observe the changes in appearance in the running application.
This completes the theme extension walkthrough; you should now have a fully functioning theme extension that you can reuse in any LightSwitch project. Of course, you might want to modify the styles to make the theme a bit more pleasing to the eye; the walkthrough is only intended to show you the necessary techniques.
If you are going to distribute your extension, there are a couple more steps that you must take. To make sure that the information displayed for your extension in the project designer and in Extension Manager are correct, update the properties for the VSIX package. For more information, see How to: Set VSIX Package Properties. In addition, there are several things to consider if you are going to distribute your extension publicly. For more information, see How to: Distribute a LightSwitch Extension.
LightSwitch Metro Theme Extension Sample
This sample demonstrates how to recreate the LightSwitch Metro Theme extension, a contemporary theme for Visual Studio LightSwitch applications.
The prerequisites for this sample are:
In addition to these prerequisites, you should be proficient in either Visual Basic or C# and should be familiar with theming in Silverlight. We also recommend that you be familiar with creating Visual Studio extensions using the Visual Studio SDK.
Description
This sample expands upon the Help topic Walkthrough: Creating a Theme Extension, which demonstrates a simple theme that defines fonts and colors. The Metro theme also makes use of styles, defining new appearance and behavior for the built-in LightSwitch control templates. To provide a consistent experience, you will need to define Resource Dictionaries in the form of a .xaml file for each control template, as shown in the following illustration:
Additional styles are defined in the MetroStyles.xaml file, which also contains a MergedDictionaries node that references the other .xaml files. When LightSwitch loads the extension, it reads in all of the style information and applies it to the built-in templates, providing a different look and feel for your application.
There isn’t much code in this sample; most of the work is done in xaml. You can use this sample as a starting point for your own theme, changing the fonts, colors, and styles to create your own look. Enjoy!
For more information on creating extensions for Visual Studio LightSwitch, seeVisual Studio LightSwitch 2011 Extensibility Toolkit.
Visual Studio LightSwitch is a tool for developing business applications for the desktop, web, and cloud. You can extend the functionality of LightSwitch by creating extensions using Microsoft Visual Studio Professional 2012, the Visual Studio 2012 SDK, and the LightSwitch Extensibility Toolkit for Microsoft Visual Studio 2012.
The following are required in order to create LightSwitch extensions:
Visual Studio Professional 2012
Visual Studio 2012 SDK
LightSwitch Extensibility Toolkit for Microsoft Visual Studio 2012
In addition to these prerequisites, you should be proficient in either Visual Basic or C# and should be familiar with both Windows Presentation Foundation (WPF) and Silverlight. We also recommend that you be familiar with creating Visual Studio extensions using the Visual Studio SDK.
There are six types of extensions for LightSwitch:
Business types
Let you wrap a base data type in a semantic type, providing additional validation and display capabilities in LightSwitch while continuing to store the data in its underlying type. They can include a Silverlight control for displaying data.
Custom controls
Silverlight user controls with additional attributes to make them usable in and better integrated with LightSwitch.
Data sources
Domain service adapter class that enables LightSwitch to work with other data sources.
Screen templates
Can be used to create screens that have common layout patterns different from the standard screen layouts provided by LightSwitch.
Shells
Let you create an application shell with a different layout and different capabilities than the standard LightSwitch application shell.
Themes
Let you create a different appearance and behavior for LightSwitch applications and controls.
The LightSwitch Extensibility Toolkit for Microsoft Visual Studio 2012 includes templates that contain the necessary files for each extension type.
Creating LightSwitch Extension Projects
The LightSwitch Extensibility Toolkit for Microsoft Visual Studio 2012 installs two new project templates, LightSwitch Extension Library (Visual Basic) and LightSwitch Extension Library (Visual C#), that can be used to create extensions. When you select one of these project types, a solution with seven projects is generated:
The projects with names that end in .Client, .Client.Design, .Common, .Design, and .Server contain the various parts of the extension items that will be added to the library.
Content project
Purpose
Referenced by
Client
Contains client implementations that should be deployed with a LightSwitch application but are not found in the Common project. For example, controls, shells, and themes.
Client sub-project
Client.Design
Contains implementations necessary during the debugging of a LightSwitch application. For example, control images or custom property editors for the runtime screen designer.
Client sub-project
Common
Contains implementations that are common to both the client and the server. For example, metadata loaders and validators.
Client sub-project, server sub-project, Visual Studio IDE
Design
Contains implementations for design time integrated development environment (IDE) operations. For example, a screen template.
Visual Studio IDE
Server
Contains server implementations that should be deployed with a LightSwitch application but are not found in the Common project. For example, data sources.
Server sub-project
The .Lspkg project packages the previous five projects so that LightSwitch can unpack and reference them when the package is installed.
The .Vsix project packages the generated .Lspkg file into a .Vsix package so that it can be added to LightSwitch through the Extension Manager.
The contents of each project will differ depending on which extension type template is selected. To learn more about how to create extensibility projects, see How to: Create a LightSwitch Extension Project
Developing LightSwitch Extensions
The process of developing a LightSwitch extension is like that of developing a Visual Studio extension using the Visual Studio SDK. As with any extension, you create an extensibility project, write code for the extension, debug the extension, set properties for the .Vsix package, and distribute the extension.
The actual code that you have to write will vary depending on the extension type. To start working with a particular extension type, see one of the following topics:
As with any Visual Studio extension, you debug a LightSwitch extension by using an experimental instance of Visual Studio. To learn more about how to debug, see How to: Debug or Test a LightSwitch Extension.
Once your extension is complete, you will want to set properties in the .Vsix package to identify the extension. For more information, see How to: Set VSIX Package Properties. The final step is to publish your extension on Visual Studio Gallery. For more information, see How to: Distribute a LightSwitch Extension.
Visual Studio LightSwitch allows you to create Theme extensions. A theme controls the overall look of a LightSwitch application.
Microsoft has an article, Walkthrough: Creating a Theme Extension, that covers the basics of creating themes for LightSwitch, however, this article will go a bit deeper and demonstrate creating more complex themes.
First note that the following are required in order to create LightSwitch extensions:
Visual Studio 2010 SP1 (Professional, Premium, or Ultimate edition)
Visual Studio 2010 SP1 SDK
Visual Studio LightSwitch 2011
First, we create an extension project in Visual Studio.
We add a New Item to the .Lspkg project.
We add a Theme to the project.
A number of files are created in the various projects in the solution, including files in the Theme folder in the .Client project.
We click on the .Vsix project…
We then Start Debugging. This will open another instance of Visual Studio.
We create or open a LightSwitch project and go into Properties.
We click on the Extensions tab and enable the theme extension.
On the General Properties tab we select the Theme.
We then run the application.
The application shows with the default theme.
We now close the application, and the Visual Studio instance, and return to the extensions project.
We right-click on the .xaml file and open it in Expression Blend.
When we click on the Resources tab, we can easily alter the brush styles.
When we run the application we see that our changes are reflected.
If we look at the LightSwitch Metro Theme we see an example of a more advanced theme.
It contains a class that implements the IThemeExtension interface, and an associated resource file.
See Jan Van der Haegen‘s article: Adding control styles to your LightSwitch theme extension for a full explanation of the the IThemeExtension interface.
We add a new class that implements the IThemeExtension interface using the following code:
using System;using System.ComponentModel.Composition;using Microsoft.LightSwitch.Theming;using System.Collections.Generic;using Microsoft.LightSwitch.Model;namespace SimpleGreenTheme.Presentation.Themes{[Export(typeof(IThemeExtension))][Theme(GreenTheme.ThemeId, GreenTheme.ThemeVersion)]internal class MetroStyles :IThemeExtension{IEnumerable<Uri> IThemeExtension.GetControlStyleResources(string themeId, string themeVersion, IEnumerable<IModuleDefinition> modules){yield return newUri(@"/SimpleGreenTheme.Client;component/Presentation/Themes/GreenStyles.xaml",UriKind.Relative);}}}Next, we add a Resource Dictionary to the project.
We can download Silverlight Themes from this link to “grab some ideas”
.
When we open the resource file in Expression Blend…
We can visually edit the theme.
When we run the application we are able to see our advanced theming of controls.
Download Code
The LightSwitch project is available at http://lightswitchhelpwebsite.com/Downloads.aspx
Express yourself! Share your work with other members of the Expression Community.
Each contribution is licensed to you under a License Agreement by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.
Description
The SharePoint plugin for Expression Encoder 4 will allow you to publish your encoded output to the SharePoint 2010 video gallery.
To install:
NOTE: At this time, IIS Smooth Streaming content uploaded to SharePoint cannot be played back directly from the service.
A Better way to Read A Better way to Success
Serious Science Starts when you Begin to Measure
Thích lập trình
Stuff and things.
Find the perfect theme for your blog.