Exemple #1
0
        /// <summary>
        /// The event sequence when the create button is clicked.
        /// </summary>
        public void CreateDM()
        {
            String name = INTextBox.Text;
            bool isOverride = false;
            string filename = Path.Combine(m_dir, name);
            string dmFilename = filename + Constants.FileExtDM;
            filename = filename + Constants.FileExtSource;

            if (!Directory.Exists(m_dir))
                Directory.CreateDirectory(m_dir);

            if (File.Exists(filename))
            {
                if (!Util.ShowOKCancelDialog(string.Format(MessageResources.ConfirmOverrideFile, filename)))
                {
                    throw new Ecell.Exceptions.IgnoreException("");
                }
                isOverride = true;
            }
            if (File.Exists(dmFilename))
                isOverride = true;

            //                File.Create(filename);
            StreamWriter writer = null;
            try
            {
                writer = new StreamWriter(filename, false, Encoding.UTF8);
                writer.Write(templateRichText.Text.Replace("XXXXX", name));
            }
            finally
            {
                if (writer != null)
                {
                    writer.Close();
                }
            }

            if (!isOverride)
            {
                DMNode dNode = new DMNode(name);
                dNode.ImageIndex = m_env.PluginManager.GetImageIndex(Constants.xpathDMSource);
                dNode.SelectedImageIndex = dNode.ImageIndex;
                dNode.Tag = name;
                dNode.ContextMenuStrip = m_menu;
                m_node.Nodes.Add(dNode);
            }
            m_path = filename;
        }
Exemple #2
0
 public void AddDMUIColor(NodeAddedEvent e, [Combine] BattleUserNode battleUser, [JoinByBattle] DMNode battle, [Context, JoinByBattle] TankBattleUserNode tankBattleUser)
 {
     if (!tankBattleUser.Entity.Id.Equals(battleUser.Entity.Id))
     {
         battleUser.Entity.AddComponent(new ColorInBattleComponent(TeamColor.RED));
     }
 }
Exemple #3
0
 public void AddDMSpectatorUIColor(NodeAddedEvent e, [Combine] BattleUserNode battleUser, [JoinByBattle] DMNode battle, [Context, JoinByBattle] SpectatorBattleUserNode spectatorBattleUser)
 {
     if (!spectatorBattleUser.Entity.Id.Equals(battleUser.Entity.Id))
     {
         battleUser.Entity.AddComponent(new ColorInBattleComponent(TeamColor.NONE));
     }
 }
Exemple #4
0
 public void AddDMUIColor(NodeAddedEvent e, TankBattleUserNode tankBattleUser, [JoinByBattle] DMNode battle)
 {
     tankBattleUser.Entity.AddComponent(new ColorInBattleComponent(TeamColor.BLUE));
 }
Exemple #5
0
        public void EnableIsisTargetSound(NodeAddedEvent e, TargetEffectNode weapon, [Context, JoinByTank] IsisCurrentSoundEffectNode isisSound, [Context, JoinByBattle] DMNode dm)
        {
            IsisCurrentSoundEffectComponent isisCurrentSoundEffect = isisSound.isisCurrentSoundEffect;

            this.UpdateIsisSoundEffect(isisCurrentSoundEffect, weapon.isisDamagingSoundEffect.SoundController);
        }