public System.Text.StringBuilder GetStringBuilder()
 {
     CodeContract.Ensures(CodeContract.Result <System.Text.StringBuilder>() != null);
     return(default(System.Text.StringBuilder));
 }
 public void SetCustomAttribute(System.Reflection.ConstructorInfo !con, Byte[] !binaryAttribute)
 {
     CodeContract.Requires(con != null);
     CodeContract.Requires(binaryAttribute != null);
 }
 public void DefineUnmanagedResource(Byte[] !resource)
 {
     CodeContract.Requires(resource != null);
 }
        public PolicyStatement Resolve(Evidence !evidence)
        {
            CodeContract.Requires(evidence != null);

            return(default(PolicyStatement));
        }
Esempio n. 5
0
 /// <summary>
 /// Add OptOut friendly properties to the action
 /// </summary>
 /// <param name="propertyNameList"></param>
 public void AddOptOutFriendlyPropertiesList(IEnumerable <string> propertyNameList)
 {
     CodeContract.RequiresArgumentNotNull <IEnumerable <string> >(propertyNameList, "propertyNameList");
     optoutFriendlyProperties.UnionWith(propertyNameList);
 }
Esempio n. 6
0
 public void GetObjectData(System.Runtime.Serialization.SerializationInfo !info, System.Runtime.Serialization.StreamingContext context)
 {
     CodeContract.Requires(info != null);
 }
Esempio n. 7
0
 public KeyPressingWaitDescriptor(KeyType[] keys, bool allKeysPressed)
 {
     CodeContract.Requires(keys != null && keys.Length > 0);
     Keys           = keys;
     AllKeysPressed = allKeysPressed;
 }
 public void Write(Char[] !chars)
 {
     CodeContract.Requires(chars != null);
 }
 public void Write(Byte[] !buffer)
 {
     CodeContract.Requires(buffer != null);
 }
Esempio n. 10
0
 public FlightScopeFilterProvider(IExperimentationService experimentationService)
 {
     CodeContract.RequiresArgumentNotNull <IExperimentationService>(experimentationService, "experimentationService");
     this.experimentationService = experimentationService;
 }
 public void Write(string !value)
 {
     CodeContract.Requires(value != null);
 }
Esempio n. 12
0
 public PrintReportEventArgs(PrinterJob printerJob)
 {
     CodeContract.Requires(printerJob != null);
     Job = printerJob;
 }
Esempio n. 13
0
 public MacUserPropertyProvider(IUserInformationProvider theUserInfoProvider)
 {
     CodeContract.RequiresArgumentNotNull <IUserInformationProvider>(theUserInfoProvider, "theUserInfoProvider");
     userInfoProvider = theUserInfoProvider;
     adminInformation = new Lazy <bool>(() => InitializeAdminInformation(), false);
 }
        public StringWriter(System.Text.StringBuilder !sb, IFormatProvider formatProvider)
        {
            CodeContract.Requires(sb != null);

            return(default(StringWriter));
        }
Esempio n. 15
0
 public T Parse(string source, CompilationErrorList errorList, CancellationToken ctoken)
 {
     CodeContract.RequiresArgumentNotNull(source, "source");
     return(Parse(new StringReader(source), errorList, ctoken));
 }
Esempio n. 16
0
 public PhraseComposer(ISoundManager soundManager)
 {
     CodeContract.Requires(soundManager != null);
     _soundManager = soundManager;
 }
Esempio n. 17
0
        public void Turn(int gestureID)
        {
            CodeContract.Requires(gestureID > 0);
            CodeContract.Requires(i == winnersDict.Count);

            if (engine.players.Count != 1)
            {
                roundNumber++;

                console.AppendText("---------Round " + roundNumber + "---------" + Environment.NewLine);

                if (engine.players.ContainsKey("User"))
                {
                    engine.players["User"] = gestureID;
                }
                else
                {
                    console.AppendText(Environment.NewLine + "You are not in the game anymore" + Environment.NewLine + Environment.NewLine);
                }

                engine.GetAllCompGestures();
                WriteAllGestures();

                endTurnWin = engine.CalculateWinner();

                if (endTurnWin == (int)gesture.rock)
                {
                    console.AppendText(Environment.NewLine + "Rock wins." + Environment.NewLine + Environment.NewLine);
                }
                else if (endTurnWin == (int)gesture.paper)
                {
                    console.AppendText(Environment.NewLine + "Paper wins." + Environment.NewLine + Environment.NewLine);
                }
                else if (endTurnWin == (int)gesture.scissors)
                {
                    console.AppendText(Environment.NewLine + "Scissors wins." + Environment.NewLine + Environment.NewLine);
                }
                else if (endTurnWin == 4)
                {
                    console.AppendText(Environment.NewLine + "Rock and paper tie." + Environment.NewLine + Environment.NewLine);
                }
                else if (endTurnWin == 5)
                {
                    console.AppendText(Environment.NewLine + "Paper and scissors tie." + Environment.NewLine + Environment.NewLine);
                }
                else if (endTurnWin == 6)
                {
                    console.AppendText(Environment.NewLine + "Scissors and rock tie." + Environment.NewLine + Environment.NewLine);
                }
                else if (endTurnWin == 0)
                {
                    console.AppendText(Environment.NewLine + "Draw." + Environment.NewLine + Environment.NewLine);
                }
                else if (endTurnWin == 7)
                {
                    console.AppendText(Environment.NewLine + "AN ERROR HAS OCCURED" + Environment.NewLine + Environment.NewLine);
                }

                if (engine.players.Count != 1)
                {
                    if (engine.players.ContainsKey("User"))
                    {
                        console.AppendText("Make your next gesture." + Environment.NewLine + Environment.NewLine);
                    }
                    else
                    {
                        console.AppendText("Click any button to see the next round." + Environment.NewLine + Environment.NewLine);
                    }
                }
                else
                {
                    winnersDict.Add(i, engine.players.Keys.ToArray().GetValue(0).ToString());
                    if (winners.Items.Contains((winnersDict.Count(name => name.Value == engine.players.Keys.ToArray().GetValue(0).ToString()) - 1) + " ------ " + engine.players.Keys.ToArray().GetValue(0).ToString()))
                    {
                        winners.Items.Remove((winnersDict.Count(name => name.Value == engine.players.Keys.ToArray().GetValue(0).ToString()) - 1) + " ------ " + engine.players.Keys.ToArray().GetValue(0).ToString());
                    }
                    winners.Items.Add(winnersDict.Count(name => name.Value == engine.players.Keys.ToArray().GetValue(0).ToString()) + " ------ " + engine.players.Keys.ToArray().GetValue(0).ToString());
                    i++;
                    MessageBox.Show(engine.players.Keys.ToArray().GetValue(0).ToString() + " is the winner.");
                    console.AppendText(engine.players.Keys.ToArray().GetValue(0).ToString() + " is the winner.");
                }
            }
        }
