예제 #1
0
        private void addonToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            //Create the new Addon Wizard
            NewAddonWizard wizard = new NewAddonWizard();
            if (wizard.ShowDialog() != DialogResult.OK) return; //They didnt want to make a new addon.  Whatever...

            KeyValue doc = new KeyValue("AddonInfo");
            doc += new KeyValue("addonSteamAppID") + 816;
            doc += new KeyValue("addontitle") + wizard.addonTitleBox.Text;
            doc += new KeyValue("addonversion") + wizard.addonVersionBox.Text;
            doc += new KeyValue("addontagline") + wizard.addonTagLineBox.Text;
            doc += new KeyValue("addonauthor") + wizard.addonTagLineBox.Text;
            doc += new KeyValue("addonSteamGroupName") + wizard.addonSteamGroupName.Text;
            doc += new KeyValue("addonauthorSteamID") + wizard.addonSteamGroupName.Text;
            doc += new KeyValue("addonContent_Campaign") + 0;
            doc += new KeyValue("addonURL0") + wizard.addonURLBox.Text;
            doc += new KeyValue("addonDescription") + wizard.addonDescriptionBox.Text;

            string addonPath = Properties.Settings.Default.dotadir + Path.DirectorySeparatorChar
                + "dota" + Path.DirectorySeparatorChar + "addons" + Path.DirectorySeparatorChar
                + wizard.addonNameBox.Text + Path.DirectorySeparatorChar;

            Directory.CreateDirectory(addonPath);
            Directory.CreateDirectory(addonPath + "scripts");
            Directory.CreateDirectory(addonPath + "maps");
            Directory.CreateDirectory(addonPath + "materials");
            Properties.Settings.Default.AddonPath = addonPath;
            Properties.Settings.Default.Save();

            File.WriteAllText(addonPath + "addoninfo.txt", DotaData.KVHeader + doc.ToString());
        }
예제 #2
0
        private void ShowNewAddonWizard()
        {
            NewAddonWizard wizard = new NewAddonWizard();
            if (wizard.ShowDialog() != DialogResult.OK) return; //They didnt want to make a new addon.  Whatever...


            KeyValue doc = new KeyValue("AddonInfo");
            doc += new KeyValue("addonSteamAppID") + 816;
            doc += new KeyValue("addontitle") + wizard.addonTitleBox.Text;
            doc += new KeyValue("addonversion") + wizard.addonVersionBox.Text;
            doc += new KeyValue("addontagline") + wizard.addonTagLineBox.Text;
            doc += new KeyValue("addonauthor") + wizard.addonTagLineBox.Text;
            doc += new KeyValue("addonSteamGroupName") + wizard.addonSteamGroupName.Text;
            doc += new KeyValue("addonauthorSteamID") + wizard.addonSteamGroupName.Text;
            doc += new KeyValue("addonContent_Campaign") + 0;
            doc += new KeyValue("addonURL0") + wizard.addonURLBox.Text;
            doc += new KeyValue("addonDescription") + wizard.addonDescriptionBox.Text;

            string addonPath = Properties.Settings.Default.AddOnPath + Path.DirectorySeparatorChar + wizard.addonNameBox.Text + Path.DirectorySeparatorChar;

            Directory.CreateDirectory(addonPath);
            Directory.CreateDirectory(addonPath + "scripts");
            Directory.CreateDirectory(addonPath + "resource");
            File.WriteAllText(addonPath + "addoninfo.txt", DotaData.KVHeader + doc.ToString());

            LoadProject(addonPath);  
        }
예제 #3
0
        private void ReadDefaultFolders()
        {
            //Read the default folder script that is in the executable.  
            Assembly asm = Assembly.GetExecutingAssembly();
            string resName = "WorldSmith.Scripts.ObjectBrowserFolderOverride.txt";
                     

            using (System.IO.Stream s = asm.GetManifestResourceStream(resName))
            using (System.IO.StreamReader reader = new System.IO.StreamReader(s))
            {
                DefaultFolders = KVParser.KV1.Parse(reader.ReadToEnd());
            }
        }
