Ejemplo n.º 1
0
        public static void CopyToDocument(MNDocument doc)
        {
            foreach (MNPage page in internalDocument.Data.Templates)
            {
                if (AddTemplateToArray(doc, page, false))
                {
                    page.Document = doc;
                    page.Id       = doc.Data.GetNextId();
                    foreach (SMControl sc in page.Objects)
                    {
                        long oldId = sc.Id;
                        sc.Id   = doc.Data.GetNextId();
                        sc.Page = page;
                    }
                }
            }
            foreach (MNReferencedImage img in internalDocument.DefaultLanguage.Images)
            {
                if (AddImageToArray(doc, img, false))
                {
                    img.Id = doc.Data.GetNextId();
                }
            }
            foreach (MNReferencedStyle st in internalDocument.DefaultLanguage.Styles)
            {
                AddStyleToArray(doc, st, false);
            }

            // load again, since we have most probably destroyed structure of document
            Load();
        }
Ejemplo n.º 2
0
        private void checkTransitionPagesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogInsertTransPages dlg = new DialogInsertTransPages();
            MNDocument             doc = MNNotificationCenter.CurrentDocument;

            dlg.SetDocument(doc);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                for (int i = 2; i >= 0; i--)
                {
                    int afterPage, pageType;
                    dlg.GetPageToInsert(i, out afterPage, out pageType);
                    MNPage p = null;
                    switch (pageType)
                    {
                    case 1:
                        doc.Data.Pages[afterPage].NextPage = "";
                        p = AddNewPage(doc, "End of Book", "EOPBook", 0, afterPage);
                        break;

                    case 2:
                        doc.Data.Pages[afterPage].NextPage = "";
                        p = AddNewPage(doc, "End of Exercises Before", "EOPExBefore", 0, afterPage);
                        break;

                    case 3:
                        doc.Data.Pages[afterPage].NextPage = "";
                        p = AddNewPage(doc, "End of Exercises After", "EOPExAfter", 0, afterPage);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public void SetDocument(MNDocument doc)
 {
     Document           = doc;
     doc.Viewer         = p_docexec;
     p_docexec.Document = doc;
     p_docexec.OnEvent("OnLoad", doc);
 }
Ejemplo n.º 4
0
        private static bool LoadBookHeader(string fileName)
        {
            bool r = true;

            using (StreamWriter sw = new StreamWriter(@"d:\LearnToRead\load_book.txt"))
            {
                using (BinaryReader br = new BinaryReader(File.OpenRead(fileName)))
                {
                    MNDocument   document = new MNDocument();
                    RSFileReader fr       = new RSFileReader(br);
                    fr.logStream = sw;
                    try
                    {
                        document.Book.Load(fr);
                        document.Book.FilePath = fileName;
                        MNNotificationCenter.CurrentFileName = fileName;
                        MNNotificationCenter.CurrentDocument = document;
                    }
                    catch (Exception ex)
                    {
                        sw.Flush();
                        sw.WriteLine("Exception:");
                        sw.WriteLine(ex.Message);
                        sw.WriteLine(ex.StackTrace);
                        sw.Flush();
                        r = false;
                    }
                }
            }

            return(r);
        }
Ejemplo n.º 5
0
 public void OnNotificationReceived(object sender, string message, params object[] args)
 {
     if (message.Equals("DocumentChanged"))
     {
         MNDocument doc = args[0] as MNDocument;
         StopDocumentReview();
         StartDocumentReview(doc, doc.Book.FilePath);
     }
     else if (message.Equals("StartDocumentReview"))
     {
         StopDocumentReview();
         StartDocumentReview(args[0] as MNDocument, args[1] as string);
     }
     else if (message.Equals("AppWillClose"))
     {
         StopDocumentReview();
     }
     else if (message.Equals("StopDocumentReview"))
     {
         StopDocumentReview();
     }
     else if (message.Equals("PageDidAppear"))
     {
         SetPage(args[0] as MNPage);
     }
     else if (message.Equals("ObjectForReview"))
     {
     }
 }
Ejemplo n.º 6
0
        private void testAction1ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MNDocument doc = MNNotificationCenter.CurrentDocument;

            if (doc == null)
            {
                return;
            }

            MNPage page = MNNotificationCenter.CurrentPage;

            if (page == null)
            {
                return;
            }

            foreach (SMControl c in page.Objects)
            {
                if (c is SMTextContainer)
                {
                    SMTextContainer tc = c as SMTextContainer;
                    tc.Text = "Here is text for dropping <drop text=\"______\" tag=\"word1\">. Be sure to place here correct word";
                }
            }
        }
Ejemplo n.º 7
0
 public TVAction(TreeObjectView v, string t, MNDocument d)
     : base(t)
 {
     Script   = "";
     View     = v;
     Page     = null;
     Document = d;
 }
Ejemplo n.º 8
0
 public void SetObject(MNDocument data)
 {
     this.Tree = new TItemDocument(this)
     {
         Document = data, Name = "Document"
     };
     this.Tree.Expand(true);
 }
Ejemplo n.º 9
0
        public void SetDocument(MNDocument doc)
        {
            lastDocument = doc;

            if (lastDocument != null)
            {
                RefreshContent(lastDocument);
            }
        }
Ejemplo n.º 10
0
        private void SaveDocument(string filePath)
        {
            if (filePath != null)
            {
                MNNotificationCenter.CurrentFileName = filePath;
            }
            else
            {
                filePath = MNNotificationCenter.CurrentFileName;
            }

            RSFileWriter fw;
            string       fileName = filePath;
            MNDocument   doc      = MNNotificationCenter.CurrentDocument;

            using (StreamWriter sw = new StreamWriter(@"d:\LearnToRead\save_book.txt"))
            {
                using (BinaryWriter bw = new BinaryWriter(File.Create(fileName)))
                {
                    fw           = new RSFileWriter(bw);
                    fw.logStream = sw;
                    doc.Book.Save(fw);
                }
            }

            fileName = fileName.Replace(".smb", ".smd");
            using (StreamWriter sw = new StreamWriter(@"d:\LearnToRead\save_data.txt"))
            {
                using (BinaryWriter bw = new BinaryWriter(File.Create(fileName)))
                {
                    fw           = new RSFileWriter(bw);
                    fw.logStream = sw;
                    doc.Data.Save(fw);
                }
            }

            if (doc.DefaultLanguage.IsModified())
            {
                fileName = fileName.Replace(".smd", ".sme");
                using (StreamWriter sw = new StreamWriter(@"d:\LearnToRead\save_lang.txt"))
                {
                    using (BinaryWriter bw = new BinaryWriter(File.Create(fileName)))
                    {
                        fw           = new RSFileWriter(bw);
                        fw.logStream = sw;
                        MNLocalisation loc = doc.DefaultLanguage;
                        loc.SetProperty("BookCode", doc.Book.BookCode);
                        loc.SetProperty("LanguageName", "Default");
                        loc.Save(fw);
                        loc.Modified = false;
                    }
                }
            }

            lastSaved = DateTime.Now;
        }
Ejemplo n.º 11
0
 public void SetDocument(MNDocument doci)
 {
     doc = doci;
     comboBox1.Items.Clear();
     foreach (MNReferencedImage img in doc.DefaultLanguage.Images)
     {
         comboBox1.Items.Add(img);
     }
     control = null;
 }
Ejemplo n.º 12
0
        public void Set(MNDocument doc, MNPage page, MNPageTextObject obj)
        {
            Document = doc;
            Page     = page;
            Object   = obj;

            noupdate          = true;
            richTextBox1.Text = obj.Text;
            noupdate          = false;
        }
Ejemplo n.º 13
0
        private void generateInitialPagesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MNDocument doc = MNNotificationCenter.CurrentDocument;

            if (doc == null)
            {
                return;
            }

            MNBookData data = doc.Data;

            MNLocalisation lang = doc.DefaultLanguage;

            if (data == null || lang == null)
            {
                return;
            }

            if (data.Pages.Count != 1)
            {
                return;
            }

            data.Pages[0].Title = "Title";
            SetPageHeaderControls(0, data.Pages[0]);
            SetControlsToPage("Title page", data.Pages[0]);

            AddNewPage(doc, "start", "startPage", 0);
            AddNewPage(doc, "tp", "tpPage", 0);
            AddNewPage(doc, "new_letters", "tpNewLetters", 1);
            AddNewPage(doc, "teaching_plan", "tpTeachingPlan", 1);
            List <int> pageNos = new List <int>();

            foreach (MNReferencedSound snd in lang.Sounds)
            {
                if (snd.Name.StartsWith("Page "))
                {
                    int i;
                    if (int.TryParse(snd.Name.Substring(5).Trim(), out i))
                    {
                        pageNos.Add(i);
                    }
                }
            }
            pageNos.Sort();
            foreach (int a in pageNos)
            {
                AddNewPage(doc, "Page " + a, "mainAbove", 3);
            }
            AddNewPage(doc, "ex_before", "", 2);
            AddNewPage(doc, "ex_after", "", 2);
        }
