virtual void Execute() final override {
     char* name = AskUser();
     if (0 != name) {
         Document* document = new Document(name);
         _application->Add(document);
         document->Open();
     }
 }
コード例 #2
0
void OpenCommand::Execute()
{
    const char* name = AskUser();
    if(name != NULL)
    {
        Document* document = new Document(name);
        _application->Add(document);
        document->Open();
    }
}
コード例 #3
0
void Application::OpenDocument (const char* name) {
    if (!CanOpenDocument(name)) {
        // cannot handle this document
        return;
    }
/*
*/
    Document* doc = DoCreateDocument();

    if (doc) {
        _docs->Append(*doc);
        AboutToOpenDocument(doc);
        doc->Open();
        doc->DoRead();
    }
}
コード例 #4
0
 void NewDocument(char* pFileName) {
   Document *pDoc = CreateDocument(GetDocType(pFileName));
   if (pDoc == NULL) exit(0);
   docs_[pFileName] = pDoc;
   pDoc->Open(pFileName);
 }