public void DynamicLoadUI() { int ypos = 60; int xpos = 30; Dictionary <string, WorkTopic> .Enumerator it = CoreGlobals.getScenarioWorkTopicManager().getScenarioWorkTopics().GetEnumerator(); this.SuspendLayout(); while (it.MoveNext()) { WorkTopicControl topicControl = new WorkTopicControl(); it.Current.Value.UpdateState(); topicControl.Topic = it.Current.Value; topicControl.StateChanged += new EventHandler(topicControl_StateChanged); this.Controls.Add(topicControl); topicControl.Left = xpos; topicControl.Top = ypos; if (it.Current.Value.Name == "Export") // special case separation { topicControl.Top += 40; } ypos = topicControl.Bottom + 20; mTopicControls.Add(topicControl); } this.ResumeLayout(); CoreGlobals.getScenarioWorkTopicManager().NotifyTopicsUpdated(); }
public void UpdateUI() { foreach (WorkTopicControl c in mTopicControls) { c.UpdateUI(); } AllowOverwriteCheckBox.Checked = CoreGlobals.getScenarioWorkTopicManager().sAllowOverwrite; }
public void SetTopic(string topicName) { Dictionary <string, WorkTopic> topics = CoreGlobals.getScenarioWorkTopicManager().getScenarioWorkTopics(); mTopic = topics[topicName]; this.workTopicControl1.Topic = mTopic; this.workTopicControl1.StateChanged += new EventHandler(workTopicControl1_StateChanged); workTopicControl1.DoNotSaveOption = true; workTopicControl1.OverwriteOption = true; UpdateState(); //this.ParentForm.Text = " }
private void CheckOutButton_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; CoreGlobals.getScenarioWorkTopicManager().AddOrEdit(mTopic.Name); mTopic.UpdateState(); UpdateUI(); if (!mbPaused && StateChanged != null) { StateChanged.Invoke(this, null); } Cursor.Current = Cursors.Default; }
public ExportWorkCoordinator() { InitializeComponent(); Dictionary <string, WorkTopic> topics = CoreGlobals.getScenarioWorkTopicManager().getScenarioWorkTopics(); mWorkTopics["Export"] = topics["Export"]; this.ExportFilesWorkTopicControl.Topic = mWorkTopics["Export"]; this.ExportFilesWorkTopicControl.StateChanged += new EventHandler(ExportFilesWorkTopicControl_StateChanged); ExportFilesWorkTopicControl.DoNotSaveOption = false; ExportFilesWorkTopicControl.OverwriteOption = true; UpdateState(); }
void UpdateState() { bool filesBlocked = false; Dictionary <string, WorkTopic> workTopics = CoreGlobals.getScenarioWorkTopicManager().getScenarioWorkTopics(); Dictionary <string, WorkTopic> .Enumerator it = workTopics.GetEnumerator(); while (it.MoveNext()) { if (it.Current.Value.mDataPattern != WorkTopic.eDataPatterm.cPrimary) { continue; } if (it.Current.Value.Changed == true) { ICollection <string> blocked; if (it.Current.Value.DoNotSave == false && it.Current.Value.AreFilesWritetable(out blocked) == false) { filesBlocked = true; } else { } } else { } } if (filesBlocked) { this.SaveButton.Enabled = false; } else { this.SaveButton.Enabled = true; } CoreGlobals.getScenarioWorkTopicManager().NotifyTopicsUpdated(); }
public ScenarioWorkCoordinator() { InitializeComponent(); Dictionary <string, WorkTopic> workTopics = CoreGlobals.getScenarioWorkTopicManager().getScenarioWorkTopics(); this.TerrainWorkTopicControl.Topic = workTopics["Terrain"]; this.SimWorkTopicControl.Topic = workTopics["Sim"]; this.ArtObjectsTopicControl.Topic = workTopics["ArtObjects"]; this.SoundWorkTopicControl.Topic = workTopics["Sounds"]; this.LightsWorkTopicControl.Topic = workTopics["Lights"]; this.MasksWorkTopicControl.Topic = workTopics["Masks"]; this.TerrainWorkTopicControl.StateChanged += new EventHandler(TerrainWorkTopicControl_StateChanged); this.SimWorkTopicControl.StateChanged += new EventHandler(SimWorkTopicControl_StateChanged); this.ArtObjectsTopicControl.StateChanged += new EventHandler(ArtObjectsTopicControl_StateChanged); this.SoundWorkTopicControl.StateChanged += new EventHandler(SoundWorkTopicControl_StateChanged); this.LightsWorkTopicControl.StateChanged += new EventHandler(LightsWorkTopicControl_StateChanged); this.MasksWorkTopicControl.StateChanged += new EventHandler(MasksWorkTopicControl_StateChanged); this.SavingLabel.Text = "Save: " + Path.GetFileNameWithoutExtension(CoreGlobals.ScenarioFile); UpdateState(); }
private void CheckInAllButton_Click(object sender, EventArgs e) { CoreGlobals.getScenarioWorkTopicManager().mChangeList.Submitchanges(); }
void topicControl_StateChanged(object sender, EventArgs e) { //UpdateUI(); CoreGlobals.getScenarioWorkTopicManager().NotifyTopicsUpdated(); }
private void AllowOverwriteCheckBox_CheckedChanged(object sender, EventArgs e) { CoreGlobals.getScenarioWorkTopicManager().sAllowOverwrite = AllowOverwriteCheckBox.Checked; this.UpdateUI(); }
private void SaveButton_Click(object sender, EventArgs e) { CoreGlobals.getScenarioWorkTopicManager().sDontPromtResolvedSave = this.DontAskAgainCheckBox.Checked; this.ParentForm.DialogResult = DialogResult.OK; this.ParentForm.Close(); }
public void UpdateUI() { mbPaused = true; if (mTopic == null) { TopicNameLabel.Text = "error"; return; } this.TopicNameLabel.Text = GetTopicAlias(mTopic.Name); this.TopicDescriptionLabel.Text = mTopic.Description; this.FileDescriptionLabel.Text = mTopic.FileDescription; this.StatusLabel.Text = mTopic.mState.ToString(); mStatusIcon.Value = mTopic.mState; this.DontSaveCheckBox.Visible = false; this.CheckInButton.Visible = false; this.CheckInButton.Enabled = false; this.SourceActionButton.Visible = false; this.RevertButton.Visible = false; this.OverwriteButton.Visible = false; this.WriteStatusLabel.Visible = false; this.OutOfDateLabel.Visible = false; if (mbDoNotSaveOption && (mTopic.mState == WorkTopic.eWorkTopicFileState.cLocalReadOnly || mTopic.mState == WorkTopic.eWorkTopicFileState.cCheckedOutByOther || mTopic.mState == WorkTopic.eWorkTopicFileState.cCheckedIn)) { this.DontSaveCheckBox.Visible = true; this.DontSaveCheckBox.Checked = mTopic.DoNotSave; this.DontSaveCheckBox.AutoSize = true; if (mbOverwriteOption && CoreGlobals.getScenarioWorkTopicManager().sAllowOverwrite) { this.OverwriteButton.Visible = true; } } else { mTopic.DoNotSave = false; } string message = ""; string owner = mTopic.mOwner;//"asdf"; //if (mTopic.Writeable == true && CoreGlobals.getScenarioWorkTopicManager().sAllowOverwrite //&& mTopic.mState == WorkTopic.eWorkTopicFileState.cCheckedIn && mTopic.mVersionStatus == WorkTopic.eVersionStatus.cCurrent) //{ // this.SourceActionButton.Text = "Check Out"; // this.SourceActionButton.Visible = true; // this.SourceActionButton.Enabled = true; // message = "checked in (+Writeable)"; //} //else if (mTopic.Writeable == true && mbOverwriteOption && (mTopic.mState != WorkTopic.eWorkTopicFileState.cCheckedOutByUser))//CoreGlobals.getScenarioWorkTopicManager().sAllowOverwrite) { this.WriteStatusLabel.Visible = true; } if (mTopic.mState == WorkTopic.eWorkTopicFileState.cCheckedIn && mTopic.mVersionStatus == WorkTopic.eVersionStatus.cCurrent) { this.SourceActionButton.Text = "Check Out"; this.SourceActionButton.Visible = true; this.SourceActionButton.Enabled = true; message = "checked in"; } else if (mTopic.mState != WorkTopic.eWorkTopicFileState.cCheckedIn && mTopic.mVersionStatus == WorkTopic.eVersionStatus.cOutofdate) { this.SourceActionButton.Text = "Out of date"; this.SourceActionButton.Visible = true; this.SourceActionButton.Enabled = false; this.CheckInButton.Enabled = false; message = "Opened files out of date"; this.OutOfDateLabel.Visible = true; if (mbOverwriteOption && CoreGlobals.getScenarioWorkTopicManager().sAllowOverwrite) { this.OverwriteButton.Visible = true; } } else if (mTopic.mState == WorkTopic.eWorkTopicFileState.cCheckedIn && mTopic.mVersionStatus == WorkTopic.eVersionStatus.cOutofdate) { this.SourceActionButton.Text = "Check Out"; this.SourceActionButton.Visible = true; this.SourceActionButton.Enabled = false; message = "checked in (out of date)"; this.OutOfDateLabel.Visible = true; } else if (mTopic.mState == WorkTopic.eWorkTopicFileState.cCheckedOutByOther) { this.SourceActionButton.Text = ""; message = "checked out by " + owner; } else if (mTopic.mState == WorkTopic.eWorkTopicFileState.cCheckedOutByUser) { if (mbCheckInOption) { this.CheckInButton.Visible = true; this.CheckInButton.Enabled = true; this.RevertButton.Visible = true; } message = "checked out by you"; } else if (mTopic.mState == WorkTopic.eWorkTopicFileState.cLocalReadOnly) { message = "not in perfoce, Read Only"; } else if (mTopic.mState == WorkTopic.eWorkTopicFileState.cLocalWriteable) { message = "not in perforce, Writeable"; } else if (mTopic.mState == WorkTopic.eWorkTopicFileState.cNoFiles) { message = "no files yet."; } this.StatusLabel.Text = message; mbPaused = false; }