黄贺彬 5 سال پیش
والد
کامیت
d18ae539bb

+ 60 - 0
PPTXMLParser/Background.cs

@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public abstract class Background
+    {
+        private List<KeyValuePair<int, string>> gradientList = null;
+        private string bgColor;
+        private float alpha;
+        private string BgImageLocation;
+
+        public Background()
+        {
+            bgColor = "ffffff";
+            BgImageLocation = "No picture";
+        }
+
+        public void setGradientList(List<KeyValuePair<int, string>> list)
+        {
+            if (gradientList == null)
+                gradientList = new List<KeyValuePair<int, string>>();
+
+            gradientList = list;
+        }
+
+        public void setBgImageLocation(string loc)
+        {
+            BgImageLocation = loc;
+        }
+
+        public string getBgImageLocation()
+        {
+            return BgImageLocation;
+        }
+
+        public List<KeyValuePair<int, string>> getGradientList()
+        {
+            if (gradientList != null)
+                return gradientList;
+            else
+                return null;
+        }
+
+        public float Alpha
+        {
+            get { return alpha; }
+            set { alpha = 1 - ((value / 1000) / 100);}
+        }
+
+        public string BgColor
+        {
+            get { return bgColor; }
+            set { bgColor = value; }
+        }
+    }
+}

+ 391 - 0
PPTXMLParser/ColorConverter.cs

@@ -0,0 +1,391 @@
+using System;
+using System.Drawing;
+
+namespace ConsoleApplication
+{
+    public class ColorConverter
+    {
+        public ColorConverter(){}
+
+        public string SetLuminanceMod(string s, double luminance)
+        {
+
+            Color c = ColorTranslator.FromHtml("#" + s);
+
+            return SetLuminanceMod(c, luminance);
+        }
+        public string SetLuminanceOff(string s, double luminance)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+
+            return SetLuminanceOff(c, luminance);
+        }
+        public string SetTint(string s, double tint)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+
+            return SetTint(c,tint);
+        }
+        public string SetShade(string s, double shade)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+
+            return SetShade(c, shade);
+        }
+        public string SetSaturationMod(string s, double saturation)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+
+            return SetSaturationMod(c, saturation);
+        }
+        public string SetSaturationOff(string s, double saturation)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+
+            return SetSaturationOff(c, saturation);
+        }
+        public string SetBrightness(string s, double luminance)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+
+            return SetBrightness(c, luminance);
+        }
+        public string SetHueMod(string s, double hueMod)
+        {
+            Color c = ColorTranslator.FromHtml("#" + s);
+
+            return SetHueMod(c, hueMod);
+        }
+        private double RGB_to_linearRGB(double val){
+
+            if (val < 0.0)
+                return 0.0;
+            if (val <= 0.04045)
+                return val / 12.92;
+            if (val <= 1.0)
+                return (double) Math.Pow(((val + 0.055) / 1.055),2.4);
+            
+            return 1.0;
+        }
+        private double linearRGB_to_RGB(double val)
+        {
+
+            if (val < 0.0)
+                return 0.0;
+            if (val <= 0.0031308)
+                return val * 12.92;
+            if (val < 1.0)
+                return (1.055 * Math.Pow(val, (1.0 / 2.4))) - 0.055;
+
+            return 1.0;
+            /*
+            Public Function linearRGB_to_sRGB(ByVal value As Double) As Double
+                If value < 0.0# Then Return 0.0#
+                If value <= 0.0031308# Then Return value * 12.92
+                If value < 1.0# Then Return 1.055 * (value ^ (1.0# / 2.4)) - 0.055
+                Return 1.0#
+            End Function
+            */
+
+        }
+        public string SetShade(Color c, double shade)
+        {
+            //Console.WriteLine("Shade: " + shade);
+
+            double convShade = (shade / 1000) * 0.01;
+
+            double r = (double) c.R / 255;
+            double g = (double) c.G / 255;
+            double b = (double) c.B / 255;
+
+            double rLin  = RGB_to_linearRGB(r);
+            double gLin = RGB_to_linearRGB(g);
+            double bLin = RGB_to_linearRGB(b);
+
+            //Console.WriteLine("Linear R: " + rLin + "\nLinear G: " + gLin + "\nLinear B: " + bLin);
+
+            //SHADE 
+            if ((rLin * convShade) < 0)
+                rLin = 0;
+            if ((rLin * convShade) > 1)
+                rLin = 0;
+            else
+                rLin *= convShade;
+
+            if ((gLin * convShade) < 0)
+                gLin = 0;
+            if ((gLin * convShade) > 1)
+                gLin = 0;
+            else
+                gLin *= convShade;
+
+            if ((bLin * convShade) < 0)
+                bLin = 0;
+            if ((bLin * convShade) > 1)
+                bLin = 0;
+            else
+                bLin *= convShade;
+
+            //SHADEEND
+
+            r = linearRGB_to_RGB(rLin);
+            g = linearRGB_to_RGB(gLin);
+            b = linearRGB_to_RGB(bLin);
+
+            Color outColor = Color.FromArgb((int)Math.Round(r * 255), (int)Math.Round(g * 255), (int)Math.Round(b * 255));
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+
+        }
+        public string SetTint(Color c, double tint)
+        {
+
+            double tintConv = (tint / 1000)*0.01;
+
+            double r = (double)c.R / 255;
+            double g = (double)c.G / 255;
+            double b = (double)c.B / 255;
+
+            double rLin = RGB_to_linearRGB(r);
+            double gLin = RGB_to_linearRGB(g);
+            double bLin = RGB_to_linearRGB(b);
+
+            /**TINT**/
+
+            if (tintConv > 0)
+                rLin = (rLin * tintConv) + (1 - tintConv);
+            else
+                rLin = rLin * (1 + tintConv);
+
+            if (tintConv > 0)
+                gLin = (gLin * tintConv) + (1 - tintConv);
+            else
+                gLin = gLin * (1 + tintConv);
+
+            if (tintConv > 0)
+                bLin = (bLin * tintConv) + (1 - tintConv);
+            else
+                bLin = bLin * (1 + tintConv);
+
+            r = linearRGB_to_RGB(rLin);
+            g = linearRGB_to_RGB(gLin);
+            b = linearRGB_to_RGB(bLin);
+
+            Color outColor = Color.FromArgb((int)Math.Round(r * 255), (int)Math.Round(g * 255), (int)Math.Round(b * 255));
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+        }
+        public string SetSaturationMod(Color c, double saturation)
+        {
+            double satMod = (saturation / 1000)*0.01;
+
+            HSLColor hsl = RGB_to_HSL(c);
+            hsl.Saturation *= satMod;
+            c = HSL_to_RGB(hsl);
+
+            return c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
+        }
+        public string SetSaturationOff(Color c, double saturation)
+        {
+            double satOff = (saturation / 1000) * 0.01;
+
+            HSLColor hsl = RGB_to_HSL(c);
+            hsl.Saturation += satOff;
+            c = HSL_to_RGB(hsl);
+
+            return c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
+        }
+        public string SetBrightness(Color c, double brightness)
+        {
+            
+            double convBrightness = brightness / 100000;
+
+            HSLColor hsl = RGB_to_HSL(c);
+
+            hsl.Luminance *= convBrightness;
+            c = HSL_to_RGB(hsl);
+
+            return c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
+        }
+        public string SetLuminanceMod(Color c, double luminance)
+        {
+            double lumMod = (luminance / 1000)*0.01;
+
+            HSLColor hsl = RGB_to_HSL(c);
+            hsl.Luminance *= lumMod;
+            Color outColor = HSL_to_RGB(hsl);
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+        }
+        public string SetLuminanceOff(Color c, double luminance)
+        {
+            double lumModOff = (luminance / 1000) * 0.01;
+
+            HSLColor hsl = RGB_to_HSL(c);
+            hsl.Luminance += lumModOff;
+            Color outColor = HSL_to_RGB(hsl);
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+        }
+        public string SetHueMod(Color c, double hue)
+        {
+
+            double hueMod = (hue / 1000) * 0.01;
+            
+            HSLColor hsl = RGB_to_HSL(c);
+            hsl.Hue *= hueMod;
+            Color outColor = HSL_to_RGB(hsl);
+
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+
+        }
+        public string SetHueOff(Color c, double hue)
+        {
+
+            double hueMod = (hue / 1000) * 0.01;
+
+            HSLColor hsl = RGB_to_HSL(c);
+            hsl.Hue += hueMod;
+            Color outColor = HSL_to_RGB(hsl);
+            return outColor.R.ToString("X2") + outColor.G.ToString("X2") + outColor.B.ToString("X2");
+
+        }
+
+
+        private HSLColor RGB_to_HSL(Color c)
+        {
+            HSLColor hsl = new HSLColor();
+
+            hsl.Hue = c.GetHue() / 360.0;
+            hsl.Luminance = c.GetBrightness();
+            hsl.Saturation = c.GetSaturation();
+
+            return hsl;
+        }
+        private HSLColor CreateHSL(int r, int g, int b)
+        {
+            HSLColor hsl = new HSLColor();
+
+            double R = (double)r / 255;
+            double G = (double)g / 255;
+            double B = (double)b / 255;
+            double max = 0, min = 0;
+            double H = 0, S = 0, L = 0;
+            bool rBool = false, gBool = false, bBool = false;
+
+            //find max
+            if ((R > G) && (R > B))
+            {
+                max = R;
+                rBool = true;
+            }
+            else if ((G > R) && (G > B))
+            {
+                max = G;
+                gBool = true;
+            }
+            else if ((B > G) && (B > R))
+            {
+                max = B;
+                bBool = true;
+            }
+
+            if ((R < G) && (R < B))
+                min = R;
+            else if ((G < R) && (G < B))
+                min = G;
+            else if ((B < G) && (B < R))
+                min = B;
+
+            //set Luminance
+            hsl.Luminance = (min + max) / 2;
+
+            if (min == max)
+            {
+                hsl.Saturation = 0;
+                hsl.Hue = 0;
+            }
+
+            //set saturation
+            if (hsl.Luminance < 0.5)
+                hsl.Saturation = (max - min) / (max + min);
+            else if (hsl.Luminance > 0.5)
+                hsl.Saturation = (max - min) / (2.0 - max - min);
+
+            if (rBool)
+            {
+                H = ((G - B) / (max - min)) * 60.0;
+                Console.WriteLine("red");
+            }
+            if (gBool)
+            {
+                H = ((2.0 + ((B - R) / (max - min))) * 60.0);
+                Console.WriteLine("green");
+            }
+            if (bBool)
+            {
+                H = (4.0 + (R - G) / (max - min)) * 60.0;
+                Console.WriteLine("blue");
+            }
+
+            if (H < 0)
+                H += 360;
+
+            H = Math.Round(H);
+            H = H / 360;
+
+            hsl.Hue = H;
+
+            return hsl;
+        }
+        private Color HSL_to_RGB(HSLColor hslColor)
+        {
+
+            double r = 0, g = 0, b = 0;
+            double temp1, temp2;
+
+
+            if (hslColor.Luminance == 0)
+                r = g = b = 0;
+            else
+            {
+                if (hslColor.Saturation == 0)
+                {
+                    r = g = b = hslColor.Luminance;
+                }
+                else
+                {
+                    temp2 = ((hslColor.Luminance <= 0.5) ? hslColor.Luminance * (1.0 + hslColor.Saturation) : hslColor.Luminance + hslColor.Saturation - (hslColor.Luminance * hslColor.Saturation));
+                    temp1 = 2.0 * hslColor.Luminance - temp2;
+
+                    double[] t3 = new double[] { hslColor.Hue + 1.0 / 3.0, hslColor.Hue, hslColor.Hue - 1.0 / 3.0 };
+                    double[] clr = new double[] { 0, 0, 0 };
+                    for (int i = 0; i < 3; i++)
+                    {
+                        if (t3[i] < 0)
+                            t3[i] += 1.0;
+                        if (t3[i] > 1)
+                            t3[i] -= 1.0;
+
+                        if (6.0 * t3[i] < 1.0)
+                            clr[i] = temp1 + (temp2 - temp1) * t3[i] * 6.0;
+                        else if (2.0 * t3[i] < 1.0)
+                            clr[i] = temp2;
+                        else if (3.0 * t3[i] < 2.0)
+                            clr[i] = (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - t3[i]) * 6.0);
+                        else
+                            clr[i] = temp1;
+                    }
+                    r = clr[0];
+                    g = clr[1];
+                    b = clr[2];
+                }
+            }
+
+            return Color.FromArgb((int)(255 * r), (int)(255 * g), (int)(255 * b));
+            
+        }
+
+    }
+    
+}

+ 66 - 0
PPTXMLParser/GradientBackground.cs

@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Drawing;
+
+namespace ConsoleApplication
+{
+    public class GradientBackground
+    {
+        //pos, color, alpha
+        private List<GradientInfo> _gradientList;
+        private string _bgType, _gradientType;
+
+        private int _angle;
+        public GradientBackground()
+        {
+            _gradientList = new List<GradientInfo>();
+            _angle = 0;
+            _bgType = "gradient";
+            _gradientType = "";
+        }
+
+        public float getAlpha1()
+        {
+            return _gradientList.First().Alpha;
+        }
+
+        public int Angle
+        {
+            get { return _angle; }
+            set { _angle = value; }
+        }
+
+        public List<GradientInfo> GradientList
+        {
+            get { return _gradientList; }
+            set { _gradientList = value; }
+        }
+
+        public string GradientType
+        {
+            get { return _gradientType; }
+            set { _gradientType = value; }
+        }
+
+        public string BgType
+        {
+            get { return _bgType; }
+            set { _bgType = value; }
+        }
+
+        public string toString()
+        {
+            string output = "Infolist:\n";
+            foreach (var item in _gradientList)
+            {
+                output += item.toString() + "\n";
+            }
+            output += "GradientType: " + GradientType + "\n";
+
+            return output;
+        }
+    }
+}

+ 86 - 0
PPTXMLParser/GradientInfo.cs

@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Drawing;
+
+namespace ConsoleApplication
+{
+    public class GradientInfo
+    {
+        private string _gradColor;
+        private int _position;
+        private float _alpha, _tint, _saturationMod, _shade, _luminance;
+
+        private Color _color;
+
+        public GradientInfo()
+        {
+            _gradColor = "ffffff";
+            _position = 0;
+            _alpha = 1;
+            _tint = 100;
+            _saturationMod = 0;
+            _shade = 0;
+            _color = new Color();
+        }
+
+        public Color Color
+        {
+            get { return _color; }
+            set { _color = value; }
+        }
+
+
+        public float Luminance
+        {
+            get { return _luminance; }
+            set { _luminance = value; }
+        }
+
+        public float Alpha
+        {
+            get { return _alpha; }
+            set { _alpha = value; }
+        }
+        public int Position
+        {
+            get { return _position; }
+            set { _position = value; }
+        }
+        public string GradColor
+        {
+            get { return _gradColor; }
+            set 
+            { 
+                _gradColor = value;
+                _color = ColorTranslator.FromHtml("#" + _gradColor);
+            }
+        }
+
+        public float SaturationMod
+        {
+            get { return _saturationMod; }
+            set { _saturationMod = value; }
+        }
+
+        public float Shade
+        {
+            get { return _shade; }
+            set { _shade = value; }
+        }
+
+        public float Tint
+        {
+            get { return _tint; }
+            set { _tint = value; }
+        }
+
+        public string toString()
+        {
+            return "Color: " + _color + "\nPosition: " + _position + "\nAlpha: " + _alpha +
+                    "\nTint: " + _tint + "\nSatMode: " + _saturationMod + "\nShade: " + _shade + "\n";
+        }
+    }
+}

