public TagBase CreateAndAddTag(string type, string data, TagWindow tagw) { Type tagtype = TagWindow.functions[type]; object tag = Activator.CreateInstance(tagtype, new object[] { tagw }); if (data != "") { ((TagBase)tag).OnLoad(data); } tagw.AddTag((TagBase)tag); return((TagBase)tag); }
public void SplitTag(TagBase tag) { CtrlButtonRemoveData(tag, false); POINT pt = new POINT(); GetCursorPos(out pt); TagWindow tagw = ((MainWindow)Application.Current.MainWindow).CreateTagWindow(pt.X - tag.Width / 2, pt.Y - tag.Height / 2); tag.OnTransfer(tagw); tagw.AddTag(tag, false); tagw.Window_MouseLeftButtonDown(null, null); }