Ejemplo n.º 1
0
        private void btnSceneAddSource_Click(object sender, System.EventArgs e)
        {
            if(lvScenes.SelectedItems.Count != 1)return;

            OCL.Scene Sce = (OCL.Scene)lvScenes.SelectedItems[0].Tag;

            frmFindSource frmFS = new frmFindSource(ref OSystem,ref LUser,true);

            if(frmFS.ShowDialog(this) == DialogResult.OK)
            {
                foreach(ListViewItem LVI in frmFS.lvScenes.CheckedItems)
                {
                    if(LVI.Tag is OCL.Source)
                    {
                        if(LVI.ForeColor != Color.Gray)
                        {
                            String sErrorMessage = "";
                            OCL.Source S = (OCL.Source)LVI.Tag;
                            if(!Sce.AddSource(LUser,S,out sErrorMessage))
                            {
                                MessageBox.Show("Adding Source: " +
                                    S.Description + " reported the error message: " +
                                    sErrorMessage,CarverLab.Utility.AppInfo.Title +
                                    ": Error Message",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                            }
                        }
                    }
                }
                lvScenes_SelectedIndexChanged(null,null);
            }
        }
Ejemplo n.º 2
0
        private void btnAddSourceToSceneInGroup_Click(object sender, System.EventArgs e)
        {
            if(lvGroups.SelectedItems.Count == 0)return;
            OCL.Group G = (OCL.Group)lvGroups.SelectedItems[0].Tag;

            if(lvGroupScenes.SelectedItems.Count != 1)return;
            OCL.Scene Sce = (OCL.Scene)lvGroupScenes.SelectedItems[0].Tag;

            ArrayList ExcludeSources = new ArrayList();

            foreach(ListViewItem lvs in lvGroupSceneSources.Items)
            {
                ExcludeSources.Add((OCL.Source)lvs.Tag);
            }

            frmFindSource frmFS = new frmFindSource(ExcludeSources,Sce,ref OSystem,ref LUser);
            if(frmFS.ShowDialog(this) == DialogResult.OK)
            {
                foreach(ListViewItem LVI in frmFS.lvScenes.CheckedItems)
                {
                    if(LVI.Tag is OCL.Source)
                    {
                        if(LVI.ForeColor != Color.Gray)
                        {
                            String sErrorMessage = "";
                            OCL.Source S = (OCL.Source)LVI.Tag;
                            if(!G.AddSource(LUser,S,out sErrorMessage))
                            {
                                MessageBox.Show("Adding Source: " +
                                    S.Description + " reported the error message: " +
                                    sErrorMessage,CarverLab.Utility.AppInfo.Title +
                                    ": Error Message",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                            }
                        }
                    }
                }
                lvGroupScenes_SelectedIndexChanged(null,null);
            }
        }