public TileListWidget(Application application, TileSelection selection, Adjustment adjv) { this.selection = selection; selection.Changed += OnSelectionChanged; this.application = application; Tileset.LoadEditorImages = true; SetSizeRequest((TILE_WIDTH + SPACING_X) * TILES_PER_ROW, -1); ButtonPressEvent += OnButtonPress; ButtonReleaseEvent += OnButtonRelease; MotionNotifyEvent += OnMotionNotify; ScrollEvent += OnScroll; AddEvents((int) Gdk.EventMask.ButtonPressMask); AddEvents((int) Gdk.EventMask.ButtonReleaseMask); AddEvents((int) Gdk.EventMask.PointerMotionMask); AddEvents((int) Gdk.EventMask.ScrollMask); SizeAllocated += OnSizeAllocated; application.LevelChanged += OnLevelChanged; vadjustment = adjv; vadjustment.ValueChanged += OnVAdjustmentChangedValue; }
public Result Execute( ExternalCommandData commandData, ref string message, ElementSet elements) { // Get the access to the top most objects. UIApplication uiApp = commandData.Application; UIDocument uiDoc = uiApp.ActiveUIDocument; _app = uiApp.Application; _doc = uiDoc.Document; // (1) In eailer lab, CommandData command, we // learned how to access to the wallType. i.e., // here we'll take a look at more on the topic // of accessing to elements in the interal rvt // project database. ListFamilyTypes(); // (2) List instances of specific object class. ListInstances(); // (3) Find a specific family type. FindFamilyType(); // (4) Find specific instances, including filtering by parameters. FindInstance(); // (5) List all elements. ListAllElements(); // We are done. return Result.Succeeded; }
static void ExecuteJavaScrtiptFunction(string javaScript, string functionName, string args) { var app = new Application("Adobe InDesign CC 2014"); app.JavaScript(javaScript); Console.WriteLine(app.Execute(functionName, args)); }
// The sheets of the workbook are: // Sheet number 1: INPUTS // Sheet number 2: OUTPUTS // Sheet number 3: Cover // Sheet number 4: Amendment Record // Sheet number 5: Reference documents // Sheet number 6: Introduction // Sheet number 7: ETCS DMI inputs => to import // Sheet number 8: ETCS DMI outputs => to import // Sheet number 9: INPUT ITEMS // Sheet number 10: OUTPUT ITEMS // Sheet number 11: ANALYSIS /// <summary> /// Launches import of the excel file in the background task /// </summary> /// <param name="arg"></param> public override void ExecuteWork() { if (TheDictionary != null) { Application application = new Application(); if (application != null) { Workbook workbook = application.Workbooks.Open(FileName); if (workbook.Sheets.Count == 11) { Specification newSpecification = (Specification) acceptor.getFactory().createSpecification(); newSpecification.Name = "Start Stop Conditions"; TheDictionary.appendSpecifications(newSpecification); Chapter newChapter = (Chapter) acceptor.getFactory().createChapter(); newChapter.setId("1 - DMI inputs"); newSpecification.appendChapters(newChapter); Worksheet aWorksheet = workbook.Sheets[7] as Worksheet; importParagraphs(newChapter, "1", aWorksheet); newChapter = (Chapter) acceptor.getFactory().createChapter(); newChapter.setId("2 - DMI outputs"); newSpecification.appendChapters(newChapter); aWorksheet = workbook.Sheets[8] as Worksheet; importParagraphs(newChapter, "2", aWorksheet); } workbook.Close(false); } else { Log.ErrorFormat("Error while opening the excel file"); } application.Quit(); } }
public ExcelViewProvider(Application excelApplication) { workbooks = new Dictionary<Workbook, List<Window>>(); this.excelApplication = excelApplication; var monitor = new WorkbookClosedMonitor(excelApplication); monitor.WorkbookClosed += MonitorWorkbookClosed; }
public string WriteToFile(String fileName, City from, City to, List<Link> links) { object misValue = System.Reflection.Missing.Value; Application excelApplication = new Application(); Workbook excelWorkBook = excelApplication.Workbooks.Add(misValue); Worksheet excelWorkSheet = excelWorkBook.Worksheets.get_Item(1); excelWorkSheet.Cells[1, 1] = "From"; excelWorkSheet.Cells[1, 2] = "To"; excelWorkSheet.Cells[1, 3] = "Distance"; excelWorkSheet.Cells[1, 4] = "Transport Mode"; Range _range; _range = excelWorkSheet.get_Range("A1", "D1"); _range.Font.Size = 14; _range.Font.Bold = true; Borders borders = _range.Borders; borders.LineStyle = XlLineStyle.xlContinuous; borders.Weight = 2d; int j = 2; foreach (var l in links) { excelWorkSheet.Cells[j, 1] = l.FromCity.Name + " (" + l.FromCity.Country + ")"; excelWorkSheet.Cells[j, 2] = l.ToCity.Name + " (" + l.ToCity.Country + ")"; excelWorkSheet.Cells[j, 3] = l.Distance; excelWorkSheet.Cells[j, 4] = l.TransportMode.ToString(); ++j; } excelWorkBook.SaveAs(fileName); excelWorkBook.Close(); return "Ok"; }
static void Main(string[] args) { try { Application oApp = null; if (args.Length < 1) oApp = new Application(); else oApp = new Application(args[0]); Application.SBO_Application.StatusBar.SetSystemMessage("Start installing UDO's", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); AddonInfoInfo.InstallUDOs(); Application.SBO_Application.StatusBar.SetSystemMessage("UDO's installed successfully", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); Menu MyMenu = new Menu(); AddonInfoInfo.SetFormFilter(); Application.SBO_Application.StatusBar.SetSystemMessage("Adding menus", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); MyMenu.AddMenuItems(); Application.SBO_Application.StatusBar.SetSystemMessage("Menus Added Successfully", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); Application.SBO_Application.StatusBar.SetSystemMessage("Register listeners", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); var bListeners = new ApplicationHandlers(); Application.SBO_Application.StatusBar.SetSystemMessage("Items Transfer Add-on installed successfully.", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); oApp.Run(); } catch (Exception ex) { Utilities.LogException(ex); } }
public static void MyClassInitialize(TestContext testContext) { if (!Directory.Exists(Utility.RootFolder)) { Directory.CreateDirectory(Utility.RootFolder); } if (!Directory.Exists(Utility.TempFolder)) { Directory.CreateDirectory(Utility.TempFolder); } _mXmlNs = Utility.NS; _mOnGenerator = new OneNoteGenerator(Utility.RootFolder); //Get Id of the test notebook so we chould retrieve generated content //KindercareFormatConverter will create notebookName as Kindercare _mNotebookId = _mOnGenerator.CreateNotebook(NotebookName); var word = new Application(); var doc = word.Application.Documents.Add(); //add pages to doc for (int i = 1; i < DocPageTitles.Count; i++) { doc.Content.Text += DocPageTitles[i]; doc.Words.Last.InsertBreak(WdBreakType.wdPageBreak); } var filePath = TestDocPath as object; doc.SaveAs(ref filePath); ((_WordDocument)doc).Close(); ((_WordApplication)word).Quit(); }
public WordDocTargetHost(Application app) { _app = app; _app.DocumentOpen += OnMsWordDocumentOpen; _app.DocumentBeforeClose += OnMsWordDocumentBeforeClose; }
// PUT api/Applications/5 public HttpResponseMessage PutApplication(int id, Application application) { if (!ModelState.IsValid) { return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } if (id != application.Id) { return Request.CreateResponse(HttpStatusCode.BadRequest); } db.Entry(application).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException ex) { return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex); } return Request.CreateResponse(HttpStatusCode.OK); }
private Mutex mutex = null; // синхронизатор #endregion Fields #region Constructors public ChannelsViewForm(Application _app) { app = _app; InitializeComponent(); mutex = new Mutex(); }
public LayerListWidget(Application application) { this.application = application; RowSeparatorFunc = OurRowSeparatorFunc; ButtonPressEvent += OnButtonPressed; VisibilityRenderer visibilityRenderer = new VisibilityRenderer(); visibilityRenderer.VisibilityChanged += OnVisibilityChange; TreeViewColumn visibilityColumn = new TreeViewColumn("Visibility", visibilityRenderer); visibilityColumn.SetCellDataFunc(visibilityRenderer, (TreeCellDataFunc)VisibilityDataFunc); AppendColumn(visibilityColumn); CellRendererText TextRenderer = new CellRendererText(); TreeViewColumn TypeColumn = new TreeViewColumn(); TypeColumn.PackStart(TextRenderer, true); TypeColumn.SetCellDataFunc(TextRenderer, (TreeCellDataFunc)TextDataFunc); TypeColumn.Title = "Type"; AppendColumn(TypeColumn); HeadersVisible = false; application.SectorChanged += OnSectorChanged; application.TilemapChanged += OnTilemapChanged; application.LevelChanged += OnLevelChanged; FieldOrProperty.AnyFieldChanged += OnFieldModified; }
public void TestFixtureSetUp() { SingletonProvider<TestSetup>.Instance.Authenticate(); _application = SingletonProvider<TestSetup>.Instance.GetApp(); _settings = _application.Settings; }
public async void Guards() { Application application = new Application("OrchestrateApiKey"); var client = new Client(application); var exception = await Assert.ThrowsAsync<ArgumentException>( () => client.CreateCollectionAsync(string.Empty, string.Empty, string.Empty) ); Assert.Equal("collectionName", exception.ParamName); exception = await Assert.ThrowsAsync<ArgumentNullException>( () => client.CreateCollectionAsync(null, string.Empty, string.Empty) ); Assert.Equal("collectionName", exception.ParamName); exception = await Assert.ThrowsAsync<ArgumentException>( () => client.CreateCollectionAsync(collectionName, string.Empty, string.Empty) ); Assert.Equal("key", exception.ParamName); exception = await Assert.ThrowsAsync<ArgumentNullException>( () => client.CreateCollectionAsync(collectionName, null, string.Empty) ); Assert.Equal("key", exception.ParamName); exception = await Assert.ThrowsAsync<ArgumentNullException>( () => client.CreateCollectionAsync<object>(collectionName, "jguid", null) ); Assert.Equal("item", exception.ParamName); }
static void Main(string[] args) { try { Application oApp = null; if (args.Length < 1) { oApp = new Application(); } else { oApp = new Application(args[0]); } Menu MyMenu = new Menu(); MyMenu.AddMenuItems(); oApp.RegisterMenuEventHandler(MyMenu.SBO_Application_MenuEvent); Application.SBO_Application.AppEvent += new SAPbouiCOM._IApplicationEvents_AppEventEventHandler(SBO_Application_AppEvent); // openGRPO(); // updateLandedCost(); //testLandedCost(); AddLandedCostXML(); oApp.Run(); } catch (Exception ex) { //SAPbobsCOM.Company oCompany = Application.SBO_Application.Company.GetDICompany() as SAPbobsCOM.Company; //string s = oCompany.GetLastErrorDescription(); System.Windows.Forms.MessageBox.Show(ex.Message); } }
public CalDavSynchronizerToolBar (Application application, ComponentContainer componentContainer, object missing) { _componentContainer = componentContainer; var toolBar = application.ActiveExplorer().CommandBars.Add ("CalDav Synchronizer", MsoBarPosition.msoBarTop, false, true); var toolBarBtnOptions = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing); toolBarBtnOptions.Style = MsoButtonStyle.msoButtonIconAndCaption; toolBarBtnOptions.Caption = "Options"; toolBarBtnOptions.FaceId = 222; // builtin icon: hand hovering above a property list toolBarBtnOptions.Tag = "View or set CalDav Synchronizer options"; toolBarBtnOptions.Click += ToolBarBtn_Options_OnClick; _toolBarBtnSyncNow = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing); _toolBarBtnSyncNow.Style = MsoButtonStyle.msoButtonIconAndCaption; _toolBarBtnSyncNow.Caption = "Synchronize"; _toolBarBtnSyncNow.FaceId = 107; // builtin icon: lightning hovering above a calendar table _toolBarBtnSyncNow.Tag = "Synchronize now"; _toolBarBtnSyncNow.Click += ToolBarBtn_SyncNow_OnClick; var toolBarBtnAboutMe = (CommandBarButton) toolBar.Controls.Add (1, missing, missing, missing, missing); toolBarBtnAboutMe.Style = MsoButtonStyle.msoButtonIconAndCaption; toolBarBtnAboutMe.Caption = "About"; toolBarBtnAboutMe.FaceId = 487; // builtin icon: blue round sign with "i" letter toolBarBtnAboutMe.Tag = "About CalDav Synchronizer"; toolBarBtnAboutMe.Click += ToolBarBtn_About_OnClick; toolBar.Visible = true; }
public override void Initialize(ContentRepository.Content context, string backUri, Application application, object parameters) { base.Initialize(context, backUri, application, parameters); //if (string.Compare(PortalContext.Current.AuthenticationMode, "windows", StringComparison.CurrentCultureIgnoreCase) != 0) // this.Forbidden = true; }
private WordApplicationProxy() { _Documents = new ObservableCollection<WordDocumentProxy>(); _State = WordApplicationProxyState.NotRunning; _WApplication = null; RefreshWordDocuments(); }
public static void SaveMessage(string[] recipients, string subject, string body, string[] attachments, string filepath) { var curpwd = FileIO.PresentWorkingDirectory(); var outlookApplication = new Application(); var mailObject = outlookApplication.CreateItem(OlItemType.olMailItem) as MailItem; mailObject.Body = body; mailObject.Subject = subject; if (recipients != null) { foreach (var recipient in recipients) { mailObject.Recipients.Add(recipient); } } if (attachments != null) { foreach (var attachment in attachments) { if ((attachment ?? string.Empty) != string.Empty) mailObject.Attachments.Add(attachment); } } mailObject.SaveAs(FileIO.CombinePath(curpwd, "sample.msg")); }
public SessionFactory(Application app, MessageStoreFactory storeFactory, LogFactory logFactory, IMessageFactory messageFactory) { application_ = app; messageStoreFactory_ = storeFactory; logFactory_ = logFactory; messageFactory_ = messageFactory ?? new DefaultMessageFactory(); }
public void Setup() { _application = LaunchApplication(); _horizonWindow = FindMainWindow(); CustomCommandSerializer.AddKnownTypes(typeof(Background)); }
bool WordOpen(string file) { var tmp = CopyFile(file); var application = new Application(); using (new ComRelease(application)) { try { var documents = application.Documents; using (new ComRelease(documents)) { var document = documents.Open(tmp); using (new ComRelease(document)) { object saveChanges = WdSaveOptions.wdDoNotSaveChanges; document.Close(ref saveChanges); return true; } } } finally { application.Quit(); File.Delete(tmp); } } }
public void AddChildNodesToGroupTest() { Application application = new Application(); try { // Where ever we are creating object for WorkflowController_Accessor, we need to set the ThisAddIn_Accessor.ExcelApplication to // wither null or actual application object. ThisAddIn_Accessor.ExcelApplication = application; Group childGroup = new Group("Earth", GroupType.ReferenceFrame, null); Layer layer = new Layer(); layer.Name = "Layer1"; layer.Group = childGroup; LayerMap_Accessor localLayerMap = new LayerMap_Accessor(layer); localLayerMap.MapType = LayerMapType.Local; GroupChildren groupChild = LayerMapExtensions_Accessor.AddChildNodesToGroup(localLayerMap); Assert.AreEqual("Earth", groupChild.Name); Assert.AreEqual(1, groupChild.AllChildren.Count); Assert.AreEqual(1, groupChild.Layers.Count); foreach (Layer layerVal in groupChild.Layers) { Assert.AreEqual("Layer1", layerVal.Name); } } finally { application.Close(); } }
public void ExportToExcel(object sender, EventArgs e) { var tableRow = _table.Rows; //Open Excel and get worksheet var app = new Application(); var workbook = app.Workbooks.Add(); var worksheet = workbook.Worksheets[1] as Microsoft.Office.Interop.Excel.Worksheet; //Add headers worksheet.Cells[1, 1] = "Reference #"; worksheet.Cells[1, 2] = "Part #"; worksheet.Cells[1, 3] = "Description | Serial #"; worksheet.Cells[1, 4] = "Quantity"; worksheet.Cells[1, 5] = "Additional Information"; for (int x = 0; x < _table.Rows.Count; x++) { worksheet.Cells[x + 2, 1] = tableRow[x].ItemArray[0]; worksheet.Cells[x + 2, 2] = tableRow[x].ItemArray[1]; worksheet.Cells[x + 2, 3] = tableRow[x].ItemArray[2]; worksheet.Cells[x + 2, 4] = tableRow[x].ItemArray[3]; worksheet.Cells[x + 2, 5] = tableRow[x].ItemArray[4]; } //save gvDetails.DataSource = _table; gvDetails.DataBind(); HttpContext.Current.Session["name"] = _table; //Response.WriteFile(workbook.SaveAs("C:\\test2.xlsx")); }
public void TestDomainAdminAccessOtherDomain() { Account account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "*****@*****.**", "test"); account.AdminLevel = eAdminLevel.hAdminLevelDomainAdmin; account.Save(); SingletonProvider<TestSetup>.Instance.AddDomain("example.com"); var newApplication = new Application(); newApplication.Authenticate("*****@*****.**", "test"); Assert.AreEqual(1, newApplication.Domains.Count); Domains domains = SingletonProvider<TestSetup>.Instance.GetApp().Domains; Assert.AreEqual(2, domains.Count); try { Domain secondDomain = newApplication.Domains.get_ItemByName("example.com"); Assert.Fail("Was able to access other domain."); } catch (COMException ex) { Assert.IsTrue(ex.Message.Contains("Invalid index.")); } }
public new void SetUp() { TestSetup.AssertSpamAssassinIsRunning(); // Enable spam assassin application = SingletonProvider<TestSetup>.Instance.GetApp(); hMailServer.AntiSpam antiSpam = _settings.AntiSpam; account = SingletonProvider<TestSetup>.Instance.AddAccount(_domain, "*****@*****.**", "test"); // Disallow incorrect line endings. antiSpam.SpamMarkThreshold = 1; antiSpam.SpamDeleteThreshold = 10000; antiSpam.AddHeaderReason = true; antiSpam.AddHeaderSpam = true; antiSpam.PrependSubject = true; antiSpam.PrependSubjectText = "ThisIsSpam"; // Enable SpamAssassin antiSpam.SpamAssassinEnabled = true; antiSpam.SpamAssassinHost = "localhost"; antiSpam.SpamAssassinPort = 783; antiSpam.SpamAssassinMergeScore = false; antiSpam.SpamAssassinScore = 5; }
public void FirstWhileWaiting() { var trigger = true; var expected = TestHelper.CreateElement("Expected", "Expected"); var application = new Application(null); var host = TestHelper.CreateMock<ElementHost>(application, null); var element = TestHelper.CreateElement("Root", "Root", host.Object); host.Object.Application.Timeout = TimeSpan.FromSeconds(1); host.Setup(x => x.Refresh()) .Returns(() => { trigger = !trigger; if (trigger) { host.Object.Children.Add(expected); } return host.Object; }); var actual = host.Object.First(expected.Id); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); }
static Startup() { CommandModel commandModel = new CommandModel("sc").AddArgument("port", new CommandArgument("type", "number")) .AddArgument("path", new CommandArgument("type", "string")) .AddArgument("logs", new CommandArgument("type", "boolean")); ApplicationOptions options; try { options = (ApplicationOptions)CommandLine.Parse(commandModel); options.Port = Script.Or(options.Port, Number.ParseInt(Node.Process.Environment["PORT"]), 1337); options.Path = Script.Or(options.Path, Node.Process.GetCurrentDirectory()); Runtime.EnableTrace = options.Logs; } catch (Exception e) { Console.Log(e.Message); Console.Log(commandModel.ToString()); return; } Application app = new Application(options); app.Run(); }
public void Wrapup() { if (wb != null) { try { wb.Close(SaveChanges: false); app.DisplayAlerts = displayAlerts; // reset to whatever it was before } finally { wb = null; } } if (app != null) { try { app.Quit(); } finally { app = null; } } }
public void ImportDataFile(ClassDataFile file) { try { string newFileLoc = this.UpdateTemplate(file); Application app = new Application(); Package package = null; //Load the SSIS Package which will be executed package = app.LoadPackage(newFileLoc, null); //Pass the varibles into SSIS Package //Execute the SSIS Package and store the Execution Result Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = package.Execute(); //Check the results for Failure and Success if (results == Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure) { string err = ""; foreach (Microsoft.SqlServer.Dts.Runtime.DtsError local_DtsError in package.Errors) { string error = local_DtsError.Description.ToString(); err = err + error; } } } catch (Exception ex) { throw ex; } }
public void ExitGame() { Application.Quit(); }
/// <summary> /// This is the event handler for the "FormClosing" event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CalculatorForm_FormClosing(object sender, FormClosingEventArgs e) { Application.Exit();// terminate the application }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormAccidente()); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new TeamBuilder()); }
public static void Main() { Application.Run(new War()); }
public void ExitAsk() { Application.Quit(); }
void OnGUI() { if (!UIUtils.Initialized || UIUtils.CurrentWindow == null) { EditorGUILayout.LabelField(NoASEWindowWarning); return; } if (m_init) { Init(); } TitleLabelWidth = (int)(this.position.width * 0.42f); KeyCode key = Event.current.keyCode; if (key == ShortcutsManager.ScrollUpKey) { m_currentScrollPos.y -= 10; if (m_currentScrollPos.y < 0) { m_currentScrollPos.y = 0; } Event.current.Use(); } if (key == ShortcutsManager.ScrollDownKey) { m_currentScrollPos.y += 10; Event.current.Use(); } if (Event.current.type == EventType.MouseDrag && Event.current.button > 0) { m_currentScrollPos.x += Constants.MenuDragSpeed * Event.current.delta.x; if (m_currentScrollPos.x < 0) { m_currentScrollPos.x = 0; } m_currentScrollPos.y += Constants.MenuDragSpeed * Event.current.delta.y; if (m_currentScrollPos.y < 0) { m_currentScrollPos.y = 0; } } m_availableArea = new Rect(WindowPosX, WindowPosY, position.width - 2 * WindowPosX, position.height - 2 * WindowPosY); GUILayout.BeginArea(m_availableArea); { if (GUILayout.Button("Wiki Page")) { Application.OpenURL(Constants.HelpURL); } m_currentScrollPos = GUILayout.BeginScrollView(m_currentScrollPos); { EditorGUILayout.BeginVertical(); { NodeUtils.DrawPropertyGroup(ref m_portAreaFoldout, PortLegendTitle, DrawPortInfo); float currLabelWidth = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = 1; NodeUtils.DrawPropertyGroup(ref m_editorShortcutAreaFoldout, EditorShortcutsTitle, DrawEditorShortcuts); NodeUtils.DrawPropertyGroup(ref m_menuShortcutAreaFoldout, MenuShortcutsTitle, DrawMenuShortcuts); NodeUtils.DrawPropertyGroup(ref m_nodesShortcutAreaFoldout, NodesShortcutsTitle, DrawNodesShortcuts); NodeUtils.DrawPropertyGroup(ref m_compatibleAssetsFoldout, CompatibleAssetsTitle, DrawCompatibleAssets); NodeUtils.DrawPropertyGroup(ref m_nodesDescriptionAreaFoldout, NodesDescTitle, DrawNodeDescriptions); EditorGUIUtility.labelWidth = currLabelWidth; } EditorGUILayout.EndVertical(); } GUILayout.EndScrollView(); } GUILayout.EndArea(); }
void HandleTreeviewFilesTestExpandRow (object o, TestExpandRowArgs args) { TreeIter iter; if (changedpathstore.IterChildren (out iter, args.Iter)) { string[] diff = changedpathstore.GetValue (iter, colDiff) as string[]; if (diff != null) return; string path = (string)changedpathstore.GetValue (args.Iter, colPath); changedpathstore.SetValue (iter, colDiff, new string[] { GettextCatalog.GetString ("Loading data...") }); var rev = SelectedRevision; ThreadPool.QueueUserWorkItem (delegate { string text = ""; try { text = info.Repository.GetTextAtRevision (path, rev); } catch (Exception e) { Application.Invoke (delegate { LoggingService.LogError ("Error while getting revision text", e); MessageService.ShowError ("Error while getting revision text.", "The file may not be part of the working copy."); }); return; } Revision prevRev = null; try { prevRev = rev.GetPrevious (); } catch (Exception e) { Application.Invoke (delegate { LoggingService.LogError ("Error while getting previous revision", e); MessageService.ShowException (e, "Error while getting previous revision."); }); return; } string[] lines; // Indicator that the file was binary if (text == null) { lines = new [] { " Binary files differ" }; } else { var changedDocument = new Mono.TextEditor.TextDocument (text); if (prevRev == null) { lines = new string [changedDocument.LineCount]; for (int i = 0; i < changedDocument.LineCount; i++) { lines[i] = "+ " + changedDocument.GetLineText (i + 1).TrimEnd ('\r','\n'); } } else { string prevRevisionText = ""; try { prevRevisionText = info.Repository.GetTextAtRevision (path, prevRev); } catch (Exception e) { Application.Invoke (delegate { LoggingService.LogError ("Error while getting revision text", e); MessageService.ShowError ("Error while getting revision text.", "The file may not be part of the working copy."); }); return; } if (String.IsNullOrEmpty (text)) { if (!String.IsNullOrEmpty (prevRevisionText)) { lines = new string [changedDocument.LineCount]; for (int i = 0; i < changedDocument.LineCount; i++) { lines [i] = "- " + changedDocument.GetLineText (i + 1).TrimEnd ('\r','\n'); } } } var originalDocument = new Mono.TextEditor.TextDocument (prevRevisionText); originalDocument.FileName = "Revision " + prevRev; changedDocument.FileName = "Revision " + rev; lines = Mono.TextEditor.Utils.Diff.GetDiffString (originalDocument, changedDocument).Split ('\n'); } } Application.Invoke (delegate { changedpathstore.SetValue (iter, colDiff, lines); }); }); } }
static void RunApplication() { CoreDLL.SystemIdleTimerReset(); //comandos.Name = "comandos"; //comandos.Clear(); //posicion.Name = "posicion"; //status.Name = "status"; mobile.StackFailure += ClientMobileStackFailure; mobile.destination = new Destination(); try { ServerAddress = new IPEndPoint(IPAddress.Parse(ConfigurationManager.AppSettings["ip_address"]) ?? IPAddress.Any, 2357); HostAddress = new IPEndPoint(IPAddress.Parse("169.254.2.2") ?? IPAddress.Any, 2357); // establezo la direccion UDP y UIQ (inter queue) //mobile.destination.UIQ = mobile.destination.UDP = SystemState.ActiveSyncStatus == ActiveSyncStatus.Synchronizing ? HostAddress : ServerAddress; mobile.destination.UIQ = mobile.destination.UDP = ServerAddress; restart_timer = Convert.ToInt32(ConfigurationManager.AppSettings["restart_timer"]); if (restart_timer == 0) { restart_timer = 300 * 1000; } shutdown_timer = Convert.ToInt32(ConfigurationManager.AppSettings["shutdown_timer"]); if (shutdown_timer == 0) { shutdown_timer = 300 * 1000; } connection_timer = Convert.ToInt32(ConfigurationManager.AppSettings["connection_timer"]); if (connection_timer == 0) { connection_timer = 60 * 1000; } GpsMinimunPDOP = Convert.ToInt32(ConfigurationManager.AppSettings["gps_min_pdop"]); if (GpsMinimunPDOP == 0) { GpsMinimunPDOP = 8; } fix_interval = Convert.ToInt32(ConfigurationManager.AppSettings["gps_fix_interval"]); if (fix_interval == 0) { fix_interval = 60; } destination_area_radio = Convert.ToInt32(ConfigurationManager.AppSettings["gps_area_radio"]); if (destination_area_radio == 0) { destination_area_radio = 1500; } //notschedule = (ConfigurationManager.AppSettings["hack_not_re_schedule"] == "active" ? true : false); var auto_gc = ConfigurationManager.AppSettings["hack_auto_gc"]; /*if (!string.IsNullOrEmpty(auto_gc)) { * T.TRACE(String.Format("HACK: Activo GeoCerca Automatica de Pruebas {0}",auto_gc)); * var dummy = new byte[2]; * comandos.Push(auto_gc, dummy); * }*/ } catch (Exception) { T.ERROR("ERROR FATAL: La configuracion no es valida, revisar."); T.ERROR("CUIDADO!!! No se programa el restart, debe ejecutar la aplicacion manualmente."); return; } #if false mobile.IMEI = iPaqUtil.GetDeviceSN(); #else mobile.IMEI = "HTC-GUSTAVO"; #endif using (var script_hlp = File.Create(@"\Temp\pdaserial.txt")) { var buffer = Encoding.ASCII.GetBytes(mobile.IMEI); script_hlp.Write(buffer, 0, buffer.GetLength(0)); } mobile.Password = "******"; mobile.Init(2357, 2358, 8192, "entrante", "saliente"); T.INFO("COMM: Init convocado."); network = new Thread(NetworkProc); T.INFO("NETWORK: lanzando hilo."); network.Start(); tracker = new Thread(TrackerProc); T.INFO("TRACKER: lanzando hilo."); tracker.Start(); CoreDLL.SystemIdleTimerReset(); IntPtr wavHandle = CoreDLL.SetPowerRequirement("WAV1:", CEDEVICE_POWER_STATE.D0, DevicePowerFlags.POWER_NAME | DevicePowerFlags.POWER_FORCE, IntPtr.Zero, 0); if (wavHandle == IntPtr.Zero) { throw new System.ComponentModel.Win32Exception(); } var gpsHandle = CoreDLL.SetPowerRequirement("GPD0:", CEDEVICE_POWER_STATE.D0, DevicePowerFlags.POWER_NAME | DevicePowerFlags.POWER_FORCE, IntPtr.Zero, 0); if (gpsHandle == IntPtr.Zero) { throw new System.ComponentModel.Win32Exception(); } CoreDLL.Beep(1); T.TRACE("Lanzando Urbetrack Ready"); LaunchGatewayRunning(); var upgrade_count = 0; while (running) { CoreDLL.SystemIdleTimerReset(); if (upgrade_count == 0) { T.TRACE("Lanzando Urbetrack Update"); LaunchGatewayUpgrade(); upgrade_count = 360; } upgrade_count--; for (var x = 0; x < 10; x++) { Thread.Sleep(1000); Application.DoEvents(); } var comando = ""; try { Thread.Sleep(1000); /*comandos.Pop(ref comando); * if (comando.Length > 0) * ProcessCommand(comando);*/ } catch (Exception e) { T.EXCEPTION(e, "Command Processor"); } } if (wavHandle != IntPtr.Zero) { CoreDLL.ReleasePowerRequirement(wavHandle); } if (gpsHandle != IntPtr.Zero) { CoreDLL.ReleasePowerRequirement(gpsHandle); } T.INFO("URBEMOBILE: hora de ahorar energia..."); mobile.Close(); network.Join(10000); T.INFO("URBEMOBILE: network sincronizada."); //supervisor.Join(10000); //T.INFO("URBEMOBILE: supervisor sincornizado."); tracker.Join(10000); T.INFO("URBEMOBILE: tracker sincornizado."); T.TRACE("--- URBEMOBILE TERMINADO ---"); Beep("end_app"); }
public void OpenGamePage() { Application.OpenURL(URL); }
private void btn_salir_Click(object sender, EventArgs e) { Application.Exit(); }
private void Button_Exit_Click(object sender, EventArgs e) { Application.Exit(); }
// Update is called once per frame void Update() { transform.position = Vector3.Lerp(transform.position, pos[groupState].position, 0.05f); transform.rotation = Quaternion.Lerp(transform.rotation, pos[groupState].rotation, 0.05f); timer -= Time.deltaTime; if (timer < 0) { if (Input.GetAxis("P1_HorizontalMovement") > 0.19f || Input.GetKeyDown(KeyCode.D)) { if (buttonState < Groups[groupState].transform.childCount - 1) { if (!playerSelectActive) GetComponent<AudioSource>().PlayOneShot(sideBop, 0.25f); timer = 0.1f; buttonState++; } } if (Input.GetAxis("P1_HorizontalMovement") < -0.19f && buttonState > 0 || Input.GetKeyDown(KeyCode.A)) { if (buttonState > 0) { if (!playerSelectActive) GetComponent<AudioSource>().PlayOneShot(sideBop, 0.25f); timer = 0.1f; buttonState--; } } } if (groupState == 3) { num = PlayerPrefs.GetInt("NumOfPlayers"); switch (num) { case 2: if (Groups[3].transform.GetChild(0).GetComponent<MenuChoice>().Ready && Groups[3].transform.GetChild(1).GetComponent<MenuChoice>().Ready) { Application.LoadLevel(levelselected); } break; case 3: if (Groups[3].transform.GetChild(0).GetComponent<MenuChoice>().Ready && Groups[3].transform.GetChild(1).GetComponent<MenuChoice>().Ready && Groups[3].transform.GetChild(2).GetComponent<MenuChoice>().Ready) { Application.LoadLevel(levelselected); } break; case 4: if (Groups[3].transform.GetChild(0).GetComponent<MenuChoice>().Ready && Groups[3].transform.GetChild(1).GetComponent<MenuChoice>().Ready && Groups[3].transform.GetChild(2).GetComponent<MenuChoice>().Ready && Groups[3].transform.GetChild(3).GetComponent<MenuChoice>().Ready) { Application.LoadLevel(levelselected); } break; } } if (Input.GetButtonDown("P1_A") || Input.GetKeyDown(KeyCode.W)) { switch (groupState) { case 0: // play switch (buttonState) { case 0: // Play PlayButton(); break; case 1: // Controls ControlsButton(); break; case 2: // Exit CreditsButton(); break; case 3: // Exit ExitButton(); break; } break; case 1: // Player Num switch (buttonState) { case 0: // 2 Players2(); break; case 1: // 3 Players3(); break; case 2: // 4 Players4(); break; } break; case 2: // Map switch (buttonState) { case 0: // Suburban Level1(); break; case 1: // Graveyard Level2(); break; case 2: // Mansion Level3(); break; } break; case 3: // PlayerSelect break; } buttonState = 0; } if (!playerSelectActive) { if (Input.GetButtonDown("P1_B") || Input.GetKeyDown(KeyCode.S)) { buttonState = 0; if (groupState == 4 || groupState == 5) BacktoMain(); else Back(); } } //if (Groups[groupState].GetComponent<Group>().Buttons[buttonState].CompareTag("Menu")) if (groupState != 3 && groupState != 5) Groups[groupState].GetComponent<Group>().Buttons[buttonState].GetComponent<Select>().selected = true; }
public void Quit() { Application.Quit(); }
private void selectRegAdressAction_CustomizePopupWindowParams(object sender, CustomizePopupWindowParamsEventArgs e) { IObjectSpace objectSpace = Application.CreateObjectSpace(); e.View = Application.CreateDetailView(objectSpace, new Address(((XPObjectSpace)objectSpace).Session)); }
private void Principal_FormClosing(object sender, FormClosingEventArgs e) { Application.Exit(); }
public void EndGame() { Application.Quit(); }
public void ExitButton() { Application.Quit(); }
public new bool InitForm(string uid, string xmlPath, ref Application application, ref SAPbobsCOM.Company company, ref CSBOFunctions SBOFunctions, ref TGlobalVid _GlobalSettings) { bool Result = base.InitForm(uid, xmlPath, ref application, ref company, ref SBOFunctions, ref _GlobalSettings); try { oRecordSet = (SAPbobsCOM.Recordset)(FCmpny.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)); FSBOf.LoadForm(xmlPath, "FM_UMISO.srf", uid); oForm = FSBOApp.Forms.Item(uid); oForm.AutoManaged = false; oForm.SupportedModes = -1; // afm_All Flag = false; oForm.Freeze(true); if (GlobalSettings.RunningUnderSQLServer) { s = @"select count(*) Cont from [@FM_UMISO]"; } else { s = @"select count(*) ""Cont"" from ""@FM_UMISO"" "; } oRecordSet.DoQuery(s); if ((System.Int32)(oRecordSet.Fields.Item("Cont").Value) > 0) { oForm.Mode = BoFormMode.fm_UPDATE_MODE; } else { oForm.Mode = BoFormMode.fm_ADD_MODE; } oGrid = (Grid)(oForm.Items.Item("3").Specific); oDBDSHeader = oForm.DataSources.DBDataSources.Add("@FM_UMISO"); oDataTable = oForm.DataSources.DataTables.Add("UMISO"); if (GlobalSettings.RunningUnderSQLServer) { s = @"select Code, Name, U_UMBASE, U_UMISO from [@FM_UMISO] UNION ALL select CAST('' as varchar(20)), CAST('' as varchar(20)), CAST('' as varchar(20)), CAST('' as varchar(50))"; } else { s = @"select ""Code"", ""Name"", ""U_UMBASE"", ""U_UMISO"" from ""@FM_UMISO"" UNION ALL select CAST('' as varchar(20)), CAST('' as varchar(20)), CAST('' as varchar(20)), CAST('' as varchar(50)) FROM DUMMY "; } oDataTable.ExecuteQuery(s); oGrid.DataTable = oDataTable; oGrid.Columns.Item("Code").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Code")); var oEditCol = (EditTextColumn)(oColumn); oEditCol.Editable = true; oEditCol.TitleObject.Caption = "Codigo"; oGrid.Columns.Item("Name").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("Name")); oEditCol = (EditTextColumn)(oColumn); oEditCol.Editable = true; oEditCol.Visible = false; oEditCol.TitleObject.Caption = "Descripción"; oGrid.Columns.Item("U_UMBASE").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("U_UMBASE")); oEditCol = (EditTextColumn)(oColumn); oEditCol.Editable = true; oEditCol.TitleObject.Caption = "UM Base"; oGrid.Columns.Item("U_UMISO").Type = BoGridColumnType.gct_EditText; oColumn = (GridColumn)(oGrid.Columns.Item("U_UMISO")); oEditCol = (EditTextColumn)(oColumn); oEditCol.Editable = true; oEditCol.TitleObject.Caption = "UM ISO"; oGrid.AutoResizeColumns(); } catch (Exception e) { OutLog("InitForm: " + e.Message + " ** Trace: " + e.StackTrace); FSBOApp.MessageBox(e.Message + " ** Trace: " + e.StackTrace, 1, "Ok", "", ""); } oForm.Freeze(false); return(Result); }//fin InitForm
static void Main() { Application.Run(new MainForm()); }
public void QuitClick() { Debug.Log("Quit"); Application.Quit(); }
private static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MultiPageForm()); }
private void SignUp_Close_Click(object sender, EventArgs e) { if (MessageBox.Show("Are You sure to exit application?", "Exit Application", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button1) == DialogResult.Yes) Application.Exit(); }
private void Exit(object sender, EventArgs e) { Application.Exit(); }
public void QuitRequest() { Debug.Log("i want to quit"); Application.Quit(); }
public void QuitGame() { song.Stop(); Application.Quit(); }
public void QuitGame() { Debug.Log("QUIT!"); Application.Quit(); }
/// <summary> /// Scan and load plugin files for configuration /// </summary> public static void Initialize() { //ConfigurationApplicationContext.s_configurationPanels.Add(new ClientRegistryAboutPanel()); // Load DB providers foreach (var file in Directory.GetFiles(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "*.dll")) { try { Application.DoEvents(); Assembly asm = Assembly.LoadFrom(file); // Scan assembly for database configurators foreach (var typ in asm.GetTypes()) { ConstructorInfo ci = typ.GetConstructor(Type.EmptyTypes); if (ci != null) { if (typeof(IDatabaseProvider).IsAssignableFrom(typ)) DatabaseConfiguratorRegistrar.Configurators.Add(ci.Invoke(null) as IDatabaseProvider); } } } catch (Exception e) { Console.WriteLine("ERROR: {0} : {1}", file, e.ToString()); } } // Load Panels foreach (var file in Directory.GetFiles(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "*.dll")) { try { Application.DoEvents(); Assembly asm = Assembly.LoadFrom(file); // Scan assembly for configuration panels foreach (var typ in Array.FindAll<Type>(asm.GetTypes(), o => o.GetInterface(typeof(IConfigurableFeature).FullName) != null)) { ConstructorInfo ci = typ.GetConstructor(Type.EmptyTypes); if (ci != null) { try { var config = ci.Invoke(null); Console.WriteLine("Adding panel {0}...", config.ToString()); ConfigurationApplicationContext.s_configurationPanels.Add(config as IConfigurableFeature); if (config is IDataboundFeature) DatabaseConfiguratorRegistrar.Features.Add(config as IDataboundFeature); } catch (Exception e) { Console.WriteLine("ERROR: {0} : {1}", file, e.ToString()); } } } } catch (Exception e) { Console.WriteLine("ERROR: {0} : {1}", file, e.ToString()); } } }
void FormConfig_FormClosing(object sender, FormClosingEventArgs e) { Application.RemoveMessageFilter(this); }
private void menuClose_Click(object sender, EventArgs e) { Application.Exit(); }