Click here to Skip to main content
15,895,283 members
Home / Discussions / C#
   

C#

 
AnswerRe: localizable form gridview issue Pin
nelsonpaixao1-Aug-08 13:17
nelsonpaixao1-Aug-08 13:17 
GeneralRe: localizable form gridview issue Pin
muharrem2-Aug-08 1:51
muharrem2-Aug-08 1:51 
QuestionService to show form Pin
BenGriffiths1-Aug-08 4:17
BenGriffiths1-Aug-08 4:17 
AnswerRe: Service to show form Pin
paas1-Aug-08 4:43
paas1-Aug-08 4:43 
AnswerRe: Service to show form Pin
vikas amin1-Aug-08 4:53
vikas amin1-Aug-08 4:53 
QuestionMessage Removed Pin
1-Aug-08 3:50
tkrn1-Aug-08 3:50 
AnswerRe: Dataset Designer using it programmatically? Pin
nelsonpaixao1-Aug-08 14:06
nelsonpaixao1-Aug-08 14:06 
QuestionTemplates Pin
Dirso1-Aug-08 2:45
Dirso1-Aug-08 2:45 
Hi,

I create this template but I have some problems compiling it
    public class CuponsFormas<t> : CollectionBase
    {
        #region Add/Remove Methods
        public int Add(T item)
        {
            return List.Add(item);
        }
        public void Remove(T item)
        {
            List.Remove(item);
        }
        #endregion

        #region Load/Save Methods
        public void LoadItens(XmlElement el)
        {
            XmlElement elAliqs = XmlConfigLoader.GetElement(el, "Aliquotas");
            if (elAliqs != null)
            {
                XmlNodeList lista = elAliqs.GetElementsByTagName("Aliquota");
                foreach (XmlNode node in lista)
                {
                    /// FIRST COMPILER ERROR!!!!
                    Add((T)XmlConfigLoader.createXmlItem(
                        typeof(T), node as XmlElement));
                }
            }
        }

        public void SaveItens(XmlElement el)
        {
            if (List.Count > 0)
            {
                XmlElement items = el.OwnerDocument.CreateElement("Aliquotas");
                foreach (T item in List)
                    /// SECOND COMPILER ERROR
                    XmlConfigLoader.createXmlEl(item, items);
                el.AppendChild(items);
            }
        }
        #endregion
    }
</t>

createXmlItem return a IXmlItem derivated class (I made them up)
createXmlEl requires a IXmlItem derivated class

So, the compiler says cannot convert IXmlItem to T and connot convert T to IXmlItem
My question is: Is there any way to tell the compiler I'm sure T is a IXmlItem derivated?

Thanks,
Dirso.
AnswerRe: Templates Pin
J4amieC1-Aug-08 2:48
J4amieC1-Aug-08 2:48 
QuestionProgrammatically Added SSIS Package Pin
Jammer1-Aug-08 1:29
Jammer1-Aug-08 1:29 
AnswerRe: Programmatically Added SSIS Package Pin
Jammer1-Aug-08 6:12
Jammer1-Aug-08 6:12 
QuestionSharePoint Problem from client pc Pin
manju#1231-Aug-08 1:04
manju#1231-Aug-08 1:04 
QuestionGet the code of an Stored procedure Pin
anderslundsgard1-Aug-08 0:42
anderslundsgard1-Aug-08 0:42 
AnswerRe: Get the code of an Stored procedure Pin
Rob Philpott1-Aug-08 0:45
Rob Philpott1-Aug-08 0:45 
GeneralRe: Get the code of an Stored procedure Pin
Paul Conrad1-Aug-08 5:39
professionalPaul Conrad1-Aug-08 5:39 
AnswerRe: Get the code of an Stored procedure Pin
Anurag Gandhi1-Aug-08 1:00
professionalAnurag Gandhi1-Aug-08 1:00 
Questionwindows servioce - timer Pin
arkiboys1-Aug-08 0:36
arkiboys1-Aug-08 0:36 
AnswerRe: windows servioce - timer Pin
stancrm1-Aug-08 0:47
stancrm1-Aug-08 0:47 
GeneralRe: windows servioce - timer Pin
arkiboys1-Aug-08 0:49
arkiboys1-Aug-08 0:49 
AnswerRe: windows servioce - timer Pin
paas1-Aug-08 1:05
paas1-Aug-08 1:05 
GeneralRe: windows servioce - timer Pin
arkiboys1-Aug-08 2:58
arkiboys1-Aug-08 2:58 
GeneralLine numbers differ in Debug and Release. Pin
Brady Kelly1-Aug-08 0:26
Brady Kelly1-Aug-08 0:26 
GeneralRe: Line numbers differ in Debug and Release. Pin
Rob Philpott1-Aug-08 0:43
Rob Philpott1-Aug-08 0:43 
GeneralRe: Line numbers differ in Debug and Release. Pin
leppie1-Aug-08 1:49
leppie1-Aug-08 1:49 
QuestionHow to connect a DTO to my table Pin
Exelioindia1-Aug-08 0:12
Exelioindia1-Aug-08 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.