Ejemplo n.º 14
0
        private static void LoadBookLang(string fileName)
        {
            if (MNNotificationCenter.CurrentDocument == null)
            {
                return;
            }

            if (!File.Exists(fileName))
            {
                return;
            }

            using (StreamWriter sw = new StreamWriter(@"d:\LearnToRead\load_lang.txt"))
            {
                using (BinaryReader br = new BinaryReader(File.OpenRead(fileName)))
                {
                    MNDocument   document = MNNotificationCenter.CurrentDocument;
                    RSFileReader fr       = new RSFileReader(br);
                    fr.logStream = sw;
                    try
                    {
                        document.DefaultLanguage.Load(fr, true);
                    }
                    catch (Exception ex)
                    {
                        sw.Flush();
                        sw.WriteLine("Exception:");
                        sw.WriteLine(ex.Message);
                        sw.WriteLine(ex.StackTrace);
                        sw.Flush();
                    }
                }
            }

            MNDocument doc = MNNotificationCenter.CurrentDocument;

            if (doc.DefaultLanguage.Styles.Count == 0)
            {
                doc.InitialiseDefaultStyles();
            }

            foreach (MNReferencedImage ri in doc.DefaultLanguage.Images)
            {
                if (ri.Id < 1)
                {
                    ri.Id = doc.Data.GetNextId();
                }
            }
        }
