Example #1
0
        public static PinboardFileV1 Load(ParsedPath pinboardFileName)
        {
            PinboardFileV1 data = null;

            if (pinboardFiles == null)
            {
                pinboardFiles = new Dictionary <ParsedPath, PinboardFileV1>();
            }

            if (pinboardFiles.TryGetValue(pinboardFileName, out data))
            {
                return(data);
            }

            try
            {
                data = PinboardFileReaderV1.ReadFile(pinboardFileName);
            }
            catch
            {
                throw new ContentFileException("Unable to read pinboard file '{0}'".CultureFormat(pinboardFileName));
            }

            pinboardFiles.Add(pinboardFileName, data);

            return(data);
        }
Example #2
0
        private void OpenFile(string fileName)
        {
            PinboardFileV1 data = null;

            try
            {
                data = PinboardFileReaderV1.ReadFile(new ParsedPath(fileName, PathType.File));
            }
            catch
            {
                MessageBox.Show("Unable to load pinboard file", "Error Loading File",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            this.fileName = fileName;
            SetPinboardData(data);
            SetPinboardSize();
        }
Example #3
0
        private Dictionary <ParsedPath, PinboardFileV1> ReadPinboardFiles(IEnumerable <ParsedPath> pinboardFiles)
        {
            Dictionary <ParsedPath, PinboardFileV1> pinboards = new Dictionary <ParsedPath, PinboardFileV1>();

            foreach (var pinboardFile in pinboardFiles)
            {
                Context.Output.Message(MessageImportance.Low, "Reading pinboard file '{0}'", pinboardFile);

                PinboardFileV1 pinboard = null;

                try
                {
                    pinboard = PinboardFileReaderV1.ReadFile(pinboardFile);
                }
                catch (Exception e)
                {
                    throw new ContentFileException(Context.ContentFile, Target.LineNumber, String.Format("Unable to read pinboard file '{0}'", pinboardFile), e);
                }

                pinboards.Add(pinboardFile, pinboard);
            }

            return(pinboards);
        }