Beispiel #1
0
		internal static void AddController(Controller controller) {
			if (!IsAllowEdit)
				return;
			Controller cn = new Controller { Number = GetIndexController(1, true) };
			cn.WidthChanged += cn_WidthChanged;
			MWin.I.Doc.Controller.Add(cn);
			Selectors.SelController(cn);
		}
Beispiel #2
0
		public static void SelController(Controller sender) {
			MWin win = MWin.I;
			if (win.ActCont == sender)
				return;
			for (int i = win.ActFrm.Count - 1; i > -1; i--)
				if (!sender.Frames.Contains(win.ActFrm[i])) {
					win.ActFrm[i].IsSelected = false;
					win.ActFrm.Remove(win.ActFrm[i]);
				}
			if (win.ActCont != null)
				win.ActCont.IsSelected = false;
			sender.IsSelected = true;
			win.ActCont = sender;
		}
Beispiel #3
0
		public void Add(Controller item) {
			_cont.Add(item);
		}
Beispiel #4
0
		internal static void AddSample(object all) {
			if (!IsAllowEdit)
				return;
			Controller con = new Controller { Id = Guid.NewGuid() };
			Controller cn = MWin.I.ActCont;
			//List<Frame> frms = new List<Frame>();
			bool prm = bool.Parse(all.ToString());
			for (int i = 0; i < cn.Frames.Count; i++) {
				Frame frm = cn.Frames[i];
				if (prm || frm.IsSelected) {
					Frame fr = (Frame)frm.Clone();
					fr.Length = 1;
					con.Frames.Add(fr);
				}
			}
			//string path = FileOperations.SaveSample(con);
			List<Controller> sour = (List<Controller>)MWin.I.grSampl.ItemsSource;
			sour.Add(con);
			MWin.I.grSampl.Items.Refresh();
		}
Beispiel #5
0
		public bool Remove(Controller item) {
			return _cont.Remove(item);
		}