Ejemplo n.º 15
0
        private void convertAllFilesToHTMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PageEditView  pev     = pageDetailPanel1.GetEditView();
            MNPageContext ctx     = pev.Context;
            string        rootDir = Properties.Settings.Default.ExportHTMLFolder;


            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter      = "SlideViewer books (*.smb)|*.smb";
            ofd.FilterIndex = 0;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                if (MessageBox.Show("Now select folder where output will be writen (in the form of many HTml files and images)") == DialogResult.OK)
                {
                    FolderBrowserDialog folderBrowser = new FolderBrowserDialog();
                    folderBrowser.SelectedPath = rootDir;
                    if (folderBrowser.ShowDialog() == DialogResult.OK)
                    {
                        rootDir = folderBrowser.SelectedPath;
                        Properties.Settings.Default.ExportHTMLFolder = rootDir;
                        Properties.Settings.Default.Save();
                        MNExportContext etx = new MNExportContext();
                        etx.DirAllBooks = rootDir;
                        foreach (string file in Directory.EnumerateFiles(Path.GetDirectoryName(ofd.FileName)))
                        {
                            if (file.EndsWith(".smb"))
                            {
                                MNDocument docx = LoadDocument(file);
                                //ConvertDocToHtml(pev, docx, file.Replace(".smb", ".html"), rootDir);
                                docx.ExportToHtml(etx, Path.GetFileNameWithoutExtension(file));
                                Debugger.Log(0, "", "Converted " + Path.GetFileName(file) + ".\n");
                                docx = null;
                            }
                            MNNotificationCenter.CurrentDocument = null;
                            GC.Collect();
                            GC.WaitForPendingFinalizers();
                            if (etx.Files >= etx.MaxFiles)
                            {
                                break;
                            }
                        }
                        Debugger.Log(0, "", "Finished.\n");

                        MessageBox.Show("Files were converted.");
                    }
                }
            }
        }
