public void PropertyBackColor () { Control c = new Control (); EventWatcher ew = new EventWatcher (c); c.BackColor = Color.Aquamarine; Assert.AreEqual (Color.Aquamarine, c.BackColor, "B1"); Assert.AreEqual ("BackColorChanged", ew.ToString (), "B2"); ew.Clear (); c.BackColor = Color.Aquamarine; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyAutoSize () { ToolStripPanel tsp = new ToolStripPanel (); EventWatcher ew = new EventWatcher (tsp); tsp.AutoSize = false; Assert.AreEqual (false, tsp.AutoSize, "B1"); Assert.AreEqual ("AutoSizeChanged", ew.ToString (), "B2"); ew.Clear (); tsp.AutoSize = false; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyAllowDrop () { Control c = new Control (); EventWatcher ew = new EventWatcher (c); c.AllowDrop = true; Assert.AreEqual (true, c.AllowDrop, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); c.AllowDrop = true; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyAnchor () { Control c = new Control (); EventWatcher ew = new EventWatcher (c); c.Anchor = AnchorStyles.Bottom; Assert.AreEqual (AnchorStyles.Bottom, c.Anchor, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); c.Anchor = AnchorStyles.Bottom; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyDock () { ToolStripPanel tsp = new ToolStripPanel (); EventWatcher ew = new EventWatcher (tsp); tsp.Dock = DockStyle.Left; Assert.AreEqual (DockStyle.Left, tsp.Dock, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); tsp.Dock = DockStyle.Left; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyAutoSize () { Control c = new Control (); EventWatcher ew = new EventWatcher (c); c.AutoSize = true; Assert.AreEqual (true, c.AutoSize, "B1"); Assert.AreEqual ("AutoSizeChanged", ew.ToString (), "B2"); ew.Clear (); c.AutoSize = true; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyBackColor () { ToolStripContentPanel tsp = new ToolStripContentPanel (); EventWatcher ew = new EventWatcher (tsp); tsp.BackColor = Color.Green; Assert.AreEqual (Color.Green, tsp.BackColor, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); tsp.BackColor = Color.Green; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyMarqueeAnimationSpeed () { ToolStripProgressBar tsi = new ToolStripProgressBar (); EventWatcher ew = new EventWatcher (tsi); tsi.MarqueeAnimationSpeed = 200; Assert.AreEqual (200, tsi.MarqueeAnimationSpeed, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); tsi.MarqueeAnimationSpeed = 200; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyImage() { ToolStripItem tsi = new NullToolStripItem(); EventWatcher ew = new EventWatcher(tsi); Image i = new Bitmap(1, 1); tsi.Image = i; Assert.AreSame(i, tsi.Image, "B1"); Assert.AreEqual(string.Empty, ew.ToString(), "B2"); ew.Clear(); tsi.Image = i; Assert.AreSame(string.Empty, ew.ToString(), "B3"); }
public void PropertyOwner() { ToolStripItem tsi = new NullToolStripItem(); EventWatcher ew = new EventWatcher(tsi); ToolStrip ts = new ToolStrip(); tsi.Owner = ts; Assert.AreSame(ts, tsi.Owner, "B1"); Assert.AreEqual("OwnerChanged", ew.ToString(), "B2"); ew.Clear(); tsi.Owner = ts; Assert.AreSame(string.Empty, ew.ToString(), "B3"); }
public void PropertyLines() { ToolStripTextBox tsi = new ToolStripTextBox(); EventWatcher ew = new EventWatcher(tsi); string[] lines = new string[] { "Apple", "Banana" }; tsi.Lines = lines; Assert.AreEqual(lines, tsi.Lines, "B1"); Assert.AreEqual(string.Empty, ew.ToString(), "B2"); ew.Clear(); tsi.Lines = lines; Assert.AreEqual(string.Empty, ew.ToString(), "B3"); }
public void PropertyBackgroundImage() { ToolStripControlHost tsi = new ToolStripControlHost(new Control()); EventWatcher ew = new EventWatcher(tsi); Image i = new Bitmap(1, 1); tsi.BackgroundImage = i; Assert.AreSame(i, tsi.BackgroundImage, "B1"); Assert.AreEqual(string.Empty, ew.ToString(), "B2"); ew.Clear(); tsi.BackgroundImage = i; Assert.AreSame(string.Empty, ew.ToString(), "B3"); }
public void PropertySelectedText() { ToolStripTextBox tsi = new ToolStripTextBox(); EventWatcher ew = new EventWatcher(tsi); tsi.Text = "Crumbelievable"; tsi.SelectedText = "lie"; Assert.AreEqual(string.Empty, tsi.SelectedText, "B1"); Assert.AreEqual("ModifiedChanged", ew.ToString(), "B2"); ew.Clear(); tsi.SelectedText = "lie"; Assert.AreEqual(string.Empty, ew.ToString(), "B3"); }
public void PropertySite() { ToolStripControlHost tsi = new ToolStripControlHost(new Control()); EventWatcher ew = new EventWatcher(tsi); ISite i = new Form().Site; tsi.Site = i; Assert.AreSame(i, tsi.Site, "B1"); Assert.AreEqual(string.Empty, ew.ToString(), "B2"); ew.Clear(); tsi.Site = i; Assert.AreSame(string.Empty, ew.ToString(), "B3"); }
public void PropertyFont() { ToolStripControlHost tsi = new ToolStripControlHost(new Control()); EventWatcher ew = new EventWatcher(tsi); Font f = new Font("Arial", 12); tsi.Font = f; Assert.AreSame(f, tsi.Font, "B1"); Assert.AreEqual(string.Empty, ew.ToString(), "B2"); ew.Clear(); tsi.Font = f; Assert.AreEqual(string.Empty, ew.ToString(), "B3"); }
public void PropertyFont() { ToolStrip ts = new ToolStrip(); EventWatcher ew = new EventWatcher(ts); Font f = new Font("Arial", 12); ts.Font = f; Assert.AreSame(f, ts.Font, "B1"); Assert.AreEqual("LayoutCompleted", ew.ToString(), "B2"); ew.Clear(); ts.Font = f; Assert.AreEqual(string.Empty, ew.ToString(), "B3"); }
public void PropertySelectedItem() { ToolStripComboBox tsi = new ToolStripComboBox(); EventWatcher ew = new EventWatcher(tsi); tsi.Items.Add("A"); tsi.Items.Add("B"); tsi.SelectedItem = "B"; Assert.AreEqual("B", tsi.SelectedItem, "B1"); Assert.AreEqual("SelectedIndexChanged", ew.ToString(), "B2"); ew.Clear(); tsi.SelectedItem = "B"; Assert.AreEqual(string.Empty, ew.ToString(), "B3"); }
public void UploadsDirectoryWhenCreated() { _configuration.LocalDirectory = "dir"; var filename = "file"; _fileWatcher.Setup(x => x.IsDirectory(It.IsAny <string>())).Returns(true); var watcher = new EventWatcher(_processor.Object, _configurationProvider.Object, _fileWatcher.Object); watcher.Start(); _fileWatcher.Raise(x => x.Created += null, new FileSystemEventArgs(WatcherChangeTypes.Created, _configuration.LocalDirectory, filename)); _processor.Verify(x => x.ProcessDirectory(It.IsAny <IDirectoryObject>())); }
public void dispatchEvent(BaseEvent eventValue) { string sendedOwnerName = eventValue.owner; if (eventValue.isGloabal) { sendedOwnerName = default(string); } EventWatcher watcher = getWatcher(eventValue.type, false, sendedOwnerName); if (watcher != null) { watcher.dispatch(eventValue); } }
public void PropertyRenderer() { ToolStrip ts = new ToolStrip(); EventWatcher ew = new EventWatcher(ts); ToolStripProfessionalRenderer pr = new ToolStripProfessionalRenderer(); ts.Renderer = pr; Assert.AreSame(pr, ts.Renderer, "B1"); Assert.AreEqual("LayoutCompleted;RendererChanged", ew.ToString(), "B2"); Assert.AreEqual(ToolStripRenderMode.Custom, ts.RenderMode, "B4"); ew.Clear(); ts.Renderer = pr; Assert.AreEqual(string.Empty, ew.ToString(), "B3"); }
public void RenamesFile() { _configuration.LocalDirectory = "c:\\dir"; var watcher = new EventWatcher(_processor.Object, _configurationProvider.Object, _fileWatcher.Object); watcher.Start(); _fileWatcher.Raise(x => x.Renamed += null, new RenamedEventArgs(WatcherChangeTypes.Renamed, _configuration.LocalDirectory, "newName.txt", "oldName.txt")); var oldFullPath = Path.Combine(_configuration.LocalDirectory, "oldName.txt"); _processor.Verify(x => x.RenameFile( It.Is <IFileObject>(f => f.FullName == oldFullPath), "newName.txt")); }
private static void onQQAuthRegHandler(EventWatcher watcher, BaseEventArgs evtArgs) { if (evtArgs.mEventID == EventConst.ON_NETSCENE_AUTH_NEEDREG) { Log.d("QQREG", "(1/3)onQQAuthNeedFillUserName"); //ServiceCenter.sceneGetUserName.doScene("halenhuang"); } else if (evtArgs.mEventID == EventConst.ON_NETSCENE_FILLUSERNAME_SUCCESS) { Log.d("QQREG", "(2/3)onQQAuthNeedReg"); ServiceCenter.sceneNewReg.doScene(); } else if (evtArgs.mEventID == EventConst.ON_NETSCENE_NEWREG_SUCCESS) { Log.d("QQREG", "(3/3)onQQAuthSuccess"); } }
/// <summary> /// Initializes from the AddIn registry /// </summary> /// <param name="callback"></param> public static void Initialize(Action callback) { if (_init) { return; } _services = AddInTree.BuildItems <ServiceBase>("/Maestro/ApplicationServices", null); //NOXLATE foreach (var svc in _services) { svc.Initialize(); svc.Load(); } _init = true; EventWatcher.Initialize(); callback?.Invoke(); }
public WatchReg(EventWatcher func) { this.func = func; del = (IntPtr ud, ref Event v) => { try { func(ref v); } catch (Exception e) { SDL.OnUnhandledException(e, true); } return 1; }; fp = Marshal.GetFunctionPointerForDelegate(del); }
public void PropertyRenderer() { ToolStripContentPanel tsp = new ToolStripContentPanel(); EventWatcher ew = new EventWatcher(tsp); ToolStripProfessionalRenderer pr = new ToolStripProfessionalRenderer(); tsp.Renderer = pr; Assert.AreSame(pr, tsp.Renderer, "B1"); Assert.AreEqual(ToolStripRenderMode.Custom, tsp.RenderMode, "B1-2"); // I refuse to call the event twice like .Net does. //Assert.AreEqual ("RendererChanged;RendererChanged", ew.ToString (), "B2"); ew.Clear(); tsp.Renderer = pr; //Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyRenderer () { ToolStripContentPanel tsp = new ToolStripContentPanel (); EventWatcher ew = new EventWatcher (tsp); ToolStripProfessionalRenderer pr = new ToolStripProfessionalRenderer (); tsp.Renderer = pr; Assert.AreSame (pr, tsp.Renderer, "B1"); Assert.AreEqual (ToolStripRenderMode.Custom, tsp.RenderMode, "B1-2"); // I refuse to call the event twice like .Net does. //Assert.AreEqual ("RendererChanged;RendererChanged", ew.ToString (), "B2"); ew.Clear (); tsp.Renderer = pr; //Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyAutoCompleteCustomSource() { ToolStripTextBox tsi = new ToolStripTextBox(); EventWatcher ew = new EventWatcher(tsi); AutoCompleteStringCollection acsc = new AutoCompleteStringCollection(); acsc.AddRange(new string[] { "Apple", "Banana" }); tsi.AutoCompleteCustomSource = acsc; Assert.AreSame(acsc, tsi.AutoCompleteCustomSource, "B1"); Assert.AreEqual(string.Empty, ew.ToString(), "B2"); ew.Clear(); tsi.AutoCompleteCustomSource = acsc; Assert.AreEqual(string.Empty, ew.ToString(), "B3"); }
public void PropertyMaximumSize() { Control c = new Control(); c.Size = new Size(10, 10); // Chaning MaximumSize below Size forces a size change EventWatcher ew = new EventWatcher(c); c.MaximumSize = new Size(5, 5); Assert.AreEqual(new Size(5, 5), c.MaximumSize, "B1"); Assert.AreEqual("Layout;Resize;SizeChanged;ClientSizeChanged", ew.ToString(), "B2"); // Changing MaximumSize when Size is already smaller or equal doesn't raise any events ew.Clear(); c.MaximumSize = new Size(5, 5); Assert.AreEqual(string.Empty, ew.ToString(), "B3"); }
public void UploadsFileWhenCreated() { _configuration.LocalDirectory = "dir"; var filename = "file"; var wasUploaded = false; _processor.Setup(x => x.CopyFile(It.IsAny <IFileObject>())).Callback(() => wasUploaded = true); var watcher = new EventWatcher(_processor.Object, _configurationProvider.Object, _fileWatcher.Object); watcher.Start(); _fileWatcher.Raise(x => x.Created += null, new FileSystemEventArgs(WatcherChangeTypes.Created, _configuration.LocalDirectory, filename)); Assert.IsTrue(wasUploaded); }
private static void onMobileRegHandler(EventWatcher watcher, BaseEventArgs evtArgs) { if (evtArgs.mEventID == EventConst.ON_NETSCENE_MOBILEREG_SETPHONE_SUCCESS) { Log.d("QQREG", "(1/3)onMobileRegHandler"); string verifyCode = "3535"; ServiceCenter.sceneBindOpMobileForReg.doSceneVerify(verifyCode); } else if (evtArgs.mEventID == EventConst.ON_NETSCENE_MOBILEREG_VERIFY_SUCCESS) { Log.d("QQREG", "(2/3)onMobileRegHandler"); ServiceCenter.sceneNewReg.doSceneSetPwdforMobileReg("mm@1234", "halen"); } else if (evtArgs.mEventID == EventConst.ON_NETSCENE_MOBILEREG_SUCCESS) { Log.d("QQREG", "(3/3)onMobileRegHandler"); } }
private static void onContactRefresh(EventWatcher watcher, BaseEventArgs evtArgs) { if (((evtArgs != null) && (evtArgs.mObject != null)) && (mapHeadImgUrl.Count > 0)) { List <string> mObject = evtArgs.mObject as List <string>; if (((mObject != null) && (mObject.Count == 1)) && mapHeadImgUrl.ContainsKey(mObject[0])) { string key = mObject[0]; //Contact contact = StorageMgr.contact.get(key); //string str2 = mapHeadImgUrl[key]; //mapHeadImgUrl.Remove(key); //if (str2 != contact.strBrandIconURL) //{ // // HeadImageMgr.update(key); //} } } }
private void Start() { ew = new EventWatcher(); characterFactory = new CharacterFactory(ew); actionFactory = new ActionFactory(ew); cellFactory = new CellFactory(); g = new BattleGrid(WIDTH, HEIGHT); List <BattleCell> actionCells = new List <BattleCell>(); List <BattleCell> characterCells = new List <BattleCell>(); characters = AddChars(); g.PlaceCellsRandom(characters); List <BattleCell> targets = AddTargets(); g.PlaceCellsRandom(targets); Object.FindObjectOfType <GridView>().grid = g; Object.FindObjectOfType <GridView>().CreateView(); }
static void Main(string[] args) { var usbWatcher = new EventWatcher(); usbWatcher.DeviceInserted += (s, ea) => { Console.WriteLine($"{ea.Disk.Name} was {ea.EventType}"); Console.WriteLine($"{ea.Disk}"); }; usbWatcher.DeviceRemoved += (s, ea) => { Console.WriteLine($"{ea.Disk.Name} was {ea.EventType}"); }; usbWatcher.Start(); Console.WriteLine("Press enter to quit..."); Console.ReadLine(); }
private void StartProcessing(ProcessorConfiguration configuration) { _asyncTaskQueue.TaskError += _asyncTaskQueue_TaskError; _asyncTaskQueue.StartProcessing(); var processorFactory = new ProcessorFactory(); _processor = processorFactory.Create(configuration, _asyncTaskQueue); _processor.ProcessSourceDirectory(); _watcher = new EventWatcher(_processor, AppContainer.Container.Resolve <IConfigurationProvider>(), AppContainer.Container.Resolve <IFileWatcher>()); StaticLogger.Log("Starting file watcher..."); _watcher.Start(); StaticLogger.Log("Ready."); }
private static void onHandlerToCleanStatus(EventWatcher watcher, BaseEventArgs evtArgs) { NetSceneSyncResult mObject = evtArgs.mObject as NetSceneSyncResult; if (mObject != null) { SyncStatus syncStatus = mObject.syncStatus; } //if (((mObject != null) && (mObject.syncStatus == SyncStatus.syncEnd)) && (mObject.syncCount == 0)) //{ // List<ChatMsg> msgList = StorageMgr.chatMsg.searhCacheMsg(1, 0, 1); // List<ChatMsg> list2 = StorageMgr.chatMsg.searhCacheMsg(0x24, 0, 1); // List<ChatMsg> list3 = StorageMgr.chatMsg.searhCacheMsg(0x30, 0, 1); // if (msgList == null) // { // msgList = new List<ChatMsg>(); // } // if ((list2 != null) && (list2.Count > 0)) // { // foreach (ChatMsg msg in list2) // { // msgList.Add(msg); // } // } // if ((list3 != null) && (list3.Count > 0)) // { // foreach (ChatMsg msg2 in list3) // { // msgList.Add(msg2); // } // } // if ((msgList != null) && (msgList.Count > 0)) // { // ServiceCenter.sceneSendMsg.sendCachMsg(msgList); // if (mWatcherToCleanStatus != null) // { // EventCenter.removeEventWatcher(EventConst.ON_NETSCENE_SYNC, mWatcherToCleanStatus); // mWatcherToCleanStatus = null; // } // } //} }
public void PropertyForeColor() { ToolStripControlHost tsi = new ToolStripControlHost(new Control()); EventWatcher ew = new EventWatcher(tsi); tsi.ForeColor = Color.BurlyWood; Assert.AreEqual(Color.BurlyWood, tsi.ForeColor, "B1"); Assert.AreEqual(string.Empty, ew.ToString(), "B2"); ew.Clear(); tsi.ForeColor = Color.BurlyWood; Assert.AreEqual(string.Empty, ew.ToString(), "B3"); // CausesValidation initially comes from hosted control tsi = new ToolStripControlHost(new Button()); Assert.AreEqual(SystemColors.ControlText, tsi.ForeColor, "B4"); tsi = new ToolStripControlHost(new TextBox()); Assert.AreEqual(SystemColors.WindowText, tsi.ForeColor, "B5"); }
public void Can_Store_Event() { //Arrange var result = new AuditLog(); var repositoryMock = new Mock <IAuditLogRepository>(); repositoryMock.Setup(m => m.Add(It.IsAny <AuditLog>())).Callback((AuditLog log) => result = log); //Act var target = new EventWatcher(repositoryMock.Object); target.StoreEvent("1", typeof(ProjectAdded).Name, "newMessage"); //Assert repositoryMock.Verify(m => m.Add(It.IsAny <AuditLog>())); Assert.True(result.EventMassage == "newMessage"); Assert.True(result.UserId == 1); Assert.True(result.EventType == "ProjectAdded"); }
private static void HandlerDoScene(EventWatcher watcher, BaseEventArgs evtArgs) { if (evtArgs != null) { Log.i("DownloadVoiceService", "onHander NetSceneNewSync mEventID = " + evtArgs.mEventID); if (evtArgs.mEventID == EventConst.ON_NET_DEVICE_CONNECTED) { doSceneBegin(); } //else if (evtArgs.mEventID == EventConst.ON_APP_ACTIVE) //{ // isAppActive = true; //} else { NetSceneSyncResult mObject = evtArgs.mObject as NetSceneSyncResult; if (mObject == null) { Log.e("DownloadVoiceService", "NetSceneSyncResult == null"); } else if ((mObject.syncStatus == SyncStatus.syncEnd) && (mObject.syncCount == 0)) { Log.d("DownloadVoiceService", string.Concat(new object[] { "onHander sync event result.syncStatus = ", mObject.syncStatus, " result.syncCount = ", mObject.syncCount, " DownloadVoiceService doSceneBegin" })); ServiceCenter.sceneNewSync.setRecvMsgStatus(RecvMsgStatus.isRecvVoice); isFirstSync = true; doSceneBegin(); } else if ((mObject.syncStatus == SyncStatus.syncEnd)) { Log.d("DownloadVoiceService", string.Concat(new object[] { "onHander sync event result.syncStatus = ", mObject.syncStatus, " result.syncCount = ", mObject.syncCount, " isAppActive = ", "isAppActive", " DownloadVoiceService doSceneBegin" })); ServiceCenter.sceneNewSync.setRecvMsgStatus(RecvMsgStatus.isRecvVoice); doSceneBegin(); } else { Log.d("DownloadVoiceService", string.Concat(new object[] { "onHander sync event result.syncStatus = ", mObject.syncStatus, " result.syncCount = ", mObject.syncCount })); } } } }
public void RenamesDirectory() { var newName = "newName"; var oldName = "oldName"; _configuration.LocalDirectory = "c:\\dir"; _fileWatcher.Setup(x => x.IsDirectory(It.IsAny <string>())).Returns(true); var watcher = new EventWatcher(_processor.Object, _configurationProvider.Object, _fileWatcher.Object); watcher.Start(); _fileWatcher.Raise(x => x.Renamed += null, new RenamedEventArgs(WatcherChangeTypes.Renamed, _configuration.LocalDirectory, newName, oldName)); var oldFullPath = Path.Combine(_configuration.LocalDirectory, oldName); _processor.Verify(x => x.RenameDirectory( It.Is <IDirectoryObject>(f => f.FullName == oldFullPath), newName)); }
public void PropertyLayoutStyle () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow; Assert.AreEqual (ToolStripLayoutStyle.VerticalStackWithOverflow, ts.LayoutStyle, "B1"); Assert.AreEqual ("LayoutCompleted;LayoutStyleChanged", ew.ToString (), "B2"); ew.Clear (); ts.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyFont () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); Font f = new Font ("Arial", 12); ts.Font = f; Assert.AreSame (f, ts.Font, "B1"); Assert.AreEqual ("LayoutCompleted", ew.ToString (), "B2"); ew.Clear (); ts.Font = f; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyForeColor () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.ForeColor = Color.BurlyWood; Assert.AreEqual (Color.BurlyWood, ts.ForeColor, "B1"); Assert.AreEqual ("ForeColorChanged", ew.ToString (), "B2"); ew.Clear (); ts.ForeColor = Color.BurlyWood; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyGripMargin () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.GripMargin = new Padding (6); Assert.AreEqual (new Padding (6), ts.GripMargin, "B1"); Assert.AreEqual ("LayoutCompleted", ew.ToString (), "B2"); ew.Clear (); ts.GripMargin = new Padding (6); Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyTextDirectionIEAE () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.TextDirection = (ToolStripTextDirection)42; }
public void PropertyGripStyle () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.GripStyle = ToolStripGripStyle.Hidden; Assert.AreEqual (ToolStripGripStyle.Hidden, ts.GripStyle, "B1"); Assert.AreEqual ("LayoutCompleted", ew.ToString (), "B2"); ew.Clear (); ts.GripStyle = ToolStripGripStyle.Hidden; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyImageList () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ImageList il = new ImageList (); ts.ImageList = il; Assert.AreSame (il, ts.ImageList, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); }
public void PropertyRowMargin () { ToolStripPanel tsp = new ToolStripPanel (); EventWatcher ew = new EventWatcher (tsp); tsp.RowMargin = new Padding (4); Assert.AreEqual (new Padding (4), tsp.RowMargin, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); tsp.RowMargin = new Padding (4); Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyOrientation () { ToolStripPanel tsp = new ToolStripPanel (); EventWatcher ew = new EventWatcher (tsp); tsp.Orientation = Orientation.Vertical; Assert.AreEqual (Orientation.Vertical, tsp.Orientation, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); tsp.Orientation = Orientation.Vertical; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyCheckOnClick () { ToolStripButton tsi = new ToolStripButton (); EventWatcher ew = new EventWatcher (tsi); tsi.CheckOnClick = true; Assert.AreEqual (true, tsi.CheckOnClick, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); tsi.CheckOnClick = true; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyImageScalingSize () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.ImageScalingSize = new Size (32, 32); Assert.AreEqual (new Size (32, 32), ts.ImageScalingSize, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); }
public void PropertyAutoToolTip () { ToolStripButton tsi = new ToolStripButton (); EventWatcher ew = new EventWatcher (tsi); tsi.AutoToolTip = true; Assert.AreEqual (true, tsi.AutoToolTip, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); tsi.AutoToolTip = true; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyRenderer () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ToolStripProfessionalRenderer pr = new ToolStripProfessionalRenderer (); ts.Renderer = pr; Assert.AreSame (pr, ts.Renderer, "B1"); Assert.AreEqual ("LayoutCompleted;RendererChanged", ew.ToString (), "B2"); Assert.AreEqual (ToolStripRenderMode.Custom, ts.RenderMode, "B4"); ew.Clear (); ts.Renderer = pr; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyCheckState () { ToolStripButton tsi = new ToolStripButton (); EventWatcher ew = new EventWatcher (tsi); tsi.CheckState = CheckState.Checked; Assert.AreEqual (CheckState.Checked, tsi.CheckState, "B1"); Assert.AreEqual ("CheckedChanged;CheckStateChanged", ew.ToString (), "B2"); ew.Clear (); tsi.CheckState = CheckState.Checked; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyRenderMode () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.RenderMode = ToolStripRenderMode.System; Assert.AreEqual (ToolStripRenderMode.System, ts.RenderMode, "B1"); Assert.AreEqual ("LayoutCompleted;RendererChanged", ew.ToString (), "B2"); ew.Clear (); ts.RenderMode = ToolStripRenderMode.System; Assert.AreEqual ("LayoutCompleted;RendererChanged", ew.ToString (), "B3"); }
public void PropertyRenderMode () { ToolStripPanel tsp = new ToolStripPanel (); EventWatcher ew = new EventWatcher (tsp); tsp.RenderMode = ToolStripRenderMode.System; Assert.AreEqual (ToolStripRenderMode.System, tsp.RenderMode, "B1"); // I refuse to call the event twice like .Net does. //Assert.AreEqual ("RendererChanged;RendererChanged", ew.ToString (), "B2"); ew.Clear (); tsp.RenderMode = ToolStripRenderMode.System; //Assert.AreEqual ("RendererChanged", ew.ToString (), "B3"); }
public void PropertyShowItemToolTips () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.ShowItemToolTips = false; Assert.AreEqual (false, ts.ShowItemToolTips, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); }
public void PropertyDefaultDropDownDirection () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.DefaultDropDownDirection = ToolStripDropDownDirection.AboveLeft; Assert.AreEqual (ToolStripDropDownDirection.AboveLeft, ts.DefaultDropDownDirection, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); }
public void PropertyTabStop () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.TabStop = true; Assert.AreEqual (true, ts.TabStop, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); }
public void PropertyLocked () { ToolStripPanel tsp = new ToolStripPanel (); EventWatcher ew = new EventWatcher (tsp); tsp.Locked = true; Assert.AreEqual (true, tsp.Locked, "B1"); Assert.AreEqual (string.Empty, ew.ToString (), "B2"); ew.Clear (); tsp.Locked = true; Assert.AreEqual (string.Empty, ew.ToString (), "B3"); }
public void PropertyDefaultDropDownDirectionIEAE () { ToolStrip ts = new ToolStrip (); EventWatcher ew = new EventWatcher (ts); ts.DefaultDropDownDirection = (ToolStripDropDownDirection)42; }