Example #1
0
        public override void Save(RSFileWriter bw)
        {
            base.Save(bw);

            bw.WriteByte(10);
            bw.WriteString(TargetControl);

            bw.WriteByte(0);
        }
Example #2
0
        public override void Save(RSFileWriter bw)
        {
            base.Save(bw);

            bw.WriteByte(10);
            bw.WriteInt64(BackgroundImageId);

            bw.WriteByte(0);
        }
Example #3
0
        public void Save(RSFileWriter bw)
        {
            bw.WriteByte(10); bw.WriteBool(SizeToFit);
            bw.WriteByte(11); bw.WriteInt32((Int32)Align);
            bw.WriteByte(12); bw.WriteInt32((Int32)VertAlign);
            bw.WriteByte(13); bw.WriteFloat(LineSpacing);

            bw.WriteByte(0);
        }
Example #4
0
        public void Save(RSFileWriter bw)
        {
            bw.WriteByte(10);
            bw.WriteInt64(Source != null ? Source.Id : -1);
            bw.WriteInt64(Target != null ? Target.Id : -1);
            bw.WriteInt32((Int32)ConnectionStyle);

            bw.WriteByte(0);
        }
Example #5
0
        public void SaveStatus(RSFileWriter bw)
        {
            // tag and value for highlighted status
            bw.WriteByte(10);
            bw.WriteBool(UIStateHighlighted);

            // end for spot status info
            bw.WriteByte(0);
        }
Example #6
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;
        }
Example #7
0
        public override void Save(RSFileWriter bw)
        {
            base.Save(bw);

            bw.WriteByte(10);
            bw.WriteInt32((Int32)LinesCount);
            bw.WriteString(ExpectedValue);

            bw.WriteByte(0);
        }
Example #8
0
        public override void Save(RSFileWriter bw)
        {
            bw.WriteByte(10);
            bw.WriteString(Name);
            bw.WriteByte(12);
            bw.WriteString(Text);

            bw.WriteByte(0);
            Modified = false;
        }
Example #9
0
 public override void Save(RSFileWriter bw)
 {
     bw.WriteByte(1);
     bw.WriteInt64(TimeOffset);
     bw.WriteByte(2);
     bw.WriteBool(Valid);
     bw.WriteByte(3);
     bw.WriteString(Text);
     bw.WriteByte(0);
     Modified = true;
 }
Example #10
0
        public void Save(RSFileWriter bw)
        {
            bw.WriteByte(10); bw.WriteColor(BackColor);
            bw.WriteByte(11); bw.WriteColor(ForeColor);
            bw.WriteByte(12); bw.WriteInt32((int)BorderStyle);
            bw.WriteByte(13); bw.WriteInt32(Convert.ToInt32(BorderWidth * 100));
            bw.WriteByte(14); bw.WriteColor(BorderColor);
            bw.WriteByte(15); bw.WriteInt32(CornerRadius);

            bw.WriteByte(0);
        }
Example #11
0
        public virtual void Save(RSFileWriter W)
        {
            for (int i = 0; i < Count; i++)
            {
                W.WriteByte(10);
                W.WriteString(Parent.ObjectToTag(this[i]));
                this[i].Save(W);
            }

            W.WriteByte(0);
        }
Example #12
0
        public void Save(RSFileWriter W)
        {
            foreach (GVGraphConnection g in this)
            {
                W.WriteByte(10);
                W.WriteString(Parent.ObjectToTag(g));
                g.Save(W);
            }

            W.WriteByte(0);
        }
Example #13
0
        public override void Save(RSFileWriter bw)
        {
            base.Save(bw);

            bw.WriteByte(10);
            bw.WriteString(ContentCells);

            bw.WriteByte(11);
            bw.WriteString(HelpTextControlName);

            bw.WriteByte(0);
        }
Example #14
0
        public override void Save(RSFileWriter bw)
        {
            base.Save(bw);

            bw.WriteByte(10);
            bw.WriteInt32((int)RunningLine);

            bw.WriteByte(11);
            bw.WriteBool(RichContent);

            bw.WriteByte(0);
        }