Ejemplo n.º 16
0
        private void convertAllFilesToVersion3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (string s in Directory.EnumerateFiles(@"c:\Users\Gopa702\Documents\"))
            {
                if (Path.GetExtension(s) == ".smb")
                {
                    Debugger.Log(0, "", "File: " + s + "\n");
                    MNDocument doc = new MNDocument();

                    using (Stream str = File.OpenRead(s))
                    {
                        using (BinaryReader br = new BinaryReader(str))
                        {
                            RSFileReader fr = new RSFileReader(br);
                            doc.Book.Load(fr);
                        }
                    }
                    using (Stream str = File.OpenWrite(s))
                    {
                        using (BinaryWriter br = new BinaryWriter(str))
                        {
                            RSFileWriter fr = new RSFileWriter(br);
                            doc.Book.Save(fr);
                        }
                    }
                }
                else if (Path.GetExtension(s) == ".smd")
                {
                    Debugger.Log(0, "", "File: " + s + "\n");
                    MNDocument doc = new MNDocument();
                    using (Stream str = File.OpenRead(s))
                    {
                        using (BinaryReader br = new BinaryReader(str))
                        {
                            RSFileReader fr = new RSFileReader(br);
                            doc.Data.Load(fr);
                        }
                    }
                    using (Stream str = File.OpenWrite(s))
                    {
                        using (BinaryWriter bw = new BinaryWriter(str))
                        {
                            RSFileWriter fw = new RSFileWriter(bw);
                            doc.Data.Save(fw);
                        }
                    }
                }
            }
        }
Ejemplo n.º 17
0
        private void StartDocumentReview(MNDocument doc, string filePath)
        {
            Document = doc;
            ClearUI();

            labelBookTitle.Text     = Document.Book.BookTitle;
            tabControl1.SelectedTab = tabBook;

            LoadData(filePath.Replace(".smb", ".smr"));

            p_PageOrig = null;
            p_ItemOrig = null;
            p_Page     = new ReviewPage();
            p_Item     = new ReviewItem();
        }
Ejemplo n.º 18
0
        private void exportDocumentToHTMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PageEditView  pev     = pageDetailPanel1.GetEditView();
            MNPageContext ctx     = pev.Context;
            MNDocument    doc     = MNNotificationCenter.CurrentDocument;
            string        rootDir = "d:\\temp\\books";

            SaveFileDialog sfd = new SaveFileDialog();

            sfd.FileName = doc.Book.BookCode + ".html";
            if (sfd.ShowDialog() == DialogResult.OK)
            {
                ConvertDocToHtml(pev, doc, sfd.FileName, rootDir);
            }
        }
Ejemplo n.º 19
0
        private static bool AddTemplateToArray(MNDocument doc, MNPage page, bool overwrite)
        {
            bool          added = false;
            int           index = -1;
            List <MNPage> array = doc.Data.Templates;

            for (int i = 0; i < array.Count; i++)
            {
                if (array[i].APIName == page.APIName)
                {
                    index = i;
                    break;
                }
            }

            if (index >= 0)
            {
                if (overwrite)
                {
                    array.RemoveAt(index);
                    array.Insert(index, page);
                    added = true;
                }
            }
            else
            {
                array.Add(page);
                added = true;
            }

            if (added)
            {
                foreach (SMControl sc in page.Objects)
                {
                    if (sc is SMImage)
                    {
                        AddImageToArray(doc, (sc as SMImage).Img.Image, overwrite);
                    }
                    else if (sc is SMImageButton)
                    {
                        AddImageToArray(doc, (sc as SMImageButton).ImgA.Image, overwrite);
                    }
                }
            }

            return(added);
        }
Ejemplo n.º 20
0
 private void ExtractObjectConnections(GSCore obj, List <string> scheduled, string name)
 {
     if (obj is MNDocument)
     {
         MNDocument doc = obj as MNDocument;
         foreach (MNReferencedText rs in doc.Data.Scripts)
         {
             if (rs.Name.Equals(name))
             {
                 scheduled.Add(rs.Text);
             }
         }
         foreach (MNPage page in doc.Data.Pages)
         {
             ExtractObjectConnections(page, scheduled, name);
         }
     }
     else if (obj is MNPage)
     {
         MNPage page = obj as MNPage;
         foreach (MNReferencedText rt in page.Scripts)
         {
             if (rt.Name.Equals(name))
             {
                 scheduled.Add(rt.Text);
             }
         }
         foreach (SMControl smc in page.Objects)
         {
             if (smc.ContainsScript(name))
             {
                 ExtractObjectConnections(smc, scheduled, name);
             }
         }
     }
     else if (obj is SMControl)
     {
         MNReferencedText rt = (obj as SMControl).FindScript(name);
         if (rt != null)
         {
             scheduled.Add(rt.Text);
         }
     }
 }
