public void MBox_CorrectLeftCornerWidthHeightLength_MBoxReturned() { // arrange float width = 100, length = (float)58.3, height = 50; var expectedVertices = GetVertices(width, length, height); var expectedFacets = GetFacets(expectedVertices); MPoint leftFaceCorner = new MPoint((float)21.5, (float)45.39, 4); // act MBox actualBox = new MBox(leftFaceCorner, length, width, height); // assert CompareLogic compareLogic = new CompareLogic(); var vericesComparsionResult = compareLogic.Compare(expectedVertices, actualBox.Vertices); var facetsComparsionResult = compareLogic.Compare(expectedFacets, actualBox.Facets); Assert.IsTrue(vericesComparsionResult.AreEqual); Assert.IsTrue(facetsComparsionResult.AreEqual); Assert.AreEqual(width, actualBox.Width); Assert.AreEqual(length, actualBox.Length); Assert.AreEqual(height, actualBox.Height); }
static void Main(string[] args) { if (IsRunning.AllRunning()) { MBox.ErrorMessage("An instance of the application is already running."); } else { Mutex mutex = new Mutex(false, Self.LauncherMutex); try { if (mutex.WaitOne(0, false)) { if (args.Length != 0) { MBox.ErrorMessage("Arguments are not supported yet!\n\nPassed Arguments:\n" + String.Join(" ", args)); } //Register all components for launcher, including its settings and configs. Directory.SetCurrentDirectory(Path.GetDirectoryName(Application.ExecutablePath)); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); Application.Run(new MainWindow()); } } finally { mutex.Close(); } } }
public void show() { NLabel.Show(); NBox.Show(); MLabel.Show(); MBox.Show(); sceneImage.Show(); }
public void hide() { NLabel.Hide(); NBox.Hide(); MLabel.Hide(); MBox.Hide(); sceneImage.Hide(); }
private void Button_Click(object sender, RoutedEventArgs e) { var testBox = new MBox(new MPoint(0, 0, 0), 50, 50, 50); Scene.AddShape(testBox); screen.Source = Scene.Render(); //screen.Source = BitmapToImageSource(Scene.RenderBitmap()); }
private void btn_createShape_Click(object sender, RoutedEventArgs e) { float width = Int32.Parse(tb_width.Text); float length = Int32.Parse(tb_width.Text); float height = Int32.Parse(tb_width.Text); float x = Int32.Parse(tb_leftCornerX.Text); float y = Int32.Parse(tb_leftCornerY.Text); float z = Int32.Parse(tb_leftCornerZ.Text); var leftFaceCorner = new MPoint(x, y, z); MBox mbox = new MBox(leftFaceCorner, width, length, height); }
private void Button_Click_6(object sender, RoutedEventArgs e) { MBox.Show("Bingo", new Run[] { new Run() { Text = "font, ", Foreground = Brushes.Red, FontSize = 25 }, new Run() { Text = "size, ", Foreground = Brushes.Green, FontSize = 28 }, new Run() { Text = "color, ", Foreground = Brushes.Blue, FontSize = 35 }, new Run() { Text = "...is all ", Foreground = Brushes.Black, FontSize = 24, FontFamily = new FontFamily("Segoe Script") }, new Run() { Text = "up to you", Foreground = Brushes.Red, FontSize = 30, FontWeight = FontWeights.Bold } }, MBoxType.Normal); }
static void Main(string[] args) { Self.isDebugMode = Debugger.IsAttached; if (IsRunning.AllRunning()) { MBox.ErrorMessage("An instance of the application is already running."); } else { Mutex mutex = new Mutex(false, Self.LauncherMutex); try { if (mutex.WaitOne(0, false)) { if (args.Length != 0) { MBox.ErrorMessage("Arguments are not supported yet!\n\nPassed Arguments:\n" + String.Join(" ", args)); } Directory.SetCurrentDirectory(Path.GetDirectoryName(Application.ExecutablePath)); ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; Application.ThreadException += (sender, exception) => { ExceptionCapture((Exception)exception.Exception, "ThreadExceptionEventHandler"); }; AppDomain.CurrentDomain.UnhandledException += (sender, exception) => { ExceptionCapture((Exception)exception.ExceptionObject, "UnhandledExceptionEventHandler"); }; Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); Application.Run(new MainWindow(args)); } } finally { mutex.Close(); } } }
public static void ExceptionCapture(Exception exception, String className) { MBox.ErrorMessage(className + ": " + exception.Message); }
/// <summary> /// Returns XML string with all occurences of Active element "Data matrix". /// </summary> /// <param name="index">index of data source in FEplugin data sources table</param> /// <returns>XML string</returns> public static string getList(int index) { string resultString = ""; // result XML string string ErrStr = ""; // error reports // loading DTD to resultString try { resultString = XMLHelper.loadDTD(); } catch (Exception e) { #if (LADENI) MessageBox.Show("error while loading DTD: " + e.Message); #endif return(resultString); } // root element resultString += "<active_list>"; // processing of each box "Data matrix" #region searching a processing of each boxes Column (DataMiningCommon.DataMatrix) IBoxModule[] MatrBoxes = BoxesHelper.ListBoxesWithID(CFEsourcesTab.Sources[index] as CFEsource, "DataMiningCommon.DataMatrix"); // processing of each box Column foreach (IBoxModule MBox in MatrBoxes) { try { Rec_data_matrix rMatrix = new Rec_data_matrix(); // zaznam o datove matici // searching ID rMatrix.id = "matrix" + MBox.ProjectIdentifier.ToString(); // searching data source name (database) IBoxModule[] db_names = BoxesHelper.ListAncestBoxesWithID(MBox, "DataMiningCommon.Database"); if (db_names.GetLength(0) != 1) // searched more than one data source or neither one { throw new System.Exception("found " + db_names.GetLength(0).ToString() + " databases"); } rMatrix.db_name = (db_names[0].GetPropertyOther("DatabaseName") as StringT).stringValue; // searching data matrix name rMatrix.matrix_name = MBox.GetPropertyString("Name"); // searching records count rMatrix.record_count = MBox.GetPropertyLong("RecordCount").ToString(); // adding item to XML resultString += rMatrix.ToXML(); } catch (System.Exception e) { ErrStr += "Box ProjectIdentifier=" + MBox.ProjectIdentifier.ToString() + ": " + e.Message + "\n"; } } #endregion resultString += "</active_list>"; #if (LADENI) // Kody - storing output to file "XMLData_matrixExample.xml" in directory XMLHelper.saveXMLexample(resultString, "../XML/XMLData_matrixExample.xml"); if (ErrStr != "") { MessageBox.Show("Chyby pri generating seznamu Boolskych cedent:\n" + ErrStr); } #endif return(resultString); }
private void Button_Click_5(object sender, RoutedEventArgs e) { MBox.Show("tips", new Run[] { new Run("you can set the count down sec") }, new string[] { "ok", "ignore" }, MBoxType.Alarm, 10); }
private void Button_Click_4(object sender, RoutedEventArgs e) { MBox.Show("tips", "three option: the third option is for MBoxResult.Cancel", new string[] { "yes", "no", "cancel" }); }
private void Button_Click_3(object sender, RoutedEventArgs e) { MBox.Show("tips", "two option: one for MBoxResult.Yes, one for MBoxResult.No", new string[] { "yes", "no" }); }
private void Button_Click_2(object sender, RoutedEventArgs e) { MBox.Show("tips", "you can diy the chose option button content", new string[] { "Yes!" }); }
private void Button_Click_1(object sender, RoutedEventArgs e) { MBox.Show("Alert", "this is a alert mbox", MBoxType.Alarm); }
private void Button_Click(object sender, RoutedEventArgs e) { MBox.Show("this is a normal mbox"); }