+ 55 - 0
PPTXMLParser/HSLColor.cs

@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class HSLColor
+    {
+
+        double _hue, _saturation, _luminance;
+        public HSLColor()
+        {
+            _hue = 0;
+            _saturation = 0;
+            _luminance = 0;
+        }
+        public double Hue
+        {
+            get { return _hue; }
+            set
+            {
+                _hue = value;
+                _hue = _hue > 1 ? 1 : _hue < 0 ? 0 : _hue;
+            }
+        }
+
+        public double Saturation
+        {
+            get { return _saturation; }
+            set
+            {
+                _saturation = value;
+                _saturation = _saturation > 1 ? 1 : _saturation < 0 ? 0 : _saturation;
+            }
+        }
+
+        public double Luminance
+        {
+            get { return _luminance; }
+            set
+            {
+                _luminance = value;
+                _luminance = _luminance > 1 ? 1 : _luminance < 0 ? 0 : _luminance;
+            }
+        }
+
+        public string toString()
+        {
+            return "\n H: " + Hue + "\n S: " + Saturation + "\n L: " + Luminance + "\n";
+        }
+
+    }
+}

+ 62 - 0
PPTXMLParser/ImageObject.cs

@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class ImageObject : SceneObjectDecorator
+    {
+
+        /*<sceneObject type="FluddClip" clipID="4938d5b0-0a24-4977-b218-f7612f6e4630" z="0" boundsX="209" boundsY="183" clipWidth="200" clipHeight="200" width="0" height="0" rotation="0" alpha="1" name="31D3B859-8325-3FDA-F85E-CD5C1B97FAD2" hidden="false" flip="0">
+            <optimizedClip optID="" useOpt="false" readSize="0" writeSize="0" compress="true" optWidth="0" optHeight="0" processed="false" processFail="false"/>
+            <dsCol><![CDATA[]]></dsCol>
+            <properties>opacity,fx,xpos,ypos,width,height,rotation,flip,isRemovable,isMovable,isCopyable,isActionExecuter,isSwappable</properties>
+          </sceneObject>*/
+
+        private Properties _properties;
+
+        public ImageObject(SceneObject sceneobject) : base(sceneobject) 
+        {
+            sceneobject.setObjectType("FluddClip");
+            _properties = new Properties(true, false, true, true, true, true, true, true, true, true, true, false, true, true, true);
+        }
+
+        public XmlElement getOptimizedClip()
+        {
+            return null;
+        }
+
+        public override XmlElement getXMLTree()
+        {
+            XmlElement parent = base.getXMLTree();
+            XmlElement properties = _properties.getNode(getXMLDocumentRoot());
+            parent.AppendChild(properties);
+
+            return parent;
+        }
+
+        public override XmlDocument getXMLDocumentRoot()
+        {
+            return base.getXMLDocumentRoot();
+        }
+
+        public override void setXMLDocumentRoot(ref XmlDocument xmldocument)
+        {
+            base.setXMLDocumentRoot(ref xmldocument);
+        }
+
+        public override Properties getProperties()
+        {
+            return base.getProperties();
+        }
+
+        public override void setProperties(Properties properties)
+        {
+            base.setProperties(properties);
+        }
+    }
+}

+ 85 - 0
PPTXMLParser/ImageResponse.cs

@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class ImageResponse
+    {
+        string _clipID, _itemType, _width, _height, _label, _size, _uploadDate, _url;
+
+
+        public ImageResponse(){
+            _clipID = "";
+            _itemType = "";
+            _width = "";
+            _height = "";
+            _label = "";
+            _size = "";
+            _uploadDate = "";
+            _url = "";
+        }
+
+        public string Url
+        {
+            get { return _url; }
+            set { _url = value; }
+        }
+
+        public string UploadDate
+        {
+            get { return _uploadDate; }
+            set { _uploadDate = value; }
+        }
+
+        public string Size
+        {
+            get { return _size; }
+            set { _size = value; }
+        }
+
+        public string Label
+        {
+            get { return _label; }
+            set { _label = value; }
+        }
+
+        public string Height
+        {
+            get { return _height; }
+            set { _height = value; }
+        }
+
+        public string Width
+        {
+            get { return _width; }
+            set { _width = value; }
+        }
+
+        public string ItemType
+        {
+            get { return _itemType; }
+            set { _itemType = value; }
+        }
+
+        public string ClipID
+        {
+            get { return _clipID; }
+            set { _clipID = value; }
+        }
+
+        public string toString()
+        {
+            return "clipID: " +_clipID +
+                     "\nitemType : " + _itemType +
+                     "\nwidth : " + _width +
+                     "\nheight : " + _height +
+                     "\nlabel : " + _label +
+                     "\nsize : " + _size +
+                     "\nuploadDate : " + _uploadDate +
+                     "\nurl : " + _url;
+        }
+    }
+}

+ 117 - 0
PPTXMLParser/MediaFile.cs

@@ -0,0 +1,117 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using DocumentFormat.OpenXml.Packaging;
+using DocumentFormat.OpenXml;
+
+namespace ConsoleApplication
+{
+    class MediaFile
+    {
+        private int _offX, _offY, _extX, _extY, _rotation, _alpha;
+
+
+        private string _imageType, _imageLocation, _storeLocation, _imageName;
+        private ImagePart _imagePart;
+
+        public MediaFile()
+        {
+            _extX = 0;
+            _extY = 0;
+            _offX = 0;
+            _offY = 0;
+            _alpha = 100000;
+            _rotation = 0;
+            _imageType = "";
+            _imagePart = null;
+            _storeLocation = @"C:\Users\ex1\Desktop\PPTImages\";
+        }
+
+        public string ImageName
+        {
+            get { return _imageName; }
+            set 
+            { 
+                _imageName = value;
+                ImageType = _imageName.Split('.')[1]; 
+            }
+        }
+
+        public string StoreLocation
+        {
+            get { return _storeLocation; }
+            set { _storeLocation = value; }
+        }
+
+        public string ImageLocation
+        {
+            get { return _imageLocation; }
+            set { _imageLocation = value; }
+        }
+
+        public string ImageType
+        {
+            get { return _imageType; }
+            set { _imageType = value; }
+        }
+
+        public int Alpha
+        {
+            get { return _alpha; }
+            set { _alpha = value; }
+        }
+
+        public int Rotation
+        {
+            get { return _rotation; }
+            set { _rotation = value; }
+        }
+
+        public int ExtY
+        {
+            get { return _extY; }
+            set { _extY = value; }
+        }
+
+        public int ExtX
+        {
+            get { return _extX; }
+            set { _extX = value; }
+        }
+
+        public int OffY
+        {
+            get { return _offY; }
+            set { _offY = value; }
+        }
+
+        public int OffX
+        {
+            get { return _offX; }
+            set { _offX = value; }
+        }
+
+        public ImagePart ImagePart
+        {
+            get { return _imagePart; }
+            set { _imagePart = value; }
+        }
+
+        public string toString()
+        {
+            return "Image information \n" +
+                   " Image Name: " + _imageName + "\n" +
+                   " Offset Position (X,Y): (" + _offX + "," + _offY + ")\n" +
+                   " Extent Position (X,Y): (" + _extX + "," + _extY + ")\n" +
+                   " Rotation: " + _rotation + "\n" +
+                   " Image Type: " + _imageType + "\n" +
+                   " Alpha: " + _alpha + "\n";
+        }
+
+
+    }
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2330 - 0
PPTXMLParser/OpenXMLReader.cs


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2438 - 0
PPTXMLParser/OpenXMLReaderBackup.cs


+ 102 - 0
PPTXMLParser/OptimizedClip.cs

@@ -0,0 +1,102 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class OptimizedClip
+    {
+        private string _optID;
+        private int _readSize, _writeSize, _optWidth, _optHeight;
+        private bool _useOpt, _compress, _processed, _processFail;
+
+        private string[] _optimizedClipAttributes = new string[9]{  "optID", "useOpt", "readSize", "writeSize", "compress", 
+                                                                    "optWidth", "optHeight", "processed","processFail"};
+
+        public OptimizedClip()
+        {
+            _optID = "";
+            _useOpt = false;
+            _readSize = 0;
+            _writeSize = 0;
+            _compress = true;
+            _optWidth = 0;
+            _optHeight = 0;
+            _processed = false;
+            _processFail = false;
+        }
+
+        public XmlElement getOptimizedClipNode(XmlDocument docRoot)
+        {
+            XmlElement optimizedClip = docRoot.CreateElement("optimizedClip");
+
+            foreach (string s in _optimizedClipAttributes)
+            {
+                XmlAttribute xmlAttr = docRoot.CreateAttribute(s);
+
+                FieldInfo fieldInfo = GetType().GetField("_" + s, BindingFlags.NonPublic | BindingFlags.Instance);
+                if (fieldInfo != null)
+                    xmlAttr.Value = fieldInfo.GetValue(this).ToString();
+
+                optimizedClip.Attributes.Append(xmlAttr);
+            }
+
+            return optimizedClip;
+        }
+        public string OptID
+        {
+            get { return _optID; }
+            set { _optID = value; }
+        }
+        public int OptHeight
+        {
+            get { return _optHeight; }
+            set { _optHeight = value; }
+        }
+
+        public int OptWidth
+        {
+            get { return _optWidth; }
+            set { _optWidth = value; }
+        }
+
+        public int WriteSize
+        {
+            get { return _writeSize; }
+            set { _writeSize = value; }
+        }
+        public int ReadSize
+        {
+            get { return _readSize; }
+            set { _readSize = value; }
+        }
+
+        public bool ProcessFail
+        {
+            get { return _processFail; }
+            set { _processFail = value; }
+        }
+
+        public bool Processed
+        {
+            get { return _processed; }
+            set { _processed = value; }
+        }
+
+        public bool Compress
+        {
+            get { return _compress; }
+            set { _compress = value; }
+        }
+
+        public bool UseOpt
+        {
+            get { return _useOpt; }
+            set { _useOpt = value; }
+        }
+    }
+}

+ 12 - 0
PPTXMLParser/PPTXMLParser.csproj

@@ -0,0 +1,12 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>netcoreapp2.2</TargetFramework>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\TEAMModelOS.SDK\TEAMModelOS.SDK.csproj" />
+  </ItemGroup>
+
+</Project>

+ 302 - 0
PPTXMLParser/PowerPointColor.cs