Example #15
0
 public override void Save(RSFileWriter bw)
 {
     bw.WriteInt32(Nodes.Count);
     foreach (KeyValuePair <string, MNReferencedCore> obj in Nodes)
     {
         bw.WriteString(obj.Key);
         bw.WriteString(GOFile.InstanceToTag(obj.Value));
         obj.Value.Save(bw);
         obj.Value.Modified = false;
     }
     Modified = false;
 }
Example #16
0
        public override void Save(RSFileWriter W)
        {
            base.Save(W);

            if (Action != null)
            {
                W.WriteByte(20);
                Action.Save(W);
            }

            W.WriteByte(0);
        }
Example #17
0
        public override void Save(RSFileWriter bw)
        {
            base.Save(bw);

            bw.WriteByte(10);
            bw.WriteInt32(Spacing);
            bw.WriteInt32(Rows);
            bw.WriteInt32(Columns);
            bw.WriteColor(HighlightColor);

            bw.WriteByte(0);
        }
Example #18
0
        public override void SaveStatus(RSFileWriter bw)
        {
            base.SaveStatusCore(bw);

            foreach (SMTextContainerWord tcw in drawWords)
            {
                bw.WriteByte(20);
                bw.WriteString(tcw.text);
            }

            bw.WriteByte(0);
        }
Example #19
0
        public void SaveStatus(RSFileWriter bw)
        {
            bw.WriteHeader(p_fileStatusHeader);

            foreach (MNPage page in Pages)
            {
                bw.WriteByte(10);
                bw.WriteInt64(page.Id);
                page.SaveStatus(bw);
            }

            bw.WriteByte(0);
        }
Example #20
0
        public void Save(RSFileWriter bw)
        {
            bw.WriteByte(10);
            bw.WriteString(ImageName);

            bw.WriteByte(11);
            bw.WriteString(Text);

            bw.WriteByte(12);
            bw.WriteString(ActionScript);

            bw.WriteByte(0);
        }
Example #21
0
        public override void Save(RSFileWriter bw)
        {
            base.Save(bw);

            bw.WriteByte(10);
            bw.WriteByte((byte)DefaultChecked);
            bw.WriteByte((byte)ExpectedChecked);

            bw.WriteByte(11);
            bw.WriteBool(CheckBoxAtEnd);

            bw.WriteByte(0);
        }
Example #22
0
        public void Save(RSFileWriter bw)
        {
            bw.WriteHeader(p_fileHeader);

            bw.WriteByte(5);
            bw.WriteByte(sizeof(int));

            bw.WriteTagString(10, BookTitle);
            bw.WriteTagString(11, BookCode);
            bw.WriteTagString(12, BookAuthor);
            bw.WriteTagString(13, BookPublisher);
            bw.WriteTagString(14, BookCopyright);
            bw.WriteTagString(15, BookCollection);

            bw.WriteByte(16);
            bw.WriteColor(BookColor);

            bw.WriteTagString(17, StartPage);

            if (BookImageRef != null)
            {
                bw.WriteByte(18);
                BookImageRef.Save(bw);
            }

            bw.WriteByte(19);
            bw.WriteInt32((Int32)Evaluation);

            bw.WriteByte(20);
            bw.WriteString(WorkTime.GetLastTime());

            bw.WriteByte(21);
            bw.WriteInt64(WorkTime.GetTotalWorkTime());

            bw.WriteByte(22);
            bw.WriteInt32(BookPriority);

            bw.WriteByte(23);
            bw.WriteString(HomePage);

            bw.WriteByte(24);
            bw.WriteInt32(Version);

            bw.WriteByte(25);
            bw.WriteInt32(DefaultFontSize);

            bw.WriteByte(27);
            bw.WriteString(DefaultFontName);

            bw.WriteByte(0);
        }
