|
I am using a windows service which has the app.config in it.
That does not work.
|
|
|
|
|
In VS2008
Properties.Settings.Default.yourpropertyname
(intellisense should show yourpropertyname)
works, and is (I believe) the currently recommended method.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Maybe this has something to do with this:
[ObsoleteAttribute("This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings")]
I know that obsolete doesn't mean it doesn't work but try to use the other method.
|
|
|
|
|
I have taken refences
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Word = Microsoft.Office.Interop.Word;
and some code
public class PptToWord
{
PowerPoint.Application objApp;
PowerPoint.Presentations objPresSet;
PowerPoint._Presentation objPres;
PowerPoint.Slides objSlides;
public void CreateFile(StringCollection array)
{
String strTemplate;
strTemplate = "C:\\TFSPRESENTATION.ppt";
try
{
//Create a new presentation based on a template.
objApp = new PowerPoint.Application();
objPresSet = objApp.Presentations;
objApp.Visible = MsoTriState.msoTrue;
objPres = objPresSet.Open(strTemplate,MsoTriState.msoFalse , MsoTriState.msoTrue, MsoTriState.msoTrue);
objSlides = objPres.Slides;
// word doc
object oMissing = System.Reflection.Missing.Value;
Word._Application oWord;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,ref oMissing, ref oMissing);
//oWord.ActiveDocument.InlineShapes.AddPicture();
foreach(PowerPoint._Slide slide in objSlides)
{
foreach(PowerPoint.Shape Slideshape in slide.Shapes)
{
if (Microsoft.Office.Core.MsoTriState.msoTrue == Slideshape.HasTextFrame)
{
if (Microsoft.Office.Core.MsoTriState.msoTrue == Slideshape.TextFrame.HasText)
{
//MessageBox.Show(Slideshape.TextFrame.TextRange.Text);
Word.Paragraph oPara1;
oPara1 = oDoc.Content.Paragraphs.Add(ref oMissing);
oPara1.Range.Text = Slideshape.TextFrame.TextRange.Text;
oPara1.Range.Font.Bold = 1;
oPara1.Format.SpaceAfter = 24; //24 pt spacing after paragraph.
oPara1.Range.InsertParagraphAfter();
}
}
if(Microsoft.Office.Core.MsoShapeType.msoPicture==Slideshape.Type)//for image
{
//Word.Shape oPicture;
// oPicture = (Word.Shape)Slideshape
// I am facing problem here, as i m not able to directly transfer pictures from power point slides to word document pictures.
// I dont want to save images on temprory location to my system hard disk. Can anyone guide me to do the same.
}
}
}
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}
}
Can any one guide me.
Thanks and Regards
Haroon(SolnTryst)
Haroon(SolnTryst)
|
|
|
|
|
Hey guys
how can i add the following .cs file to VS so that the control will always be in VS toolbox for me to just drag and drop?
namespace DoubleBufferPanelNameSpace
{
class DoubleBufferPanel : Panel
{
public DoubleBufferPanel()
{
this.SetStyle(ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.DoubleBuffer |
ControlStyles.ResizeRedraw,
true);
this.UpdateStyles();
}
}
}
thanx
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
To have it appear in your projects, you need to put it in a dll, and then import it into your project. For something this trival, a snippet could be a better idea ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thats not what i mean... i can do that... at the moment it is in my solution as a seperate project, compiles as dll and is referenced on 2nd project in the same solution
what i intend is to it have there and ready for me when i make a new solution without having to add the cs file to the solution and compiling the project for it to show up in the tools window
like if you buy a set of controls from devExpress for instance, their controls are in the toolbox without having to do anything
BTW the code was just an example, i actually want to do this for a wrapper class that gives me access to a multimediaTimer...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
HarveySaayman wrote: thats not what i mean... i can do that... at the moment it is in my solution as a seperate project, compiles as dll and is referenced on 2nd project in the same solution
If you add it to the toolbox, your project needs not to be present, just the dll (somewhere).
|
|
|
|
|
leppie wrote: add it to the toolbox
how do i do that?
the idea is to add it once and never have to worry about it again... i duno if yall are getting what im trying to say
let me put it this way...
let say ive developed a commercial control "ButtonVersionTwo", intended to sell to my "clients" for R2 id have to ship it with an installer... how would you tell the installer program to add "ButtonVersionTwo" to the toolbox? because my "clients" dont want to have to add its dll to every project they do...
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
Just add the dll to the toolbox, close VS, open it again, look at the toolbox, you will notice it is still there, and will be there till you remove it manually.
|
|
|
|
|
I would like to create a method that within the method it will handle the mouse click event and after the user has input 2 points the method will return a value back to the caller.
void Test(){
/* The Drawline method should allow user to click the left mouse button 2 times to accept 2 points,after that the DrawLine method will return a true value;*/
bool isDraw = DrawLine();
}
Anyone know what should I do within the DrawLine() method? All help is appreciated. Thanks.
|
|
|
|
|
TaiZhong wrote: I would like to create a method that within the method it will handle the mouse click event and after the user has input 2 points the method will return a value back to the caller.
What has this to do with multi-threading? Anyway, return what value back to the caller? What caller? You need to handle the mouse button down/up events I expect.
Post your code for further assistance.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I am sorry, I am not sure whether its something do to with multithreading or not. You can forget about the "caller" if this terms confuse you (Caller means those who call this DrawLine() method). I just want to know how to make the program to stop at the DrawLine() method and after I have accept 2 points from the mouse down button then will return a true value back from the DrawLine method and after that the program will proceed.
void Test(){
/* The program should wait untill I accept 2 points from the mouse down event after that a true value will return by DrawLine() to "temp" variables */
bool temp= DrawLine();
}
I don't know what should I handle within the DrawLine() method.
|
|
|
|
|
The exact way describe is not possible in .NET or most languages for that matter.
To do it (exactly) like you show, your language will need to support continuations (only Ruby and Scheme does that AFAIK).
The solution to your problem is to rethink the problem, and design it so it can be handled by the platform/language.
|
|
|
|
|
I am using a third party components and it is written by C# .NET and there is a method that works exactly like what I have described previously I wonder how they did it?
|
|
|
|
|
Just handle the mouse click event and have a counter var in your class, increment it each time the click event happens and call the drawline method, in the drawline method check the counter, if it's the amount you want (2 in your case) reset it back to 0 and return true.
|
|
|
|
|
I have a question, if you want the program to stop at a method (drawLine() in my case), isn't it there must be a loop inside that method and loop untill the user have click the mouse button 2 times and only stop the loop and return a value?
|
|
|
|
|
hi.
how to give space between each section in crystal report
|
|
|
|
|
Please don't ask twice.
Have you tried google ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
And somehow you cannot do this in the designer?
|
|
|
|
|
can u be more specific with what u r looking for ???
|
|
|
|
|
hi i am using crystal report in windows appliction
i am getting output from my database as...
data data data
data data data
data data data
data data data
tell me how to extend height between these datas in crystal repor
regards,
vidhya.s
|
|
|
|
|
Is there a simple way of setting MustUnderstand in WCF?
I have a project which uses WSE to connect to a java web service. In order to get it working I had to change the mustunderstand property on the client which was a simple one line if I recall
e.g.
requestContext.Security.MustUnderstand = false
How do I achieve the same using WCF?
modified on Wednesday, June 25, 2008 9:33 AM
|
|
|
|
|
Could not find a straightforward way of doing this client side.
To fix this I had to ammend the java class to add "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" to the list of understood headers.
|
|
|
|
|
Hi, I have a question on correct usage of object composition. This is the situation I'm facing:
class Address
{
private byte _FieldA;
private byte _FieldB;
private byte _FieldC;
public byte FieldA
{
set { _FieldA = value; }
get { return _FieldA; }
}
public void SetAddress (byte fieldA, byte fieldB, byte fieldC);
public void DoStuff(...)
public void DoOtherStuff(...)
...
}
class Message
{
public Address SourceAddress = new Address();
public Address DestAddress = new Address();
}
A client which instantiates a message should only be able to access the address fields and to invoke SetAddress().
By declaring SourceAddress and DestAddress objects as public, I can write things like message.SourceAddress.FieldA , message.DestAddress.SetAddress() , with no need for additional code. However, I also expose other methods like DoStuff() etc, which a message should not be able to call.
On the other hand, if I declare SourceAddress and DestAddress as private, I can control what I expose to the client but I'm also forced to add a lot of code: public properties and methods like SourceAddressFieldA , SourceAddressFieldB , SetSourceAddress() , all duplicated for DestAddress ... this means a lot of code duplication, and less flexibility (imagine if I have to add other Address fields to Message ...).
Is there a "sweet spot"? Is there a correct (or better, preferred) way to expose the behaviour of child objects in C#?
Regards,
Andrea
|
|
|
|