Show DevExpress waitform dialog without designer - c#

I'm trying to display a Loading Please Wait dialog form using devex controls and I can't seem to do it. (using winforms, c#)
I'm using an older version of devex - not the latest. I can't do
SplashScreenManager.ShowDefaultWaitForm()
I need to do this in code without the designer.
1.
I tried:
SplashScreenManager.ShowForm(typeof(WaitDialogForm));
It looks right when it loads, but then it throws an error:
Unable to cast object of type 'DevExpress.Utils.WaitDialogForm' to type 'DevExpress.XtraSplashForm.SplashFormBase'
I tried:
SplashScreenManager.ShowForm(typeof(WaitForm));
This shows an empty form thats too big with no image and no text
I tried:
WaitDialogForm mWaitDialog = new WaitDialogForm() {Visible = false};
mWaitDialog.Show();
The wait form doesn't look right. There are white spaces instead of the image.
I tried:
WaitDialogForm mWaitDialog = new WaitDialogForm() {Visible = false};
mWaitDialog.ShowDialog();
The code doesn't continue executing.
I saw examples of
SplashScreenManager.ShowForm(typeof(WaitForm1));
I don't know how to do this without designer.
Can somebody please assist? I thought I'm doing something simple, but I can't seem to figure it out!

Probably this help u ;)
using (new DevExpress.Utils.WaitDialogForm("Please wait"))
{
//Do your stuff here
}

I don't know if this is in your 13.2 version but from looking at documentation you should be using ShowWaitForm instead of just ShowForm.
SplashScreenManager ssm = new SplashScreenManager();
ssm.ActiveSplashFormTypeInfo = typeof(WaitForm1);
ssm.ShowWaitForm();
If that does not work then i would just try preparing a working solution in the designer and then extracting the code from the designer.cs file.
Found a specific documentation example here

Related

Use complex jquery selector with PuppeteerSharp

