コード例 #1
0
ファイル: AutoFace.cs プロジェクト: hwwen/Plurker
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ServiceAddress">Web Service位址</param>
 /// <param name="mApi">Plurk Api物件</param>
 /// <param name="UnReadPlurks">未讀噗</param>
 public AutoFace(string ServiceAddress,PlurkApi.PlurkApi mApi,plurks UnReadPlurks)
 {
     if (ServiceAddress.Substring(ServiceAddress.Length - 1, 1) == "/") ServiceAddress = ServiceAddress.Substring(0, ServiceAddress.Length - 1);
     this._ServiceAddress = ServiceAddress;
     this._mApi = mApi;
     this._UnReadPlurks = UnReadPlurks;
 }
コード例 #2
0
ファイル: AutoExchangeRate.cs プロジェクト: hwwen/Plurker
 public AutoExchangeRate(PlurkApi.PlurkApi mApi, plurks UnReadPlurk)
 {
     xmlDoc.Load(PlurkModule.GetConfig.GetCurrencySynonymousFilePath());
     root = xmlDoc.DocumentElement;
     this._mApi = mApi;
     this._UnreadPlurk = UnReadPlurk;
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: hwwen/Plurker
        static void Main(string[] args)
        {
            Console.WriteLine("Creating timer: {0}\n",
                                          DateTime.Now.ToString("h:mm:ss"));

            try
            {
                PlurkApi.PlurkApi mApi = new PlurkApi.PlurkApi(GetConfig.GetApiKey());
                mApi.login(GetConfig.GetUserName(), GetConfig.GetPassword());
                TimerCallback callback = new TimerCallback(Tick);
                // create a one second timer tick
                Timer stateTimer = new Timer(callback, mApi, 0, GetConfig.GetTimerInterval());

                // loop here forever
                for (; ; )
                {
                    try
                    {
                        if (!blnRoot) RootingJob(mApi);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("[Error]" + ex.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                //程式結束
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
                if (ex.InnerException != null) Console.WriteLine(ex.InnerException.Message);
                Console.WriteLine("Press enter to terminate process...");
                Console.ReadLine();
            }
        }
コード例 #4
0
ファイル: AutoAddToFriends.cs プロジェクト: hwwen/Plurker
 public AutoAddToFriends(PlurkApi.PlurkApi mApi,plurks UnReadPlurk)
 {
     this._mApi = mApi;
     this.UnreadPlurk = UnReadPlurk;
 }