@@ -0,0 +1,302 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    class PowerPointColor
+    {
+        private int _tint,
+                    _shade,
+                    _comp,
+                    _inv,
+                    _gray,
+                    _alpha,
+                    _alphaOff,
+                    _alphaMod,
+                    _hueOff,
+                    _hueMod,
+                    _sat,
+                    _satOff,
+                    _satMod,
+                    _lum,
+                    _lumOff,
+                    _lumMod,
+                    _red,
+                    _redOff,
+                    _redMod,
+                    _green,
+                    _greenOff,
+                    _greenMod,
+                    _blue,
+                    _blueOff,
+                    _blueMod,
+                    _gamma,
+                    _invGamma;
+
+    
+        private string _color;
+
+        public PowerPointColor()
+        {
+            _color = "";
+            _tint = 0;
+            _shade = 0;
+            _comp = 0;
+            _inv = 0;
+            _gray = 0;
+            _alpha = 100000;
+            _alphaOff = 0;
+            _alphaMod = 0;
+            _hueOff = 0;
+            _hueMod = 0;
+            _sat = 0;
+            _satOff = 0;
+            _satMod = 0;
+            _lum = 0;
+            _lumOff = 0;
+            _lumMod = 0;
+            _red = 0;
+            _redOff = 0;
+            _redMod = 0;
+            _green = 0;
+            _greenOff = 0;
+            _greenMod = 0;
+            _blue = 0;
+            _blueOff = 0;
+            _blueMod = 0;
+            _gamma = 0;
+            _invGamma = 0;
+        }
+
+        //TODO
+        public string getAdjustedColor()
+        {
+            ColorConverter conv = new ColorConverter();
+            string color = _color;
+
+            if (Tint != 0)
+                color = conv.SetTint(color, _tint);
+            if (Shade != 0)
+                color = conv.SetShade(color, _shade);
+            if (LumMod != 0)
+                color = conv.SetLuminanceMod(color, _lumMod);
+            if (LumOff != 0)
+                color = conv.SetLuminanceOff(color, _lumOff);
+            if (SatMod != 0)
+                color = conv.SetSaturationMod(color, _satMod);
+            if (SatOff != 0)
+                color = conv.SetSaturationOff(color, _satOff);
+            if (HueMod != 0)
+                color = conv.SetHueMod(color, _hueMod);
+
+            return color;
+        }
+
+        public override string ToString()
+        {
+ 	        string output =  "PowerPointColor\n";
+
+            output +=                       " color:    " + _color + "\n";
+            output += (_tint != 0) ?        " tint:     " + _tint + "\n" : "";
+            output += (_shade != 0) ?       " shade:    " + _shade + "\n" : "";
+            output += (_inv != 0) ?         " inv:      " + _inv + "\n" : "";
+            output += (_gray != 0) ?        " gray:     " + _gray + "\n" : "";
+            output += (_alpha != 0) ?       " alpha:    " + _alpha + "\n" : "";
+            output += (_alphaOff != 0) ?    " alphaOff: " + _alphaOff + "\n" : "";
+            output += (_alphaMod != 0) ?    " alphaMod: " + _alphaMod + "\n" : "";
+            output += (_hueOff != 0) ?      " hueOff:   " + _hueOff + "\n" : "";
+            output += (_hueMod != 0) ?      " hueMod:   " + _hueMod + "\n" : "";
+            output += (_satOff != 0) ?      " satOff:   " + _satOff + "\n" : "";
+            output += (_satMod != 0) ?      " satMod:   " + _satMod + "\n" : "";
+            output += (_lum != 0) ?         " lum:      " + _lum + "\n" : "";
+            output += (_lumOff != 0) ?      " lumOff:   " + _lumOff + "\n" : "";
+            output += (_lumMod != 0) ?      " lumMod:   " + _lumMod + "\n" : "";
+            output += (_red != 0) ?         " red:      " + _red + "\n" : "";
+            output += (_redOff != 0) ?      " redOff:   " + _redOff + "\n" : "";
+            output += (_redMod != 0) ?      " redMod:   " + _redMod + "\n" : "";
+            output += (_green != 0) ?       " green:    " + _green + "\n" : "";
+            output += (_greenOff != 0) ?    " greenOff: " + _greenOff + "\n" : "";
+            output += (_greenMod != 0) ?    " greenMod: " + _greenMod + "\n" : "";
+            output += (_blue != 0) ?        " blue:     " + _blue + "\n" : "";
+            output += (_blueOff != 0) ?     " blueOff:  " + _blueOff + "\n" : "";
+            output += (_blueMod != 0) ?     " blueMod:  " + _blueMod + "\n" : "";
+            output += (_gamma != 0) ?       " gamma:    " + _gamma + "\n" : "";
+            output += (_invGamma != 0) ?    " invGamma: " + _invGamma + "\n": "";         
+
+            return output;
+        }
+
+        public int SatMod
+        {
+            get { return _satMod; }
+            set { _satMod = value; }
+        }
+
+        public string Color
+        {
+            get { return _color; }
+            set { _color = value; }
+        }
+
+        public int Alpha
+        {
+            get { return _alpha; }
+            set { _alpha = value; }
+        }
+
+        public int Tint
+        {
+            get { return _tint; }
+            set { _tint = value; }
+        }
+
+        public int LumMod
+        {
+            get { return _lumMod; }
+            set { _lumMod = value; }
+        }
+
+        public int Shade
+        {
+            get { return _shade; }
+            set { _shade = value; }
+        }
+
+        public int InvGamma
+        {
+            get { return _invGamma; }
+            set { _invGamma = value; }
+        }
+
+        public int Gamma
+        {
+            get { return _gamma; }
+            set { _gamma = value; }
+        }
+
+        public int BlueMod
+        {
+            get { return _blueMod; }
+            set { _blueMod = value; }
+        }
+
+        public int BlueOff
+        {
+            get { return _blueOff; }
+            set { _blueOff = value; }
+        }
+
+        public int Blue
+        {
+            get { return _blue; }
+            set { _blue = value; }
+        }
+
+        public int GreenMod
+        {
+            get { return _greenMod; }
+            set { _greenMod = value; }
+        }
+
+        public int GreenOff
+        {
+            get { return _greenOff; }
+            set { _greenOff = value; }
+        }
+
+        public int Green
+        {
+            get { return _green; }
+            set { _green = value; }
+        }
+
+        public int RedMod
+        {
+            get { return _redMod; }
+            set { _redMod = value; }
+        }
+
+        public int RedOff
+        {
+            get { return _redOff; }
+            set { _redOff = value; }
+        }
+
+        public int Red
+        {
+            get { return _red; }
+            set { _red = value; }
+        }
+
+        public int LumOff
+        {
+            get { return _lumOff; }
+            set { _lumOff = value; }
+        }
+
+        public int Lum
+        {
+            get { return _lum; }
+            set { _lum = value; }
+        }
+
+        public int SatOff
+        {
+            get { return _satOff; }
+            set { _satOff = value; }
+        }
+
+        public int Sat
+        {
+            get { return _sat; }
+            set { _sat = value; }
+        }
+
+        public int HueOff
+        {
+            get { return _hueOff; }
+            set { _hueOff = value; }
+        }
+
+        public int AlphaMod
+        {
+            get { return _alphaMod; }
+            set { _alphaMod = value; }
+        }
+
+        public int AlphaOff
+        {
+            get { return _alphaOff; }
+            set { _alphaOff = value; }
+        }
+
+        public int Gray
+        {
+            get { return _gray; }
+            set { _gray = value; }
+        }
+
+        public int Inv
+        {
+            get { return _inv; }
+            set { _inv = value; }
+        }
+
+        public int Comp
+        {
+            get { return _comp; }
+            set { _comp = value; }
+        }
+
+
+        public int HueMod
+        {
+            get { return _hueMod; }
+            set { _hueMod = value; }
+        }
+
+    }
+}

+ 227 - 0
PPTXMLParser/PowerPointText.cs

@@ -0,0 +1,227 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    class PowerPointText
+    {
+        private int _fontSize, _x, _y, _cx, _cy, _rotation, _idx, _level;
+        private string _type, _font, _alignment, _anchor, _fontColor, _bulletColor;
+        private Boolean _bold, _italic, _underline;
+
+        public PowerPointText()
+        {
+            _fontSize = 0;
+            _x = 0;
+            _y = 0;
+            _cx = 0;
+            _cy = 0;
+            _rotation = 0;
+            _idx = -1;
+            _level = 0;
+
+            _type = "";
+            _font = "";
+            _fontColor = "";
+            _bulletColor = "";
+            _anchor = "";
+            _alignment = "";
+            
+            _bold = false;
+            _italic = false;
+            _underline = false;
+        }
+
+        public PowerPointText(PowerPointText ppt)
+        {
+            _fontSize = ppt.FontSize;
+            _x = ppt.X;
+            _y = ppt.Y;
+            _cx = ppt.Cx;
+            _cy = ppt.Cy;
+            _rotation = ppt.Rotation;
+            _idx = ppt.Idx;
+            _level = ppt.Level;
+
+            _type = ppt.Type;
+            _font = ppt.Font;
+            _fontColor = ppt.FontColor;
+            _bulletColor = ppt.BulletColor;
+            _anchor = ppt.Anchor;
+            _alignment = ppt.Alignment;
+
+            _bold = ppt.Bold;
+            _italic = ppt.Italic;
+            _underline = ppt.Underline;
+        }
+
+        public String toString()
+        {
+            return "Placeholder: (" + _type + ", " + _idx + ")\n" +
+                   "  Level:       " + _level + "\n" +
+                   "  Font:        " + _font + "\n" +
+                   "  Font size:   " + _fontSize + "\n" +
+                   "  Font color:  " + _fontColor + "\n" +
+                   "  Bullet clr:  " + _bulletColor + "\n" +
+                   "  Size:        (" + _cx + "," + _cy + ")\n" +
+                   "  Position:    (" + _x + "," + _y + ")\n" +
+                   "  Rotation:    " + Rotation/60000 + "\n" +
+                   "  Anchor:      " + _anchor + "\n" +
+                   "  Alignment:   " + _alignment + "\n" + 
+                   "  B U I:       (" + _bold + ", " + _underline + ", " + _italic + ") \n";
+        }
+
+        public string BulletColor
+        {
+            get { return _bulletColor; }
+            set { _bulletColor = value; }
+        }
+
+        public int Idx
+        {
+            get { return _idx; }
+            set { _idx = value; }
+        }
+
+        public int Level
+        {
+            get { return _level; }
+            set { _level = value; }
+        }
+
+        public Boolean Underline
+        {
+            get { return _underline; }
+            set { _underline = value; }
+        }
+
+        public Boolean Italic
+        {
+            get { return _italic; }
+            set { _italic = value; }
+        }
+
+        public Boolean Bold
+        {
+            get { return _bold; }
+            set { _bold = value; }
+        }
+
+        public string Anchor
+        {
+            get { return _anchor; }
+            set { _anchor = value; }
+        }
+
+        public string Alignment
+        {
+            get { return _alignment; }
+            set { _alignment = value; }
+        }
+
+        public string Font
+        {
+            get { return _font; }
+            set { _font = value; }
+        }
+
+        public string Type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+        
+        public int Rotation
+        {
+            get { return _rotation; }
+            set { _rotation = value; }
+        }
+
+        public int Cy
+        {
+            get { return _cy; }
+            set { _cy = value; }
+        }
+
+        public int Cx
+        {
+            get { return _cx; }
+            set { _cx = value; }
+        }
+
+        public int Y
+        {
+            get { return _y; }
+            set { _y = value; }
+        }
+
+        public int X
+        {
+            get { return _x; }
+            set { _x = value; }
+        }
+
+        public int FontSize
+        {
+            get { return _fontSize; }
+            set { _fontSize = value; }
+        }
+
+        public string FontColor
+        {
+            get { return _fontColor; }
+            set { _fontColor = value; }
+        }
+
+        public bool isEmpty()
+        {
+            if( _idx == -1 &&
+                _fontSize == 0 &&
+                //_x == 0 &&
+                //_y == 0 &&
+                //_cx == 0 &&
+                //_cy == 0 &&
+                _rotation == 0 &&
+                _fontColor == "" &&
+                _type == "" &&
+                _font == "" &&
+                //_alignment == "" &&
+                //_anchor == "" &&
+                //_level == -1 &&
+                _bold == false &&
+                _italic == false &&
+                _underline == false
+            )
+                return true;
+            else
+                return false;
+        }
+
+        public void setVisualAttribues(PowerPointText temp)
+        {
+            this.Anchor = temp.Anchor;
+            this.Alignment = (temp.Alignment!="")?temp.Alignment:this.Alignment;
+            this.Bold = temp.Bold;
+            this.Cx = (temp.Cx != 0) ? temp.Cx : this.Cx;
+            this.Cy = (temp.Cy != 0) ? temp.Cy : this.Cy;
+            this.Font = (temp.Font != "") ? temp.Font : this.Font;
+            this.FontColor = (temp.FontColor != "") ? temp.FontColor : this.FontColor;
+            this.BulletColor = (temp.BulletColor != "") ? temp.BulletColor : this.BulletColor;
+
+            if (temp.BulletColor == "none")
+                this.BulletColor = "";
+
+            this.FontSize = (temp.FontSize != 0) ? temp.FontSize : this.FontSize;
+            this.Italic = temp.Italic;
+            this.Rotation = (temp.Rotation != 0) ? temp.Rotation : this.Rotation;
+            this.Underline = temp.Underline;
+            this.X = (temp.X != 0) ? temp.X : this.X;
+            this.Y = (temp.Y != 0) ? temp.Y : this.Y;
+            this.Level = (temp.Level > 0) ? temp.Level : this.Level;
+
+        }
+    }
+}

+ 187 - 0
PPTXMLParser/PresentationObject.cs

@@ -0,0 +1,187 @@
+using System;
+using System.Drawing;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    class PresentationObject
+    {
+        private int _backgroundColor, _projektWidth, _projectHeight;
+        private string _id;
+        private List<Scene> sceneList;
+        private XmlDocument _xmlDoc;
+        List<SceneObject> _backgroundSceneObjectList;
+
+        public PresentationObject()
+        {
+            _projektWidth = 1024;
+            _projectHeight = 768;
+
+            _id = Guid.NewGuid().ToString();
+            _backgroundColor = Color.Red.ToArgb();
+            _backgroundSceneObjectList = new List<SceneObject>();
+            sceneList = new List<Scene>();
+            _xmlDoc = new XmlDocument();
+        }
+
+        public void addScene(Scene scene)
+        {
+            sceneList.Add(scene);
+        }
+
+        public void removeScene(Scene scene)
+        {
+            sceneList.Remove(scene);
+        }
+
+        public void getXmlDocument(out XmlDocument outs)
+        {
+            outs = _xmlDoc;
+        }
+
+        public void createXMLTree()
+        {
+            
+            
+
+        }
+
+        public XmlElement getBackgroundSceneNode()
+        {
+            XmlElement background = _xmlDoc.CreateElement("backgroundScene");
+            XmlElement properties = _xmlDoc.CreateElement("properties");
+            XmlElement backgroundColor = _xmlDoc.CreateElement("bgColor");
+            backgroundColor.InnerXml = "15298";
+            XmlAttribute bgMode = _xmlDoc.CreateAttribute("backgroundMode");
+            bgMode.Value = "";
+
+            background.Attributes.Append(bgMode);
+            background.AppendChild(properties);
+            background.AppendChild(backgroundColor);
+
+
+            int z_index = 0;
+            foreach (SceneObject item in _backgroundSceneObjectList)
+            {
+                item.setZindex(z_index);
+                item.setXMLDocumentRoot(ref _xmlDoc);
+                background.AppendChild(item.getXMLTree());
+                z_index++;
+            }
+
+            return background;
+        }
+
+        public XmlElement getForegroundSceneNode()
+        {
+            XmlElement foreground = _xmlDoc.CreateElement("foregroundScene");
+            XmlElement properties = _xmlDoc.CreateElement("properties");
+
+            foreground.AppendChild(properties);
+
+            return foreground;
+        }
+        public XmlElement getSceneTransitionNode()
+        {
+            XmlElement sceneTransition = _xmlDoc.CreateElement("sceneTransition");
+            XmlAttribute swf = _xmlDoc.CreateAttribute("swf");
+            swf.Value = "CrossFade";
+
+            XmlElement transSettings = _xmlDoc.CreateElement("transSettings");
+            XmlAttribute type = _xmlDoc.CreateAttribute("type");
+            type.Value = "YoobaTransition";
+            XmlAttribute trans_swf = _xmlDoc.CreateAttribute("swf");
+            trans_swf.Value = "trans.YoobaTransition";
+
+            XmlElement duration = _xmlDoc.CreateElement("duration");
+            duration.InnerXml = "0.6";
+            XmlElement direction = _xmlDoc.CreateElement("direction");
+            direction.InnerXml = "0";
+            XmlElement direction_2 = _xmlDoc.CreateElement("direction");
+            direction_2.InnerXml = "0";
+            XmlElement color = _xmlDoc.CreateElement("color");
+            color.InnerXml = "16777215";
+            XmlElement motionBlur = _xmlDoc.CreateElement("motionBlur");
+            motionBlur.InnerXml = "true";
+
+            transSettings.Attributes.Append(type);
+            transSettings.Attributes.Append(trans_swf);
+
+            transSettings.AppendChild(duration);
+            transSettings.AppendChild(direction);
+            transSettings.AppendChild(direction_2);
+            transSettings.AppendChild(color);
+            transSettings.AppendChild(motionBlur);
+
+            sceneTransition.Attributes.Append(swf);
+
+            sceneTransition.AppendChild(transSettings);
+
+            return sceneTransition;
+        }
+
+        public XmlDocument getXMLTree()
+        {
+
+            XmlDeclaration xmlDeclaration = _xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null);
+            XmlElement root = _xmlDoc.CreateElement("yoobaProject");
+            _xmlDoc.InsertBefore(xmlDeclaration, _xmlDoc.DocumentElement);
+            _xmlDoc.AppendChild(root);
+
+            root.AppendChild(getSceneTransitionNode());
+            root.AppendChild(getBackgroundSceneNode());
+            root.AppendChild(getForegroundSceneNode());
+
+            foreach(Scene scene in sceneList){
+                scene.setXMLDocumentRoot(ref _xmlDoc);
+                _xmlDoc.DocumentElement.AppendChild(scene.getXMLTree());
+            }
+            return _xmlDoc;
+        }
+
+        public List<SceneObject> BackgroundSceneObjectList
+        {
+            get { return _backgroundSceneObjectList; }
+            set { _backgroundSceneObjectList = value; }
+        }
+
+        public int ProjectHeight
+        {
+            get { return _projectHeight; }
+            set { _projectHeight = value; }
+        }
+
+        public int ProjektWidth
+        {
+            get { return _projektWidth; }
+            set { _projektWidth = value; }
+        }
+
+        public string Id
+        {
+            get { return _id; }
+            set { _id = value; }
+        }
+
+        public int BackgroundColor
+        {
+            get { return _backgroundColor; }
+            set { _backgroundColor = value; }
+        }
+
+        public void ConvertToYoobaUnits(int width, int height)
+        {
+            foreach(Scene scene in this.sceneList)
+                foreach (SceneObject sceneObject in scene.SceneObjectList)
+                    sceneObject.ConvertToYoobaUnits(width, height);
+
+            foreach (SceneObject sceneObject in BackgroundSceneObjectList)
+                sceneObject.ConvertToYoobaUnits(width, height);
+
+        }
+    }
+}