I am new to PuppeteerSharp and I have searched already on the internet for several hours and also the documentation, but I don't seem to find a solution to my problem.
Now, I have a table with some rows on my webpage (see attached picture). I need to find the row that has some text in one of the columns, and click the button left to it (the black one with an arrow).
I have got my button (at least the td) with JQuery in Firefox Dev tools like this:
$("td: Contains('41818397111')").parent().find("td[id = 'InvoiceDetails']")"
But I do not know how to use this information in PuppeteerSharp
I have tried:
ElementHandle element = await page.QuerySelectorAsync("td:Contains('41818397111')");
ElementHandle hanlde = await page.EvaluateFunctionAsync<ElementHandle>("e=> e.parent().find(\"td[id=['InvoiceDetails']\")", element);
await page.ClickAsync($("td: Contains('41818397111')").parent().find("td[id = 'InvoiceDetails']")")
but neither one works. I think I am missing some information.
Thank you
So, after many tries and a lot of searched, I ended up switching to Selenium, which seems to have better documentation and a lot of examples here.
This is the code, that worked for me:
string locator1 = "td:Contains(\'41818397111\')";
string locator2 = "td[id = \'InvoiceDetails\']";
IWebElement webElement = driver.FindElement(Selenium.WebDriver.Extensions.By.JQuerySelector(locator1).Parent().Find(locator2));
webElement.Click();

Setting/Passing a Value to a Parameter to a Crystal Report in c# is Not Working

I have 2 parameters (Detail, Summary) that I have created in a Crystal Report. The report is called from c# in a Windows Forms application. I am trying to pass the appropriate value to each parameter at runtime so the report can make some decisions based on the values. I have read many articles regarding this and I think I am using the best method to accomplish this?
This is the simple code I have implemented after the report has been loaded and before the SetDataSoruce has been set:
crReportDocument.SetParameterValue("DetailView", false);
crReportDocument.SetParameterValue("SummaryView", true);
For some reason the values are not getting to the report as the report is always prompting for the values to be set when it runs.
Everything else about the report works correctly.
I would appreciate any light someone can shed on this matter as it seems to be a simple task to do?
Actually the problem was code placement. I was populating the parameters in the wrong place of code execution:
This is how I had it when it was not working:
crReportDocument.SetParameterValue("FromDate", dtmFromDate);
ReportViewer reportViewer = new ReportViewer();
reportViewer.ReportSource = crReportDocument;
To resolve I moved the code around as follows:
ReportViewer reportViewer = new ReportViewer();
reportViewer.ReportSource = crReportDocument;
crReportDocument.SetParameterValue("FromDate", dtmFromDate);
That's all it took to get it to work correctly.
Let me know if it does not work for you.
The problem is that the parameter must be passed using format {?PARAMETER}.
It works.
crReportDocument.SetParameterValue("{?DetailView}", false);
crReportDocument.SetParameterValue("{?SummaryView}", true);

Word Statusbar gets reset when I use range.Information

I have the following code (simplified to show the problem):
var wdApp = new Application();
var wdDoc = wdApp.Documents.Open("C:\foo.docx");
wdApp.StatusBar = "Updating...";
var rng = wdDoc.Range(10, 10);
if ((bool)rng.Information(WdInformation.wdWithInTable))
{
}
//StatusBar value is gone...
What could be the reason?
How can I prevent it?
Do you know of other situations where this can happen?
Here screenshots of the problem
1 F10 (step over) later
Edit:
The provided code uses NetOffice and not the interop library from Microsoft directly, therefor the syntax is correct. You may notice in the provided screenshots that they are taken from a running application. Breakpoint, highlighting of current line of code executing, aswell as the actual result of the code in the word application on the right. Where at first there is the desired statusbar "Tabelle 8 von 17 wird neu erstellt." (Table 8 out of 17 is recreating) and at the next step my statusbar is gone and its the default stuff "165 von 8227 Wörtern" (165 out of 8227 words)
What could be the reason?
I believe this is to do with the library you are using. I tested your code but with the Word Interop library, and the only way I could get the status bar to reset was to manually click/type within the Word window.
How can I prevent it?
I would say take a look into the code base of library you are using. It is likely that it is doing something that is causing the behaviour. Unless there is a specific reason you are using NetOffice I would suggest switching to the either the standard Interop or VSTO.
Do you know of other situations where this can happen?
As above, I could only get the status bar to reset if I manually carried out some sort of input into the window.

Automating Website/Web forms using C# in Firefox, using Visual Studio 2010?

If anyone can help me I'd appreciate it.
I'm working on a C# file in Visual Studio 2010 that I need to be able to test a website with multiple form pages, for the purpose of an example we'll refer to them all as 1.aspx, 2.aspx etc.
I've my code that fills out the first page (1.aspx) fine, and click the "continue" button to load the next page, but when it gets to 2.aspx it won't continue to fill out the form.
We'll say an element on the 2.aspx page is called "DOB". On trying to run from the start (I've all the pages form data in the one .cs file) I get an error like "DOB does not exist in the current context".
Anyone's insight into this would be really appreciated!
In all honesty, it sounds like you might be better off using the WatiN Framework. I have been writing automation with it for years and the way that it is implemented and its ease-of-use make it worth the slight learning curve.
Just to add a bit more to the answer; and yes, this is pseudo-code:
[Test]
public void Should_attach_to_browser()
{
ExecuteTest(browser =>
{
browser.GoTo(NewWindowUri);
browser.Link(Find.First()).Click();
var findBy = Find.ByTitle("New window");
var newWindow = Browswer.AttachTo(browser.GetType(), findBy);
newWindow.Close();
});
}
In the code above, note the Browser.AttachTo(browser.GetType(), findBy); method. Based on what I have understood of your question, the .AttachTo() method would work well since you would be able to take the focus off the current form and assign it to the next in your work/execution flow.

Updating Application tile using TileUpdateManager

I'm developing metro app using Windows 8 release preview and C#(VS 2012),I'm using below code to update Application tile.
TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);
XmlDocument TileXML = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideImage);
XmlNodeList imageAttribute = TileXML.GetElementsByTagName("image");
((XmlElement)imageAttribute[0]).SetAttribute("src", "ms-appx:///Assets/Tile.png");
((XmlElement)imageAttribute[0]).SetAttribute("alt", "red graphic");
TileNotification notify = new TileNotification(TileXML);
notify.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(10);
TileUpdateManager.CreateTileUpdaterForApplication().Update(notify);
But my Application Tile is not updating, I don't know what I'm missing and where I'm doing wrong, please help me.
I got the answer, its about adding Extension file "NotificationExtensions.winmd" as my reference and also i have couple of questions
When i run above code by setting my target device as "Local
Machine" it works but when i set it to "Simulator" it doesn't, Can
any one explains me please why.
We have expiration time for tiles by using below line
notify.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(10);
what i have to do if want the live tile to be running continuously,
Please let me know if have any links or study material
Thanks in advance.
Thank you Guys,i got the answer, my image size is <200KB and < 1024x1024, mistake i did is i haven't added extension file "NotificationExtensions.winmd" as my reference. i did that and i got it.

Categories

Resources