Esempio n. 18
0
 public Guid(Byte[] !b)
 {
     CodeContract.Requires(b != null);
     CodeContract.Requires(b.Length == 16);
     return(default(Guid));
 }
 public UIPermission(PermissionState state)
 {
     CodeContract.Requires((int)state == 1 || (int)state == 0);
     return(default(UIPermission));
 }
Esempio n. 20
0
        public Guid(string !g)
        {
            CodeContract.Requires(g != null);

            return(default(Guid));
        }
        public CodeGroup ResolveMatchingCodeGroups(Evidence !evidence)
        {
            CodeContract.Requires(evidence != null);

            return(default(CodeGroup));
        }
        public string GetArgName(int index)
        {
            CodeContract.Requires(index >= 0);

            return(default(string));
        }
Esempio n. 23
0
 /// <summary>
 /// Add OptOut friendly event name
 /// </summary>
 /// <param name="eventName"></param>
 public void AddOptOutFriendlyEventName(string eventName)
 {
     CodeContract.RequiresArgumentNotNull <string>(eventName, "eventName");
     optoutFriendlyEvents.Add(eventName);
 }
 public MethodResponse(Header[] h1, IMethodCallMessage !mcm)
 {
     CodeContract.Requires(mcm != null);
     return(default(MethodResponse));
 }
 public void SetCustomAttribute(CustomAttributeBuilder !customBuilder)
 {
     CodeContract.Requires(customBuilder != null);
 }
Esempio n. 26
0
        public T Parse(SourceReader source, CompilationErrorList errorList, CancellationToken ctoken)
        {
            CodeContract.RequiresArgumentNotNull(source, "source");

            if (!m_isInitialized)
            {
                OnInitialize();
            }

            Scanner scanner;

            scanner = new Scanner(m_scannerInfo);
            scanner.SetTriviaTokens(m_triviaTokens.Select(t => t.Index).ToArray());
            scanner.ErrorList      = errorList;
            scanner.RecoverErrors  = true;
            scanner.LexicalErrorId = m_errorDefinition.LexicalErrorId;

            scanner.SetSource(source);

            ParserEngine engine = new ParserEngine(m_transitionTable, m_errorDefinition);

            engine.EnableDeletionRecovery    = EnableDeletionRecovery;
            engine.EnableInsertionRecovery   = EnableInsertionRecovery;
            engine.EnableReplacementRecovery = EnableReplacementRecovery;

            Lexeme r = scanner.Read();

            while (true)
            {
                try
                {
                    engine.Input(r, ctoken);
                }
                catch (PanicRecoverException prex)
                {
                    var follow = prex.PossibleFollow;

                    HashSet <int> validTokens = new HashSet <int>(follow.Select(p =>
                    {
                        Terminal t = p as Terminal;
                        if (t != null)
                        {
                            return(t.Token.Index);
                        }
                        else
                        {
                            return(m_scannerInfo.EndOfStreamTokenIndex);
                        }
                    }));

                    while (!validTokens.Contains(r.TokenIndex) && !r.IsEndOfStream)
                    {
                        r = scanner.Read();
                    }

                    continue;
                }

                if (r.IsEndOfStream)
                {
                    break;
                }

                r = scanner.Read();
            }

            if (engine.AcceptedCount == 0)
            {
                throw new ParsingFailureException("There's no parsing result");
            }

            if (engine.AcceptedCount > 1 && engine.GetResultInfo(0).ErrorCount == 0)
            {
                throw new ParsingFailureException("Multiple parsing results are found. There's ambiguity in your grammar");
            }

            object result = engine.GetResult(0, errorList);

            return((T)result);
        }
 public void DefineUnmanagedResource(string !resourceFileName)
 {
     CodeContract.Requires(resourceFileName != null);
 }
Esempio n. 28
0
 public T Parse(TextReader source, CompilationErrorList errorList)
 {
     CodeContract.RequiresArgumentNotNull(source, "source");
     return(Parse(new SourceReader(source), errorList));
 }
Esempio n. 29
0
        public static Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo !element, bool inherit)
        {
            CodeContract.Requires(element != null);

            return(default(Attribute[]));
        }
 public string ToString()
 {
     CodeContract.Ensures(CodeContract.Result <string>() != null);
     return(default(string));
 }