Ejemplo n.º 21
0
        public static void Load()
        {
            if (File.Exists(FilePath))
            {
                using (Stream sr = File.OpenRead(FilePath))
                {
                    using (BinaryReader br = new BinaryReader(sr))
                    {
                        RSFileReader fr = new RSFileReader(br);

                        byte b = 0;
                        internalDocument = new MNDocument();
                        while ((b = fr.ReadByte()) != 0)
                        {
                            switch (b)
                            {
                            case 10:
                                MNPage p = new MNPage(internalDocument);
                                p.Load(fr);
                                p.TemplateName = "";
                                p.TemplateId   = -1;
                                internalDocument.Data.Templates.Add(p);
                                break;

                            case 11:
                                MNReferencedImage img = new MNReferencedImage();
                                img.Load(fr);
                                internalDocument.DefaultLanguage.Images.Add(img);
                                break;

                            case 12:
                                MNReferencedStyle st = new MNReferencedStyle();
                                st.Load(fr);
                                internalDocument.DefaultLanguage.Styles.Add(st);
                                break;
                            }
                        }
                    }
                }

                //internalDocument.ReapplyStyles();
            }
        }
Ejemplo n.º 22
0
        private void RefreshContent(MNDocument doc)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("PAGES");
            foreach (MNPage p in doc.Data.Pages)
            {
                WritePage(sb, p, 1);
            }
            sb.AppendLine("END PAGES");

            sb.AppendLine("TEMPLATES");
            foreach (MNPage p in doc.Data.Templates)
            {
                WritePage(sb, p, 1);
            }
            sb.AppendLine("END TEMPLATES");

            richTextBox1.Text = sb.ToString();
        }
Ejemplo n.º 23
0
        private static void LoadBookData(string fileName)
        {
            if (MNNotificationCenter.CurrentDocument == null)
            {
                return;
            }

            if (!File.Exists(fileName))
            {
                return;
            }

            using (StreamWriter sw = new StreamWriter(@"d:\LearnToRead\load_data.txt"))
            {
                using (BinaryReader br = new BinaryReader(File.OpenRead(fileName)))
                {
                    MNDocument   document = MNNotificationCenter.CurrentDocument;
                    RSFileReader fr       = new RSFileReader(br);
                    fr.logStream = sw;
                    try
                    {
                        document.Data.Load(fr);
                    }
                    catch (Exception ex)
                    {
                        sw.Flush();
                        sw.WriteLine("Exception:");
                        sw.WriteLine(ex.Message);
                        sw.WriteLine(ex.StackTrace);
                        sw.Flush();
                    }
                }
            }

            MNDocument doc = MNNotificationCenter.CurrentDocument;

            if (doc.Data.Pages.Count == 0)
            {
                doc.CreateNewPage();
            }
        }
Ejemplo n.º 24
0
        static void Main(string[] args)
        {
            MNExportContext etx = new MNExportContext();

            etx.DirAllBooks = @"e:\temp";
            string file = @"e:\Dropbox\ReaderBooks\STFK.smb";

            if (!File.Exists(file))
            {
                Console.WriteLine("File {0} does not exist.", file);
                return;
            }

            Console.WriteLine("File: {0}", file);
            MNDocument docx = Program.LoadDocument(file);

            docx.ExportToHtml(etx, Path.GetFileNameWithoutExtension(file));

            docx = null;

            StringBuilder Consolereport = new StringBuilder();

            Consolereport.AppendLine("Used controls:");
            foreach (string s in etx.UsedControls.Keys)
            {
                HashSet <long> hash = etx.UsedControls[s];
                Consolereport.AppendFormat("{0}:", s);
                foreach (long l in hash)
                {
                    Consolereport.AppendFormat(" {0}", l);
                }
                Consolereport.AppendLine();
            }

            Console.WriteLine(Consolereport.ToString());
            File.WriteAllText(Path.Combine(etx.DirCurrentBook, "info.txt"), Consolereport.ToString());

            Console.ReadLine();
        }