+ 107 - 0
PPTXMLParser/Program.cs

@@ -0,0 +1,107 @@
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO;
+using System.IO.Compression;
+using System.Web;
+using System.Drawing;
+using TEAMModelOS.SDK.Helper.Common.ColorHelper;
+
+namespace ConsoleApplication
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+
+
+            ColorConverter converter = new ColorConverter();
+            Color color4 = Color.FromArgb(255, 192, 0);
+            Console.WriteLine(converter.SetLuminanceOff(converter.SetLuminanceMod(color4, 20000), 80000));
+            for (int i = 0; i <= 10; i++)
+            {
+                //converter.SetTint(color4, i * 10000);
+               // Color color5 = ColorHelper.GetShadeOrTintColor(color4, i * 10000, "Tint");
+                //Color color6 = ColorHelper.GetShadeOrTintColor(color4, i * 10000, "Shade");
+               // Color color6 = ColorHelper.applyTint(color4, i * 10000);
+                //Color color6 = ColorHelper.applyShade(color4, i * 10000);
+               // Console.WriteLine(ColorTranslator.ToHtml(color5) +" "+ converter.SetTint(color4, i * 10000));
+            }
+
+            var watch = Stopwatch.StartNew();
+
+            string originalPath = @"C:\Users\ex1\downloads\Presentation2.pptx";
+
+            //Get's the pptx name
+            string originalFileName = originalPath.Substring(originalPath.LastIndexOf('\\') + 1);
+
+            string path = @"C:\Users\ex1\desktop\randomStuffNotANYHAVEBOfDY12723489";
+
+            //Image folder location
+            string imagesPath = @"C:\Users\ex1\Desktop\" + originalFileName.Split('.')[0] + "_img";
+
+            File.Copy(originalPath, path + ".pptx");
+
+            //Change to .zip
+            FileInfo f1 = new FileInfo(path + ".pptx");
+            f1.MoveTo(Path.ChangeExtension(path, ".zip"));
+
+            if(!Directory.Exists(imagesPath)){
+                DirectoryInfo di = Directory.CreateDirectory(imagesPath);
+            }
+
+            //Open zip file
+            using (ZipArchive zip = ZipFile.Open(path + ".zip", ZipArchiveMode.Update)) {
+                
+                foreach (ZipArchiveEntry entry in zip.Entries)
+                {
+                    if (entry.FullName.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase) || (entry.FullName.EndsWith(".png", StringComparison.OrdinalIgnoreCase)))
+                    {
+                        if (Directory.Exists(imagesPath))
+                        {
+                            string[] fileEntries = Directory.GetFiles(imagesPath);
+                            int count = 0;
+                            bool exists = false;
+
+                            while (count < fileEntries.Length)
+                            {
+                                string last = fileEntries[count].Substring(fileEntries[count].LastIndexOf('\\') + 1);
+                                if (last == entry.Name.ToString())
+                                {
+                                    exists = true;
+                                    break;
+                                }
+                                count++;
+                            }
+
+                            if (!exists)
+                                entry.ExtractToFile(Path.Combine(imagesPath, entry.Name));
+
+                        }
+                    }
+                    
+                }
+
+            }
+
+            //Change back to .pptx
+            FileInfo f2 = new FileInfo(path + ".zip");
+            f2.MoveTo(Path.ChangeExtension(path, ".pptx"));
+
+            //Do the read
+            OpenXMLReader reader = new OpenXMLReader(originalPath);
+            reader.read();
+            reader.PresentationObject.getXMLTree().Save(@"C:\Users\ex1\Desktop\out.xml");
+
+            //Delete file
+            File.Delete(path + ".pptx");
+
+            Console.WriteLine("\nCompilation time: " + (double)watch.ElapsedMilliseconds/1000 + "s");
+            Console.WriteLine("Press any key to exit...");
+            Console.ReadKey();
+        }
+    }
+}

+ 245 - 0
PPTXMLParser/Properties.cs

@@ -0,0 +1,245 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class Properties
+    {
+        private Boolean _flip,
+                        _formEnabled,
+                        _fx,
+                        _height,
+                        _isActionExectuer,
+                        _isCopyable,
+                        _isMovable,
+                        _isRemovable,
+                        _isSwapable,
+                        _opacity,
+                        _rotation,
+                        _text,
+                        _width,
+                        _xpos,
+                        _ypos;
+
+
+        public Properties()
+        {
+            _flip = false;
+            _formEnabled = false;
+            _fx = false;
+            _height = false;
+            _isActionExectuer = false;
+            _isCopyable = false;
+            _isMovable = false;
+            _isRemovable = false;
+            _isSwapable = false;
+            _opacity = false;
+            _rotation = false;
+            _text = false;
+            _width = false;
+            _xpos = false;
+            _ypos = false;
+        }
+
+        public Properties(  Boolean flip,
+                            Boolean formEnabled,
+                            Boolean fx,
+                            Boolean height,
+                            Boolean isActionExectuer,
+                            Boolean isCopyable,
+                            Boolean isMovable,
+                            Boolean isRemovable,
+                            Boolean isSwapable,
+                            Boolean opacity,
+                            Boolean rotation,
+                            Boolean text,
+                            Boolean width,
+                            Boolean xpos,
+                            Boolean ypos)
+        {
+            _flip = flip;
+            _formEnabled = formEnabled;
+            _fx = fx;
+            _height = height;
+            _isActionExectuer = isActionExectuer;
+            _isCopyable = isCopyable;
+            _isMovable = isMovable;
+            _isRemovable = isRemovable;
+            _isSwapable = isSwapable;
+            _opacity = opacity;
+            _rotation = rotation;
+            _text = text;
+            _width = width;
+            _xpos = xpos;
+            _ypos = ypos;
+        }
+
+        public Properties(SceneObject sceneObject)
+        {
+            Console.WriteLine();
+        }
+
+        public void setProperties(  Boolean flip,
+                                    Boolean formEnabled,
+                                    Boolean fx,
+                                    Boolean height,
+                                    Boolean isActionExectuer,
+                                    Boolean isCopyable,
+                                    Boolean isMovable,
+                                    Boolean isRemovable,
+                                    Boolean isSwapable,
+                                    Boolean opacity,
+                                    Boolean rotation,
+                                    Boolean text,
+                                    Boolean width,
+                                    Boolean xpos,
+                                    Boolean ypos)
+        {
+            _flip = flip;
+            _formEnabled = formEnabled;
+            _fx = fx;
+            _height = height;
+            _isActionExectuer = isActionExectuer;
+            _isCopyable = isCopyable;
+            _isMovable = isMovable;
+            _isRemovable = isRemovable;
+            _isSwapable = isSwapable;
+            _opacity = opacity;
+            _rotation = rotation;
+            _text = text;
+            _width = width;
+            _xpos = xpos;
+            _ypos = ypos;
+        }
+
+        public Boolean Ypos
+        {
+            get { return _ypos; }
+            set { _ypos = value; }
+        }
+
+        public Boolean Xpos
+        {
+            get { return _xpos; }
+            set { _xpos = value; }
+        }
+
+        public Boolean Width
+        {
+            get { return _width; }
+            set { _width = value; }
+        }
+
+        public Boolean Text
+        {
+            get { return _text; }
+            set { _text = value; }
+        }
+
+        public Boolean Rotation
+        {
+            get { return _rotation; }
+            set { _rotation = value; }
+        }
+
+        public Boolean Opacity
+        {
+            get { return _opacity; }
+            set { _opacity = value; }
+        }
+
+        public Boolean IsSwapable
+        {
+            get { return _isSwapable; }
+            set { _isSwapable = value; }
+        }
+
+        public Boolean IsRemovable
+        {
+            get { return _isRemovable; }
+            set { _isRemovable = value; }
+        }
+
+        public Boolean IsMovable
+        {
+            get { return _isMovable; }
+            set { _isMovable = value; }
+        }
+
+        public Boolean IsCopyable
+        {
+            get { return _isCopyable; }
+            set { _isCopyable = value; }
+        }
+
+        public Boolean IsActionExectuer
+        {
+            get { return _isActionExectuer; }
+            set { _isActionExectuer = value; }
+        }
+
+        public Boolean Height
+        {
+            get { return _height; }
+            set { _height = value; }
+        }
+
+        public Boolean Fx
+        {
+            get { return _fx; }
+            set { _fx = value; }
+        }
+
+        public Boolean FormEnabled
+        {
+            get { return _formEnabled; }
+            set { _formEnabled = value; }
+        }
+
+        public Boolean Flip
+        {
+            get { return _flip; }
+            set { _flip = value; }
+        }
+
+        public XmlElement getNode(XmlDocument root)
+        {
+            XmlElement node = root.CreateElement("properties");
+            node.InnerText = toString();
+
+            return node;
+        }
+        public string toString()
+        {
+            string output = "";
+
+            output += (_flip) ? "flip," : "";
+            output += (_formEnabled) ? "formEnabled," : "";
+            output += (_fx) ? "fx," : "";
+            output += (_height) ? "height," : "";
+            output += (_isActionExectuer) ? "isActionExectuer," : "";
+            output += (_isCopyable) ? "isCopyable," : "";
+            output += (_isMovable) ? "isMovable," : "";
+            output += (_isRemovable) ? "isRemovable," : "";
+            output += (_isSwapable) ? "isSwapable," : "";
+            output += (_opacity) ? "opacity," : "";
+            output += (_rotation) ? "rotation," : "";
+            output += (_text) ? "text," : "";
+            output += (_width) ? "width," : "";
+            output += (_xpos) ? "xpos," : "";
+            output += (_ypos) ? "ypos," : "";
+
+            if (output.Contains(","))
+                output = output.Remove(output.LastIndexOf(","));
+
+            return output;
+        }
+
+
+
+    }
+}

+ 135 - 0
PPTXMLParser/Scene.cs

@@ -0,0 +1,135 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class Scene
+    {
+        private Properties _properties;
+        private List<SceneObject> _sceneObjectList;
+        private string _sceneLabel, _name, _dataSourceID, _sceneType, _numNavIndex;
+        private bool _sceneIsScrollable, _enableTimeTracking;
+        private int _preloadType, _dataSourceRecord;
+
+        private string[] _scenAttributes = new string[] { "sceneLabel", "sceneIsScrollable", "numNavIndex", "dataSourceID", "dataSourceRecord",
+                                                          "name", "sceneType", "enableTimeTracking", "preloadType"};
+
+        private XmlDocument _doc;
+
+        public Scene(int sceneNumber)
+        {
+            /********ATTRIBUTES***********/
+            if (sceneNumber == 1)
+                _name = "SceneViewer1855";
+            else
+                _name = Guid.NewGuid().ToString();
+
+            _dataSourceID = "";
+            _dataSourceRecord = 1;
+            _sceneType = "blank";
+            _sceneLabel = "Scene " + sceneNumber.ToString();
+            _sceneIsScrollable = false;
+            _enableTimeTracking = false;
+            _preloadType = 0;
+            _numNavIndex = "";
+            /******END OF ATTRIBUTES******/
+
+            _properties = new Properties();
+            _properties.IsRemovable = true;
+            _properties.IsMovable = true;
+            _properties.FormEnabled = true;
+
+            _sceneObjectList = new List<SceneObject>();
+            
+        }
+
+        public void addSceneObject(SceneObject sceneObject)
+        {
+            //HÄR NÅGONSTANS VILL VI SORTERA EFTER Z-INDEX
+            _sceneObjectList.Add(sceneObject);
+        }
+
+        public void addSceneObjects(List<SceneObject> list)
+        {
+            foreach(SceneObject sceneObject in list)
+                _sceneObjectList.Add(sceneObject);
+        }
+
+        public void removeSceneObject(SceneObject sceneObject)
+        {
+            _sceneObjectList.Remove(sceneObject);
+        }
+
+        public XmlElement getXMLTree()
+        {
+            XmlElement _rootElement = _doc.CreateElement("scene");
+
+            foreach (string s in _scenAttributes)
+            {
+                XmlAttribute xmlAttr = _doc.CreateAttribute(s);
+
+                FieldInfo fieldInfo = GetType().GetField("_" + s, BindingFlags.NonPublic | BindingFlags.Instance);
+                if (fieldInfo != null)
+                    xmlAttr.Value = fieldInfo.GetValue(this).ToString();
+
+                _rootElement.Attributes.Append(xmlAttr);
+            }
+
+
+            _rootElement.AppendChild(_properties.getNode(_doc));
+
+            int z_index = 0;
+
+            foreach (SceneObject sceneObject in _sceneObjectList)
+            {
+                sceneObject.setZindex(z_index);
+                sceneObject.setXMLDocumentRoot(ref _doc);
+                _rootElement.AppendChild(sceneObject.getXMLTree());
+                z_index++;
+
+            }
+
+            return _rootElement;
+        }
+
+        private XmlElement getFormNode()
+        {
+            XmlElement form = _doc.CreateElement("form");
+
+            form.Attributes.Append(_doc.CreateAttribute("id"));
+            form.Attributes.Append(_doc.CreateAttribute("name"));
+            form.Attributes.Append(_doc.CreateAttribute("description"));
+
+            return form;
+        }
+
+        public void setXMLDocumentRoot(ref XmlDocument xmlDocument)
+        {
+            _doc = xmlDocument;
+        }
+
+        public List<SceneObject> SceneObjectList
+        {
+            get { return _sceneObjectList; }
+            set { _sceneObjectList = value; }
+        }
+        public Properties Properties
+        {
+            get { return _properties; }
+            set { _properties = value; }
+        }
+
+        public string SceneLabel
+        {
+            get { return _sceneLabel; }
+            set { _sceneLabel = value; }
+        }
+
+
+    }
+}

+ 22 - 0
PPTXMLParser/SceneObject.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public interface SceneObject
+    {
+        Properties getProperties();
+        void setProperties(Properties p);
+        XmlElement getXMLTree();
+        void setXMLDocumentRoot(ref XmlDocument xmldocument);
+        XmlDocument getXMLDocumentRoot();
+        void setObjectType(string objectType);
+        void ConvertToYoobaUnits(int width, int height);
+        object Clone();
+        void setZindex(int z);
+    }
+}

