Click here to Skip to main content
15,900,816 members
Home / Discussions / C#
   

C#

 
QuestionRe: set this object to null Pin
Matglas16-Apr-07 3:14
Matglas16-Apr-07 3:14 
AnswerRe: set this object to null Pin
Colin Angus Mackay16-Apr-07 3:20
Colin Angus Mackay16-Apr-07 3:20 
AnswerRe: set this object to null Pin
Luc Pattyn16-Apr-07 3:26
sitebuilderLuc Pattyn16-Apr-07 3:26 
AnswerRe: set this object to null Pin
Colin Angus Mackay16-Apr-07 3:18
Colin Angus Mackay16-Apr-07 3:18 
QuestionRe: set this object to null Pin
Matglas16-Apr-07 3:31
Matglas16-Apr-07 3:31 
AnswerRe: set this object to null Pin
Dan Neely16-Apr-07 3:37
Dan Neely16-Apr-07 3:37 
GeneralRe: set this object to null Pin
Matglas16-Apr-07 3:50
Matglas16-Apr-07 3:50 
GeneralRe: set this object to null Pin
Matglas16-Apr-07 3:42
Matglas16-Apr-07 3:42 
This is the object situation. I copyed some code, to show you. The DeletePage() needs to delete the page from the Pages property in the Document.

public class Document : ITreeView
{
    public Document() { }

    private PageCollection _pages = new PageCollection();
    [XmlElement(ElementName = "page")]
    public PageCollection Pages
    {
        get { return _pages; }
        set { _pages = value; }
    }

    #region public methods
    public Document Deserialize(string file)
    {
        //..
    }
    public void Serialize(string file, Document doc)
    {
        //...
    }
    #endregion

    #region ITreeView Members

    public ContextMenu GetContextMenu()
    {
        ContextMenu docContext = new ContextMenu();

        //...

        return docContext;
    }
    public ObjectTreeNode GetTreeNode()
    {
        return new ObjectTreeNode(this, "document", 0, 0);
    }

    #endregion
}

public class Page : ITreeView
{
    public Page() { }

    #region properties
    //...
    #endregion

    #region ITreeView Members

    public ObjectTreeNode GetTreeNode()
    {
        return new ObjectTreeNode(this, "page " + _pagenumber, 0, 0);
    }

    public System.Windows.Forms.ContextMenu GetContextMenu()
    {
        ContextMenu pageContext = new ContextMenu();

        MenuItem delItem = new MenuItem("Delete", new EventHandler(DeletePage));
        pageContext.MenuItems.Add(delItem);

        return pageContext;
    }
    public void DeletePage(object sender, EventArgs e)
    {
        //delete this page
    }

    #endregion
}

QuestionRichtext Box undo Pin
7116-Apr-07 2:42
7116-Apr-07 2:42 
AnswerRe: Richtext Box undo Pin
Pete O'Hanlon16-Apr-07 2:50
mvePete O'Hanlon16-Apr-07 2:50 
QuestionC# Threading Controls on a Form Pin
ATCsharp16-Apr-07 2:41
ATCsharp16-Apr-07 2:41 
AnswerRe: C# Threading Controls on a Form Pin
Martin#16-Apr-07 2:46
Martin#16-Apr-07 2:46 
GeneralRe: C# Threading Controls on a Form Pin
ATCsharp16-Apr-07 2:52
ATCsharp16-Apr-07 2:52 
AnswerRe: C# Threading Controls on a Form Pin
Leslie Sanford16-Apr-07 3:51
Leslie Sanford16-Apr-07 3:51 
Questionconverting C++ pseudo-code to C#.NET [modified] Pin
Software_Specialist16-Apr-07 1:50
Software_Specialist16-Apr-07 1:50 
AnswerRe: converting C++ pseudo-code to C#.NET Pin
Stefan Troschuetz16-Apr-07 2:20
Stefan Troschuetz16-Apr-07 2:20 
GeneralRe: converting C++ pseudo-code to C#.NET Pin
Software_Specialist16-Apr-07 2:43
Software_Specialist16-Apr-07 2:43 
AnswerRe: converting C++ pseudo-code to C#.NET Pin
sulabh202016-Apr-07 2:24
sulabh202016-Apr-07 2:24 
GeneralRe: converting C++ pseudo-code to C#.NET Pin
Software_Specialist16-Apr-07 3:39
Software_Specialist16-Apr-07 3:39 
QuestionWindows Scheduled Tasks Pin
karthik_dotnet116-Apr-07 1:38
karthik_dotnet116-Apr-07 1:38 
AnswerRe: Windows Scheduled Tasks Pin
kubben16-Apr-07 2:13
kubben16-Apr-07 2:13 
Questionmissing Create Class Diagram option from ADD New Item Pin
Saira Tanwir16-Apr-07 1:30
Saira Tanwir16-Apr-07 1:30 
AnswerRe: missing Create Class Diagram option from ADD New Item Pin
sulabh202016-Apr-07 1:36
sulabh202016-Apr-07 1:36 
AnswerRe: missing Create Class Diagram option from ADD New Item Pin
Saira Tanwir16-Apr-07 1:42
Saira Tanwir16-Apr-07 1:42 
GeneralRe: missing Create Class Diagram option from ADD New Item Pin
sulabh202016-Apr-07 1:44
sulabh202016-Apr-07 1:44 

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.