| SpotLight in WPF cann't form a circle of light? |
|
 |
Index ‹ Visual Studio 2008 ‹ Windows Presentation Foundation (WPF)
|
- Previous
- 1
- Windows Presentation Foundation (WPF) Security Restrictions...In my application I have a specific object instance that I set up for remote access. I then set properties on that object from other processes. Everything seems to be working well, except for two specific properties for which I get an exception when I try to set them.
The thing that's special about these properties is that they are custom-defined enumerations. For example:
class MyClass {
public enum MyEnum { enum1, enum2, enum3 }
private MyEnum _cantSetThisProperty; public MyEnum cantSetThisProperty { get {return _cantSetThisProperty;} set {_cantSetThisProperty = value;} }
....lots of other properties/methods that all work OK....
}
From the error, it looks like the security restriction is actually against the enumeration "MyEnum." How is it that I can't access MyEnum...but I can access the rest of MyClass
- 2
- 3
- 4
- Visual Studio Setup and Installation Brace Highlighting and BackgroundI actually just installed VStudio 2005 and am editing C++ code and the only brace highlighting I get is when I type a new } , but it matches in black that is really hard to determine between it and a regular one, there is no option to set the background, only the brace color. Also, is there a way to make it match just by clicking next to the }
- 5
- Windows Presentation Foundation (WPF) Filter Inner List Property
Hello,
I have done a test to see how WPF is handing entity binding and it working great. Much better than WinForms.
I have create a class call Mission with property Name and a property Tasks of type IList<Task>.
I also create a Task class which have Name and Legnth.
Now, I have created two missions with few tasks in each of them. The missions are stored in List<Mission>. I have bound the mission list to an ItemsControl and set its ItemTemplate to Expander. The Expander header is bound to the mission's name. I then create an inner ItemsControl inside the missions control which have its ItemsSource property bound to the Tasks property. Inside the inner ItemsControl I put a TextBlock which bound to the task's name.
Everything is working great.
My question is this: I want to filter both the missions I see and the tasks I see. Filtering the mission is easy by using CollectionView.
How can I filter the tasks based on thier length and still use binding
Thank you very much,
Ido.
- 6
- Windows Communication Foundation ("Indigo") Error in WCF course demo code - where is Httpcfg
In the Microsoft Learning course Clinic 5137 : Introduction to Developing WCF & VS2005 I get the following error running the WCF Demo.
I go to the above link and it directs me to use the Httpcfg tool but I cannot find Httpcfg any where on this released version of Windows Vista.
With Windows Vista is it better to develop on another platform, i.e. Win 2003 and then deploy to Windows Vista Or do I just need to get this tool on my copy of Windows Vista
Thanks
- 7
- Visual Studio Tools for Office AddIn App PathWe used to use System.Reflection.GetExecutingAssembly().Location to obtain the path to our Excel 2003 addin. In VSTO 2005 for Excel 2007 this is returning something like;
"C:\Documents and Settings\chrish\Local Settings\Application Data\assembly\dl3\Q0G97ZAE.ZN2\D7ZDXCJ1.7DR\63345ad5\54a51f05_b4fbc601\".
I've changed the code to instead use System.Reflection.GetExecutingAssembly().CodeBase. Would this be the correct method for VSTO 2005
- 8
- Windows Presentation Foundation (WPF) Hyperlink bug?
I'm
using the hyperlink tag to switch my standalone window from window 1 to
window 2 and vice versa. But the link doesn't work when i click in "Go
To The Windiw 2" :-(
windows1.xaml
<Window x:Class="Server.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Server" Height="300" Width="300" > <Grid> <StackPanel Background="LightGreen"> <TextBlock DockPanel.Dock="Top" Margin="10,10,10,10">Window1</TextBlock> <TextBlock HorizontalAlignment="Left" Margin="10,10,10,10"> <Hyperlink NavigateUri="Window2.xaml">Go To The Window2</Hyperlink> </TextBlock> </StackPanel> </Grid> </Window>
windows2.xaml
<Page x:Class="Server.Window2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window2" > <Grid> <StackPanel Background="Yellow"> <TextBlock DockPanel.Dock="Top" Margin="10,10,10,10">Window2</TextBlock> <TextBlock HorizontalAlignment="Left" Margin="10,10,10,10"> <Hyperlink NavigateUri="Window1.xaml">Go To The Window1</Hyperlink> </TextBlock> </StackPanel> </Grid> </Page>
I followed the at the end of this page: ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETFX30SDK4VS.1033/wpf_conceptual/html/b96bed40-8946-4285-8fe4-88045ab854ed.htm
- 9
- Visual Studio Tools for Office Checking if excel file exists before opening
I'm writing a program in C# that will open and manipulate an excel file. However, I will need to check if the file exists BEFORE I attempt to open it. Here is what I have...
Microsoft.Office.Interop.Excel. Application xlApp = new Microsoft.Office.Interop.Excel.Application();
xlApp.Visible = false;
Workbook wb = xlApp.Workbooks.Add(@"C:\test.xls");
How can I check to see if text.xls exists before I open it
Thanks :)
- 10
- Windows Presentation Foundation (WPF) Xaml auto-completion?
|
I've VS2005 with the latest "orcas" upates. Why VS xml editor doesn't help me with hints on code tags and attributes like it does while i edit configuration files I'm already opening it with xml editor and if i digit < i receive only:
<!-- <![CDATA[]]> <
This looks strange to me. :-\ | |
- 11
- Windows Communication Foundation ("Indigo") Asynchronous calls and ChannelFactory.CreateChannel
Has anyone an example of how to implement an asynchronous call when I’ve used CreateChannnel from the ChannelFactory. I had a look around but there doesn’t seem to be any info on it.
I don’t what to use svcutil because the return types for my generic collection are returned as a dataset. I’ve tried using /ct flag and it doesn’t seem to work for my collection (it’s from llblgen) .
When I use CreateChannel and call the methods synchronously I can cast the return values to my collections with no problem.
am I missing something
Cheers
Johnny
- 12
- Windows Presentation Foundation (WPF) How are Inlines drawn?
I've been trying to understand how the FlowDocument renders it's Inline elements, but the documentation doesn't discuss this aspect.
Can you tell me how the Inlines (or Blocks also) are rendered and which classes are responsible for it
Thanks.
- 13
- 14
- Visual Studio MSBuild How to get Razzle?
I am working on WDM driver and now using WDK RC2 got from Windows Connect. I suffer a problem when I use prefast test to check my driver code.
From the feedback of MS, it has to use Razzle Window to get some more debug information. But Razzle seems an internal debug tools and is not available to the public.
Does anyone know how to get it
- 15
- Visual Studio Extensibility MPGG Unexpected errorThis is the error I get when compiling the parser.y file. It is the modified parser.y file from ManagedMyC example. The parser.y file is attached to this post.
"G:\Program Files\Visual Studio 2005 SDK\2006.09\VisualStudioIntegration\Tools\bin\MPPG.exe" Generated\parser.y > obj\Debug\parser.cs Unexpected Error Collection was modified; enumeration operation may not execute.
Can anyone help me
Thanks, Zvonko
%using Microsoft.VisualStudio.TextManager.Interop %namespace Babel.Parser %valuetype LexValue %partial
/* %expect 5 */
%union { public string str; }
%{ ErrorHandler handler = null; public void SetHandler(ErrorHandler hdlr) { handler = hdlr; } internal void CallHdlr(string msg, LexLocation val) { handler.AddError(msg, val.sLin, val.sCol, val.eCol - val.sCol); } internal TextSpan MkTSpan(LexLocation s) { return TextSpan(s.sLin, s.sCol, s.eLin, s.eCol); }
internal void Match(LexLocation lh, LexLocation rh) { DefineMatch(MkTSpan(lh), MkTSpan(rh)); } %}
%token IDENTIFIER NUMBER STRING %token ABORT ADDBRANDINGIMAGE ADDSIZE AUTOCLOSE %token SECTION FUNCTION SECTIONEND FUNCTIONEND %token TRUE FALSE %token LEFT RIGHT TOP BOTTOM
%token EQ NEQ GT GTE LT LTE AMPAMP BARBAR %token LEX_WHITE LEX_COMMENT LEX_ERROR
%left '*' '/' %left '+' '-'
%%
Program : Declarations ; Declarations : Declaration Declarations | Declaration error { CallHdlr("Expected Declaration", @2); } | /* empty */ ; Declaration /* might need an init action for symtab init here */ : Declaration_ ; Declaration_ : GlobalBlock | SectionsD | FunctionsD ; SectionsD : SectionD SectionsD | SectionD error { CallHdlr("Expected Section", @2); } | /* empty */ ; SectionD : SECTION IDENTIFIER SectionBlock SECTIONEND | SECTION SectionBlock SECTIONEND ; FunctionsD : FunctionD FunctionsD | FunctionD error { CallHdlr("Expected Function", @2); } | /* empty */ ; FunctionD : FUNCTION IDENTIFIER FunctionBlock FUNCTIONEND ; SectionBlock : AbortD | AddSizeD ; FunctionBlock : AbortD ; GlobalBlock : AddBrandingImageD | AutoCloseD ; /****************** FUNCTION DEFINITION ******************/ AbortD : ABORT | ABORT STRING ; AddBrandingImageD : ADDBRANDINGIMAGE Position NUMBER | ADDBRANDINGIMAGE Position NUMBER NUMBER ; AddSizeD : ADDSIZE NUMBER ; AutoCloseD : AUTOCLOSE Boolean ; /***************** GLOBAL DEFINITIONS *****************/ Boolean : TRUE | FALSE ; Position : LEFT | RIGHT | TOP | BOTTOM ; %%
|
| Author |
Message |
samonwang