+ 64 - 0
PPTXMLParser/SceneObjectDecorator.cs

@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public abstract class SceneObjectDecorator : SceneObject
+    {
+        private SceneObject _sceneObject;
+
+        public SceneObjectDecorator(SceneObject so)
+        {
+            _sceneObject = so;
+        }
+
+        public virtual object Clone()
+        {
+            return _sceneObject.Clone();
+        }
+
+        public virtual XmlElement getXMLTree()
+        {
+            return _sceneObject.getXMLTree();
+        }
+
+        public virtual void ConvertToYoobaUnits(int width, int height)
+        {
+            _sceneObject.ConvertToYoobaUnits(width, height);
+        }
+
+        public virtual Properties getProperties()
+        {
+            return _sceneObject.getProperties();
+        }
+
+        public virtual void setProperties(Properties properties)
+        {
+            _sceneObject.setProperties(properties);
+        }
+
+        public virtual void setXMLDocumentRoot(ref XmlDocument xmldocument)
+        {
+            _sceneObject.setXMLDocumentRoot(ref xmldocument);
+        }
+
+        public virtual void setObjectType(string objectType)
+        {
+            _sceneObject.setObjectType(objectType);
+        }
+
+        public virtual void setZindex(int z)
+        {
+            _sceneObject.setZindex(z);
+        }
+
+        public virtual XmlDocument getXMLDocumentRoot()
+        {
+            return _sceneObject.getXMLDocumentRoot();
+        }
+    }
+}

+ 398 - 0
PPTXMLParser/ShapeObject.cs

@@ -0,0 +1,398 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class ShapeObject : SceneObjectDecorator
+    {
+        private float _alpha, _cornerRadius, _fillAlpha, _fillAlpha1, _fillAlpha2, _gradientAngle, _rotation, _rotationX, _rotationY, _rotationZ, _scaleZ;
+
+        private int _lineAlpha, _lineSize, _x, _y, _z, _points, _radius;
+
+        private Boolean _cacheAsBitmap, _fillEnable, _lineEnabled, _visible;
+        private string _fillType, _gradientType, _fillColor, _lineColor, _fillColor1, _fillColor2;
+
+        private float[] _gradientAlphas;
+        private string[] _gradientFills;
+
+        private string[] _attributes = new string[24]{   "alpha", "cacheAsBitmap", "cornerRadius", "gradientAngle", "gradientType", "fillAlpha", "fillColor",
+                                                         "fillEnable", "fillType", "lineAlpha", "lineColor", "lineEnabled", "lineSize", "points", "radius",
+                                                         "rotation", "rotationX", "rotationY", "rotationZ", "scaleZ", "visible", "x",
+                                                         "y", "z"};
+
+        private List<String> _shapeObjectAccessorChild = new List<string>();
+        private List<XmlElement> _accessorChildList;
+        private Properties _properties;
+
+        public enum shape_type{
+            Rectangle,
+            Circle,
+            Polygon
+        }
+
+        public ShapeObject(SceneObject sceneobject, shape_type shapeType) : base(sceneobject) 
+        {
+            _shapeObjectAccessorChild.AddRange(_attributes);
+            
+            string objectType = "";
+
+            switch (shapeType)
+            {
+                case shape_type.Rectangle:
+                    objectType = "com.yooba.shapes.RoundedRectangleShape";
+                    _shapeObjectAccessorChild.Remove("radius");
+                break;
+                case shape_type.Circle:
+                    objectType = "com.yooba.shapes.CircleShape";
+                    _shapeObjectAccessorChild.Remove("cornerRadius");
+                break;
+                case shape_type.Polygon:
+                    objectType = "com.yooba.shapes.PolygonShape";
+                    _shapeObjectAccessorChild.Remove("radius");
+                    _shapeObjectAccessorChild.Remove("cornerRadius");
+                break;
+
+            }
+
+            sceneobject.setObjectType(objectType);
+            _accessorChildList = new List<XmlElement>();
+
+            _alpha = 1;
+            _cacheAsBitmap = false;
+            _cornerRadius = 0;
+            _gradientAngle = 90;
+            _gradientType = "linear";
+            _fillAlpha = 100000;
+            _fillAlpha1 = 100000;
+            _fillAlpha2 = 100000;
+            _fillColor = "16743690";
+            _fillEnable = true;
+            _fillType = "solid";
+            _lineAlpha = 1;
+            _lineColor = "6426397";
+            _lineEnabled = false;
+            _lineSize = 0;
+            _points = 3;
+            _radius = 0;
+            _rotation = 0;
+            _rotationX = 0;
+            _rotationY = 0;
+            _rotationZ = 0;
+            _scaleZ = 1;
+            _visible = true;
+            _x = 0;
+            _y = 0;
+            _z = 0;
+            _gradientAlphas = new float[2];
+            _gradientAlphas[0] = 100000;
+            _gradientAlphas[1] = 100000;
+            _gradientFills = new string[2];
+
+            _fillColor1 = _fillColor;
+            _fillColor2 = "10834182";
+
+            _properties = new Properties(true,false,true,true,true,true,true,true,false,true,true,false,true,true,true);
+        }
+
+        public override XmlElement getXMLTree()
+        {
+
+            XmlElement parent = base.getXMLTree();
+
+            parent.AppendChild(Properties.getNode(getXMLDocumentRoot()));
+
+            XmlElement acce = getXMLDocumentRoot().CreateElement("accessors");
+
+            foreach (string s in _shapeObjectAccessorChild)
+            {
+                XmlElement xmlChild = getXMLDocumentRoot().CreateElement(s);
+
+                FieldInfo fieldInfo = GetType().GetField("_" + s, BindingFlags.NonPublic | BindingFlags.Instance);
+                if (fieldInfo != null)
+                    xmlChild.InnerText = fieldInfo.GetValue(this).ToString().Replace(",",".").ToLower();
+
+                acce.AppendChild(xmlChild);
+            }
+
+            XmlElement gradientColor = getXMLDocumentRoot().CreateElement("gradientFills");
+            gradientColor.InnerText = _fillColor1.ToString() + ", " + _fillColor2.ToString();
+            XmlElement gradientAlpha = getXMLDocumentRoot().CreateElement("gradientAlphas");
+            gradientAlpha.InnerText = _fillAlpha1.ToString().Replace(",", ".") + ", " + _fillAlpha2.ToString().Replace(",", ".");
+
+            acce.AppendChild(gradientColor);
+            acce.AppendChild(gradientAlpha);
+
+            parent.AppendChild(acce);
+
+            return parent;
+            
+        }
+
+        public override void ConvertToYoobaUnits(int width, int height)
+        {
+
+            base.ConvertToYoobaUnits(width, height);
+            if (_fillType.Equals("solid"))
+            {
+                _fillColor = getColorAsInteger(_fillColor).ToString();
+                _fillAlpha /= 100000;
+            }
+
+            if (_fillType.Equals("gradient"))
+            {
+
+                _fillColor = getColorAsInteger(_fillColor1).ToString();
+
+                _fillAlpha1 /= 100000;
+                _fillAlpha2 /= 100000;
+
+                _fillColor1 = _fillColor;
+                _fillColor2 = getColorAsInteger(_fillColor2).ToString();
+                
+                _gradientAngle /= 60000;
+
+            }
+
+            _lineSize = (int) Math.Round((double)_lineSize / 12700);
+
+            if (_lineSize <= 0)
+                _lineEnabled = false;
+            else
+                _lineEnabled = true;
+
+            _lineColor = getColorAsInteger(_lineColor).ToString();
+            _cornerRadius = (float) Math.Round((_cornerRadius / 100000) * 128 * 4);
+
+            _rotation /= 60000;
+            
+        }
+
+        public override XmlDocument getXMLDocumentRoot()
+        {
+            return base.getXMLDocumentRoot();
+        }
+
+        public override void setXMLDocumentRoot(ref XmlDocument xmldocument)
+        {
+            base.setXMLDocumentRoot(ref xmldocument);
+        }
+
+        public override Properties getProperties()
+        {
+            return base.getProperties();
+        }
+
+        public override void setProperties(Properties properties)
+        {
+            base.setProperties(properties);
+        }
+
+        public int getColorAsInteger(string color)
+        {
+            if (color != "")
+                return int.Parse(color, System.Globalization.NumberStyles.HexNumber);
+            else
+                return 0;
+        }
+
+        public float CornerRadius
+        {
+            get { return _cornerRadius; }
+            set { _cornerRadius = value; }
+        }
+
+        public float ScaleZ
+        {
+            get { return _scaleZ; }
+            set { _scaleZ = value; }
+        }
+
+        public string FillColor2
+        {
+            get { return _fillColor2; }
+            set { _fillColor2 = value; }
+        }
+
+        public string FillColor1
+        {
+            get { return _fillColor1; }
+            set { _fillColor1 = value; }
+        }
+
+        public float RotationZ
+        {
+            get { return _rotationZ; }
+            set { _rotationZ = value; }
+        }
+
+        public float RotationY
+        {
+            get { return _rotationY; }
+            set { _rotationY = value; }
+        }
+
+        public float RotationX
+        {
+            get { return _rotationX; }
+            set { _rotationX = value; }
+        }
+
+        public float Rotation
+        {
+            get { return _rotation; }
+            set { _rotation = value; }
+        }
+
+        public float GradientAngle
+        {
+            get { return _gradientAngle; }
+            set { _gradientAngle = value; }
+        }
+        public float FillAlpha
+        {
+            get { return _fillAlpha; }
+            set { _fillAlpha = value; }
+        }
+        public float Alpha
+        {
+            get { return _alpha; }
+            set { _alpha = value; }
+        }
+
+        public float[] GradientAlphas
+        {
+            get { return _gradientAlphas; }
+            set { _gradientAlphas = value; }
+        }
+
+        public int Z
+        {
+            get { return _z; }
+            set { _z = value; }
+        }
+
+        public int Y
+        {
+            get { return _y; }
+            set { _y = value; }
+        }
+
+        public int X
+        {
+            get { return _x; }
+            set { _x = value; }
+        }
+
+        public int LineSize
+        {
+            get { return _lineSize; }
+            set { _lineSize = value; }
+        }
+
+        public string LineColor
+        {
+            get { return _lineColor; }
+            set { _lineColor = value; }
+        }
+
+        public int LineAlpha
+        {
+            get { return _lineAlpha; }
+            set { _lineAlpha = value; }
+        }
+
+        public string FillColor
+        {
+            get { return _fillColor; }
+            set { _fillColor = value; }
+        }
+
+        public Boolean Visible
+        {
+            get { return _visible; }
+            set { _visible = value; }
+        }
+
+        public Boolean LineEnabled
+        {
+            get { return _lineEnabled; }
+            set { _lineEnabled = value; }
+        }
+
+        public Boolean FillEnable
+        {
+            get { return _fillEnable; }
+            set { _fillEnable = value; }
+        }
+
+        public Boolean CacheAsBitmap
+        {
+            get { return _cacheAsBitmap; }
+            set { _cacheAsBitmap = value; }
+        }
+
+        public string GradientType
+        {
+            get { return _gradientType; }
+            set { _gradientType = value; }
+        }
+
+        public string FillType
+        {
+            get { return _fillType; }
+            set { _fillType = value; }
+        }
+
+        public string[] GradientFills
+        {
+            get { return _gradientFills; }
+            set { _gradientFills = value; }
+        }
+
+        public int Radius
+        {
+            get { return _radius; }
+            set { _radius = value; }
+        }
+
+        public int Points
+        {
+            get { return _points; }
+            set { _points = value; }
+        }
+
+        public float FillAlpha2
+        {
+            get { return _fillAlpha2; }
+            set { _fillAlpha2 = value; }
+        }
+
+        public float FillAlpha1
+        {
+            get { return _fillAlpha1; }
+            set { _fillAlpha1 = value; }
+        }
+
+        public Properties Properties
+        {
+            get { return _properties; }
+            set { _properties = value; }
+        }
+
+        internal void setAttributes(TableStyle tableStyle)
+        {
+            if(tableStyle==null)
+                return;
+
+            FillAlpha = (tableStyle.FillAlpha != 0) ? tableStyle.FillAlpha : FillAlpha;
+            FillColor = (tableStyle.FillColor != "") ? tableStyle.FillColor : FillColor;
+            LineSize = (tableStyle.LineSize != 0) ? tableStyle.LineSize : LineSize;
+            LineColor = (tableStyle.LineColor != "") ? tableStyle.LineColor : LineColor;
+        }
+    }
+}

+ 308 - 0
PPTXMLParser/SimpleSceneObject.cs