Example #23
0
        private void saveOnlyHeaderFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string fileName = MNNotificationCenter.CurrentFileName;

            using (StreamWriter sw = new StreamWriter(@"d:\LearnToRead\save_book.txt"))
            {
                using (BinaryWriter bw = new BinaryWriter(File.Create(fileName)))
                {
                    RSFileWriter fw = new RSFileWriter(bw);
                    fw.logStream = sw;
                    MNNotificationCenter.CurrentDocument.Book.Save(fw);
                }
            }
        }
Example #24
0
        public void Save(RSFileWriter fw)
        {
            // write header
            fw.WriteHeader(p_FileHeader);

            Properties["LastTime"]  = WorkTime.GetLastTime();
            Properties["TotalWork"] = WorkTime.GetTotalWorkTime().ToString();

            // write general data
            foreach (KeyValuePair <string, string> ps in Properties)
            {
                fw.WriteByte(10);
                fw.WriteString(ps.Key);
                fw.WriteString(ps.Value);
            }

            // write objects
            foreach (MNReferencedText text in Texts)
            {
                fw.WriteByte(100);
                text.Save(fw);
            }

            foreach (MNReferencedImage image in Images)
            {
                fw.WriteByte(101);
                image.Save(fw);
            }

            foreach (MNReferencedSound sound in Sounds)
            {
                fw.WriteByte(102);
                sound.Save(fw);
            }

            foreach (MNReferencedAudioText audio in AudioTexts)
            {
                fw.WriteByte(103);
                audio.Save(fw);
            }

            foreach (MNReferencedStyle rs in Styles)
            {
                fw.WriteByte(104);
                rs.Save(fw);
            }

            fw.WriteByte(0);
        }
Example #25
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);
                        }
                    }
                }
            }
        }
Example #26
0
        public void SaveBookStatus()
        {
            string fileName = Book.FilePath.Replace(".smb", ".sms");

            if (fileName.Equals(""))
            {
                return;
            }

            using (BinaryWriter bw = new BinaryWriter(File.OpenWrite(fileName)))
            {
                RSFileWriter fw = new RSFileWriter(bw);
                Data.SaveStatus(fw);
            }
        }
Example #27
0
        public override void SaveStatus(RSFileWriter bw)
        {
            base.SaveStatusCore(bw);

            if (Img != null && Img.Image != null && Img.Image.HasSpots())
            {
                foreach (MNReferencedSpot rs in Img.Image.SafeSpots)
                {
                    // tag for spot status info
                    bw.WriteByte(15);
                    rs.SaveStatus(bw);
                }
            }
            bw.WriteByte(0);
        }
Example #28
0
 public void Save(RSFileWriter bw)
 {
     bw.WriteByte(10);
     bw.WriteBool(p_value_valid[0]);
     bw.WriteBool(p_value_valid[1]);
     bw.WriteBool(p_value_valid[2]);
     bw.WriteBool(p_value_valid[3]);
     bw.WriteDouble(p_value[0]);
     bw.WriteDouble(p_value[1]);
     bw.WriteDouble(p_value[2]);
     bw.WriteDouble(p_value[3]);
     bw.WriteByte(11); bw.WriteInt32((int)Axis);
     bw.WriteByte(13); bw.WriteBool(Changed);
     bw.WriteByte(0);
 }
Example #29
0
        public byte[] GetBytes()
        {
            byte[] buffer = null;

            using (MemoryStream ms = new MemoryStream())
            {
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    RSFileWriter fw = new RSFileWriter(bw);
                    Save(fw);
                    buffer = ms.GetBuffer();
                }
            }

            return(buffer);
        }
Example #30
0
        public void Save(RSFileWriter bw)
        {
            bw.WriteByte(10);
            bw.WriteString(APIName);

            bw.WriteByte(11);
            bw.WriteString(UserTitle);

            foreach (MNMenuItem mi in Items)
            {
                bw.WriteByte(20);
                mi.Save(bw);
            }

            bw.WriteByte(0);
        }