当前位置: 首页>>代码示例>>C#>>正文


C# Mission.getType方法代码示例

本文整理汇总了C#中Mission.getType方法的典型用法代码示例。如果您正苦于以下问题:C# Mission.getType方法的具体用法?C# Mission.getType怎么用?C# Mission.getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mission的用法示例。


在下文中一共展示了Mission.getType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: writeXmlLog

        // http://www.tkachenko.com/blog/archives/000053.html
        // http://www.codeproject.com/KB/XML/XmlAppending.aspx
        private static void writeXmlLog(Mission mission, LogAction logAction)
        {
            if (!File.Exists(LOG_FILE))
            {
                XmlTextWriter textWritter = new XmlTextWriter(LOG_FILE, Encoding.Unicode);
                textWritter.WriteStartElement(LogXmlTag.Missions.ToString());
                textWritter.WriteEndElement();
                textWritter.Close();
            }

            DateTime dateTime = DateTime.Now;
            XmlDocument xmlDoc=new XmlDocument();
            xmlDoc.Load(LOG_FILE);

            // TODO: Prune old entries

            XmlElement subRoot = xmlDoc.CreateElement(LogXmlTag.Mission.ToString());
            subRoot.SetAttribute(LogXmlTag.Date.ToString(), dateTime.ToString("yyyy/MM/dd"));
            subRoot.SetAttribute(LogXmlTag.Time.ToString(), dateTime.ToString("HH:mm:ss"));
            subRoot.SetAttribute(LogXmlTag.Action.ToString(), logAction.ToString());
            subRoot.SetAttribute(LogXmlTag.Id.ToString(), mission.getId());
            subRoot.SetAttribute(LogXmlTag.Name.ToString(), mission.getName());
            subRoot.SetAttribute(LogXmlTag.Type.ToString(), mission.getType().ToString());
            subRoot.SetAttribute(LogXmlTag.Key.ToString(), mission.getKey());
            XmlText xmlTextMission = xmlDoc.CreateTextNode(mission.getXML());
            subRoot.AppendChild(xmlTextMission);
            xmlDoc.DocumentElement.AppendChild(subRoot);

            /*XmlTextWriter writer = new XmlTextWriter(LOG_FILE, Encoding.Unicode);
            writer.Formatting = Formatting.Indented;
            writer.Indentation = 3;
            xmlDoc.Save(writer);*/
            xmlDoc.Save(LOG_FILE);
        }
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:36,代码来源:Database.cs

示例2: setMission

 public void setMission(Mission mission)
 {
     m_mission = mission;
     guiIdTxt.Text = m_mission.getId();
     guiTypeCbo.SelectedItem = m_mission.getType();
     guiKeyTxt.Text = m_mission.getKey();
     guiNameTxt.Text = m_mission.getName();
     guiSummaryTxt.Text = m_mission.getSummary();
     guiTimeTxt.Text = m_mission.getAllowedTime().ToString();
     guiForfeitableChk.Checked = m_mission.isForfeitable();
     guiConditionsTbl.Items.Clear();
     if (m_mission.hasConditions())
     {
         foreach (Condition condition in m_mission.getConditions())
         {
             ListViewItem item = new ListViewItem(new String[] { condition.getConditionType().ToString(),
                                                                 condition.getFormattedValue() });
             guiConditionsTbl.Items.Add(item);
             item.Tag = condition;
         }
         guiConditionsTbl.Items[0].Selected = true;
     }
     guiStagesTbl.Items.Clear();
     if (m_mission.hasStages())
     {
         foreach (Stage stage in m_mission.getStages())
         {
             ListViewItem item = new ListViewItem(new String[] { stage.getId(),
                                                                 stage.getDescription() });
             guiStagesTbl.Items.Add(item);
             item.Tag = stage;
         }
         guiStagesTbl.Items[0].Selected = true;
     }
 }
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:35,代码来源:TabMission.cs

示例3: setMission

        public static void setMission(Mission mission, Boolean newMission)
        {
            String query;
            String[] parameters = new String[]{ "id", "xml", "name", "key", "type" };
            String[] values = new String[] { mission.getId(), mission.getXML(), mission.getName(), mission.getKey(), ((int)mission.getType()).ToString() };
            if (newMission)
            {
                writeXmlLog(mission, LogAction.Add);
                query = "INSERT INTO "
                      + Net7.Tables.missions
                      + " ( "
                      + ColumnData.GetName(Net7.Table_missions._mission_XML) + ","
                      + ColumnData.GetName(Net7.Table_missions._mission_name) + ","
                      + ColumnData.GetName(Net7.Table_missions._mission_key) + ","
                      + ColumnData.GetName(Net7.Table_missions._mission_type)
                      + " )"
                      + " VALUES ("
                      + DB.QueryParameterCharacter + parameters[1] + ","
                      + DB.QueryParameterCharacter + parameters[2] + ","
                      + DB.QueryParameterCharacter + parameters[3] + ","
                      + DB.QueryParameterCharacter + parameters[4]
                      + "); "
                      + DB.SELECT
                      + ColumnData.GetName(Net7.Table_missions._mission_id)
                      + DB.FROM
                      + Net7.Tables.missions
                      + DB.WHERE
                      + ColumnData.GetName(Net7.Table_missions._mission_id)
                      + " IS NULL;"; // Retrieve the last inserted row
                DataTable dataTable = DB.Instance.executeQuery(query, parameters, values);

                // Update the XML mission ID with that of the database auto-created ID
                mission.setId(ColumnData.GetString(dataTable.Rows[0], Net7.Table_missions._mission_id));
                values[0] = mission.getId();
                values[1] = mission.getXML();
                query = "UPDATE "
                      + Net7.Tables.missions
                      + " SET "
                      + ColumnData.GetName(Net7.Table_missions._mission_XML)
                      + DB.EQUALS
                      + DB.QueryParameterCharacter + parameters[1]
                      + DB.WHERE
                      + ColumnData.GetName(Net7.Table_missions._mission_id)
                      + DB.EQUALS
                      + DB.QueryParameterCharacter + parameters[0];
            }
            else
            {
                writeXmlLog(mission, LogAction.Edit);
                query = "UPDATE "
                      + Net7.Tables.missions
                      + " SET "
                      + ColumnData.GetName(Net7.Table_missions._mission_XML)
                      + DB.EQUALS
                      + DB.QueryParameterCharacter + parameters[1] + ","
                      + ColumnData.GetName(Net7.Table_missions._mission_name)
                      + DB.EQUALS
                      + DB.QueryParameterCharacter + parameters[2] + ","
                      + ColumnData.GetName(Net7.Table_missions._mission_key)
                      + DB.EQUALS
                      + DB.QueryParameterCharacter + parameters[3] + ","
                      + ColumnData.GetName(Net7.Table_missions._mission_type)
                      + DB.EQUALS
                      + DB.QueryParameterCharacter + parameters[4]
                      + DB.WHERE
                      + ColumnData.GetName(Net7.Table_missions._mission_id)
                      + DB.EQUALS
                      + DB.QueryParameterCharacter + parameters[0];
            }
            DB.Instance.executeQuery(query, parameters, values);
        }
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:71,代码来源:Database.cs


注:本文中的Mission.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。