Ejemplo n.º 25
0
        private void StartDocumentReview(MNDocument doc, string filePath)
        {
            Document    = doc;
            doc.Reviews = p_Book;
            ClearUI();

            labelBookTitle.Text     = Document.Book.BookTitle;
            tabControl1.SelectedTab = tabBook;

            string folder = Properties.Settings.Default.ReviewsDirectory;

            if (Directory.Exists(folder))
            {
                string path = Path.Combine(folder, Path.GetFileNameWithoutExtension(Document.Book.FilePath) + ".smr");
                LoadData(path);
            }

            p_PageOrig = null;
            p_ItemOrig = null;
            p_Page     = new ReviewPage();
            p_Item     = new ReviewItem();
        }
Ejemplo n.º 26
0
        private static bool AddStyleToArray(MNDocument doc, MNReferencedStyle style, bool overwrite)
        {
            bool added = false;

            if (style == null || style.Name.Length == 0)
            {
                return(false);
            }
            List <MNReferencedStyle> array = doc.DefaultLanguage.Styles;

            int index = -1;

            for (int i = 0; i < array.Count; i++)
            {
                if (array[i].Name == style.Name)
                {
                    index = i;
                    break;
                }
            }

            if (index >= 0)
            {
                if (overwrite)
                {
                    array.RemoveAt(index);
                    array.Insert(index, style);
                    added = true;
                }
            }
            else
            {
                array.Add(style);
                added = true;
            }

            return(added);
        }
Ejemplo n.º 27
0
        private static bool AddImageToArray(MNDocument doc, MNReferencedImage img, bool overwrite)
        {
            bool added = false;

            if (img == null || img.Name.Length == 0)
            {
                return(false);
            }

            int index = -1;
            List <MNReferencedImage> array = doc.DefaultLanguage.Images;

            for (int i = 0; i < array.Count; i++)
            {
                if (array[i].Name == img.Name)
                {
                    index = i;
                    break;
                }
            }

            if (index >= 0)
            {
                if (overwrite)
                {
                    array.RemoveAt(index);
                    array.Insert(index, img);
                    added = true;
                }
            }
            else
            {
                array.Add(img);
                added = true;
            }

            return(added);
        }
Ejemplo n.º 28
0
        public MNDocument LoadDocument(string fileName)
        {
            MNDocument prevDocument = MNNotificationCenter.CurrentDocument;
            string     prevFilename = MNNotificationCenter.CurrentFileName;

            if (LoadBookHeader(fileName))
            {
                MNNotificationCenter.CurrentDocument.Book.FindLanguageFiles(Path.GetDirectoryName(fileName));

                fileName = fileName.Replace(".smb", ".smd");
                LoadBookData(fileName);

                fileName = fileName.Replace(".smd", ".sme");
                LoadBookLang(fileName);
            }

            MNDocument newDocument = MNNotificationCenter.CurrentDocument;

            MNNotificationCenter.CurrentDocument = prevDocument;
            MNNotificationCenter.CurrentFileName = prevFilename;

            return(newDocument);
        }
Ejemplo n.º 29
0
        public void SetDocument(MNDocument d)
        {
            int groupIndex = 0;

            doc = d;
            int m = doc.Data.Pages.Count;

            for (int i = 0; i < m; i++)
            {
                comboPage1.Items.Add(doc.Data.Pages[i].Title);
                comboPage2.Items.Add(doc.Data.Pages[i].Title);
                comboPage3.Items.Add(doc.Data.Pages[i].Title);
            }

            for (int pageNo = 0; pageNo < m; pageNo++)
            {
                if (doc.Data.Pages[pageNo].NextPage.Equals(doc.Book.HomePage))
                {
                    SetPage(groupIndex, pageNo, doc.Data.Pages[pageNo]);
                    groupIndex++;
                }
            }
        }
Ejemplo n.º 30
0
        public void SetImage(MNLazyImage li)
        {
            doc   = li.Document;
            image = li;
            comboBox1.Items.Clear();
            int i        = 0;
            int selected = -1;

            foreach (MNReferencedImage img in doc.DefaultLanguage.Images)
            {
                comboBox1.Items.Add(img);
                if (img == li.Image)
                {
                    selected = i;
                }
                i++;
            }
            if (selected >= 0)
            {
                comboBox1.SelectedIndex = selected;
            }
            control = null;
        }