示例#1
0
        static async Task UseCases_Form()
        {
            // this flow submits answers so we need to mimic user log in, using Self() acquires updated account info
            AccountInfo account = await _consumer.GetSelf().DemoUnPack();

            _consumer = new SampleConsumer(_apiUrl, account);


            Form form = await _consumer.Form_Create(_sampleFactionID.GetValueOrDefault());

            Console.WriteLine("Created Item: {0}", form.form_id);

            form = await _consumer.Form_Create_With_Target(_sampleFactionID.GetValueOrDefault());

            Console.WriteLine("Created Item: {0}", form.form_id);

            form = await _consumer.Form_Edit(_sampleFactionID.GetValueOrDefault(), form.form_id);

            Console.WriteLine("Edited Item: {0}", form.form_id);

            bool success = await _consumer.Form_Submit(_sampleFactionID.GetValueOrDefault(), form.form_id);

            Console.WriteLine("Submitted Item: {0}", success);

            string filePath = await _consumer.Form_GetAnswers(_sampleFactionID.GetValueOrDefault(), form.form_id);

            Console.WriteLine("Downloaded to: {0}", filePath);
        }
示例#2
0
        static async Task UseCases_Occasions()
        {
            AccountInfo account = await _consumer.GetSelf().DemoUnPack();

            _consumer = new SampleConsumer(_apiUrl, account);


            Occasion occasion = await _consumer.Occasion_Create(_sampleFactionID.GetValueOrDefault());

            Console.WriteLine("Created Occasion: {0}", occasion.occasion_id);
        }
示例#3
0
        static void Main(string[] args)
        {
            _consumer = new SampleConsumer(_apiUrl, _account);
            ConnectionSample().Wait();
            SDKPattern().Wait();

            //UseCases_Bulletin().Wait();
            //UseCases_Form().Wait();
            //UseCases_Conversations().Wait();
            //UseCases_Push().Wait();
            //UseCases_Groups().Wait();
            //UseCases_Terms().Wait();
            //UseCases_Principals().Wait();
            //UseCases_Occasions().Wait();

            Console.WriteLine("Press any key to close..");
            Console.ReadKey();
        }