|
Posted: Windows Presentation Foundation (WPF), SpotLight in WPF cann't form a circle of light? |
Top |
Hi! Guys,
I have a problem. When I use a spotlight in the 3-D scene to light a side
plane of a cube ,the result is not a circle light effect.
<Viewport3D ClipToBounds="True" Width="150" Height="150" Canvas.Left="0"
Canvas.Top="10">
<!-- Defines the camera used to view the 3D object. -->
<Viewport3D.Camera>
<PerspectiveCamera Position="0,0,2" LookDirection="0,0,-1"
FieldOfView="60" />
</Viewport3D.Camera>
<!-- The ModelVisual3D children contain the 3D models -->
<Viewport3D.Children>
<!-- A SpotLight is used to light the scene. The InnerConeAngle
and OuterConeAngle are used
to control the size of the light cone created by the
SpotLight. The Direction and Position
properties determine where the SpotLight is pointing in the
scene. In this example, the Position
of the SpotLight is set so that the SpotLight is only
illuminating the upper right-hand corner
of the 3D object. -->
<ModelVisual3D>
<ModelVisual3D.Content>
<SpotLight x:Name="mySpotLight" InnerConeAngle="15.0"
OuterConeAngle="22.0" Color="#FFFFFF" Direction="0,0,-1"
Position="0,0,5" Range="30"/>
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<GeometryModel3D>
<!-- The geometry specifes the shape of the 3D plane. In
this sample, a flat sheet is created. -->
<GeometryModel3D.Geometry>
<MeshGeometry3D
TriangleIndices="0,1,2 3,4,5 "
Normals="0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 0,0,1 "
TextureCoordinates="0,0 1,0 1,1 1,1 0,1 0,0 "
Positions="-0.5,-0.5,0.5 0.5,-0.5,0.5 0.5,0.5,0.5
0.5,0.5,0.5 -0.5,0.5,0.5 -0.5,-0.5,0.5 " />
</GeometryModel3D.Geometry>
<GeometryModel3D.Material>
<MaterialGroup>
<DiffuseMaterial>
<DiffuseMaterial.Brush> <SolidColorBrush
Color="Blue" />
</DiffuseMaterial.Brush>
</DiffuseMaterial>
</MaterialGroup>
</GeometryModel3D.Material>
</GeometryModel3D>
</ModelVisual3D.Content>
</ModelVisual3D>
</Viewport3D.Children>
</Viewport3D>
Visual Studio 200821
|
| |
|
| |
 |
