示例#1
0
        private void AddDefaultRulers()
        {
            var l1 = new RulerLine {
                Value = -384
            };
            var l2 = new RulerLine {
                Value = 384
            };
            var ruler = new RulerData {
                Name = "1152x768 (3:2)"
            };

            ruler.Lines.Add(new RulerLine {
                IsVertical = true, Value = -576
            });
            ruler.Lines.Add(new RulerLine {
                IsVertical = true, Value = 576
            });
            ruler.Lines.Add(l1);
            ruler.Lines.Add(l2);
            DefaultRulers.Add(ruler);
            ruler = new RulerData {
                Name = "1024x768 (3:4)"
            };
            ruler.Lines.Add(new RulerLine {
                IsVertical = true, Value = -512
            });
            ruler.Lines.Add(new RulerLine {
                IsVertical = true, Value = 512
            });
            ruler.Lines.Add(l1);
            ruler.Lines.Add(l2);
            DefaultRulers.Add(ruler);
            ruler = new RulerData {
                Name = "1366x768 (16:9)"
            };
            ruler.Lines.Add(new RulerLine {
                IsVertical = true, Value = -683
            });
            ruler.Lines.Add(new RulerLine {
                IsVertical = true, Value = 683
            });
            ruler.Lines.Add(l1);
            ruler.Lines.Add(l2);
            DefaultRulers.Add(ruler);
            ruler = new RulerData {
                Name = "1579x768"
            };
            ruler.Lines.Add(new RulerLine {
                IsVertical = true, Value = -790
            });
            ruler.Lines.Add(new RulerLine {
                IsVertical = true, Value = 790
            });
            ruler.Lines.Add(l1);
            ruler.Lines.Add(l2);
            DefaultRulers.Add(ruler);
        }
示例#2
0
 public void RemoveRuler(RulerData ruler)
 {
     Orange.The.Workspace.ProjectJson.RemoveFromArray("Rulers", ruler);
     Rulers.Remove(ruler);
     Orange.The.Workspace.SaveCurrentProject();
 }
示例#3
0
 public void AddRuler(RulerData ruler)
 {
     Orange.The.Workspace.ProjectJson.AddToArray("Rulers", ruler);
     Rulers.Add(ruler);
     Orange.The.Workspace.SaveCurrentProject();
 }