예제 #1
0
        /// <summary>
        /// Creates object from plain Dictionary<string, string> object
        /// </summary>
        /// <param name="original">The Dictionary<string, string> which the DsioNoteData will be based on</param>
        /// <returns>A new DsioNoteData</returns>
        public static DsioNoteData FromDictionary(Dictionary <string, string> original)
        {
            // *** Create from plain dictionary ***

            DsioNoteData returnData = new DsioNoteData();

            if (original != null)
            {
                if (original.Count > 0)
                {
                    foreach (string key in original.Keys)
                    {
                        if (key.Length > 30)
                        {
                            throw new ArgumentException();
                        }
                        else
                        {
                            returnData.Add(key, original[key]);
                        }
                    }
                }
            }

            return(returnData);
        }
예제 #2
0
        public void AddCommandArguments(string ien, string noteText, string subject, Dictionary <string, string> noteData)
        {
            string[] noteArray = (string.IsNullOrWhiteSpace(noteText)) ? null : Util.Split(noteText);

            DsioNoteData dsioData = DsioNoteData.FromDictionary(noteData);

            this.CommandArgs = new object[] { ien, noteArray, dsioData.ToParameter(), subject };
        }