Exemplo n.º 1
0
 private void AddCondition(Rotation rotation, AdvTree advTree)
 {
     var node = new Node();
     node.Text = rotation.Name;
     node.Tag = rotation;
     AddNode(node, advTree);
 }
Exemplo n.º 2
0
 public void Load(string fileToLoad)
 {
     try
     {
         Name = Path.GetFileNameWithoutExtension(fileToLoad);
         _doc = new XmlDocument();
         _doc.Load(fileToLoad);
     }
     catch (Exception e)
     {
         Logging.Write("Error loading the rotation manager: " + e);
         return;
     }
     try
     {
         foreach (XmlNode childNode in _doc.GetElementsByTagName("RotationManager")[0])
         {
             switch (childNode.Name)
             {
                 case "Rotation":
                     var rotation = new Rotation();
                     rotation.Load(childNode);
                     Rotations.Add(rotation);
                     break;
             }
         }
     }
     catch (Exception e)
     {
         Logging.Write("Error loading the rotation manager: " + e);
     }
 }
Exemplo n.º 3
0
 private void BeComAddRuleClick(object sender, EventArgs e)
 {
     var rotation = new Rotation();
     var rotationForm = new RotationForm(rotation);
     rotationForm.Location = Location;
     rotationForm.ShowDialog();
     if (rotationForm.Save)
     {
         rotation = rotationForm.Rotation;
         if (BeTabs.SelectedTab.Name.Equals("TabRotations"))
         {
             AddCondition(rotation, BeRotations);
         }
     }
 }
Exemplo n.º 4
0
 private void BtnCopy_Click(object sender, EventArgs e)
 {
     if (_selected != null && _selectedTree != null)
     {
         if (_selected.Tag is Rotation)
         {
             var rotation = (Rotation) _selected.Tag;
             var rotationCopy = new Rotation();
             rotationCopy.Active = rotation.Active;
             rotationCopy.Alt = rotation.Alt;
             rotationCopy.Ctrl = rotation.Ctrl;
             rotationCopy.GlobalCooldown = rotation.GlobalCooldown;
             rotationCopy.Key = rotation.Key;
             rotationCopy.Name = rotation.Name + " - copy";
             rotationCopy.Shift = rotation.Shift;
             rotationCopy.Windows = rotation.Windows;
             foreach (Rule rule in rotation.Rules.GetRules)
             {
                 rotationCopy.Rules.AddRule(rule);
             }
             AddCondition(rotationCopy, BeRotations);
         }
     }
 }
Exemplo n.º 5
0
 private void StartRotation(string name)
 {
     if (_rotationThread != null && _rotationThread.IsAlive)
     {
         _rotationThread.Abort();
         _rotationThread = null;
     }
     if (RotationManagerController.Rotations.FirstOrDefault(r => r.Name == name) != _rotation)
     {
         _rotation = RotationManagerController.Rotations.FirstOrDefault(r => r.Name == name);
         _rotationThread = new Thread(DoRotation) {IsBackground = true};
         _rotationThread.Start();
         Logging.Write(LogType.Info, "Started rotator");
         UpdateStatus(true);
     }
     else
     {
         _rotation = null;
         Logging.Write(LogType.Info, "Stopped rotator");
         UpdateStatus(false);
     }
 }
Exemplo n.º 6
0
 public RotationForm(Rotation rotation)
 {
     InitializeComponent();
     Rotation = rotation;
     Geometry.GeometryFromString(GeomertrySettings.RotationForm, this);
 }