Ejemplo n.º 1
0
        /// <summary>
        /// Save gloabl mask settings.
        /// </summary>
        public void Save()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;
            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);
            XmlStorage.FileName = CommonSettingEntity.XMLAggregationKey;

            XmlStorage.Set<float>(_topMaskProp, TopMask.Value);
            XmlStorage.Set<float>(_bottomMaskProp, BottomMask.Value);
            XmlStorage.Set<float>(_leftMaskProp, LeftMask.Value);
            XmlStorage.Set<float>(_rightMaskProp, RightMask.Value);
            XmlStorage.Save();

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
Ejemplo n.º 2
0
        public static void Main(String[] args)
        {
            IStorage storage = new XmlStorage(AppName);

            storage.SetInt("a", 7);
            storage.SetInt("a", 15);
            storage.Set("b", "yuhuueo");
            storage.SetFloat("c", (Single)14.6d);
            storage.SetFloat("b", (Single)14.6d);
            storage.SetFloat("d", (Single)46.89865m);
            storage.Set("b", "arererere");
            storage.SetInt("e", (Int32)23L);
            storage.SetInt("f", 255_879_886);
            storage.SetDatetime("i", DateTime.Now);
            storage.SetTimespan("j", new TimeSpan(5, 3, 20, 40));

            String path    = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "storage.xml");
            String content = File.ReadAllText(path);
            var    xmlDoc  = new XmlDocument();

            xmlDoc.LoadXml(content);

            dynamic  readValue = new ExpandoObject();
            IStorage storage2  = new XmlStorage(path, AppName);

            readValue.A = storage2.GetInt("a");
            readValue.B = storage2.GetInt("b");
            readValue.C = storage2.GetFloat("c");
            readValue.D = storage2.GetFloat("d");
            readValue.E = storage2.GetInt("e");
            readValue.F = storage2.GetInt("f");
            readValue.I = storage2.GetDatetime("i");
            readValue.J = storage2.GetTimespan("j");

            System.Console.ReadLine();
        }
        /// <summary>
        /// Save common settings.
        /// </summary>
        public void Save()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;
            XmlStorage.ChangeAggregation(XMLAggregationKey);
            XmlStorage.FileName = XMLAggregationKey;

            XmlStorage.Set<int>(_numOfColProjectorsProp, NumOfColProjectors.Value);
            XmlStorage.Set<int>(_numOfRowProjectorsProp, NumOfRowProjectors.Value);
            XmlStorage.Set<float>(_blacknessProp, Blackness.Value);
            XmlStorage.Set<float>(_curveProp, Curve.Value);
            XmlStorage.Set<float>(_brightnessProp, Brightness.Value);
            XmlStorage.Set<bool>(_symmetry, Symmetry.Value);
            XmlStorage.Save();

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Save rect mask settings.
        /// </summary>
        public void Save()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;

            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);
            XmlStorage.FileName = CommonSettingEntity.XMLAggregationKey;

            for (int i = 0; i < MAX_RECTMASKS; i++)
            {
                XmlStorage.Set <float>(_rectMaskXPropPrefix + i.ToString(), RectMaskX[i].Value);
                XmlStorage.Set <float>(_rectMaskYPropPrefix + i.ToString(), RectMaskY[i].Value);
                XmlStorage.Set <float>(_rectMaskWidthPropPrefix + i.ToString(), RectMaskWidth[i].Value);
                XmlStorage.Set <float>(_rectMaskHeightPropPrefix + i.ToString(), RectMaskHeight[i].Value);
            }

            XmlStorage.Save();

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }
Ejemplo n.º 5
0
        private void SetData2XmlStorage(int value)
        {
            XmlStorage.SetInt("integer", value);
            XmlStorage.SetFloat("float", 1.111f);
            XmlStorage.Set("TestClass", this.test);

            XmlStorage.SetInt("del_tes1", 2);
            XmlStorage.SetString("del_tes1", "del_tes1");
            XmlStorage.DeleteKey("del_tes1");

            XmlStorage.SetInt("del_tes2", 5);
            XmlStorage.SetString("del_tes2", "del_tes2");
            XmlStorage.DeleteKey("del_tes2", typeof(int));

            var address = "*****@*****.**";

            XmlStorage.SetString("address", address);

            XmlStorage.Set("vec2", this.vec2);
            XmlStorage.Set("vec3", this.vec3);
            XmlStorage.Set("qua", this.qua);
        }
        /// <summary>
        /// Save settings.
        /// </summary>
        public void Save()
        {
            var currentAggregationKey = XmlStorage.CurrentAggregationName;

            XmlStorage.ChangeAggregation(CommonSettingEntity.XMLAggregationKey);
            XmlStorage.FileName = CommonSettingEntity.XMLAggregationKey;

            XmlStorage.Set <float>(_topBlendProp, TopBlend.Value);
            XmlStorage.Set <float>(_bottomBlendProp, BottomBlend.Value);
            XmlStorage.Set <float>(_leftBlendProp, LeftBlend.Value);
            XmlStorage.Set <float>(_rightBlendProp, RightBlend.Value);
            XmlStorage.Set <float>(_topMaskProp, topMask.Value);
            XmlStorage.Set <float>(_bottomMaskProp, bottomMask.Value);
            XmlStorage.Set <float>(_leftMaskProp, leftMask.Value);
            XmlStorage.Set <float>(_rightMaskProp, rightMask.Value);
            XmlStorage.Set <Vector2>(_topLeftMaskProp, topLeftMask.Value);
            XmlStorage.Set <Vector2>(_topRightMaskProp, topRightMask.Value);
            XmlStorage.Set <Vector2>(_bottomLeftMaskProp, bottomLeftMask.Value);
            XmlStorage.Set <Vector2>(_bottomRightMaskProp, bottomRightMask.Value);
            XmlStorage.Set <Vector2>(_uvShiftProp, uvShift.Value);
            XmlStorage.Save();

            XmlStorage.ChangeAggregation(currentAggregationKey);
        }