示例#1
0
        public string ToString(bool includeSignatureBlock)
        {
            if (IsEmpty() && !SignatureList.Any())
            {
                return(string.Empty);
            }

            var sb = new StringBuilder();

            if (includeSignatureBlock)
            {
                OutputSignatureList(sb);
            }
            const bool prependSlashes = false;

            if (IsCsNone || IsUndoc)
            {
                sb.AppendUnixLine(MemToken.TxtTagOpen);
                if (IsCsNone)
                {
                    sb.AppendUnixLine(TxtToken.CsNone);
                }
                if (IsUndoc)
                {
                    sb.AppendUnixLine(MemToken.Undoc);
                }
                sb.AppendUnixLine(MemToken.TxtTagClose);
            }
            OutputForSummary(prependSlashes, sb);
            OutputForTextBlocks(prependSlashes, sb);
            OutputForParameters(prependSlashes, sb);
            OutputForReturnDoc(prependSlashes, sb);

            return(sb.ToString().Trim());
        }
示例#2
0
        public string GetUniqueSigContent(string uniqueSig, int numTabs = 0)
        {
            var sigListSize = SignatureList.Count;
            var index       = SignatureList.FindIndex(m => m == uniqueSig);

            //uniqueSig is the LAST element of the list
            if (index == sigListSize - 1)
            {
                string reassemblerContent = ContentForReassembler(numTabs);
                if (!reassemblerContent.IsEmpty())
                {
                    return(reassemblerContent);
                }
            }
            //uniqueSig not found
            else if (index < 0 || index >= sigListSize)
            {
                return("");
            }

            //uniqueSig found but is listonly or has no content
            var sb = new StringBuilder();

            sb.AppendTabs(numTabs);
            sb.AppendFormat("///{0}\n", TxtToken.ListOnlyNoSlashes);
            return(sb.ToString());
        }
示例#3
0
 public void ApplyServerDataToServerInfo(ServerDataWrap serverData)
 {
     ModList = serverData.Mods.Select(x => x.MapTo <ServerModInfo>()).ToList();
     foreach (var str in serverData.Signatures)
     {
         SignatureList.Add(str);
     }
     Difficulty = (Difficulty)serverData.Difficulty.Difficulty;
     AiLevel    = (AiLevel)serverData.Difficulty.AiLevel;
     IsThirdPersonViewEnabled = serverData.Difficulty.IsThirdPersonCameraEnabled;
     HelicopterFlightModel    = serverData.Difficulty.IsAdvancedFlightModelEnabled
         ? HelicopterFlightModel.Advanced
         : HelicopterFlightModel.Basic;
     IsWeaponCrosshairEnabled  = serverData.Difficulty.IsWeaponCrosshairEnabled;
     IsModListOverflowed       = serverData.IsModListOveflowed;
     IsSignatureListOverflowed = serverData.IsSignatureListOverflowed;
     RequiresExpansionTerrain  = serverData.ExpansionTerrain;
     foreach (var pair in NativeToManagedDlcMap)
     {
         if (serverData.Dlc.HasFlag(pair.Key))
         {
             DownloadableContent |= pair.Value;
         }
     }
     ReceivedRules = true;
 }
示例#4
0
        private void DeleteSelectedSig()
        {
            int i = listBoxSignatures.SelectedIndex;

            if (i > -1)
            {
                // remove sig
                SignatureList.Remove(SelectedSignature);

                // update list
                DisplayList();

                // select previous sig
                i--;
                if (i < 0)
                {
                    i = 0;
                }

                if (signatureList.Count == 0)
                {
                    i = -1;
                }

                SelectSignature(i);
            }
        }
示例#5
0
        public async Task <SignatureList> ListSignaturesAsync(string engagementAccount, DbContinuationToken continuationToken, int count)
        {
            using (var ctx = new SmsServiceDbEntities(this.connectionString))
            {
                var result     = new SignatureList();
                var signagures = ctx.Signatures.Where(s => s.EngagementAccount == engagementAccount).OrderBy(s => s.Created);
                result.Total = signagures.Count();

                if (result.Total <= 0)
                {
                    return(result);
                }

                var taken = count >= 0 ?
                            await signagures.Skip(continuationToken.Skip).Take(count).ToListAsync() :
                            await signagures.Skip(continuationToken.Skip).ToListAsync();

                result.Signatures = new List <Signature>();
                foreach (var entity in taken)
                {
                    result.Signatures.Add(entity.ToModel());
                }

                if (result.Total > continuationToken.Skip + count)
                {
                    result.NextLink = new DbContinuationToken(continuationToken.DatabaseId, continuationToken.Skip + count);
                }

                return(result);
            }
        }
示例#6
0
        private void btnSortSigs_Click(object sender, EventArgs e)
        {
            SignatureList.Sort(delegate(ByteSignature a, ByteSignature b)
            {
                return(a.Name.CompareTo(b.Name));
            });

            DisplayList();
            ClearDisplay();
        }
示例#7
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog d = new OpenFileDialog();

            if (d.ShowDialog() == DialogResult.OK)
            {
                if (MessageBox.Show("Load as new signature file?", "Load or Insert", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    OpenFile(d.FileName);
                }
                else
                {
                    List <ByteSignature> insert = XmlIO.LoadObjectFromXML <List <ByteSignature> >(d.FileName);
                    foreach (ByteSignature sig in insert)
                    {
                        SignatureList.Add(sig);
                        DisplayList();
                    }
                }
            }
        }
 public IntermediarySignShipment()
 {
     SignatureList = new SignatureList();
 }
示例#9
0
 /// <summary>
 /// Adds a new signature to the list.
 /// </summary>
 private void AddSignature()
 {
     SignatureList.Add(new ByteSignature());
     DisplayList();
     SelectSignature(SignatureList.Count - 1);
 }
示例#10
0
 public PropMFindingsForm()
 {
     SignatureUploadProperties = new SignatureList();
     PropMDate = DateTime.Now;
 }
示例#11
0
 public SignatureForm()
 {
     SignatureUploadProperties = new SignatureList();
     Signatures = new List <SignatureUploadInfo>();
 }
 /// <summary>
 /// New Signature collection View Model
 /// </summary>
 /// <param name="formId">Form ID</param>
 /// <param name="props">Properties w/i form</param>
 /// <param name="infos">Completed signature uploads + information</param>
 public SignatureCollectionViewModel(int formId, SignatureList props, ICollection <SignatureUploadInfo> infos)
 {
     this.FormId     = formId;
     this.Properties = props;
     this.Infos      = infos;
 }