@@ -0,0 +1,308 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class SimpleSceneObject : SceneObject
+    {
+        private float _alpha, _height, _width, _rotation;
+
+        //BoundsX and BoundsY corresponds to positions from left top corner
+        //ClipHeight and ClipWidth are the height and width of the scene object
+        private int _boundsX, _boundsY, _clipHeight, _clipWidth, _flip, _z;
+
+        private string _clipID, _type, _name;
+        private Boolean _hidden, _isLine;
+
+
+        private XmlDocument _doc;
+        private Properties _properties;
+        private OptimizedClip _optimizedClip;
+
+        private string[] _attributes = new string[14]{  "type", "clipID","z", "boundsX", "boundsY", "clipWidth", "clipHeight",
+                                                        "width","height", "rotation", "alpha","name", "hidden", "flip"};
+        private SimpleSceneObject simpleSceneObjectShape;
+
+        public SimpleSceneObject()
+        {
+            _clipID = Guid.NewGuid().ToString();
+            _name = Guid.NewGuid().ToString();
+            _doc = new XmlDocument();
+            _alpha = 1;
+            _hidden = false;
+            _width = 0;
+            _height = 0;
+            _z = 0;
+            _flip = 0;
+            _properties = new Properties();
+            _optimizedClip = new OptimizedClip();
+            _isLine = false;
+
+            _rotation = 0;
+            _z = 0;
+            _type = "";
+            _boundsX = 0;
+            _boundsY = 0;
+            _clipHeight = 0;
+            _clipWidth = 0;
+        }
+
+        public SimpleSceneObject(SimpleSceneObject s)
+        {
+            _clipID = s.ClipID;
+            _name = s.Name;
+            _doc = new XmlDocument();
+            _alpha = s.Alpha;
+            _hidden = s.Hidden;
+            _width = s.Width;
+            _height = s.Height;
+            _z = s.Z;
+            _flip = 0;
+            _properties = new Properties();
+            _optimizedClip = new OptimizedClip();
+
+            _rotation = s.Rotation;
+            _z = s.Z;
+            _type = s.Type;
+            _isLine = s.IsLine;
+            _boundsX = s.BoundsX;
+            _boundsY = s.BoundsY;
+            _clipHeight = s.ClipHeight;
+            _clipWidth = s.ClipWidth;
+        }
+
+        public object Clone()
+        {
+            return this;
+        }
+
+        public void ConvertToYoobaUnits(int width, int height)
+        {
+            //_boundsX, _boundsY, _clipHeight, _clipWidth,
+            int pptWidth = width, pptHeight = height, yoobaWidth = 1024, yoobaHeight = 768;
+
+            yoobaWidth = (int)Math.Round(pptWidth * ((double)yoobaHeight / (double)pptHeight));
+
+            Console.WriteLine(yoobaWidth + ":" + yoobaHeight);
+
+            float scaleWidth = (float)yoobaWidth / (float)pptWidth, scaleHeight = (float)yoobaHeight / (float)pptHeight;
+
+            _boundsX = (int) Math.Round(_boundsX * scaleWidth);
+            _boundsY = (int) Math.Round(_boundsY * scaleHeight);
+            _clipWidth = (int) Math.Round(_clipWidth * scaleWidth);
+            _clipHeight = (int) Math.Round(_clipHeight * scaleHeight);
+
+
+            //rotation
+            if(!IsLine)
+                handleTranslationWhenRotate();
+
+            _rotation = _rotation / 60000;
+        }
+
+        public void setZindex(int z)
+        {
+            _z = z;
+        }
+
+        public void handleTranslationWhenRotate()
+        {
+            double rotationInDegrees = (double)_rotation / 60000;
+
+            //Handle negative and too large angles
+            while (rotationInDegrees < 0)
+                rotationInDegrees += 360;
+
+            while (rotationInDegrees > 360)
+                rotationInDegrees -= 360;
+
+            double tempRot = 0;
+
+            //Handle the 4 different cases
+            if (rotationInDegrees >= 0 && rotationInDegrees <= 90)
+                tempRot = rotationInDegrees;
+            else if (rotationInDegrees > 90 && rotationInDegrees <= 180)
+                tempRot = 180 - rotationInDegrees;
+            else if (rotationInDegrees > 180 && rotationInDegrees <= 270)
+                tempRot = rotationInDegrees - 180;
+            else if (rotationInDegrees > 270 && rotationInDegrees < 360)
+                tempRot = 360 - rotationInDegrees;
+
+            //Store the Center of mass for the object before the rotation
+            double COM_X = _boundsX + _clipWidth / 2,
+                   COM_Y = _boundsY + _clipHeight / 2;
+
+            //Calculate the top left position for the rotated object, stored in newX and newY
+            double newAngle = 90 - tempRot;
+            double newAngleInRadians = newAngle * Math.PI / 180;
+            double stepLeft = Math.Cos(newAngleInRadians) * ClipHeight;
+            double newX = stepLeft + BoundsX;
+            double newY = BoundsY;
+
+            //Calculate the center of mass position for the rotated object
+            newX += Math.Sin(newAngleInRadians) * ClipWidth / 2;
+            newY += Math.Cos(newAngleInRadians) * ClipWidth / 2;
+            newX += Math.Sin(newAngleInRadians - Math.PI / 2) * ClipHeight / 2;
+            newY += Math.Cos(newAngleInRadians - Math.PI / 2) * ClipHeight / 2;
+
+            //Calculate the difference in COM
+            double diffX = newX - COM_X;
+            double diffY = newY - COM_Y;
+
+            //Subtract the diffrence from the original bounds
+            _boundsX -= (int)Math.Round(diffX);
+            _boundsY -= (int)Math.Round(diffY);
+        }
+
+        public Properties getProperties()
+        {
+            return _properties;
+        }
+
+        public void setProperties(Properties properties)
+        {
+            _properties = properties;
+        }
+
+        public void setXMLDocumentRoot(ref XmlDocument xmldocument)
+        {
+            _doc = xmldocument;
+        }
+
+        public void setObjectType(string objectType)
+        {
+            _type = objectType;
+        }
+
+        public XmlDocument getXMLDocumentRoot()
+        {
+            return _doc;
+        }
+
+        public XmlElement getXMLTree()
+        {
+
+            //generateAttributes();
+            XmlElement xmlElement = _doc.CreateElement("sceneObject");
+
+            xmlElement.AppendChild(_optimizedClip.getOptimizedClipNode(_doc));
+            xmlElement.AppendChild(getDsColNode());
+
+            foreach (string s in _attributes)
+            {
+                XmlAttribute xmlAttr = _doc.CreateAttribute(s);
+
+                FieldInfo fieldInfo = GetType().GetField("_" + s, BindingFlags.NonPublic | BindingFlags.Instance);
+                if (fieldInfo != null)
+                    xmlAttr.Value = fieldInfo.GetValue(this).ToString();
+
+                xmlElement.Attributes.Append(xmlAttr);
+            }
+
+            _doc.DocumentElement.AppendChild(xmlElement);
+
+            return xmlElement;
+        }
+
+        public XmlElement getDsColNode()
+        {
+            XmlElement dsCol = getXMLDocumentRoot().CreateElement("dsCol");
+            XmlCDataSection cData = getXMLDocumentRoot().CreateCDataSection("");
+
+            dsCol.AppendChild(cData);
+
+            return dsCol;
+        }
+
+        public Boolean IsLine
+        {
+            get { return _isLine; }
+            set { _isLine = value; }
+        }
+
+        public int Z
+        {
+            get { return _z; }
+            set { _z = value; }
+        }
+
+        public float Rotation
+        {
+            get { return _rotation; }
+            set { _rotation = value; }
+        }
+
+        public float Width
+        {
+            get { return _width; }
+            set { _width = value; }
+        }
+
+        public float Height
+        {
+            get { return _height; }
+            set { _height = value; }
+        }
+
+        public float Alpha
+        {
+            get { return _alpha; }
+            set { _alpha = value; }
+        }
+
+        public int ClipWidth
+        {
+            get { return _clipWidth; }
+            set { _clipWidth = value; }
+        }
+
+        public int ClipHeight
+        {
+            get { return _clipHeight; }
+            set { _clipHeight = value; }
+        }
+
+        public int BoundsY
+        {
+            get { return _boundsY; }
+            set { _boundsY = value; }
+        }
+
+        public int BoundsX
+        {
+            get { return _boundsX; }
+            set { _boundsX = value; }
+        }
+
+        public string Type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        public string Name
+        {
+            get { return _name; }
+            set { _name = value; }
+        }
+
+        public string ClipID
+        {
+            get { return _clipID; }
+            set { _clipID = value; }
+        }
+
+        public Boolean Hidden
+        {
+            get { return _hidden; }
+            set { _hidden = value; }
+        }
+
+        
+    }
+}

+ 82 - 0
PPTXMLParser/SolidBackground.cs

@@ -0,0 +1,82 @@
+using System;
+using System.Drawing;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class SolidBackground
+    {
+        private string _bgColor, _backgroundType, _fillType;
+        private int _alpha, _tint, _luminanceMod, _saturationMod;
+
+        private Color _color;
+
+        public SolidBackground()
+        {
+            _bgColor = "ffffff";
+            _alpha = 0;
+            _fillType = "solid";
+            _backgroundType = "linear";
+            _color = new Color();
+        }
+
+        public string BgColor
+        {
+            get { return _bgColor; }
+            set 
+            { 
+                _bgColor = value;
+                _color = ColorTranslator.FromHtml("#"+_bgColor);
+            }
+        }
+
+        public int Alpha
+        {
+            get { return _alpha; }
+            set { _alpha = value; }
+        }
+        public string BackgroundType
+        {
+            get { return _backgroundType; }
+            set { _backgroundType = value; }
+        }
+
+        public int SaturationMod
+        {
+            get { return _saturationMod; }
+            set { _saturationMod = value; }
+        }
+
+        public int LuminanceMod
+        {
+            get { return _luminanceMod; }
+            set { _luminanceMod = value; }
+        }
+
+        public int Tint
+        {
+            get { return _tint; }
+            set { _tint = value; }
+        }
+        public Color Color
+        {
+            get { return _color; }
+            set { _color = value; }
+        }
+
+        public string FillType
+        { 
+            get{ return _fillType; }
+            set { _fillType = value; } 
+        }
+
+        public string toString()
+        {
+            return "BackgroundColor: " + _bgColor + "\nAlpha: " + _alpha + "\nType: " + _backgroundType +
+                "\nTint: " + _tint + "\nLumMod: " + _luminanceMod + "\nSatMod: " + _saturationMod + "\n";
+        }
+    }
+}

+ 101 - 0
PPTXMLParser/TableStyle.cs

@@ -0,0 +1,101 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    class TableStyle
+    {
+        int _lineSize, _fontSize, _fillAlpha;
+        string _fontColor, _lineColor, _fillColor, _type;
+        bool _bold, _italic, _underline;
+
+        public TableStyle()
+        {
+            _bold = false;
+            _italic = false;
+            _underline = false;
+
+            _lineSize = 0;
+            _fontSize = 0;
+            _fillAlpha = 0;
+
+            _fontColor = "";
+            _lineColor = "";
+            _fillColor = "";
+            _type = "";
+        }
+
+        public override string ToString()
+        {
+ 	        return "Type: " + _type + "\n" +
+                   "Fill: " + _fillColor + ", " + _fillAlpha + "\n" +
+                   "Line: " + _lineColor + ", " + _lineSize + "\n" +
+                   "Font: " + _fontColor + ", " + _fontSize;
+        }
+
+        public bool Underline
+        {
+            get { return _underline; }
+            set { _underline = value; }
+        }
+
+        public bool Italic
+        {
+            get { return _italic; }
+            set { _italic = value; }
+        }
+
+        public bool Bold
+        {
+            get { return _bold; }
+            set { _bold = value; }
+        }
+
+        public string Type
+        {
+            get { return _type; }
+            set { _type = value; }
+        }
+
+        public string FillColor
+        {
+            get { return _fillColor; }
+            set { _fillColor = value; }
+        }
+
+        public string LineColor
+        {
+            get { return _lineColor; }
+            set { _lineColor = value; }
+        }
+
+        public string FontColor
+        {
+            get { return _fontColor; }
+            set { _fontColor = value; }
+        }
+        public int FillAlpha
+        {
+            get { return _fillAlpha; }
+            set { _fillAlpha = value; }
+        }
+
+        public int FontSize
+        {
+            get { return _fontSize; }
+            set { _fontSize = value; }
+        }
+
+        public int LineSize
+        {
+            get { return _lineSize; }
+            set { _lineSize = value; }
+        }
+        
+
+        
+    }
+}

+ 97 - 0
PPTXMLParser/TextFragment.cs

@@ -0,0 +1,97 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    class TextFragment
+    {
+        private String _text;
+        private int _x, _y, _styleId, _level, _breaks;
+        private XmlDocument _rootOfDocument;
+        private bool _newParagraph;
+
+        public int StyleId
+        {
+            get { return _styleId; }
+            set { _styleId = value; }
+        }
+
+        public TextFragment()
+        {
+            _text = "";
+            _x = 0;
+            _y = 0;
+            _newParagraph = false;
+            _breaks = 0;
+        }
+
+        public XmlElement getFragmentChild()
+        {
+            XmlElement f = _rootOfDocument.CreateElement("f");
+
+            XmlAttribute t_attr = _rootOfDocument.CreateAttribute("t");
+            t_attr.Value = _text;
+
+            XmlAttribute x_attr = _rootOfDocument.CreateAttribute("x");
+            x_attr.Value = _x.ToString();
+
+            XmlAttribute y_attr = _rootOfDocument.CreateAttribute("y");
+            y_attr.Value = _y.ToString();
+
+            XmlAttribute s_attr = _rootOfDocument.CreateAttribute("s");
+            s_attr.Value = _styleId.ToString();
+
+            f.Attributes.Append(t_attr);
+            f.Attributes.Append(x_attr);
+            f.Attributes.Append(y_attr);
+            f.Attributes.Append(s_attr);
+
+            return f;
+        }
+
+        public void setXMLDocumentRoot(ref XmlDocument rootOfDocument)
+        {
+            _rootOfDocument = rootOfDocument;
+        }
+
+        public int Y
+        {
+            get { return _y; }
+            set { _y = value; }
+        }
+
+        public int X
+        {
+            get { return _x; }
+            set { _x = value; }
+        }
+
+        public String Text
+        {
+            get { return _text; }
+            set { _text = value; }
+        }
+
+        public bool NewParagraph
+        {
+            get { return _newParagraph; }
+            set { _newParagraph = value; }
+        }
+
+        public int Level
+        {
+            get { return _level; }
+            set { _level = value; }
+        }
+
+        public int Breaks
+        {
+            get { return _breaks; }
+            set { _breaks = value; }
+        }
+    }
+}

+ 646 - 0
PPTXMLParser/TextObject.cs