예제 #4
0
 //Convenience method for getting a record using a KeyValue record identifier
 public static EstimateRecord GetRecord(KeyValue id, bool bMutable)
 {
     return (EstimateRecord)EstimateTable.Instance.GetRecordData(id, bMutable);
 }
예제 #5
0
 /// <summary>
 ///  This method deletes a specified record
 /// </summary>
 /// <param name="kv">Keyvalue of the record to be deleted.</param>
 public static void DeleteRecord(KeyValue kv)
 {
     VwSiteView.Instance.DeleteOneRecord(kv);
 }
예제 #6
0
 /// <summary>
 ///  This method deletes a specified record
 /// </summary>
 /// <param name="kv">Keyvalue of the record to be deleted.</param>
 public static void DeleteRecord(KeyValue kv)
 {
     EstimateTable.Instance.DeleteOneRecord(kv);
 }
예제 #7
0
 //Convenience method for getting a record using a KeyValue record identifier
 public static ScopeRecord GetRecord(KeyValue id, bool bMutable)
 {
     return (ScopeRecord)ScopeTable.Instance.GetRecordData(id, bMutable);
 }
예제 #8
0
 //Convenience method for getting a record using a KeyValue record identifier
 public static ReportRecord GetRecord(KeyValue id, bool bMutable)
 {
     return (ReportRecord)ReportTable.Instance.GetRecordData(id, bMutable);
 }
예제 #9
0
 //Convenience method for getting a record using a KeyValue record identifier
 public static CategoryRecord GetRecord(KeyValue id, bool bMutable)
 {
     return (CategoryRecord)CategoryTable.Instance.GetRecordData(id, bMutable);
 }
예제 #10
0
파일: KeyValue.cs 프로젝트: nust03/xcore
 public static Data.KeyValue GetByKey(string key)
 {
     Data.KeyValue kv = new Data.KeyValue();
     try
     {
         XmlParamter xpKey = new XmlParamter("Key", key);
         xpKey.Direction = System.IO.ParameterDirection.Equal;
         Xml.XmlNode xn = XMLHelper.GetDataOne(path, "KeyValue", xpKey);
         if (xn == null)
         {
             return null;
         }
         else
         {
             kv.Key = xn.Attributes["Key"].Value;
             kv.Value = xn.Attributes["Value"].Value;
             kv.Description = xn.Attributes["Description"].Value;
             kv.UpdateTime = Convert.ToDateTime(xn.Attributes["UpdateTime"].Value);
         }
     }
     catch { }
     return kv;
 }
예제 #11
0
 /// <summary>
 ///  This method deletes a specified record
 /// </summary>
 /// <param name="kv">Keyvalue of the record to be deleted.</param>
 public static void DeleteRecord(KeyValue kv)
 {
     UsersTable.Instance.DeleteOneRecord(kv);
 }
