Click here to Skip to main content
15,914,327 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to create handle in C#.NET Pin
Colin Angus Mackay16-Apr-07 5:02
Colin Angus Mackay16-Apr-07 5:02 
QuestionSimple question about mandatory override Pin
Christopher Stratmann16-Apr-07 4:43
Christopher Stratmann16-Apr-07 4:43 
AnswerRe: Simple question about mandatory override Pin
Tristan Rhodes16-Apr-07 4:52
Tristan Rhodes16-Apr-07 4:52 
Questionget,set methods Pin
Kushi Bobby16-Apr-07 3:21
Kushi Bobby16-Apr-07 3:21 
AnswerRe: get,set methods Pin
sujithkumarsl16-Apr-07 3:54
sujithkumarsl16-Apr-07 3:54 
GeneralRe: get,set methods Pin
blackjack215016-Apr-07 4:07
blackjack215016-Apr-07 4:07 
GeneralRe: get,set methods Pin
Colin Angus Mackay16-Apr-07 4:31
Colin Angus Mackay16-Apr-07 4:31 
GeneralRe: get,set methods Pin
Thomas Stockwell16-Apr-07 10:45
professionalThomas Stockwell16-Apr-07 10:45 
GeneralRe: get,set methods Pin
Luc Pattyn16-Apr-07 4:18
sitebuilderLuc Pattyn16-Apr-07 4:18 
Questionset this object to null Pin
Matglas16-Apr-07 2:51
Matglas16-Apr-07 2:51 
AnswerRe: set this object to null Pin
_mubashir16-Apr-07 3:07
_mubashir16-Apr-07 3:07 
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 

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.