@@ -0,0 +1,646 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class TextObject : SceneObjectDecorator
+    {
+        private string _align, _antiAlias, _font, _autosize, _color;
+        private List<TextStyle> _styleList;
+        private List<TextFragment> _fragmentsList;
+        private int _leading, _letterSpacing, _size;
+        private Boolean _bold, _italic, _underline, _selectable, _runningText, _useScroller;
+        private XmlDocument _doc;
+        private string[] _textObjectPropertiesAttributes = new string[14]{   "font", "align", "color", "italic", "bold", "underline", "size", "runningText",
+                                                                             "autosize", "leading", "letterSpacing", "antiAlias", "useScroller", "selectable"};
+        private SimpleSceneObject _simpleSceneObject;
+
+        public TextObject(SimpleSceneObject sceneobject) : base(sceneobject) 
+        {
+            _simpleSceneObject = sceneobject;
+                       
+            _align = "left";
+            _antiAlias = "normal";
+            _font = "Arial";
+            _autosize = "none";
+            _color = "000000";
+            _leading = 0;
+            _letterSpacing = 0;
+            _size = 20;
+            _bold = false;
+            _italic = false;
+            _underline = false;
+            _selectable = false;
+            _runningText = true;
+            _useScroller = false;
+
+            string objectType = "com.customObjects.TextObject";
+            _styleList = new List<TextStyle>();
+            _fragmentsList = new List<TextFragment>();
+
+            setProperties(new Properties(true, false, true, true, true, true, true, true,
+                                         false, true, true, true, true, true, true));
+
+            sceneobject.setObjectType(objectType);
+        }
+
+        public override object Clone()
+        {
+            SimpleSceneObject simpleSceneObject = _simpleSceneObject;
+
+            TextObject textObject = new TextObject(simpleSceneObject);
+
+            textObject.Align = _align;
+            textObject.AntiAlias = _antiAlias;
+            textObject.Font = _font;
+            textObject.Autosize = _autosize;
+            textObject.Color = _color;
+            textObject.Leading = _leading;
+            textObject.LetterSpacing = _letterSpacing;
+            textObject.Size = _size;
+            textObject.Bold = _bold;
+            textObject.Italic = _italic;
+            textObject.Underline = _underline;
+            textObject.Selectable = _selectable;
+            textObject.RunningText = _runningText;
+            textObject.UseScroller = _useScroller;
+
+            string objectType = "com.customObjects.TextObject";
+            _styleList = new List<TextStyle>();
+            _fragmentsList = new List<TextFragment>();
+
+            setProperties(new Properties(true, false, true, true, true, true, true, true,
+                                         false, true, true, true, true, true, true));
+
+            textObject.setObjectType(objectType);
+
+            return textObject;
+        }
+
+        public TextObject setClipWidth(int clipWidth)
+        {
+            _simpleSceneObject.ClipWidth = clipWidth;
+            return (TextObject)Clone();
+        }
+
+        public void addToStyleList(TextStyle textStyle)
+        {
+            bool isEqual = false;
+
+            if (_styleList.Count == 0)
+                _styleList.Add(textStyle);
+            else
+            {
+                foreach (TextStyle item in _styleList)
+                    if (textStyle.isEqual(item))
+                    {
+                        isEqual = true;
+                        break;
+                    }
+                
+                if (!isEqual)
+                    _styleList.Add(textStyle);
+            }
+            
+        }
+
+        public XmlElement getTextObjectPropertiesNode()
+        {
+            XmlElement textObjectPropNode = getXMLDocumentRoot().CreateElement("textObjectProperties");
+
+            //XmlElement stylesNode = getStylesNode();
+            //XmlElement fragmentNode = getFragmentsNode();
+            //XmlElement textNode = getTextNode();
+            //textObjectPropNode.AppendChild(textNode);
+
+            XmlElement textNode = getXMLDocumentRoot().CreateElement("text");
+            textNode.InnerText = getHTML();
+            textObjectPropNode.AppendChild(textNode);
+
+            _doc = base.getXMLDocumentRoot();
+
+            foreach (string s in _textObjectPropertiesAttributes)
+            {
+                XmlAttribute xmlAttr = _doc.CreateAttribute(s);
+
+                FieldInfo fieldInfo = GetType().GetField("_" + s, BindingFlags.NonPublic | BindingFlags.Instance);
+                if (fieldInfo!=null)
+                    xmlAttr.Value = fieldInfo.GetValue(this).ToString().ToLower();
+
+                textObjectPropNode.Attributes.Append(xmlAttr);
+            }
+
+            //textObjectPropNode.AppendChild(stylesNode);
+            //textObjectPropNode.AppendChild(fragmentNode);
+
+            return textObjectPropNode;
+        }
+
+        public XmlElement getPropertiesNode()
+        {
+            string properties = getProperties().toString();
+            XmlElement prop = getXMLDocumentRoot().CreateElement("properties");
+            prop.InnerText = properties;
+
+            return prop;
+        }
+
+        public string getHTML()
+        {
+            string HTML = "";
+
+            HTML += "<TEXTFORMAT LEFTMARGIN=\"1\" RIGHTMARGIN=\"2\">";
+
+            TextStyle newStyle = new TextStyle(), oldStyle = new TextStyle();
+
+            bool bold = false, underline = false, italic = false;
+            int fontCount = 0;
+
+            foreach (TextFragment textFragment in _fragmentsList)
+            {
+                if (textFragment.NewParagraph)
+                    HTML += "<br>";
+
+                newStyle = StyleList[textFragment.StyleId];
+
+                //First fragment
+                if (_fragmentsList.IndexOf(textFragment) == 0)
+                {
+                    HTML += "<P ALIGN=\"" + newStyle.Alignment + "\">";
+
+                    fontCount++;
+                    HTML += "<FONT FACE=\"" + newStyle.Font + "\" SIZE=\"" + newStyle.FontSize + "\" COLOR=\"#" + newStyle.FontColor + "\" LETTERSPACING=\"0\" KERNING=\"1\">";
+                    
+                    if (newStyle.Bold)
+                    {
+                        HTML += "<B>";
+                        bold = true;
+                    }
+                    if (newStyle.Underline)
+                    {
+                        HTML += "<U>";
+                        underline = true;
+                    }
+                    if (newStyle.Italic)
+                    {
+                        HTML += "<I>";
+                        italic = true;
+                    }
+                     
+                    for (int i = 0; i < textFragment.Level; i++)
+                        HTML += "\t";
+
+                    HTML += textFragment.Text.Replace("<", "&#60;").Replace(">", "&#62;");
+
+                    oldStyle = newStyle;
+                    continue;
+                }
+
+                if (oldStyle != newStyle)
+                {
+                    if (oldStyle.Font != newStyle.Font ||
+                        oldStyle.FontColor != newStyle.FontColor ||
+                        oldStyle.FontSize != newStyle.FontSize ||
+                        oldStyle.Alignment != newStyle.Alignment)
+                    {
+                        if (oldStyle.Alignment != newStyle.Alignment)
+                        {
+                            for (int i = 0; i < fontCount; i++)
+                                HTML += "</FONT>";
+
+                            HTML += "</P>";
+                            HTML += "</TEXTFORMAT>";
+                            fontCount = 0;
+
+                            HTML += "<P ALIGN=\"" + newStyle.Alignment + "\">";
+
+                            fontCount++;
+                            HTML += "<FONT FACE=\"" + newStyle.Font + "\" SIZE=\"" + newStyle.FontSize + "\" COLOR=\"#" + newStyle.FontColor + "\" LETTERSPACING=\"0\" KERNING=\"1\">";
+                        }
+
+                        HTML += (bold) ? "</B>" : "";
+                        HTML += (underline) ? "</U>" : "";
+                        HTML += (italic) ? "</I>" : "";
+
+                        bold = false;
+                        underline = false;
+                        italic = false;
+
+                        fontCount++;
+
+                        HTML += "<FONT ";
+
+                        if (oldStyle.Font != newStyle.Font)
+                            HTML += "FACE=\"" + newStyle.Font + "\" ";
+                        if (oldStyle.FontSize != newStyle.FontSize)
+                            HTML += "SIZE=\"" + newStyle.FontSize + "\" ";
+                        if (oldStyle.FontColor != newStyle.FontColor)
+                            HTML += "COLOR=\"#" + newStyle.FontColor + "\" ";
+
+                        HTML += ">";
+
+                        if (newStyle.Bold)
+                        {
+                            HTML += "<B>";
+                            bold = true;
+                        }
+                        if (newStyle.Underline)
+                        {
+                            HTML += "<U>";
+                            underline = true;
+                        }
+                        if (newStyle.Italic)
+                        {
+                            HTML += "<I>";
+                            italic = true;
+                        }
+
+                        for (int i = 0; i < textFragment.Level; i++)
+                            HTML += "\t";
+
+                        HTML += textFragment.Text.Replace("<", "&#60;").Replace(">", "&#62;");
+                    }
+                    else
+                    {
+                        if (newStyle.Bold != bold)
+                        {
+                            HTML += (newStyle.Bold) ? "<B>" : "</B>";
+                            bold = (newStyle.Bold) ? true : false;
+                        }
+                        if (newStyle.Underline != underline)
+                        {
+                            HTML += (newStyle.Underline) ? "<U>" : "</U>";
+                            underline = (newStyle.Underline) ? true : false;
+                        }
+                        if (newStyle.Italic != italic)
+                        {
+                            HTML += (newStyle.Italic) ? "<I>" : "</I>";
+                            italic = (newStyle.Italic) ? true : false;
+                        }
+
+                        for (int i = 0; i < textFragment.Level; i++)
+                            HTML += "\t";
+
+                        HTML += textFragment.Text.Replace("<", "&#60;").Replace(">", "&#62;");
+                    }
+                }
+                else
+                {
+                    for (int i = 0; i < textFragment.Level; i++)
+                        HTML += "\t";
+
+                    HTML += textFragment.Text.Replace("<", "&#60;").Replace(">", "&#62;");
+                }
+
+                for (int i = 0; i < textFragment.Breaks; i++)
+                    HTML += "<br>";
+
+                oldStyle = newStyle;
+            }
+
+            HTML += (bold) ? "</B>" : "";
+            HTML += (underline) ? "</U>" : "";
+            HTML += (italic) ? "</I>" : "";
+
+            for (int i = 0; i < fontCount; i++)
+                HTML += "</FONT>";
+
+            HTML += "</P>";
+            HTML += "</TEXTFORMAT>";
+
+            return HTML;
+        }
+
+        public XmlElement getTextNode()
+        {
+            XmlElement textNode = getXMLDocumentRoot().CreateElement("text");
+            XmlElement textFormatNode = getXMLDocumentRoot().CreateElement("TEXTFORMAT");
+            XmlElement pNode = getPnode();
+
+            textFormatNode.AppendChild(pNode);
+            textNode.AppendChild(textFormatNode);
+
+            return textNode;
+        }
+
+        public XmlElement getPnode()
+        {
+            XmlElement pNode = getXMLDocumentRoot().CreateElement("P");
+            
+            List<XmlElement> fontList = new List<XmlElement>();
+            TextStyle old_style = new TextStyle();
+
+            for (int i = 0; i < _fragmentsList.Count; i++)
+            {
+                XmlElement temp = getXMLDocumentRoot().CreateElement("FONT");
+                TextStyle style = _styleList[_fragmentsList[i].StyleId];
+
+                if (i == 0)
+                {
+                    XmlAttribute font = getXMLDocumentRoot().CreateAttribute("FACE");
+                    font.Value = style.Font;
+                    XmlAttribute size = getXMLDocumentRoot().CreateAttribute("SIZE");
+                    size.Value = style.FontSize.ToString();
+                    XmlAttribute color = getXMLDocumentRoot().CreateAttribute("COLOR");
+                    color.Value = style.FontColor.ToString();
+                    temp.Attributes.Append(font);
+                    temp.Attributes.Append(size);
+                    temp.Attributes.Append(color);
+
+                    style.getTextNode(_fragmentsList[i].Text);
+
+                    temp.InnerText = _fragmentsList[i].Text;
+                    fontList.Add(temp);
+                    //pNode.AppendChild(temp);
+                    old_style = style;
+                    continue;
+                }
+
+                if (_fragmentsList[i].StyleId != _fragmentsList[i - 1].StyleId)
+                {
+                    string BIU = style.getTextNode(_fragmentsList[i].Text);
+                    if (old_style.FontColor != style.FontColor || !old_style.FontSize.Equals(style.FontSize) || !old_style.Font.Equals(style.Font))
+                    {
+
+                        if (!old_style.Font.Equals(style.Font))
+                        {
+                            XmlAttribute font = getXMLDocumentRoot().CreateAttribute("FACE");
+                            font.Value = style.Font;
+                            temp.Attributes.Append(font);
+                        }
+                        if (old_style.FontSize != style.FontSize)
+                        {
+                            XmlAttribute fontSize = getXMLDocumentRoot().CreateAttribute("SIZE");
+                            fontSize.Value = style.FontSize.ToString();
+                            temp.Attributes.Append(fontSize);
+                        }
+                        if (old_style.FontColor != style.FontColor)
+                        {
+                            XmlAttribute color = getXMLDocumentRoot().CreateAttribute("COLOR");
+                            color.Value = style.FontColor.ToString();
+                            temp.Attributes.Append(color);
+                        }
+
+                        temp.InnerText = BIU;
+                        fontList.Add(temp);
+
+                    }
+                    else
+                    {
+                        fontList[i - 1].InnerText += BIU;
+                    }
+                }
+
+
+                    old_style = style;
+            }
+
+            /*fontList.Reverse();
+
+            XmlElement fontRoot = getXMLDocumentRoot().CreateElement("TEST");
+            XmlElement oldItem = new XmlElement();
+
+            int counter = 0;
+
+            foreach (XmlElement item in fontList)
+            {
+                XmlElement temp = item;
+
+                if (counter == 0)
+                {
+                    fontRoot = temp;
+                    temp.AppendChild(oldItem);
+                    oldItem = temp;
+                    continue;
+                }
+                else
+                {
+                    temp.AppendChild(oldItem);
+                    fontRoot = temp;
+                    oldItem = temp;
+                }
+                
+            }*/
+
+            //pNode.AppendChild(fontRoot);
+
+            return pNode;
+        }
+
+        public XmlElement getFragmentsNode()
+        {
+            XmlElement fragments = getXMLDocumentRoot().CreateElement("fragments");
+
+            foreach (TextFragment tFragment in _fragmentsList)
+            {
+                XmlElement f = tFragment.getFragmentChild();
+                fragments.AppendChild(f);
+            }
+
+            return fragments;
+        }
+
+        public XmlElement getStylesNode()
+        {
+            XmlElement styles = getXMLDocumentRoot().CreateElement("styles");
+
+            foreach (TextStyle tStyle in _styleList)
+            {
+                XmlElement s = tStyle.getStylesChild();
+                styles.AppendChild(s);
+            }
+
+            return styles;
+        }
+
+        public override XmlElement getXMLTree()
+        {
+            XmlElement parent = base.getXMLTree();
+            XmlElement properties = getPropertiesNode();
+            XmlElement acce = getXMLDocumentRoot().CreateElement("accessors");
+            XmlElement textObjectProps = getTextObjectPropertiesNode();
+
+            acce.AppendChild(textObjectProps);
+            parent.AppendChild(properties);
+            parent.AppendChild(acce);
+
+            return parent;
+        }
+
+        public override XmlDocument getXMLDocumentRoot()
+        {
+            return base.getXMLDocumentRoot();
+        }
+
+        public override void setXMLDocumentRoot(ref XmlDocument xmldocument)
+        {
+            base.setXMLDocumentRoot(ref xmldocument);
+        }
+
+        public override Properties getProperties()
+        {
+            return base.getProperties();
+        }
+
+        public override void setProperties(Properties properties)
+        {
+            base.setProperties(properties);
+        }
+
+        public override void ConvertToYoobaUnits(int width, int height)
+        {
+            base.ConvertToYoobaUnits(width, height);
+
+            //FONT, SIZE, COLOR, ALIGNMENT
+
+            //Font size convertion
+            _size /= 100;
+            //_size = (int)Math.Round(_size * 1.5);
+
+            //Font color
+            _color = getFontColorAsInteger(_color).ToString();
+
+            foreach(TextStyle style in StyleList)
+            {
+                //Font size convertion
+                style.FontSize /= 100;
+                //style.FontSize = (int) Math.Round(style.FontSize*1.5);
+
+                //Fake font and color
+                style.Font = "Arial";
+
+            }
+
+            //Alignment
+            _align = (_align.ToLower() == "l" || _align.ToLower() == "left") ? "left" : _align;
+            _align = (_align.ToLower() == "r" || _align.ToLower() == "right") ? "right" : _align;
+            _align = (_align.ToLower() == "c" || _align.ToLower() == "ctr" || _align.ToLower() == "center") ? "center" : _align;
+        
+        }
+
+        public int getFontColorAsInteger(string color)
+        {
+            if(color.Length == 6)
+                return int.Parse(color, System.Globalization.NumberStyles.HexNumber);
+            else
+            {
+                Console.WriteLine("Error in color convertion, '" + color + "' could not be converted!");
+                return 0;
+            }
+        }
+
+        public string Align
+        {
+            get { return _align; }
+            set { _align = value; }
+        }
+
+        internal List<TextStyle> StyleList
+        {
+            get { return _styleList; }
+            set { _styleList = value; }
+        }
+
+        internal List<TextFragment> FragmentsList
+        {
+            get { return _fragmentsList; }
+            set { _fragmentsList = value; }
+        }
+
+        public string Autosize
+        {
+            get { return _autosize; }
+            set { _autosize = value; }
+        }
+
+        public string Font
+        {
+            get { return _font; }
+            set { _font = value; }
+        }
+
+        public string AntiAlias
+        {
+            get { return _antiAlias; }
+            set { _antiAlias = value; }
+        }
+
+        public int Size
+        {
+            get { return _size; }
+            set { _size = value; }
+        }
+
+        public int LetterSpacing
+        {
+            get { return _letterSpacing; }
+            set { _letterSpacing = value; }
+        }
+
+        public int Leading
+        {
+            get { return _leading; }
+            set { _leading = value; }
+        }
+
+        public string Color
+        {
+            get { return _color; }
+            set { _color = value; }
+        }
+
+        public Boolean RunningText
+        {
+            get { return _runningText; }
+            set { _runningText = value; }
+        }
+
+        public Boolean Selectable
+        {
+            get { return _selectable; }
+            set { _selectable = value; }
+        }
+
+        public Boolean Underline
+        {
+            get { return _underline; }
+            set { _underline = value; }
+        }
+
+        public Boolean Italic
+        {
+            get { return _italic; }
+            set { _italic = value; }
+        }
+
+        public Boolean Bold
+        {
+            get { return _bold; }
+            set { _bold = value; }
+        }
+
+        public Boolean UseScroller
+        {
+            get { return _useScroller; }
+            set { _useScroller = value; }
+        }
+
+
+        internal void setAttributes(TableStyle tableStyle)
+        {
+            if (tableStyle == null)
+                return;
+
+            Color = (tableStyle.FontColor != "") ? tableStyle.FontColor : Color;
+            Size = (tableStyle.FontSize != 0) ? tableStyle.FontSize : Size;
+            Bold = tableStyle.Bold;
+            Italic = tableStyle.Italic;
+            Underline = tableStyle.Underline;
+        }
+    }
+}

