public void AwakeFromNib() { // set appearance of view TextFieldTitle.TextColor = NSColor.WhiteColor; TextFieldTitle.Font = FontManager.FontLarge; ViewTable.RowHeight = 60.0f; ViewTable.BackgroundColor = NSColor.ClearColor; ButtonRefresh.Image = Properties.Resources.IconRefreshButton; ButtonRefresh.Frame = new NSRect(ButtonRefresh.Frame.origin.x, ButtonRefresh.Frame.origin.y, 21, 21); ButtonRefresh.ActionEvent += RefreshClick; Hourglass.Show(false); Hourglass.Frame = new NSRect(ButtonRefresh.Frame.origin.x - 4, ButtonRefresh.Frame.origin.y - 4, 30, 30); // setup model eventing iModel.EventChanged += ModelChanged; ModelChanged(this, EventArgs.Empty); if (SelectedIndex != -1) { ViewTable.ScrollRowToVisible(SelectedIndex); } // setup delegate - if this is done in IB, the methods can be called // before awakeFromNib which causes complications ViewTable.Delegate = this; }
public static ApplicationContainer GetFromUuid(string containerUuid, Hourglass hourglass = null) { EtcUser etcUser = GetPasswdFor(containerUuid); string nameSpace = null; Dictionary <string, string> env = Environ.Load(Path.Combine(etcUser.Dir, ".env")); if (!string.IsNullOrEmpty(env["OPENSHIFT_GEAR_DNS"])) { nameSpace = Regex.Replace(Regex.Replace("testing-uhu.openshift.local", @"\..*$", ""), @"^.*\-", ""); } if (string.IsNullOrEmpty(env["OPENSHIFT_APP_UUID"])) { //Maybe we should improve the exceptions we throw. throw new Exception("OPENSHIFT_APP_UUID is missing!"); } if (string.IsNullOrEmpty(env["OPENSHIFT_APP_NAME"])) { throw new Exception("OPENSHIFT_APP_NAME is missing!"); } if (string.IsNullOrEmpty(env["OPENSHIFT_GEAR_NAME"])) { throw new Exception("OPENSHIFT_GEAR_NAME is missing!"); } ApplicationContainer applicationContainer = new ApplicationContainer(env["OPENSHIFT_APP_UUID"], containerUuid, etcUser, env["OPENSHIFT_APP_NAME"], env["OPENSHIFT_GEAR_NAME"], nameSpace, null, null, hourglass); return(applicationContainer); }
public ApplicationContainer(string applicationUuid, string containerUuid, EtcUser userId, string applicationName, string containerName, string namespaceName, object quotaBlocks, object quotaFiles, Hourglass hourglass, int applicationUid = 0) { this.config = NodeConfig.Values; this.Uuid = containerUuid; this.ApplicationUuid = applicationUuid; this.ApplicationName = applicationName; this.ContainerName = containerName; this.Namespace = namespaceName; this.QuotaBlocks = quotaBlocks; this.QuotaFiles = quotaFiles; this.State = new ApplicationState(this); this.hourglass = hourglass ?? new Hourglass(3600); this.BaseDir = this.config["GEAR_BASE_DIR"]; this.containerPlugin = new ContainerPlugin(this); this.Cartridge = new CartridgeModel(this, this.State, this.hourglass); if (userId != null) { this.uid = userId.Uid; this.gid = userId.Gid; this.gecos = userId.Gecos; } if (applicationUid > 0) { this.uid = applicationUid; } }
private void actExpressionFormatDAX_Execute(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtExpression.Text)) { return; } using (var hg = new Hourglass()) { var textToFormat = "x :=" + txtExpression.Text; var newline = txtExpression.Text.StartsWith("\n") || txtExpression.Text.StartsWith("\r\n"); try { var result = TabularEditor.Dax.DaxFormatterProxy.Instance.FormatDax(textToFormat, Preferences.Current.UseSemicolonsAsSeparators, sender == actExpressionFormatDAXShort, Preferences.Current.DaxFormatterSkipSpaceAfterFunctionName).FormattedDax; if (string.IsNullOrWhiteSpace(result)) { lblStatus.Text = "Could not format DAX (invalid syntax)."; return; } lblStatus.Text = "DAX formatted succesfully"; txtExpression.Text = (newline ? "\n" : "") + result.Substring(6).Trim(); } catch (Exception ex) { lblStatus.Text = "Could not format DAX (" + ex.Message + ")."; } } }
public CartridgeModel(ApplicationContainer container, ApplicationState state, Hourglass hourglass) { this.container = container; this.state = state; this.hourglass = hourglass; this.timeout = 30; this.cartridges = new Dictionary <string, Manifest>(); }
public void AttachSpawn(GameObject spawn) { var hour = spawn.GetComponent <Hourglass>(); if (hour) { hourglass = hour; } }
private void StartRefresh() { StopRefresh(); iRefreshTimer = new System.Threading.Timer(TimerCallback); ButtonRefresh.IsHidden = true; Hourglass.Show(true); iRefreshTimer.Change(kRefreshTimeout, System.Threading.Timeout.Infinite); ModelMain.Instance.Rescan(); }
void Start() { timeForLevel *= LevelMenu.getTimeAmountMultiply(); SetDetailsLevel(); Menu.loadMenuType(StateVar.getHeaderColor(type), StateVar.getTextColor(type)); hourglass = Hourglass.instance; hourglass.startTiming(timeForLevel); maxShootedTargetsAmount = GameObject.FindGameObjectsWithTag("Target").Length; EventManager.StartListening("Endgame", EndGame); }
public void Hourglass_Test() { int actualLargestSum; int expectedLargestSum = -6; Hourglass hourglassTest = new Hourglass(); actualLargestSum = hourglassTest.CalculateLargestHourglassSum(); Assert.AreEqual(expectedLargestSum, actualLargestSum); }
private void StopRefresh() { if (iRefreshTimer != null) { iRefreshTimer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite); iRefreshTimer.Dispose(); iRefreshTimer = null; ButtonRefresh.IsHidden = false; Hourglass.Show(false); } }
private void btnRefresh_Click(object sender, EventArgs e) { using (var hourglass = new Hourglass()) { btnRefresh.Enabled = false; toolStripStatusLabel1.Text = "Analyzing..."; Application.DoEvents(); AnalyzeAll(); btnRefresh.Enabled = true; } }
private void UrlInputDialog_FormClosing(object sender, FormClosingEventArgs e) { if (DialogResult == DialogResult.OK) { try { using (var hourglass = new Hourglass()) { BestPracticeAnalyzer.BestPracticeCollection.GetUrl(txtUrl.Text); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error loading Rule File from URL", MessageBoxButtons.OK, MessageBoxIcon.Error); e.Cancel = true; } } }
public static IEnumerable <ApplicationContainer> All(Hourglass hourglass = null, bool loadenv = true) { EtcUser[] users = new Etc(NodeConfig.Values).GetAllUsers(); foreach (EtcUser user in users) { if (user.Gecos.StartsWith("openshift_service")) { RubyHash env = new RubyHash(); string gearNamespace = null; if (loadenv) { env = new RubyHash(Environ.Load(new string[] { Path.Combine(user.Dir, ".env") })); } if (env.ContainsKey("OPENSHIFT_GEAR_DNS")) { gearNamespace = env["OPENSHIFT_GEAR_DNS"]; } ApplicationContainer app = null; try { app = new ApplicationContainer(env["OPENSHIFT_APP_UUID"], user.Name, user, env["OPENSHIFT_APP_NAME"], env["OPENSHIFT_GEAR_NAME"], gearNamespace, null, null, hourglass); } catch (Exception ex) { Logger.Error("Failed to instantiate ApplicationContainer for uid {0}/uuid {1}: {2}", user.Uid, env["OPENSHIFT_APP_UUID"], ex.Message); Logger.Error("Stacktrace: {0}", ex.StackTrace); continue; } yield return(app); } } }
public static ApplicationContainer CreateAppContainer() { string applicationUuid = Guid.NewGuid().ToString("N"); string containerUuid = applicationUuid; NodeConfig config = new NodeConfig(); // EtcUser etcUser = new Etc(config).GetPwanam(containerUuid); string userId = WindowsIdentity.GetCurrent().Name; string applicationName = "testApp"; string containerName = applicationName; string namespaceName = "uhuru"; object quotaBlocks = null; object quotaFiles = null; Hourglass hourglass = null; ApplicationContainer container = new ApplicationContainer( applicationUuid, containerUuid, null, applicationName, containerName, namespaceName, quotaBlocks, quotaFiles, hourglass); return(container); }
private void actExpressionFormatDAX_Execute(object sender, EventArgs e) { using (var hg = new Hourglass()) { var textToFormat = "x :=" + txtExpression.Text; try { var result = TabularEditor.Dax.DaxFormatterProxy.FormatDax(textToFormat, Preferences.Current.UseSemicolonsAsSeparators, sender == actExpressionFormatDAXShort).FormattedDax; if (string.IsNullOrWhiteSpace(result)) { lblStatus.Text = "Could not format DAX (invalid syntax)."; return; } lblStatus.Text = "DAX formatted succesfully"; txtExpression.Text = result.Substring(6).Trim(); } catch (Exception ex) { lblStatus.Text = "Could not format DAX (" + ex.Message + ")."; } } }
public void Start() { rend = GetComponent <Renderer>(); Player = GameObject.FindGameObjectWithTag("Player"); HourglassScripts = GameObject.FindGameObjectWithTag("Hourglass").GetComponent <Hourglass>(); }
// Start is called before the first frame update void Start() { Player = GameObject.FindGameObjectWithTag("Player"); HourglassScripts = GameObject.FindGameObjectWithTag("Hourglass").GetComponent <Hourglass>(); }