Adam Smith MS

|
Posted: Windows Presentation Foundation (WPF), SpotLight in WPF cann't form a circle of light? |
Top |
What you're seeing is the fact that we're not a ray tracing engine. What I mean by that is that we're not running light calculations for every pixel, we take shortcuts (as does DX, OGL, etc). When lighting triangles, we light each corner of the triangle in question and then interpolate between the 3 corners to fill the inside of the triangle. You have a spotlight targetting the direct center of your quad - this means that each corner is equally lit, so you see a nice even illumination. If you want finer detail, you can sub-divide your quad into, say, a 5x5 grid of quads.
-Adam Smith [MS]
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio 2008 ‹ Windows Presentation Foundation (WPF) |
- Next
- 1
- Visual Studio MSBuild MSBuild NewBie question
Hi,
I just have two problems with MSBuild and wonder if somebody can help me.
1. I'm trying to incorporate NUnit tests with MSBuild, so I try the following:
<ItemGroup><TestAssembly Include="Scheduler.Service.Test.dll"> <WorkingDirectory>build\test\</WorkingDirectory> </TestAssembly></ItemGroup>
and then in task I used MSBuild Community Task:
<Target Name="UnitTest"> <NUnit ContinueOnError='true' Assemblies="@(TestAssembly)" WorkingDirectory="%(WorkingDirectory)" ToolPath="build\test\" /> </Target>
Now I want to make a test with a group of assembles, so I tried <TestAssembly Include="*.Test.dll">
However, in this case, it cannot found any of the dll because of the working directory. But if I delete the working directory, I cannot get the nunit run probably. Any suggestion for this problem
2. I'm also trying to do <replacetoken> from an xml file like NAnt like the <filterchain>. I looked up the net and find the <updatefile> attribute in the Community Task useful.
However, is there a way that you could include an xml file in the msbuild and load all the local properties in
Something that will do
<include buildfile="local.properties.xml" />
Thank you very much for the help in advance,
Cheers,
Joshua
- 2
- 3
- Visual Studio Extensibility IVsTextMarkerClient multi-level context menuIs it possible to create multi-level menu items from a IVsTextMarkerClient (perhaps inside the GetMarkerCommandInfo method)
The sample code below adds one menu item for each item in the pointcuts
array, but I would like to add only one menu item with each array
element as sub menu items.
public int GetMarkerCommandInfo(IVsTextMarker pMarker, int iItem, string[] pbstrText, uint[] pcmdf)
{
if (pbstrText == null)
{
return VSConstants.S_OK;
}
uint
flags =
(uint)(Microsoft.VisualStudio.OLE.Interop.OLECMDF.OLECMDF_SUPPORTED |
Microsoft.VisualStudio.OLE.Interop.OLECMDF.OLECMDF_ENABLED);
if (iItem < pointcuts.Length)
{
pbstrText[0] = pointcuts[iItem].ToString();
pcmdf[0] = flags;
return VSConstants.S_OK;
}
return VSConstants.S_FALSE;
}
- 4
- 5
- Windows Presentation Foundation (WPF) TreeView and several HierarchicalDataTemplate
I have two HierarchicalDataTemplates for TreeView :
< HierarchicalDataTemplate DataType="Person" ItemsSource ="{Binding XPath=*}" x:Key="BriefTemplate">
< HierarchicalDataTemplate DataType="Person" ItemsSource ="{Binding XPath=*}" x:Key="FullTemplate">
My questions are:
1. <TreeView ItemTemplate="{StaticResource BriefTemplate}" ItemContainerStyle="{StaticResource VerticalTreeItem}" Name="myTreeView" ItemsSource="{Binding Source={StaticResource FamilyTree}, XPath=*}" >
It doesn't work,I get the error : "cannot find resource BriefTemplate". How should I write resource for ItemTemplate
2. In Button Click event I want to change one HierarchicalDataTemplate to another. How should I do it
Thanks for advance.
- 6
- 7
- 8
- Windows Communication Foundation ("Indigo") dataContractSerializer with msmqIntegration?
I have basetype datacontract with knowntype attributes of subclass type marked. it has no problem work with netTCP, namePipe,msmqBinding, but it gives error with msmqIntegrationBinding.
Is it dataContractSerializer can't be appied to msmqIntegration due to the interop reason if so, how to pass around subclass types with msmqIntegrationBinding, any example
thanks
- 9
- Visual Studio Report Controls Testing for Null in RDLC Report Field
In .net 2.0, vb.net, I am trying to display a strPhCell phone number char field, from a DataSet, using the Format() function. The Format works fine, but whenever there is NO Phone Number, the string "#error" displays on the report. I have tried every way I can think of to detect a Null or blank, but nothing works. Someone on ExpertExchange suggested the following ... which also does not work if there is no phone number. Can someone help
=IIF (Fields!strPhCell.Value is nothing, nothing, Format(cdec(Fields!strPhCell.Value),"(###) ###-####") )
cgai
- 10
- Visual Studio Tools for Office Display HTML text in Word (with VSTO)Hi,
I would like to tell Word to interpret some text in HTML form and display only the resulting text well-formated.
Here some code: Word.Range range = Range(ref missing, ref missing); range.Text = "Some normal text"; range.Bold = 1; range.InsertAfter("\n\n"); range.Collapse(ref collapseEnd);
// now the html part range.Text = "<span class="A21">This is some html content</span>" ; range.InsertAfter("\n\n");
The second part of the code displays the HTML tags instaed of interpreting it as html. Any idea how I can fix this
Thanks a lot for any help. Claudia
- 11
- Windows Presentation Foundation (WPF) How to create DynamicResource in code?
Hi all,
I have a program to play slideshow. All images are imported in run-time than use XmlWriter to save. Likes below.
....
<Grid.Resources> <BitmapImage UriSource="20040714_lsps9140723_20213.jpg" x:Key="Bitmap1" /> <BitmapImage UriSource="20051010_ak0674661_030324.jpg" x:Key="Bitmap2" /> </Grid.Resources> ....
<DrawingCollection > <ImageDrawing ImageSource ="{DynamicResource Bitmap1}"/> <ImageDrawing ImageSource ="{DynamicResource Bitmap2}"/> </DrawingCollection >
My question is, How to create ImageSource ="{DynamicResource Bitmap1}" in code
Thanks.
- 12
- Visual Studio Guidance Automation Toolkit Testing a web site Using Visual studio 2005
Hi, i m using visual studio 2005 build in feature to test the website, adding the new test to the solution by going in the test menu is gud.. but when i right click on the test and say new test, i dont find any web.test in the dialog only two options, which i get are orderedtest and unit test. i m using visual studio 2005 team suite but cant find the web.test .... do i need to download this addins or whts the solution...
- 13
- 14
- Developer Documentation and Help System Sandcastle - Links to inherited framework members not working on my system.
Hello All,
I would appreciate some feedback on the following issue I am having with the latest version of Sandcastle. I am either doing something wrong or there would appear to be an issue with the latest sandcastle release.
When I use sandcastle ( latest release ) to generate a help 2.0 .HXS file I have noticed that when I integrate it into Visual Studio 2005 - using the help integration wizard supplied in the SDK - I seem unable to get to inherited members from the Framework when I click on them. When I look at my classes they contain inherited members like GetType(), Equals(Object) which are all inherited from the Object() class. When I click on them I get a page displayed saying "Information not found". I am sure on previous versions of sandcastle this used to work. I have had a look at the references in the help file and in the case of GetType() - which is inherited from Object() - it seems to contain references which looks quite a bit different to links which work in the existing visual studio 2005 help. In the resolve reference links of sandcastle.config file I have the "index" type set for the cpref_reflection:
<!-- resolve reference links --> <component type="Microsoft.Ddue.Tools.ResolveReferenceLinksComponent" assembly="..\..\ProductionTools\BuildComponents\BuildComponents.dll"> <targets files="reflection.xml" type="local" /> <targets files="..\cpref_reflection\*.xml" type="index" /> </component>
If I set the cpref_reflection type to "msdn" it correctly access the internet to show me details of the inherited member, it is just the setting the type to "index" does not appear to work. I am sure on previous versions of Sandcastle, when I clicked on an inherited framework member to give its details my from visual studio help files installed on my system.
If I view the source of an inheritied framework member like GetType() in the .HXS I have generated using Sandcastle it seems to have the following code which does not look right:
<td><mshelp:link keywords="GetType" tabindex="0" xmlns:mshelp="http://msdn.microsoft.com/mshelp">GetType()</mshelp:link></td><td><div class="summary">Gets the <mshelp:link keywords="Type" tabindex="0" xmlns:mshelp="http://msdn.microsoft.com/mshelp">Type</mshelp:link> of the current instance.</div> (Inherited from <mshelp:link keywords="Object" tabindex="0" xmlns:mshelp="http://msdn.microsoft.com/mshelp">Object</mshelp:link>.)</td>
I would appreciate any help on this matter as I am need to get this working as I would like to use Sandcastle to document my code.
Michael
- 15
- Visual Studio Extensibility Can I create ModelDocData and ModelDocView from the model domain class?
I serialized my model doing something like this:
SerializationResult sr = new SerializationResult();
UseCaseSampleSerializationHelper.Instance.SaveModelAndDiagram(sr, obj1.ModelRoot, @"C:\TEMP\MODEL.XML", obj2.Diagram, @"c:\temp\model.diagram");
This work fine, after i want to deserialized the model and show it on one designer, but i haven’t any file ".diagram" on the solution explorer, only I have the model load on the store:
SerializationResult sr = new SerializationResult();
UseCaseModel result=null;
Store store = new Store();
Type[] modelTypes = new Type[] {
typeof(Microsoft.VisualStudio.Modeling.Diagrams.CoreDesignSurfaceDomainModel),
typeof(Microsoft.Example.UseCases.UseCaseSampleDomainModel)
};
store.LoadDomainModels(modelTypes);
UseCaseSampleDiagram d=null;
using (Transaction t = store.TransactionManager.BeginTransaction("Reading diagram")) {
result = UseCaseSampleSerializationHelper.Instance.LoadModelAndDiagram(store, @"C:\TEMP\MODEL.XML", @"c:\temp\model.diagram", null,null);
t.Commit();
}
How can i do for create a Document and show it
Thanks.
|
|
|