|
With regard to "another tack", I don't know of anything, but then I am merely a tourist in the .NET and C# district. Maybe some of the friendly locals might know.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
I found that Visual Studio has a tool accessible from the context menu to generate the interface. I run into obstacles often when I build a C# library for COM and try to use it in Excel. I have two such libraries with interfaces that appear to be identical in format. One works with Excel, the other does not. However, the one that doesn't work using an interface works OK when I remove the interface. But then nothing is available for VBA intellisense. And the functions don't show in the object explorer with either version. Is there a good book or reference that carefully and fully explains building C# libraries for use with Excel VBA?
|
|
|
|
|
Anyone has an AI in c# app
Felix Fernandez
|
|
|
|
|
Did you want to ask a question or just beg for someone else to give you their hard work?
|
|
|
|
|
Yes. Someone has. Why?
This space for rent
|
|
|
|
|
All my programs are "intelligent" (I don't write "dumb" programs ... if I can help it).
All my programs are "artificial"; i.e. "I" made them.
So, you need to be more specific.
|
|
|
|
|
|
Hi. What I'm trying to accomplish is to call this class, pass some controls and values and then have the new object update the existing control.
Help with this would be appreciated? Maybe it is not possible since I cannot pass the handle value to the class?
The error is a little misleading as the control is already created?
private void btnGroupsForUserTest_Click(object sender, EventArgs e)
{
progressBarControl pbarcontrol = new progressBarControl();
pbarcontrol.pbarIncrementValue = 1;
pbarcontrol.pbarMaximum = 100;
pbarcontrol.pbarThreadSleepIncrement = 250;
pbarcontrol.pbarObject = pBarGroupsForUser;
pbarcontrol.pbarLabel = lblGroupsForUserStatus;
progressBarIncrementer = new Thread(new ThreadStart(pbarcontrol.pbarIncrementFunction));
progressBarIncrementer.IsBackground = true;
progressBarIncrementer.Start();
}
public class progressBarControl : FormGroupMemberShipCheckingTool
{
public ProgressBar pbarObject;
public Label pbarLabel;
public int pbarMaximum { get; set; }
public int pbarIncrementValue { get; set; }
public int pbarThreadSleepIncrement { get; set; }
public void pbarIncrementFunction()
{
int incrementValue = pbarIncrementValue;
do
{
this.Invoke((MethodInvoker)delegate()
{
if (incrementValue < pbarMaximum)
{
pbarObject.Value = incrementValue;
pbarLabel.Text = incrementValue.ToString() + "% complete";
Application.DoEvents();
}
});
incrementValue++;
Thread.Sleep(pbarThreadSleepIncrement);
} while (incrementValue < pbarMaximum);
}
}
|
|
|
|
|
The progressBarControl control has been created, but the window handle for the control has not. You create a new instance of the control, but never show it anywhere, so it never creates a window.
Try using pbarObject.Invoke instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Doh!
Thank you, that worked!
|
|
|
|
|
I am getting "
1.not.found.as.a.resource "error
When I am compiling the code from xcode with iphone attached, it is working fine but when I send the build to client over TestFlight it is giving me error and the PDF is not generating.
Thanks
|
|
|
|
|
At a guess, you are doing something wrong. But without more information it is impossible to guess what.
|
|
|
|
|
First of all my apologies if this is in the wrong forum, i'm sure i will find out very quickly if it is
So basically i am writing an API that needs to return the running date and time of tours including the offset, this format "2016-12-05T10:00:00+02:00", these tours can be in England or Italy so they run in two different timezones and should have a different offset.
Our API and DB run on servers in the US, all the running times are stored in the db as a datetime, without any offset, without anything to distinguish the timezones they run in bar the fact they are linked to different countries.
I'm just wondering what the coorect process is here, i have spent ages reading up on this and i think I'm more confused than when i started.
I am thinking that maybe i need to get the running date as a universal datetime and decrease this datetime for the English tours but i'm not sure how i can update the date to have a different offset, how to set/change the date so it knows its in a different timezone.
Any guidance, advice or suggestions of an appropriate blog/article to put me on the correct track would really be appreciated, thanks very much in advance.
|
|
|
|
|
IMO, you are mixing two issues, one being the storage of the time and the other being the display.
Dates and times should always be stored using a common base (e.g. UTC). The exact base is irrelevant (it could just as easily be Eastern Standard Time), but it should be consistent.
The display may depend on the location of the user (e.g. all the DB users are in the U.S.), the location of the tour (display in UK time or Italian time), etc. For example, airline schedules are always displayed using the local time at the origin (for takeoff) and at the destination (for landing).
I hope this helps.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Daniel Pfeffer wrote: Dates and times should always be stored using a common base (e.g. UTC). The exact base is irrelevant (it could just as easily be Eastern Standard Time), but it should be consistent. Spot on!
/ravi
|
|
|
|
|
Thanks for your reply, much appreciated.
So based on your logic could I not say that all my times are stored in Italian time but not in UTC, then try to convert them to UTC and back to the English time just for the tours in England?
|
|
|
|
|
Yes, that would work.
The advantage of using UTC for everything is that you don't need to handle switches between Daylight Saving Time and Standard Time - UTC has no Daylight Saving time. It also simplifies your code - all display times require one (and only one) conversion. Compare and contrast to the Italian --> UK case.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
Im working on an Online Survey Form and a Question Builder.
You create different of question groups via the Question Builder by dragging(drag N drop) In Yes/No-questions, OptionLists and Text-input-fields. Here Is how the Question-builder looks like:(picture):
http://i.stack.imgur.com/U1RY2.png[^]
After you have created this groups with Questions, you can populate the Survey form with this Question groups. After you have created the Survey Form and added the groups of questions, the form should be assigned to all the users In the system.
I want your input on my Data-model how this should work. Below you can see my models. The thing I am a little worried about Is how the Answer-model should work.
QuestionContainer
---------------
public int ID { get; set; }
public string QuestionerContainerName { get; set; }
public virtual List<Question> Questions { get; set; }
Question
--------------
public int ID { get; set; }
public string QuestionHeader { get; set; }
public string QuestionHelpText { get; set; }
public string QuestionText { get; set; }
public virtual List<QuestionOption> QuestionOptions { get; set; }
QuestionOption
---------------
public string OptionText { get; set; }
public int RiskScore { get; set; }
public Question NestedQuestion {get; set;}
The QuestionOption Is the different of answer options/alternatives a question has.
Here comes the models for the Form Suvey
FormModel
-----------------
public int ID { get; set; }
public string Name { get; set; }
public string IntroTitle { get; set; }
public string IntroText { get; set; }
public string SupportName { get; set; }
public string SupportPhone { get; set; }
public virtual FormSection FormSections { get; set; }
FormSection
----------------------
public LicenseHolderModel LicenseHolder { get; set; }
public List<GasStationModel> GasStations { get; set; }
public List<Question> FormQuestions1 { get; set; }
public List<Question> FormQuestions2 { get; set; }
SurveyAnswers(Is this Ok??)
-----------------------
public int ID {get; set}
public int SurveyFormId {get; set;}
public int QuestionOptionId {get; set;}
public string Answer {get; set;}
Can you guys give me som Input of this? Have I missed something? As I said, Im not sure If I have got the Answer-model right. I want to store the answer on each question that the user has enterd In the form.
modified 28-Sep-16 5:10am.
|
|
|
|
|
You should create a "picture" of your model (e.g. an (ERD) Entity-Relation Diagram); this can help you "visualize" your model and identify inconsistencies: e.g.
[Question Container]->>[Question]->>[Question Option]
etc.
Based on the above:
1) Why is "Form Section" separate from "Form model" (it looks like a "0ne-for-one")
2) Missing primary key: "Question Option"
...
|
|
|
|
|
FormSection can be In FormModel. Yeah, I have skipped the primary keys when I wrote here.
But I just want the overall input of this.
|
|
|
|
|
I have a Dynamic asp Gridview with all columns as template feild TextBox. The columns of the Gridview are also dynamic and column count may vary everytime.
Please find code below
public void FillPoDetails()
{
DataTable dt = new DataTable();
dt = pmdata.createdatatable(int.Parse(Session["OurStyleid"].ToString()), int.Parse(Session["PoPackid"].ToString()));
GenerateTable(dt.Columns.Count, dt.Rows.Count,dt);
foreach (DataColumn col in dt.Columns)
{
TemplateField bfield = new TemplateField();
bfield.HeaderTemplate = new ArtWebApp.Controls.GridViewTemplate(ListItemType.Header, col.ColumnName);
bfield.ItemTemplate = new ArtWebApp.Controls.GridViewTemplate(ListItemType.Item, col.ColumnName);
GrdDynamic.Columns.Add(bfield);
}
GrdDynamic.DataSource = dt;
GrdDynamic.DataBind();
}
public GridViewTemplate(ListItemType type, string colname)
{
_templateType = type;
_columnName = colname;
}
void ITemplate.InstantiateIn(System.Web.UI.Control container)
{
switch (_templateType)
{
case ListItemType.Header:
Label lbl = new Label();
lbl.Text = _columnName;
lbl.CssClass = "Headerclass";
container.Controls.Add(lbl);
break;
case ListItemType.Item:
TextBox tb1 = new TextBox();
tb1.DataBinding += new EventHandler(tb1_DataBinding);
tb1.Columns =6;
tb1.Width = 100;
tb1.Wrap = true;
tb1.ID = "txt_" + _columnName;
if(_columnName== "ColorTotal")
{
tb1.CssClass = "ColorTotal";
}
else if (_columnName == "Color")
{
tb1.CssClass = "Color";
}
else
{
tb1.CssClass = "txtCalQty";
tb1.Attributes.Add("onkeypress", "return isNumberKey(event,this)");
tb1.Attributes.Add("onkeyup", "sumofQty(this)");
}
container.Controls.Add(tb1);
break;
}
}
And inorder to get the row total I had added a Javascript function on keydown event and its working clearly
function sumofQty(objText) {
var cell = objText.parentNode;
var row = cell.parentNode;
var sum = 0;
var textboxs = row.getElementsByClassName("txtCalQty");
for (var i = 0; i < textboxs.length; i++)
{
sum += parseFloat(textboxs[i].value);
}
var textboxtotalqtys = row.getElementsByClassName("ColorTotal");
textboxtotalqtys[0].value = sum.toString();
}
can anyone please help me in finding out the sum of each columns(all same cssclass).and display it in the Sizetotal row because I am not able to loop through columns
|
|
|
|
|
Your post title tells you that this really isn't the right forum. Why not ask in the JavaScript or Web Development forums?
This space for rent
|
|
|
|
|
HI,
I want to ask that,What is delegate with event?What it's use?And why we have to use it???
Can anyone explain me this concept with simple example???
Thanks...
|
|
|
|
|
Ah, delegates and events. On the surface, they appear to be an incredibly simple concept but there are many sources of confusion on this topic. Jon Skeet published a very good explanation of events and delegates here[^]. I heartily recommend studying this article.
This space for rent
|
|
|
|