예제 #12
0
        /// <summary>
        /// This method takes a key and returns a keyvalue.
        /// </summary>
        /// <param name="key">key could be array of primary key values in case of composite primary key or a string containing single primary key value in case of non-composite primary key.</param>
        public static KeyValue GetKeyValue(object key)
        {
            KeyValue kv = null;
            if (!(UsersTable.Instance.TableDefinition.PrimaryKey == null))
            {
                bool isCompositePrimaryKey = false;
                isCompositePrimaryKey = UsersTable.Instance.TableDefinition.PrimaryKey.IsCompositeKey;
                if ((isCompositePrimaryKey && key.GetType().IsArray))
                {
                    //  If the key is composite, then construct a key value.
                    kv = new KeyValue();
                    Array keyArray = ((Array)(key));
                    if (!(keyArray == null))
                    {
                        int length = keyArray.Length;
                        ColumnList pkColumns = UsersTable.Instance.TableDefinition.PrimaryKey.Columns;
                        int index = 0;
                        foreach (BaseColumn pkColumn in pkColumns)
                        {
                            string keyString = ((keyArray.GetValue(index)).ToString());
                            if (UsersTable.Instance.TableDefinition.TableType == BaseClasses.Data.TableDefinition.TableTypes.Virtual)
                            {
                                kv.AddElement(pkColumn.UniqueName, keyString);
                            }
                            else
                            {
                                kv.AddElement(pkColumn.InternalName, keyString);
                            }

                            index = (index + 1);
                        }
                    }
                }
                else
                {
                    //  If the key is not composite, then get the key value.
                    kv = UsersTable.Instance.TableDefinition.PrimaryKey.ParseValue(((key).ToString()));
                }
            }
            return kv;
        }
 //Convenience method for getting a record using a KeyValue record identifier
 public static VwPropSBondBudgetRecord GetRecord(KeyValue id, bool bMutable)
 {
     return (VwPropSBondBudgetRecord)VwPropSBondBudgetView.Instance.GetRecordData(id, bMutable);
 }
 /// <summary>
 /// This method checks if record exist in the database using the keyvalue provided.
 /// </summary>
 /// <param name="kv">Key value of the record.</param>
 public static bool DoesRecordExist(KeyValue kv)
 {
     bool recordExist = true;
     try
     {
         VwPropSBondBudgetView.GetRecord(kv, false);
     }
     catch (Exception)
     {
         recordExist = false;
     }
     return recordExist;
 }
 /// <summary>
 ///  This method deletes a specified record
 /// </summary>
 /// <param name="kv">Keyvalue of the record to be deleted.</param>
 public static void DeleteRecord(KeyValue kv)
 {
     VwPropSBondBudgetView.Instance.DeleteOneRecord(kv);
 }
예제 #16
0
        private KeyValueCollection Split(string config)
        {
            KeyValueCollection r = new KeyValueCollection();
            string[] kvArray = config.Split(';');
            foreach (string kv in kvArray)
            {
                string[] k_v = kv.Split('=');
                if (k_v.Length == 2)
                {
                    string k = k_v[0];
                    string v = k_v[1];

                    KeyValue newkv = new KeyValue(k, v);
                    r.Add(newkv);
                }
            }
            return r;
        }
예제 #17
0
 //Convenience method for getting a record using a KeyValue record identifier
 public static VwSiteRecord GetRecord(KeyValue id, bool bMutable)
 {
     return (VwSiteRecord)VwSiteView.Instance.GetRecordData(id, bMutable);
 }
예제 #18
0
 /// <summary>
 /// This method checks if record exist in the database using the keyvalue provided.
 /// </summary>
 /// <param name="kv">Key value of the record.</param>
 public static bool DoesRecordExist(KeyValue kv)
 {
     bool recordExist = true;
     try
     {
         UsersTable.GetRecord(kv, false);
     }
     catch (Exception)
     {
         recordExist = false;
     }
     return recordExist;
 }
예제 #19
0
 //Convenience method for getting a record using a KeyValue record identifier
 public static RolesRecord GetRecord(KeyValue id, bool bMutable)
 {
     return (RolesRecord)RolesTable.Instance.GetRecordData(id, bMutable);
 }
예제 #20
0
 //Convenience method for getting a record using a KeyValue record identifier
 public static UsersRecord GetRecord(KeyValue id, bool bMutable)
 {
     return (UsersRecord)UsersTable.Instance.GetRecordData(id, bMutable);
 }
예제 #21
0
 /// <summary>
 ///  This method deletes a specified record
 /// </summary>
 /// <param name="kv">Keyvalue of the record to be deleted.</param>
 public static void DeleteRecord(KeyValue kv)
 {
     CategoryTable.Instance.DeleteOneRecord(kv);
 }