+ 200 - 0
PPTXMLParser/TextStyle.cs

@@ -0,0 +1,200 @@
+using System;
+using System.Drawing;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Threading.Tasks;
+
+namespace ConsoleApplication
+{
+    public class TextStyle
+    {
+        private Boolean _bold, _underline, _italic;
+        private int _fontSize;
+        private string _font, _fontColor, _alignment;
+
+        private XmlDocument _rootOfDocument;
+
+        public TextStyle()
+        {
+            _bold = false;
+            _underline = false;
+            _italic = false;
+            _fontSize = 0;
+            _fontColor = "";
+            _font = "Arial";
+            _alignment = "";
+        }
+
+        public string attrubiteValue()
+        {
+            string style = "k";
+
+            if(_bold)
+                style += "b";
+            if(_underline)
+                style += "u";
+            if(_italic)
+                style += "i";
+
+            return _font + "," + _fontSize.ToString() + "," + _fontColor.ToString() + "," + style;
+        }
+
+        private XmlAttribute getStylesAttributes()
+        {
+            XmlAttribute attrStyle = _rootOfDocument.CreateAttribute("style");
+            attrStyle.Value = attrubiteValue();
+
+            return attrStyle;
+        }
+
+        public XmlElement getStylesChild()
+        {
+            XmlElement child = _rootOfDocument.CreateElement("s");
+            child.Attributes.Append(getStylesAttributes());
+
+            return child;
+        }
+
+        public XmlElement getFontNode()
+        {
+            XmlElement FONT = _rootOfDocument.CreateElement("FONT");
+
+            return FONT;
+
+        }
+
+        public string getTextNode(string text)
+        {
+
+            string temp = text;
+
+            if (Bold)
+                temp = "<B>" + text + "</B>";
+            if(Italic)
+                temp = "<I>" + text + "</I>";
+            if(Underline)
+                temp = "<U>" + text + "</U>";
+
+            return temp;
+
+        }
+
+        public void setXMLDocumentRoot(ref XmlDocument rootOfDocument)
+        {
+            _rootOfDocument = rootOfDocument;
+        }
+
+        public string Font
+        {
+            get { return _font; }
+            set { _font = value; }
+        }
+
+        public string FontColor
+        {
+            get { return _fontColor; }
+            set { _fontColor = value; }
+        }
+
+        public int FontColorInteger()
+        {
+            return int.Parse(_fontColor, System.Globalization.NumberStyles.HexNumber);
+        }
+
+        public int FontSize
+        {
+            get { return _fontSize; }
+            set { _fontSize = value; }
+        }
+
+        public Boolean Italic
+        {
+            get { return _italic; }
+            set { _italic = value; }
+        }
+
+        public Boolean Underline
+        {
+            get { return _underline; }
+            set { _underline = value; }
+        }
+
+        public Boolean Bold
+        {
+            get { return _bold; }
+            set { _bold = value; }
+        }
+
+        public bool isEqual(object obj)
+        {
+            TextStyle other = obj as TextStyle;
+
+            if (other == null)
+                return false;
+
+            if ((Font == other.Font) && (FontColor == other.FontColor) && (FontSize == other.FontSize) && (Italic == other.Italic) && (Underline == other.Underline) && (Bold == other.Bold) && (Alignment == other.Alignment))
+            {
+                return true; 
+            }
+            else
+            {
+                return false;
+            }
+
+          /*  return (Font == other.Font)
+                && (FontColor == other.FontColor)
+                && (FontSize == other.FontSize)
+                && (Italic == other.Italic)
+                && (Underline == other.Underline)
+                && (Bold == other.Bold);*/
+        }
+
+        public string Alignment
+        {
+            get { return _alignment; }
+            set { 
+                
+                if(value.ToLower() == "r" || value.ToLower() == "right")
+                     _alignment = "right";
+
+                if (value.ToLower() == "l" || value.ToLower() == "left")
+                    _alignment = "left";
+
+                if (value.ToLower() == "c" || value.ToLower() == "ctr" || value.ToLower() == "center")
+                    _alignment = "center"; 
+            }
+        }
+
+        //public static bool operator ==(TextStyle x, TextStyle y)
+        //{
+        //    if (x == null || y == null)
+        //        return false;
+
+        //     return      (x.Font == y.Font)
+        //              && (x.FontColor == y.FontColor)
+        //              && (x.FontSize == y.FontSize)
+        //              && (x.Italic == y.Italic)
+        //              && (x.Underline == y.Underline)
+        //              && (x.Bold == y.Bold);
+        //}
+
+        //public static bool operator !=(TextStyle x, TextStyle y)
+        //{
+        //    if (x == null || y == null)
+        //        return false;
+
+        //    return !(x == y);
+        //}
+
+        public string toString()
+        {
+            return "Font:   " + _font + "\n" +
+                   "Size:   " + _fontSize + "\n" +
+                   "Color:  " + _fontColor + "\n" +
+                   "B U I:  (" + _bold + ", " + _underline + ", " + _italic + ") \n";
+        }
+
+    }
+}

+ 1 - 1
TEAMModelOS.SDK/Extension/DataResult/JsonRpcResponse/ErrorModel.cs

@@ -5,7 +5,7 @@ namespace TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse
     [MessagePackObject(keyAsPropertyName: true)]
     public class ErrorModel<E>
     {
-        public float code { get; set; }
+        public int code { get; set; }
         public string message { get; set; }
         public string devmsg { get; set; }
         public E data { get; set; }

+ 3 - 2
TEAMModelOS.SDK/TEAMModelOS.SDK.csproj

@@ -4,8 +4,9 @@
     <TargetFramework>netcoreapp2.2</TargetFramework>
     <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
     <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
-    <Version>1.0.14</Version>
-    <PackageReleaseNotes>增加两个字符串截取及文件类型获得扩展名</PackageReleaseNotes>
+    <Version>1.0.16</Version>
+    <PackageReleaseNotes>修改JsonPRC id类型</PackageReleaseNotes>
+    <Description>修改JsonPRC id类型</Description>
   </PropertyGroup>
 
   <ItemGroup>

+ 3 - 4
TEAMModelOS.Test.PPTX/PresentationConvert.cs

@@ -841,16 +841,15 @@ namespace TEAMModelOS.Test.PPTX
             if (lumModVal > 0 || lumOffVal > 0)
             {
                 Color color = ColorTranslator.FromHtml("#" + schemeColor);
-                color = ColorHelper.GetColorLumModAndLumOff(color, lumModVal, lumOffVal);
-                schemeColor = ColorTranslator.ToHtml(color).Replace("#", "");
+                schemeColor = ColorHelper.GetColorLumModAndLumOff(color, lumModVal, lumOffVal);
             }
             if (tintVal > 0)
             {
-                schemeColor = ColorTranslator.ToHtml(ColorHelper.GetShadeOrTintColor(ColorTranslator.FromHtml("#" + schemeColor), tintVal / 100000, "Tint")).Replace("#", "");
+                schemeColor = ColorHelper.GetShadeOrTintColor(ColorTranslator.FromHtml("#" + schemeColor), tintVal / 100000, "Tint");
             }
             if (shadeVal > 0)
             {
-                schemeColor = ColorTranslator.ToHtml(ColorHelper.GetShadeOrTintColor(ColorTranslator.FromHtml("#" + schemeColor), shadeVal / 100000, "Shade")).Replace("#", "");
+                schemeColor = ColorHelper.GetShadeOrTintColor(ColorTranslator.FromHtml("#" + schemeColor), shadeVal / 100000, "Shade");
             }
 
             return schemeColor;

+ 23 - 14
TEAMModelOS.Test.PPTX/Program.cs

@@ -23,19 +23,27 @@ namespace TEAMModelOS.Test.PPTX
 
             Color color1 = Color.FromArgb(255, 192, 0);
             ColorHSL colorHSL1 = ColorHelper.RgbToHsl(new ColorRGB(255, 192, 0));
-            ColorRGB colorRGB = ColorHelper.HslToRgb(new ColorHSL { H=colorHSL1.H, S = colorHSL1.S , L = colorHSL1.L });
-            Color  color2=  ColorHelper.GetColorLumModAndLumOff(color1, 20000, 80000);
-            Color color4 = Color.FromArgb(0, 0, 0);
-            Color color5 = ColorHelper.GetShadeOrTintColor(color4, 75000.0d / 100_000.0d, "Tint");
+            ColorRGB colorRGB = ColorHelper.HslToRgb(new ColorHSL { H = colorHSL1.H, S = colorHSL1.S, L = colorHSL1.L });
+            string color2 = ColorHelper.GetColorLumModAndLumOff(color1, 20000, 80000);
+            Console.WriteLine(color2);
+            Color color4 = Color.FromArgb(255, 192, 0);
+            for (int i = 0; i <= 10; i++)
+            {
+                string color5 = ColorHelper.GetShadeOrTintColor(color4, i * 10000, "Tint");
+                string color6 = ColorHelper.GetShadeOrTintColor(color4, i * 10000, "Shade");
+               // Color color5 = ColorHelper.applyTint(color4, i * 10000);
+                //Color color6 = ColorHelper.applyShade(color4, i * 10000);
+                Console.WriteLine(color5 + "  " + color6);
+            }
 
-            string json =JsonSerialization.ToJson(new Dem { aaa="aaa",bbb="bbb",ccc="cccc",ddd="ddd",eee="eeee"});
+            string json = JsonSerialization.ToJson(new Dem { aaa = "aaa", bbb = "bbb", ccc = "cccc", ddd = "ddd", eee = "eeee" });
             string jwt = "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NjQ0NzE1MjUsImhvc3RuYW1lIjoiaHR0cHM6Ly9vcGVuY2VudGVyLml5dW54aWFvLm5ldCIsInNpZ25JbiI6ImFwcEp1bXBMb2dpbi1jZDVmNWMzMC1iMjk5LTExZTktYmFhZC05M2Q0YmYxNmJjNDciLCJpYXQiOjE1NjQ0NzA5MjUsImp0aSI6IjVkM2YwMzRmMDAwMDA4ZmMxZjM2ZTgwNiJ9.OnvKd7eaSzMU-4hgYdTfNGxoaAU8YgZcIZXvrv9g3mNw_59txzibEgvQahkCjxXeKiVnltmP7WGhNqbN8Hp30A";
             var urls = "https://opencenter.iyunxiao.net/passport/v2/user/info";
-            var dict = new Dictionary<string,string>();
+            var dict = new Dictionary<string, string>();
             dict.Add("token", jwt);
-            var  info  =  HttpHelper.HttpPost(urls, MessagePackHelper.ObjectToJson(dict));
+            var info = HttpHelper.HttpPost(urls, MessagePackHelper.ObjectToJson(dict));
+
 
-           
             PresentationConvert presentation = new PresentationConvert();
             presentation.LoadPresentation("E:\\document\\123.pptx");
             ///白色灰度值计算
@@ -60,22 +68,23 @@ namespace TEAMModelOS.Test.PPTX
             double gnnn = ga * (1 - 0.4) + (255 - 255 * (1 - 0.4));
             double bnnn = ba * (1 - 0.4) + (255 - 255 * (1 - 0.4));
             Console.WriteLine(rnn + "," + gnn + "," + bnn);
-            ColorHSL colorHSL=  ColorHelper.RgbToHsl(new ColorRGB(ra,ga,ba) );
+            ColorHSL colorHSL = ColorHelper.RgbToHsl(new ColorRGB(ra, ga, ba));
             colorHSL.H = (int)(colorHSL.H * pa);
             colorHSL.L = (int)(colorHSL.L * pa);
             colorHSL.S = (int)(colorHSL.S * pa);
-            ColorRGB  color=ColorHelper.HslToRgb(colorHSL);
+            ColorRGB color = ColorHelper.HslToRgb(colorHSL);
             System.Drawing.Color s = ColorTranslator.FromHtml("#ED7D31");
             PPTXConvertNew.GetSlideTitles("E:\\document\\123.pptx");
 
-           // Color ss =  getColorLumModandOff(ColorTranslator.FromHtml("#4472C4"), 75000, 0);
-           //string sn= ColorTranslator.ToHtml(ss);
+            // Color ss =  getColorLumModandOff(ColorTranslator.FromHtml("#4472C4"), 75000, 0);
+            //string sn= ColorTranslator.ToHtml(ss);
         }
     }
 
-    public class Dem {
+    public class Dem
+    {
         public string aaa { get; set; }
-       public string bbb { get; set; }
+        public string bbb { get; set; }
         public string ccc { get; set; }
         public string ddd { get; set; }
         public string eee { get; set; }