Exemplo n.º 1
0
        private void ProcessDocument(string path, string tempPath, int width)
        {
            if (File.Exists(path) == false)
            {
                return;
            }

            this.FilePath = path;

            _currentController = null;

            DeleteOldSnapshot();

            string newTempPath = System.IO.Path.Combine(tempPath, Guid.NewGuid().ToString());

            Directory.CreateDirectory(newTempPath);

            foreach (var item in _pptController)
            {
                if (item.Load(path, newTempPath) == true)
                {
                    int         height      = (int)(width * _pptSlideHeightRatio);
                    PPTDocument pptDocument = item.ReadAll(width, height);

                    string txt = Newtonsoft.Json.JsonConvert.SerializeObject(pptDocument);
                    if (string.IsNullOrEmpty(txt) == false)
                    {
                        _snapshotForWindowsPhone = txt;
                        _currentController       = item;

                        break;
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void ProcessDocument(string path, string tempPath, int width)
        {
            if (File.Exists(path) == false)
            {
                return;
            }

            this.FilePath = path;

            _currentController = null;

            DeleteOldSnapshot();

            string newTempPath = System.IO.Path.Combine(tempPath, Guid.NewGuid().ToString());
            Directory.CreateDirectory(newTempPath);

            foreach (var item in _pptController)
            {
                if (item.Load(path, newTempPath) == true)
                {
                    int height = (int)(width * _pptSlideHeightRatio);
                    PPTDocument pptDocument = item.ReadAll(width, height);

                    string txt = Newtonsoft.Json.JsonConvert.SerializeObject(pptDocument);
                    if (string.IsNullOrEmpty(txt) == false)
                    {
                        _snapshotForWindowsPhone = txt;
                        _currentController = item;

                        break;
                    }
                }
            }
        }