Beispiel #1
0
        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();
        }
Beispiel #2
0
        public void UpdateUI()
        {
            foreach (WorkTopicControl c in mTopicControls)
            {
                c.UpdateUI();
            }

            AllowOverwriteCheckBox.Checked = CoreGlobals.getScenarioWorkTopicManager().sAllowOverwrite;
        }
Beispiel #3
0
        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 = "
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
        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();
        }
Beispiel #6
0
        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();
        }
Beispiel #7
0
        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();
        }
Beispiel #8
0
 private void CheckInAllButton_Click(object sender, EventArgs e)
 {
     CoreGlobals.getScenarioWorkTopicManager().mChangeList.Submitchanges();
 }
Beispiel #9
0
 void topicControl_StateChanged(object sender, EventArgs e)
 {
     //UpdateUI();
     CoreGlobals.getScenarioWorkTopicManager().NotifyTopicsUpdated();
 }
Beispiel #10
0
 private void AllowOverwriteCheckBox_CheckedChanged(object sender, EventArgs e)
 {
     CoreGlobals.getScenarioWorkTopicManager().sAllowOverwrite = AllowOverwriteCheckBox.Checked;
     this.UpdateUI();
 }
Beispiel #11
0
 private void SaveButton_Click(object sender, EventArgs e)
 {
     CoreGlobals.getScenarioWorkTopicManager().sDontPromtResolvedSave = this.DontAskAgainCheckBox.Checked;
     this.ParentForm.DialogResult = DialogResult.OK;
     this.ParentForm.Close();
 }
Beispiel #12
0
        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;
        }