public static List<RData> getObject(RProjectDetails details, List<String> objectNames, Boolean encodeDataFramePrimitiveAsVector, RClient client, String uri)
        {
            StringBuilder data = new StringBuilder();

            //create the input String
            data.Append(Constants.FORMAT_JSON);
            data.Append("&project=" + HttpUtility.UrlEncode(details.id));
            if (!(objectNames == null))
            {
                if (objectNames.Count > 0)
                {
                    data.Append("&name=");
                    foreach (var s in objectNames)
                    {
                        data.Append(HttpUtility.UrlEncode(s) + ",");
                    }
                    data.Remove(data.Length - 1, 1);
                }
            }
            data.Append("&encodeDataFramePrimitiveAsVector=" + encodeDataFramePrimitiveAsVector.ToString());

            //call the server
            JSONResponse jresponse = HTTPUtilities.callRESTGet(uri, data.ToString(), ref client);

            List<RData> returnValue = new List<RData>();
            returnValue = JSONUtilities.parseRObjects(jresponse.JSONMarkup);

            return returnValue;
        }
Exemple #2
0
        private void ReadPrefs()
        {
            //read existing prefs from config file
            _Version = _prefs.Version;
            _AutoUpdate = _prefs.AutoUpdate;
            _XMLTVSourceURI = _prefs.XMLTVSourceURI;
            _Country = _prefs.Country;
            _LastUpdate = _prefs.LastUpdate;
            _ChannelList = _prefs.ChannelListNames;
            _Countries = _prefs.Countries;

            //assign prefs to UI
            lblVersion.Text = _Version;
            lblLastUpdate.Text = _LastUpdate;

            cmbAutoUpdate.Items.Add(_AutoUpdate.ToString());

            cmbCountry.DataSource = _Countries;
            cmbCountry.DisplayMember = "CountryName";
            cmbCountry.ValueMember = "SourceURI";
            cmbCountry.SelectedIndex = 0;

            cmbSource.DataSource = _Countries;
            cmbSource.DisplayMember = "SourceURI";
            cmbSource.ValueMember = "SourceURI";
            cmbSource.SelectedIndex = 0;

            lstChannelList.DataSource = _ChannelList;
        }
Exemple #3
0
        public static void SendGCM(String planeId, Boolean state)
        {
            String currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            SqlParameter planeIdParam = new SqlParameter() { ParameterName = "@PlaneId", SqlDbType = SqlDbType.NVarChar, Value = planeId };
            String floorId = Convert.ToString(SqlHelper.ExecuteScalar(CommandType.Text, "SELECT [FKFloor] FROM [dbo].[Charge] WHERE [FKPlaneId]=@PlaneId", new SqlParameter[] { planeIdParam }));
            if (!String.IsNullOrEmpty(floorId))
            {
                SqlParameter floorIdParam = new SqlParameter() { ParameterName = "@FloorId", SqlDbType = SqlDbType.NVarChar, Value = floorId };
                SqlParameter stateParam = new SqlParameter() { ParameterName = "@FloorState", SqlDbType = SqlDbType.Bit, Value = state };
                SqlParameter dateTimeParam = new SqlParameter() { ParameterName = "@StateChangedDate", SqlDbType = SqlDbType.NVarChar, Value = currentDateTime };
                SqlHelper.ExecuteScalar(CommandType.Text, "UPDATE [dbo].[Floor] SET [FloorState]=@FloorState, [StateChangedDate] = @StateChangedDate WHERE [FloorId] = @FloorId", new SqlParameter[] { stateParam, dateTimeParam, floorIdParam });

                DataSet accountResult = SqlHelper.ExecuteDataSet(CommandType.Text, "SELECT [FKAccount] FROM [dbo].[Register] WHERE [FKFloor]=@FloorId", new SqlParameter[] { floorIdParam });
                int accountRows = accountResult.Tables[0].Rows.Count;
                for (int i = 0; i < accountRows; i++)
                {
                    String account = accountResult.Tables[0].Rows[i].ItemArray[0].ToString();
                    SqlParameter accountParam = new SqlParameter() { ParameterName = "@Account", SqlDbType = SqlDbType.NVarChar, Value = account };
                    DataSet phoneIdResult = SqlHelper.ExecuteDataSet(CommandType.Text, "SELECT [PhoneRegistId] FROM [dbo].[MemberMultiValue] WHERE [FKAccount]=@Account", new SqlParameter[] { accountParam });
                    int idRows = phoneIdResult.Tables[0].Rows.Count;
                    for (int j = 0; j < idRows; j++)
                    {
                        Debug.WriteLine(phoneIdResult.Tables[0].Rows[j].ItemArray[0].ToString());
                        AndroidGcmNotificationer gcmSender = new AndroidGcmNotificationer();
                        gcmSender.SendNotification(account, phoneIdResult.Tables[0].Rows[j].ItemArray[0].ToString(), state.ToString());
                    }
                }
            }
        }
        public static void autosaveProjects(Boolean save, RClient client, String uri)
        {
            StringBuilder data = new StringBuilder();

            //create the input String
            data.Append(Constants.FORMAT_JSON);
            data.Append("&enable=" + save.ToString().ToLower());
            //call the server
            JSONResponse jresponse = HTTPUtilities.callRESTPost(uri, data.ToString(), ref client);
        }
Exemple #5
0
        static StackObject *ToString_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Boolean instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.ToString();

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemple #6
0
		// Accounts - NEW
		public string GetUserAccounts(int page = 1, int limit = 25, Boolean all_accounts = false)
		{
			var sb = new StringBuilder();

			sb.Append("?page=" + page);

			if (limit > 1000) limit = 1000;
			sb.Append("&limit=" + limit);

			sb.Append("&all_accounts=" + all_accounts.ToString());

			return JsonRequest(URL_BASE + "accounts" + sb.ToString(), GET);
		}
Exemple #7
0
        public void save(string PC, string Android, Boolean clean, Boolean syncPlaylists, string iTunesLib)
        {
            System.IO.StreamWriter cfg = new System.IO.StreamWriter(cfg_filename);

            string[] lines = new string[5];
            lines[0] = "PC=" + PC;
            lines[1] = "Android=" + Android;
            lines[2] = "Clean_Sync=" + clean.ToString();
            lines[3] = "Sync_Playlists=" + syncPlaylists.ToString();
            lines[4] = "iTunesXML=" + iTunesLib;

            foreach (string element in lines) cfg.WriteLine(element);

            cfg.Close();
        }
Exemple #8
0
        public static void Main(string[] args)
        {
            //值类型
            int  i = 0;
            bool a = true;

            System.Int32   k = 0;
            System.Boolean b = false;
            System.Int32   j = new int();

            Console.WriteLine(i.ToString());
            Console.WriteLine(b.ToString());
            Console.WriteLine(j.ToString());

            //引用类型

            /*
             * System.Object
             * System.String
             * System.Dynamic
             */
            object o  = new object();
            object o2 = new object();

            Console.WriteLine(o.GetType());
            Console.WriteLine(o.ToString());
            string s  = "tianxin";
            string s2 = " temaxin ";

            s += s2;
            Console.WriteLine(s);
            Console.WriteLine(s == s2);
            char c = s [4];

            Console.WriteLine(c);
            Console.WriteLine(s2.Contains("xin"));
            Console.WriteLine(s.Length);
            Console.WriteLine(s2.IndexOf("xi"));
            Console.ReadLine();
            //指针类型
            //type* identifier;
            //不安全类型
            //			char* cptr;
            //			int* iptr;
            //动态(Dynamic)类型 ,存储任何类型的值在动态数据类型变量中。这些变量的类型检查是在运行时发生
            //dynamic <variable_name> = value;
            dynamic d = 20;
        }
        static StackObject *ToString_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.IFormatProvider provider = (System.IFormatProvider) typeof(System.IFormatProvider).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Boolean instance_of_this_method = GetInstance(__domain, ptr_of_this_method, __mStack);

            var result_of_this_method = instance_of_this_method.ToString(provider);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Exemple #10
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="section">hot | top | user     - defaults to hot</param>
 /// <param name="sort">viral | top | time | rising (only available with user section)      - defaults to viral</param>
 /// <param name="Viral">true | false     - Show or hide viral images from the 'user' section. Defaults to true</param>
 /// <param name="Page">integer - the data paging number</param>
 /// <param name="OAuth">OAuth Token - For user authentication</param>
 /// <returns></returns>
 public JsonObject GetGallery(String section,String sort, Boolean Viral, Int32 Page, String OAuth =null )
 {
     HttpClient client = GetHttpClient(OAuth);
     
     string URI = BaseURL;
     URI += "gallery/" + section + "/" + sort + "/" + Page + ".json";
     if (section == "user")
     {
             URI += "showViral=" + Viral.ToString();
     }              
     var jsonStr = client.GetStringAsync(URI).Result;
     JsonObject json = new JsonObject();
     JsonObject.TryParse(jsonStr, out json);
     return json;
    // throw new Exception("Method not implemented yet");
 }
    public void Init(HttpApplication application)
    {
        EventLog.WriteEntry(sSource, "HTTP Module registration", EventLogEntryType.Information);

        EventLog.WriteEntry(sSource, "Loading configuration from file:" + AssemblyDirectory + "\\EUMInjection.dll");
        EventLog.WriteEntry(sSource, "HTTP Post Request", EventLogEntryType.Information);
        Configuration appConfig = ConfigurationManager.OpenExeConfiguration(AssemblyDirectory+ "\\EUMInjection.dll");

        reference = Convert.ToBoolean(appConfig.AppSettings.Settings["Reference"].Value);
        uri = Convert.ToString(appConfig.AppSettings.Settings["AdrumURI"].Value);

        EventLog.WriteEntry(sSource, "Reference:" + reference.ToString());
        EventLog.WriteEntry(sSource, "URI:" + uri);

        application.PostRequestHandlerExecute += (new EventHandler(Application_PostRequest));
    }
        protected PayfirmaTransactionResponse ProcessTransaction(String type, PayfirmaCredentials credentials, Double amount, String transactionId, Boolean isTest)
        {
            PayfirmaTransactionResponse payfirmaResponse = new PayfirmaTransactionResponse();
            var webClient = new WebClient();

            NameValueCollection requestData = new NameValueCollection();
            requestData.Add("key", credentials.APIKey);
            requestData.Add("merchant_id", credentials.MerchantID);
            requestData.Add("amount", amount.ToString());
            requestData.Add("test_mode", isTest.ToString().ToLower());
            requestData.Add("do_not_store", "true");

            if (type.ToLower() != "refund" && type.ToLower() != "capture")
            {
                payfirmaResponse.Error = "Payfirma Invalid Transaction Type : " + type;
                return payfirmaResponse;
            }

            if (String.IsNullOrEmpty(transactionId))
            {
                payfirmaResponse.Error = "Payfirma Invalid Transaction ID";
                return payfirmaResponse;
            }

            String url = this.GetPayfirmaURL() + "/" + type.ToLower() + "/" + transactionId;

            try
            {
                var webResponseByte = webClient.UploadValues(url, "POST", requestData);
                var webResponse = Encoding.ASCII.GetString(webResponseByte);

                if (!String.IsNullOrEmpty(webResponse))
                {
                    payfirmaResponse = this.HandleTransacitonResponse(webResponse);
                }
                else
                {
                    payfirmaResponse.Error = "Payfirma unknown error";
                }
            }
            catch (Exception e)
            {
                payfirmaResponse.Error = "Payfirma Error: " + e.Message;
            }

            return payfirmaResponse;
        }
Exemple #13
0
        public RestRequest CreateMetadataRequest(String path, String root, String hash, Boolean list, Boolean include_deleted)
        {
            var request = new RestRequest(Method.GET);
            request.Resource = "{version}/metadata/{root}{path}";
            request.AddParameter("version", _version, ParameterType.UrlSegment);
            request.AddParameter("path", path, ParameterType.UrlSegment);
            request.AddParameter("root", root, ParameterType.UrlSegment);

            if (list)
            {
                request.AddParameter("hash", hash);
                request.AddParameter("list", list.ToString().ToLower());
                request.AddParameter("include_deleted", include_deleted.ToString().ToLower());
            }

            return request;
        }
        protected PayfirmaTransactionResponse ProcessTransaction(String type, PayfirmaCredentials credentials, PayfirmaCreditCard cc, PayfirmaMetaData metaData, Double amount, Boolean isTest)
        {
            PayfirmaTransactionResponse payfirmaResponse = new PayfirmaTransactionResponse();
            var webClient = new WebClient();

            NameValueCollection requestData = new NameValueCollection();
            this.GenerateMetaData(metaData, requestData);
            requestData.Add("key", credentials.APIKey);
            requestData.Add("merchant_id", credentials.MerchantID);
            requestData.Add("amount", amount.ToString());
            requestData.Add("card_number", cc.Number);
            requestData.Add("card_expiry_month", cc.ExpMonth.ToString());
            requestData.Add("card_expiry_year", cc.ExpYear.ToString());
            requestData.Add("cvv2", cc.CVV2);
            requestData.Add("test_mode", isTest.ToString().ToLower());
            requestData.Add("do_not_store", "true");

            if (type.ToLower() != "sale" && type.ToLower() != "authorize")
            {
                // Default to sale transaction type.
                type = "sale";
            }
            String url = this.GetPayfirmaURL() + "/" + type.ToLower(); ;

            try
            {
                var webResponseByte = webClient.UploadValues(url, "POST", requestData);
                var webResponse = Encoding.ASCII.GetString(webResponseByte);

                if (!String.IsNullOrEmpty(webResponse))
                {
                    payfirmaResponse = this.HandleTransacitonResponse(webResponse);
                }
                else
                {
                    payfirmaResponse.Error = "Payfirma unknown error";
                }
            }
            catch (Exception e)
            {
                payfirmaResponse.Error = "Payfirma Error: " + e.Message;
            }

            return payfirmaResponse;
        }
 public Boolean GetBool(XmlNode parentNode, String id, Boolean default_val)
 {
     XmlNode nd = FindChildElement(parentNode, id);
     Boolean result;
     if (nd == null)
     {
         AddParameter(parentNode, id, default_val.ToString());
         return default_val;
     }
     try
     {
         result = Boolean.Parse(nd.InnerText);
     }
     catch (Exception)
     {
         LogParamErr(parentNode, id, "True or False");
         result = default_val;
     }
     return result;
 }
        public static List<RRepositoryScript> listScripts(String filename, String directory, Boolean archived, Boolean sharedUsers, Boolean published, Boolean external, String categoryFilter, RClient client, String uri)
        {
            StringBuilder data = new StringBuilder();

            //create the input String
            data.Append(Constants.FORMAT_JSON);
            data.Append("&filename=" + HttpUtility.UrlEncode(filename));
            data.Append("&directory=" + HttpUtility.UrlEncode(directory));
            data.Append("&archived=" + archived.ToString());
            data.Append("&shared=" + sharedUsers.ToString());
            data.Append("&published=" + published.ToString());
            data.Append("&external=" + external.ToString());
            data.Append("&categoryFilter=" + HttpUtility.UrlEncode(categoryFilter));

            JSONResponse jresponse = HTTPUtilities.callRESTGet(uri, data.ToString(), ref client);

            List<RRepositoryScript> returnValue = new List<RRepositoryScript>();

            if (!(jresponse.JSONMarkup["repository"] == null))
            {
                JObject jrepo = jresponse.JSONMarkup["repository"].Value<JObject>();
                if (!(jrepo["scripts"] == null))
                {
                    JArray jvalues = jrepo["scripts"].Value<JArray>();
                    foreach (var j in jvalues)
                    {
                        if (j.Type != JTokenType.Null)
                        {
                            returnValue.Add(new RRepositoryScript(new JSONResponse(j.Value<JObject>(), true, "", 0), client));
                        }
                    }
                }
            }

            return returnValue;
        }
Exemple #17
0
 private void SetValue(string key, Boolean value)
 {
     SetValue(key, value.ToString());
 }
Exemple #18
0
 public void Setting(String key, Boolean value)
 {
     if (dFlags.ContainsKey(key)) dFlags[key] = value;
     if (dConfig.ContainsKey(key)) dConfig[key] = value.ToString();
 }
Exemple #19
0
 /// <summary>
 /// Converts the value of the specified nullable Boolean to its equivalent SqlString representation.
 /// </summary>
 /// <param name="value">A nullable Boolean value.</param>
 /// <returns>The SqlString equivalent of the nullable Boolean value.</returns>
 public static SqlString ToSqlString(Boolean? value) { return value.HasValue ? value.ToString() : SqlString.Null; }
Exemple #20
0
 /// <summary>
 /// Converts the value of the specified Boolean to its equivalent SqlString representation.
 /// </summary>
 /// <param name="value">A Boolean value.</param>
 /// <returns>The SqlString equivalent of the Boolean.</returns>
 public static SqlString ToSqlString(Boolean value) { return value.ToString(); }
 public Boolean TestToString(Boolean testSubject) {
 strLoc = "099d8";
 String b1 = "";
 String b2 = "";
 Boolean pass = false;
 Boolean excthrown = false;
 Object exc1 = null;
 Object exc2 = null;
 try {
 b1 = testSubject.ToString();
 pass = true;
 excthrown = false;
 } catch (Exception exc) {
 exc1 = exc;
 pass = false;
 excthrown = true;
 }
 try {
 b2 = Convert.ToString(testSubject);
 pass = pass & true;
 } catch (Exception exc) {
 exc2 = exc;
 pass = false;
 excthrown = excthrown & true;
 }
 if(excthrown)
   if(exc1.GetType() == exc2.GetType())
     return true;
   else
     return false;
 else if(pass && b1.Equals(b2))
   return true;
 else
   return false;
 }	
        /** When the socket reader receives a property update from runtime, it decodes object ID
         * property ID and the new value of the property. It then calls this method of
         * the target object, to update the new value in property cache. After updating the cache,
         * this method then fires appropriate event in skype.events to notify the UI of what has happened.
         * DispatchPropertyUpdate is executed in the socket reader thread.
         */
        internal override void DispatchPropertyUpdate(uint propId, object value, bool hasValue)
        {
            switch (propId)
            {
            case 202: /* Contact.P_TYPE */
                cache[0] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_type = (SktContact.TYPE)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_TYPE = " + cache_type.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_TYPE - update without value");
                skypeRef.events.FireOnContactType(this, cache_type);
                break;

            case 4: /* Contact.P_SKYPENAME */
                cache[1] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_skypename = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_SKYPENAME = " + cache_skypename.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_SKYPENAME - update without value");
                skypeRef.events.FireOnContactSkypename(this, cache_skypename);
                break;

            case 6: /* Contact.P_PSTNNUMBER */
                cache[2] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_pstnnumber = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_PSTNNUMBER = " + cache_pstnnumber.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_PSTNNUMBER - update without value");
                skypeRef.events.FireOnContactPstnnumber(this, cache_pstnnumber);
                break;

            case 5: /* Contact.P_FULLNAME */
                cache[3] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_fullname = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_FULLNAME = " + cache_fullname.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_FULLNAME - update without value");
                skypeRef.events.FireOnContactFullname(this, cache_fullname);
                break;

            case 7: /* Contact.P_BIRTHDAY */
                cache[4] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_birthday = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_BIRTHDAY = " + cache_birthday.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_BIRTHDAY - update without value");
                skypeRef.events.FireOnContactBirthday(this, cache_birthday);
                break;

            case 8: /* Contact.P_GENDER */
                cache[5] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_gender = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_GENDER = " + cache_gender.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_GENDER - update without value");
                skypeRef.events.FireOnContactGender(this, cache_gender);
                break;

            case 9: /* Contact.P_LANGUAGES */
                cache[6] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_languages = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_LANGUAGES = " + cache_languages.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_LANGUAGES - update without value");
                skypeRef.events.FireOnContactLanguages(this, cache_languages);
                break;

            case 10: /* Contact.P_COUNTRY */
                cache[7] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_country = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_COUNTRY = " + cache_country.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_COUNTRY - update without value");
                skypeRef.events.FireOnContactCountry(this, cache_country);
                break;

            case 11: /* Contact.P_PROVINCE */
                cache[8] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_province = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_PROVINCE = " + cache_province.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_PROVINCE - update without value");
                skypeRef.events.FireOnContactProvince(this, cache_province);
                break;

            case 12: /* Contact.P_CITY */
                cache[9] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_city = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_CITY = " + cache_city.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_CITY - update without value");
                skypeRef.events.FireOnContactCity(this, cache_city);
                break;

            case 13: /* Contact.P_PHONE_HOME */
                cache[10] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_phone_home = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_HOME = " + cache_phone_home.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_HOME - update without value");
                skypeRef.events.FireOnContactPhoneHome(this, cache_phone_home);
                break;

            case 14: /* Contact.P_PHONE_OFFICE */
                cache[11] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_phone_office = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_OFFICE = " + cache_phone_office.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_OFFICE - update without value");
                skypeRef.events.FireOnContactPhoneOffice(this, cache_phone_office);
                break;

            case 15: /* Contact.P_PHONE_MOBILE */
                cache[12] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_phone_mobile = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_MOBILE = " + cache_phone_mobile.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_PHONE_MOBILE - update without value");
                skypeRef.events.FireOnContactPhoneMobile(this, cache_phone_mobile);
                break;

            case 16: /* Contact.P_EMAILS */
                cache[13] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_emails = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_EMAILS = " + cache_emails.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_EMAILS - update without value");
                skypeRef.events.FireOnContactEmails(this, cache_emails);
                break;

            case 17: /* Contact.P_HOMEPAGE */
                cache[14] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_homepage = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_HOMEPAGE = " + cache_homepage.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_HOMEPAGE - update without value");
                skypeRef.events.FireOnContactHomepage(this, cache_homepage);
                break;

            case 18: /* Contact.P_ABOUT */
                cache[15] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_about = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_ABOUT = " + cache_about.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_ABOUT - update without value");
                skypeRef.events.FireOnContactAbout(this, cache_about);
                break;

            case 37: /* Contact.P_AVATAR_IMAGE */
                cache[16] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_avatar_image = (byte[])value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_AVATAR_IMAGE = binary size " + cache_avatar_image.Length.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_AVATAR_IMAGE - update without value");
                skypeRef.events.FireOnContactAvatarImage(this, cache_avatar_image);
                break;

            case 26: /* Contact.P_MOOD_TEXT */
                cache[17] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_mood_text = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_MOOD_TEXT = " + cache_mood_text.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_MOOD_TEXT - update without value");
                skypeRef.events.FireOnContactMoodText(this, cache_mood_text);
                break;

            case 205: /* Contact.P_RICH_MOOD_TEXT */
                cache[18] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_rich_mood_text = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_RICH_MOOD_TEXT = " + cache_rich_mood_text.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_RICH_MOOD_TEXT - update without value");
                skypeRef.events.FireOnContactRichMoodText(this, cache_rich_mood_text);
                break;

            case 27: /* Contact.P_TIMEZONE */
                cache[19] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_timezone = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_TIMEZONE = " + cache_timezone.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_TIMEZONE - update without value");
                skypeRef.events.FireOnContactTimezone(this, cache_timezone);
                break;

            case 36: /* Contact.P_CAPABILITIES */
                cache[20] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_capabilities = (byte[])value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_CAPABILITIES = binary size " + cache_capabilities.Length.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_CAPABILITIES - update without value");
                skypeRef.events.FireOnContactCapabilities(this, cache_capabilities);
                break;

            case 19: /* Contact.P_PROFILE_TIMESTAMP */
                cache[21] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_profile_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_PROFILE_TIMESTAMP = " + cache_profile_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_PROFILE_TIMESTAMP - update without value");
                skypeRef.events.FireOnContactProfileTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_profile_timestamp));
                break;

            case 28: /* Contact.P_NROF_AUTHED_BUDDIES */
                cache[22] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_nrof_authed_buddies = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_NROF_AUTHED_BUDDIES = " + cache_nrof_authed_buddies.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_NROF_AUTHED_BUDDIES - update without value");
                skypeRef.events.FireOnContactNrofAuthedBuddies(this, cache_nrof_authed_buddies);
                break;

            case 29: /* Contact.P_IPCOUNTRY */
                cache[23] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_ipcountry = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_IPCOUNTRY = " + cache_ipcountry.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_IPCOUNTRY - update without value");
                skypeRef.events.FireOnContactIpcountry(this, cache_ipcountry);
                break;

            case 182: /* Contact.P_AVATAR_TIMESTAMP */
                cache[24] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_avatar_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_AVATAR_TIMESTAMP = " + cache_avatar_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_AVATAR_TIMESTAMP - update without value");
                skypeRef.events.FireOnContactAvatarTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_avatar_timestamp));
                break;

            case 183: /* Contact.P_MOOD_TIMESTAMP */
                cache[25] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_mood_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_MOOD_TIMESTAMP = " + cache_mood_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_MOOD_TIMESTAMP - update without value");
                skypeRef.events.FireOnContactMoodTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_mood_timestamp));
                break;

            case 20: /* Contact.P_RECEIVED_AUTHREQUEST */
                cache[26] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_received_authrequest = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_RECEIVED_AUTHREQUEST = " + cache_received_authrequest.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_RECEIVED_AUTHREQUEST - update without value");
                skypeRef.events.FireOnContactReceivedAuthrequest(this, cache_received_authrequest);
                break;

            case 25: /* Contact.P_AUTHREQ_TIMESTAMP */
                cache[27] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_authreq_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_AUTHREQ_TIMESTAMP = " + cache_authreq_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_AUTHREQ_TIMESTAMP - update without value");
                skypeRef.events.FireOnContactAuthreqTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_authreq_timestamp));
                break;

            case 35: /* Contact.P_LASTONLINE_TIMESTAMP */
                cache[28] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_lastonline_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_LASTONLINE_TIMESTAMP = " + cache_lastonline_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_LASTONLINE_TIMESTAMP - update without value");
                skypeRef.events.FireOnContactLastonlineTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_lastonline_timestamp));
                break;

            case 34: /* Contact.P_AVAILABILITY */
                cache[29] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_availability = (SktContact.AVAILABILITY)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_AVAILABILITY = " + cache_availability.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_AVAILABILITY - update without value");
                skypeRef.events.FireOnContactAvailability(this, cache_availability);
                break;

            case 21: /* Contact.P_DISPLAYNAME */
                cache[30] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_displayname = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_DISPLAYNAME = " + cache_displayname.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_DISPLAYNAME - update without value");
                skypeRef.events.FireOnContactDisplayname(this, cache_displayname);
                break;

            case 22: /* Contact.P_REFRESHING */
                cache[31] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_refreshing = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_REFRESHING = " + cache_refreshing.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_REFRESHING - update without value");
                skypeRef.events.FireOnContactRefreshing(this, cache_refreshing);
                break;

            case 23: /* Contact.P_GIVEN_AUTHLEVEL */
                cache[32] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_given_authlevel = (SktContact.AUTHLEVEL)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_GIVEN_AUTHLEVEL = " + cache_given_authlevel.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_GIVEN_AUTHLEVEL - update without value");
                skypeRef.events.FireOnContactGivenAuthlevel(this, cache_given_authlevel);
                break;

            case 33: /* Contact.P_GIVEN_DISPLAYNAME */
                cache[33] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_given_displayname = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_GIVEN_DISPLAYNAME = " + cache_given_displayname.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_GIVEN_DISPLAYNAME - update without value");
                skypeRef.events.FireOnContactGivenDisplayname(this, cache_given_displayname);
                break;

            case 180: /* Contact.P_ASSIGNED_COMMENT */
                cache[34] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_assigned_comment = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_COMMENT = " + cache_assigned_comment.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_COMMENT - update without value");
                skypeRef.events.FireOnContactAssignedComment(this, cache_assigned_comment);
                break;

            case 39: /* Contact.P_LASTUSED_TIMESTAMP */
                cache[35] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_lastused_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_LASTUSED_TIMESTAMP = " + cache_lastused_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_LASTUSED_TIMESTAMP - update without value");
                skypeRef.events.FireOnContactLastusedTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_lastused_timestamp));
                break;

            case 41: /* Contact.P_AUTHREQUEST_COUNT */
                cache[36] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_authrequest_count = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_AUTHREQUEST_COUNT = " + cache_authrequest_count.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_AUTHREQUEST_COUNT - update without value");
                skypeRef.events.FireOnContactAuthrequestCount(this, cache_authrequest_count);
                break;

            case 184: /* Contact.P_ASSIGNED_PHONE1 */
                cache[37] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_assigned_phone1 = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE1 = " + cache_assigned_phone1.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE1 - update without value");
                skypeRef.events.FireOnContactAssignedPhone1(this, cache_assigned_phone1);
                break;

            case 185: /* Contact.P_ASSIGNED_PHONE1_LABEL */
                cache[38] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_assigned_phone1_label = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE1_LABEL = " + cache_assigned_phone1_label.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE1_LABEL - update without value");
                skypeRef.events.FireOnContactAssignedPhone1Label(this, cache_assigned_phone1_label);
                break;

            case 186: /* Contact.P_ASSIGNED_PHONE2 */
                cache[39] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_assigned_phone2 = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE2 = " + cache_assigned_phone2.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE2 - update without value");
                skypeRef.events.FireOnContactAssignedPhone2(this, cache_assigned_phone2);
                break;

            case 187: /* Contact.P_ASSIGNED_PHONE2_LABEL */
                cache[40] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_assigned_phone2_label = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE2_LABEL = " + cache_assigned_phone2_label.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE2_LABEL - update without value");
                skypeRef.events.FireOnContactAssignedPhone2Label(this, cache_assigned_phone2_label);
                break;

            case 188: /* Contact.P_ASSIGNED_PHONE3 */
                cache[41] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_assigned_phone3 = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE3 = " + cache_assigned_phone3.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE3 - update without value");
                skypeRef.events.FireOnContactAssignedPhone3(this, cache_assigned_phone3);
                break;

            case 189: /* Contact.P_ASSIGNED_PHONE3_LABEL */
                cache[42] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_assigned_phone3_label = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE3_LABEL = " + cache_assigned_phone3_label.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_ASSIGNED_PHONE3_LABEL - update without value");
                skypeRef.events.FireOnContactAssignedPhone3Label(this, cache_assigned_phone3_label);
                break;

            case 42: /* Contact.P_POPULARITY_ORD */
                cache[43] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_popularity_ord = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Contact.P_POPULARITY_ORD = " + cache_popularity_ord.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Contact.P_POPULARITY_ORD - update without value");
                skypeRef.events.FireOnContactPopularityOrd(this, cache_popularity_ord);
                break;

            default:
                skypeRef.Error(String.Format("Invalid Contact class property ID ({0})received from socket.", propId)); break;
            }
        }
    public override void OnInspectorGUI()
    {
        EditorGUILayout.ObjectField("组件", cs.comp, typeof(UnityEngine.Object));

        if (cs.propList.Count != propValList.Count)
        {
            SyncPropVal();
        }
        else
        {
            for (int i = 0; i < cs.propList.Count; ++i)
            {
                if (cs.propList[i].Value.Count != propValList[i].Value.Count)
                {
                    SyncPropVal();
                    break;
                }
            }
        }
        EditorGUILayout.BeginVertical("helpbox");
        extraCompName = EditorGUILayout.TextField("额外组件类型(类名)", extraCompName);
        EditorGUILayout.SelectableLabel(string.IsNullOrEmpty(finalCompName)?"没有此类型!":finalCompName);
        EditorGUILayout.EndVertical();

        if (GUILayout.Button("GetComponents"))
        {
            if (preExtra != extraCompName || string.IsNullOrEmpty(finalCompName))
            {
                finalCompName = getQualifiedName(extraCompName);
            }
            preExtra = extraCompName;
            List <string> compTypeList = new List <string>(defaultCompTypeList);
            if (!string.IsNullOrEmpty(finalCompName) && !compTypeList.Contains(finalCompName))
            {
                compTypeList.Add(finalCompName);
            }
            RemoteGameObjectControl.RemoteGetComponent(cs.gameObject, compTypeList);
        }
        for (int i = 0; i < cs.propList.Count; ++i)
        {
            EditorGUILayout.BeginVertical("helpbox");
            EditorGUILayout.LabelField(cs.propList[i].Key);
            for (int j = 0; j < cs.propList[i].Value.Count; ++j)
            {
                KeyValuePair <string, KeyValuePair <string, KeyValuePair <string, string> > > kvp = cs.propList[i].Value[j];
                bool bCanWrite = false;
                bool.TryParse(kvp.Value.Value.Key, out bCanWrite);
                string propType = kvp.Value.Key;
                if (notSupportEditTypeList.Contains(propType))
                {
                    bCanWrite = false;
                }
                EditorGUI.BeginDisabledGroup(!bCanWrite);
                string val = propValList[i].Value[j];
                if ("UnityEngine.Color" == propType)
                {
                    Color cVal = Color.clear;
                    if (TypeOpe.ColorTryParse(val, out cVal))
                    {
                        cVal = EditorGUILayout.ColorField(kvp.Key, cVal);
                        propValList[i].Value[j] = TypeOpe.TypeToString(propType, (object)cVal);
                    }
                    else
                    {
                        propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                    }
                }
                else if ("UnityEngine.Vector2" == propType)
                {
                    Vector2 vVal = Vector2.zero;
                    if (TypeOpe.Vector2TryParse(val, out vVal))
                    {
                        vVal = EditorGUILayout.Vector2Field(kvp.Key, vVal);
                        propValList[i].Value[j] = TypeOpe.TypeToString(propType, (object)vVal);
                    }
                    else
                    {
                        propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                    }
                }
                else if ("UnityEngine.Vector3" == propType)
                {
                    Vector3 vVal = Vector3.zero;
                    if (TypeOpe.Vector3TryParse(val, out vVal))
                    {
                        vVal = EditorGUILayout.Vector3Field(kvp.Key, vVal);
                        propValList[i].Value[j] = TypeOpe.TypeToString(propType, (object)vVal);
                    }
                    else
                    {
                        propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                    }
                }
                else if ("UnityEngine.Vector4" == propType)
                {
                    Vector4 vVal = Vector4.zero;
                    if (TypeOpe.Vector4TryParse(val, out vVal))
                    {
                        vVal = EditorGUILayout.Vector4Field(kvp.Key, vVal);
                        propValList[i].Value[j] = TypeOpe.TypeToString(propType, (object)vVal);
                    }
                    else
                    {
                        propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                    }
                }
                else if ("UnityEngine.Rect" == propType)
                {
                    Rect vVal = new Rect(0f, 0f, 0f, 0f);
                    if (TypeOpe.RectTryParse(val, out vVal))
                    {
                        vVal = EditorGUILayout.RectField(kvp.Key, vVal);
                        propValList[i].Value[j] = TypeOpe.TypeToString(propType, (object)vVal);
                    }
                    else
                    {
                        propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                    }
                }
                else if ("System.Boolean" == propType)
                {
                    System.Boolean bVal = false;
                    if (System.Boolean.TryParse(val, out bVal))
                    {
                        bVal = EditorGUILayout.Toggle(kvp.Key, bVal);
                        propValList[i].Value[j] = bVal.ToString();
                    }
                    else
                    {
                        propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                    }
                }
                else if ("System.Single" == propType)
                {
                    System.Single fVal = 0f;
                    if (System.Single.TryParse(val, out fVal))
                    {
                        fVal = EditorGUILayout.FloatField(kvp.Key, fVal);
                        propValList[i].Value[j] = fVal.ToString();
                    }
                    else
                    {
                        propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                    }
                }
                else if ("System.Int32" == propType || "System.UInt32" == propType)
                {
                    System.Int32 iVal = 0;
                    if (System.Int32.TryParse(val, out iVal))
                    {
                        iVal = EditorGUILayout.IntField(kvp.Key, iVal);
                        propValList[i].Value[j] = iVal.ToString();
                    }
                    else
                    {
                        propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                    }
                }
                else
                {
                    propValList[i].Value[j] = EditorGUILayout.TextField(kvp.Key + "(" + kvp.Value.Key + ")", val);
                }
                EditorGUI.EndDisabledGroup();
            }
            EditorGUILayout.EndVertical();
        }

        if (GUILayout.Button("submit"))
        {
            string compStr = "";
            ComponentSimulator.encode(out compStr, cs.propList, propValList);
            RemoteGameObjectControl.RemoteSetComponent(cs.gameObject, compStr);
        }

        /*
         * if (GUILayout.Button("submit0"))
         * {
         *  string compStr = "";
         *  ComponentSimulator.encode(out compStr, cs.comp.name, cs.propList, propValList);
         *  List<KeyValuePair<string, KeyValuePair<string, string>>> propList = null;
         *  ComponentSimulator.decode(ref propList, compStr);
         *
         *  Type type = Type.GetType("UnityEngine.ParticleSystem, UnityEngine");
         *  if (null == type)
         *  {
         *      return;
         *  }
         *  PropertyInfo[] pis = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);
         *  for (int j = 0; j < pis.Length; ++j)
         *  {
         *      if (!pis[j].CanWrite || !pis[j].CanRead)
         *          continue;
         *
         *      int idx = propList.FindIndex(p => p.Key == pis[j].Name);
         *      if (-1 == idx)
         *          continue;
         *
         *      MethodInfo mi = pis[j].GetSetMethod();
         *      Type propType = pis[j].PropertyType;
         *      object[] val = null;
         *      if (typeof(System.Single) == propType)
         *      {
         *          System.Single tmp;
         *          if (System.Single.TryParse(propList[idx].Value.Value, out tmp))
         *              val = new object[] { tmp };
         *          else
         *              continue;
         *      }
         *      else if (typeof(System.Boolean) == propType)
         *      {
         *          System.Boolean tmp;
         *          if (System.Boolean.TryParse(propList[idx].Value.Value, out tmp))
         *              val = new object[] { tmp };
         *          else
         *              continue;
         *      }
         *      else if (typeof(System.Int32) == propType)
         *      {
         *          System.Int32 tmp;
         *          if (System.Int32.TryParse(propList[idx].Value.Value, out tmp))
         *              val = new object[] { tmp };
         *          else
         *              continue;
         *      }
         *      else if (typeof(System.UInt32) == propType)
         *      {
         *          System.UInt32 tmp;
         *          if (System.UInt32.TryParse(propList[idx].Value.Value, out tmp))
         *              val = new object[] { tmp };
         *          else
         *              continue;
         *      }
         *      else if (typeof(System.String) == propType)
         *      {
         *          val = new object[] { propList[idx].Value.Value };
         *      }
         *      else
         *          continue;
         *
         *      try
         *      {
         *          mi.Invoke(cs.comp, val);
         *      }
         *      catch (Exception e)
         *      {
         *          Debug.Log(e.ToString());
         *      }
         *  }
         * }
         */
    }
        public conditionals_example()
        {
            bool boolTest = false;
            bool g = boolTest;
            g = true;
            // pretty simple stuff.

            // bool binaryTest = 0;
            //bool binaryTestTwo = 1; //you cannot do this. It does not recognize it as a binary digit. true or false only.

            Boolean geo = new Boolean();
            geo = false;

            for (int i = 0; i < 5; i++)
            {
                if (i > 3)
                {
                    geo = true;
                }
                else
                {
                    geo = false;
                }
                Console.WriteLine("geo is currently " + geo.ToString());
            }

            Person pOne = new Person("Bob", "Baslow");
            Person pTwo = new Person("Allan", "Smith");
            //conditionals
            bool result = 6 < 5;//false
            result = 6 > 5;//true
            result = 6 >= 5;//true
            result = 6 <= 5;//false
            result = 6 == 5;//false
            result = 6 != 5;//true. Logical NOT operator.
            result = (pOne.FirstName == pTwo.FirstName) && (pOne.LastName == pTwo.LastName);// can use the && operator. Both conditions must be true.
            result = (pOne.FirstName == pTwo.FirstName) || (pOne.LastName == pTwo.LastName);// can use OR operator as well.

            //if statements
            if (result == true)
            {
                Console.WriteLine("This is true.");
            }
            else
            {
                Console.WriteLine("This is False");
            }

            //switch-case statement - only useful if you are comparing two values that are equal. Cannot do less than or greater than.
            string str = "Hello, World";

            switch (str)
            {
                case "Hello":
                    Console.WriteLine(@"The value is ""test""");
                    break;
                case "world":
                    Console.WriteLine(@"The value is ""test""");
                    break;
                case "Hello,":
                    Console.WriteLine(@"The value is ""test""");
                    break;
                case "Hello, World":
                    Console.WriteLine(@"The value is ""test""");
                    break;
                default:
                    Console.WriteLine("No match found.");
                    break;
            }
        }
Exemple #25
0
 public Boolean deleteSld(String styleName, Boolean purge)
 {
     int result = sendRESTint(METHOD_DELETE, "/styles/" + styleName + ".sld?purge=" + purge.ToString(), null);
     // + "&name=" + styleName
     return result == 200;
 }
        private Dictionary<int, string> BuildPropertyList(int displaylevels = 20, Boolean showHidden = false, Boolean showArchived = false, int parentid = 0, String catreflist = "", String prefix = "", bool displayCount = false, bool showEmpty = true, string groupref = "", string breadcrumbseparator = ">", string lang = "")
        {
            if (lang == "") lang = Utils.GetCurrentCulture();

            var rtnDic = new Dictionary<int, string>();

            var strCacheKey = "NBrightBuy_BuildPropertyList" + PortalSettings.Current.PortalId + "*" + displaylevels + "*" + showHidden.ToString(CultureInfo.InvariantCulture) + "*" + showArchived.ToString(CultureInfo.InvariantCulture) + "*" + parentid + "*" + catreflist + "*" + prefix + "*" + Utils.GetCurrentCulture() + "*" + showEmpty + "*" + displayCount + "*" + groupref + "*" + lang;

            var objCache = NBrightBuyUtils.GetModCache(strCacheKey);

            if (objCache == null | StoreSettings.Current.DebugMode)
            {
                var grpCatCtrl = new GrpCatController(lang);
                var d = new Dictionary<int, string>();
                var rtnList = new List<GroupCategoryData>();
                rtnList = grpCatCtrl.GetTreePropertyList(breadcrumbseparator);
                var strCount = "";
                foreach (var grpcat in rtnList)
                {
                    if (displayCount) strCount = " (" + grpcat.entrycount.ToString("") + ")";

                    if (grpcat.depth < displaylevels)
                    {
                        if (showEmpty || grpcat.entrycount > 0)
                        {
                            if (grpcat.ishidden == false || showHidden)
                            {
                                if (!rtnDic.ContainsKey(grpcat.categoryid))
                                {
                                    var addprefix = new String(' ', grpcat.depth).Replace(" ", prefix);
                                    if (catreflist == "")
                                        rtnDic.Add(grpcat.categoryid, addprefix + grpcat.categoryname + strCount);
                                    else
                                    {
                                        if (grpcat.categoryref != "" &&
                                            (catreflist + ",").Contains(grpcat.categoryref + ","))
                                        {
                                            rtnDic.Add(grpcat.categoryid, addprefix + grpcat.categoryname + strCount);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                NBrightBuyUtils.SetModCache(-1, strCacheKey, rtnDic);

            }
            else
            {
                rtnDic = (Dictionary<int, string>)objCache;
            }
            return rtnDic;
        }
Exemple #27
0
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == 0x312)
            {
                switch ((int)m.WParam)
                {
                    case 0:
                        if (this.Settings != null && this.Settings.Visible)
                        {
                            this.Settings.Close();
                            break;
                        }
                        this.Settings = new Settings(); this.Settings.Show();
                        this.Settings.Location = new Point(this.GameWindowRect.Right - this.Settings.Width - 20, this.GameWindowRect.Top + 200);
                        Native.SetForegroundWindow(this.GameMemory.Process.MainWindowHandle);
                        break;

                    case 1:
                        ShowRadar = !ShowRadar;
                        Main.Ini.IniWriteValue("Radar", "Show", ShowRadar.ToString());
                        break;

                    case 2:
                        ShowMap = !ShowMap;
                        break;

                    case 3:
                        ShowMapLarge = !ShowMapLarge;
                        Main.Ini.IniWriteValue("Map", "LargeMap", Main.ShowMapLarge.ToString());
                        break;

                    case 4:
                        Main.IsRunning = false;
                        break;
                }
            }
            base.WndProc(ref m);
        }
Exemple #28
0
        public void OpenSCLFile(string filename, bool validate)
        {
            List <ErrorsManagement> list = new List <ErrorsManagement> ();

            if (modified && scl != null)
            {
                var res = MessageBox.Show("Do you want to save your work?",
                                          "Openning a new SCL",
                                          MessageBoxButtons.YesNoCancel,
                                          MessageBoxIcon.Exclamation);
                if (res == DialogResult.Yes)
                {
                    SaveSCLFile(true);
                }
                if (res == DialogResult.Cancel)
                {
                    return;
                }
            }

            string f = "";

            if (filename == null)
            {
                openDialog dlg = new openDialog();
                var        res = dlg.ShowDialog();
                if (res == DialogResult.OK)
                {
                    f = dlg.FileName;
                }
                else
                {
                    return;
                }
            }
            else
            {
                f = filename;
            }

            if (validate)
            {
                //System.Windows.Forms.MessageBox.Show ("OpenDialog: Validating");
                ValidatingSCL val = new ValidatingSCL();
                list = val.ValidateFile(f, xSDFiles);
            }
            this.PropertyGridAttributes.SelectedObject = null;
            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
            this.scl    = null;
            // Creating an SCL object
            System.Console.WriteLine("Deserializating file to SCLObject:...");
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();
            this.scl = new OpenSCL.Object();
            this.scl.Deserialize(f);
            sw.Stop();
            System.Console.WriteLine("Enlapsed Time:" + sw.ElapsedMilliseconds + " ms");
            // Creating TreeView
            System.Console.WriteLine("Creating TreeView:...");
            System.Diagnostics.Stopwatch swt = new System.Diagnostics.Stopwatch();
            swt.Start();
            string t = GetSclTitle();

            this.sclviewertree.scl   = this.scl.Configuration;
            this.sclviewertree.title = t;
            swt.Stop();
            System.Console.WriteLine("Enlapsed Time:" + swt.ElapsedMilliseconds + " ms");
            modified  = false;
            this.Text = this.AppName + " - " + this.File;
            Console.WriteLine("File: " + scl.FileName + "Openend Modif = " + modified.ToString());
            this.Cursor = System.Windows.Forms.Cursors.Default;

            if (list.Count == 0)
            {
                EnablePanels(null);
            }
            else
            {
                EnablePanels(list);
            }
        }
        /** When the socket reader receives a property update from runtime, it decodes object ID
         * property ID and the new value of the property. It then calls this method of
         * the target object, to update the new value in property cache. After updating the cache,
         * this method then fires appropriate event in skype.events to notify the UI of what has happened.
         * DispatchPropertyUpdate is executed in the socket reader thread.
         */
        internal override void DispatchPropertyUpdate(uint propId, object value, bool hasValue)
        {
            switch (propId)
            {
            case 190: /* Sms.P_TYPE */
                cache[0] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_type = (SktSms.TYPE)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_TYPE = " + cache_type.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_TYPE - update without value");
                skypeRef.events.FireOnSmsType(this, cache_type);
                break;

            case 1211: /* Sms.P_OUTGOING_REPLY_TYPE */
                cache[1] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_outgoing_reply_type = (SktSms.OUTGOING_REPLY_TYPE)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_OUTGOING_REPLY_TYPE = " + cache_outgoing_reply_type.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_OUTGOING_REPLY_TYPE - update without value");
                skypeRef.events.FireOnSmsOutgoingReplyType(this, cache_outgoing_reply_type);
                break;

            case 191: /* Sms.P_STATUS */
                cache[2] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_status = (SktSms.STATUS)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_STATUS = " + cache_status.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_STATUS - update without value");
                skypeRef.events.FireOnSmsStatus(this, cache_status);
                break;

            case 192: /* Sms.P_FAILUREREASON */
                cache[3] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_failurereason = (SktSms.FAILUREREASON)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_FAILUREREASON = " + cache_failurereason.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_FAILUREREASON - update without value");
                skypeRef.events.FireOnSmsFailurereason(this, cache_failurereason);
                break;

            case 48: /* Sms.P_IS_FAILED_UNSEEN */
                cache[4] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_is_failed_unseen = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_IS_FAILED_UNSEEN = " + cache_is_failed_unseen.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_IS_FAILED_UNSEEN - update without value");
                skypeRef.events.FireOnSmsIsFailedUnseen(this, cache_is_failed_unseen);
                break;

            case 198: /* Sms.P_TIMESTAMP */
                cache[5] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_TIMESTAMP = " + cache_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_TIMESTAMP - update without value");
                skypeRef.events.FireOnSmsTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_timestamp));
                break;

            case 193: /* Sms.P_PRICE */
                cache[6] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_price = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_PRICE = " + cache_price.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_PRICE - update without value");
                skypeRef.events.FireOnSmsPrice(this, cache_price);
                break;

            case 49: /* Sms.P_PRICE_PRECISION */
                cache[7] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_price_precision = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_PRICE_PRECISION = " + cache_price_precision.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_PRICE_PRECISION - update without value");
                skypeRef.events.FireOnSmsPricePrecision(this, cache_price_precision);
                break;

            case 194: /* Sms.P_PRICE_CURRENCY */
                cache[8] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_price_currency = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_PRICE_CURRENCY = " + cache_price_currency.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_PRICE_CURRENCY - update without value");
                skypeRef.events.FireOnSmsPriceCurrency(this, cache_price_currency);
                break;

            case 199: /* Sms.P_REPLY_TO_NUMBER */
                cache[9] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_reply_to_number = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_REPLY_TO_NUMBER = " + cache_reply_to_number.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_REPLY_TO_NUMBER - update without value");
                skypeRef.events.FireOnSmsReplyToNumber(this, cache_reply_to_number);
                break;

            case 195: /* Sms.P_TARGET_NUMBERS */
                cache[10] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_target_numbers = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_TARGET_NUMBERS = " + cache_target_numbers.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_TARGET_NUMBERS - update without value");
                skypeRef.events.FireOnSmsTargetNumbers(this, cache_target_numbers);
                break;

            case 196: /* Sms.P_TARGET_STATUSES */
                cache[11] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_target_statuses = (byte[])value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_TARGET_STATUSES = binary size " + cache_target_statuses.Length.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_TARGET_STATUSES - update without value");
                skypeRef.events.FireOnSmsTargetStatuses(this, cache_target_statuses);
                break;

            case 197: /* Sms.P_BODY */
                cache[12] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_body = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_BODY = " + cache_body.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_BODY - update without value");
                skypeRef.events.FireOnSmsBody(this, cache_body);
                break;

            case 840: /* Sms.P_CHATMSG_ID */
                cache[13] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_chatmsg_id = (SktMessage)value;
                    if (skypeRef.logging) skypeRef.Log("Sms.P_CHATMSG_ID = " + cache_chatmsg_id.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Sms.P_CHATMSG_ID - update without value");
                skypeRef.events.FireOnSmsChatmsgId(this, cache_chatmsg_id);
                break;

            default:
                skypeRef.Error(String.Format("Invalid Sms class property ID ({0})received from socket.", propId)); break;
            }
        }
		// Simple Types
		//
		/// <summary>Converts the value from <c>Boolean</c> to an equivalent <c>SqlString</c> value.</summary>
		public static SqlString ToSqlString(Boolean         p) { return p.ToString();                                                                     }
        /** When the socket reader receives a property update from runtime, it decodes object ID
         * property ID and the new value of the property. It then calls this method of
         * the target object, to update the new value in property cache. After updating the cache,
         * this method then fires appropriate event in skype.events to notify the UI of what has happened.
         * DispatchPropertyUpdate is executed in the socket reader thread.
         */
        internal override void DispatchPropertyUpdate(uint propId, object value, bool hasValue)
        {
            switch (propId)
            {
            case 972: /* Conversation.P_IDENTITY */
                cache[0] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_identity = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_IDENTITY = " + cache_identity.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_IDENTITY - update without value");
                skypeRef.events.FireOnConversationIdentity(this, cache_identity);
                break;

            case 902: /* Conversation.P_TYPE */
                cache[1] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_type = (SktConversation.TYPE)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_TYPE = " + cache_type.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_TYPE - update without value");
                skypeRef.events.FireOnConversationType(this, cache_type);
                break;

            case 918: /* Conversation.P_LIVE_HOST */
                cache[2] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_host = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_HOST = " + cache_live_host.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_HOST - update without value");
                skypeRef.events.FireOnConversationLiveHost(this, cache_live_host);
                break;

            case 974: /* Conversation.P_LIVE_START_TIMESTAMP */
                cache[3] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_start_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_START_TIMESTAMP = " + cache_live_start_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_START_TIMESTAMP - update without value");
                skypeRef.events.FireOnConversationLiveStartTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_live_start_timestamp));
                break;

            case 996: /* Conversation.P_LIVE_IS_MUTED */
                cache[4] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_live_is_muted = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_IS_MUTED = " + cache_live_is_muted.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_LIVE_IS_MUTED - update without value");
                skypeRef.events.FireOnConversationLiveIsMuted(this, cache_live_is_muted);
                break;

            case 920: /* Conversation.P_ALERT_STRING */
                cache[5] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_alert_string = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_ALERT_STRING = " + cache_alert_string.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_ALERT_STRING - update without value");
                skypeRef.events.FireOnConversationAlertString(this, cache_alert_string);
                break;

            case 921: /* Conversation.P_IS_BOOKMARKED */
                cache[6] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_is_bookmarked = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_IS_BOOKMARKED = " + cache_is_bookmarked.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_IS_BOOKMARKED - update without value");
                skypeRef.events.FireOnConversationIsBookmarked(this, cache_is_bookmarked);
                break;

            case 925: /* Conversation.P_GIVEN_DISPLAYNAME */
                cache[7] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_given_displayname = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_GIVEN_DISPLAYNAME = " + cache_given_displayname.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_GIVEN_DISPLAYNAME - update without value");
                skypeRef.events.FireOnConversationGivenDisplayname(this, cache_given_displayname);
                break;

            case 924: /* Conversation.P_DISPLAYNAME */
                cache[8] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_displayname = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_DISPLAYNAME = " + cache_displayname.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_DISPLAYNAME - update without value");
                skypeRef.events.FireOnConversationDisplayname(this, cache_displayname);
                break;

            case 927: /* Conversation.P_LOCAL_LIVESTATUS */
                cache[9] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_local_livestatus = (SktConversation.LOCAL_LIVESTATUS)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_LOCAL_LIVESTATUS = " + cache_local_livestatus.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_LOCAL_LIVESTATUS - update without value");
                skypeRef.events.FireOnConversationLocalLivestatus(this, cache_local_livestatus);
                break;

            case 928: /* Conversation.P_INBOX_TIMESTAMP */
                cache[10] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_inbox_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_INBOX_TIMESTAMP = " + cache_inbox_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_INBOX_TIMESTAMP - update without value");
                skypeRef.events.FireOnConversationInboxTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_inbox_timestamp));
                break;

            case 973: /* Conversation.P_INBOX_MESSAGE_ID */
                cache[11] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_inbox_message_id = (SktMessage)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_INBOX_MESSAGE_ID = " + cache_inbox_message_id.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_INBOX_MESSAGE_ID - update without value");
                skypeRef.events.FireOnConversationInboxMessageId(this, cache_inbox_message_id);
                break;

            case 975: /* Conversation.P_UNCONSUMED_SUPPRESSED_MESSAGES */
                cache[12] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_unconsumed_suppressed_messages = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_UNCONSUMED_SUPPRESSED_MESSAGES = " + cache_unconsumed_suppressed_messages.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_UNCONSUMED_SUPPRESSED_MESSAGES - update without value");
                skypeRef.events.FireOnConversationUnconsumedSuppressedMessages(this, cache_unconsumed_suppressed_messages);
                break;

            case 976: /* Conversation.P_UNCONSUMED_NORMAL_MESSAGES */
                cache[13] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_unconsumed_normal_messages = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_UNCONSUMED_NORMAL_MESSAGES = " + cache_unconsumed_normal_messages.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_UNCONSUMED_NORMAL_MESSAGES - update without value");
                skypeRef.events.FireOnConversationUnconsumedNormalMessages(this, cache_unconsumed_normal_messages);
                break;

            case 977: /* Conversation.P_UNCONSUMED_ELEVATED_MESSAGES */
                cache[14] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_unconsumed_elevated_messages = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_UNCONSUMED_ELEVATED_MESSAGES = " + cache_unconsumed_elevated_messages.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_UNCONSUMED_ELEVATED_MESSAGES - update without value");
                skypeRef.events.FireOnConversationUnconsumedElevatedMessages(this, cache_unconsumed_elevated_messages);
                break;

            case 970: /* Conversation.P_UNCONSUMED_MESSAGES_VOICE */
                cache[15] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_unconsumed_messages_voice = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_UNCONSUMED_MESSAGES_VOICE = " + cache_unconsumed_messages_voice.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_UNCONSUMED_MESSAGES_VOICE - update without value");
                skypeRef.events.FireOnConversationUnconsumedMessagesVoice(this, cache_unconsumed_messages_voice);
                break;

            case 971: /* Conversation.P_ACTIVE_VM_ID */
                cache[16] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_active_vm_id = (SktVoicemail)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_ACTIVE_VM_ID = " + cache_active_vm_id.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_ACTIVE_VM_ID - update without value");
                skypeRef.events.FireOnConversationActiveVmId(this, cache_active_vm_id);
                break;

            case 979: /* Conversation.P_CONSUMPTION_HORIZON */
                cache[17] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_consumption_horizon = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_CONSUMPTION_HORIZON = " + cache_consumption_horizon.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_CONSUMPTION_HORIZON - update without value");
                skypeRef.events.FireOnConversationConsumptionHorizon(this, skypeRef.UnixTimestampToDateTime(cache_consumption_horizon));
                break;

            case 981: /* Conversation.P_LAST_ACTIVITY_TIMESTAMP */
                cache[18] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_last_activity_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_LAST_ACTIVITY_TIMESTAMP = " + cache_last_activity_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_LAST_ACTIVITY_TIMESTAMP - update without value");
                skypeRef.events.FireOnConversationLastActivityTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_last_activity_timestamp));
                break;

            case 915: /* Conversation.P_SPAWNED_FROM_CONVO_ID */
                cache[19] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_spawned_from_convo_id = (SktConversation)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_SPAWNED_FROM_CONVO_ID = " + cache_spawned_from_convo_id.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_SPAWNED_FROM_CONVO_ID - update without value");
                skypeRef.events.FireOnConversationSpawnedFromConvoId(this, cache_spawned_from_convo_id);
                break;

            case 903: /* Conversation.P_CREATOR */
                cache[20] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_creator = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_CREATOR = " + cache_creator.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_CREATOR - update without value");
                skypeRef.events.FireOnConversationCreator(this, cache_creator);
                break;

            case 904: /* Conversation.P_CREATION_TIMESTAMP */
                cache[21] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_creation_timestamp = (uint)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_CREATION_TIMESTAMP = " + cache_creation_timestamp.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_CREATION_TIMESTAMP - update without value");
                skypeRef.events.FireOnConversationCreationTimestamp(this, skypeRef.UnixTimestampToDateTime(cache_creation_timestamp));
                break;

            case 919: /* Conversation.P_MY_STATUS */
                cache[22] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_my_status = (SktConversation.MY_STATUS)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_MY_STATUS = " + cache_my_status.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_MY_STATUS - update without value");
                skypeRef.events.FireOnConversationMyStatus(this, cache_my_status);
                break;

            case 922: /* Conversation.P_OPT_JOINING_ENABLED */
                cache[23] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_opt_joining_enabled = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_OPT_JOINING_ENABLED = " + cache_opt_joining_enabled.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_OPT_JOINING_ENABLED - update without value");
                skypeRef.events.FireOnConversationOptJoiningEnabled(this, cache_opt_joining_enabled);
                break;

            case 906: /* Conversation.P_OPT_ENTRY_LEVEL_RANK */
                cache[24] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_opt_entry_level_rank = (SktParticipant.RANK)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_OPT_ENTRY_LEVEL_RANK = " + cache_opt_entry_level_rank.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_OPT_ENTRY_LEVEL_RANK - update without value");
                skypeRef.events.FireOnConversationOptEntryLevelRank(this, cache_opt_entry_level_rank);
                break;

            case 907: /* Conversation.P_OPT_DISCLOSE_HISTORY */
                cache[25] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_opt_disclose_history = (Boolean)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_OPT_DISCLOSE_HISTORY = " + cache_opt_disclose_history.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_OPT_DISCLOSE_HISTORY - update without value");
                skypeRef.events.FireOnConversationOptDiscloseHistory(this, cache_opt_disclose_history);
                break;

            case 909: /* Conversation.P_OPT_ADMIN_ONLY_ACTIVITIES */
                cache[26] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_opt_admin_only_activities = (SktConversation.ALLOWED_ACTIVITY)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_OPT_ADMIN_ONLY_ACTIVITIES = " + cache_opt_admin_only_activities.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_OPT_ADMIN_ONLY_ACTIVITIES - update without value");
                skypeRef.events.FireOnConversationOptAdminOnlyActivities(this, cache_opt_admin_only_activities);
                break;

            case 980: /* Conversation.P_PASSWORDHINT */
                cache[27] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_passwordhint = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_PASSWORDHINT = " + cache_passwordhint.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_PASSWORDHINT - update without value");
                skypeRef.events.FireOnConversationPasswordhint(this, cache_passwordhint);
                break;

            case 910: /* Conversation.P_META_NAME */
                cache[28] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_meta_name = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_META_NAME = " + cache_meta_name.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_META_NAME - update without value");
                skypeRef.events.FireOnConversationMetaName(this, cache_meta_name);
                break;

            case 911: /* Conversation.P_META_TOPIC */
                cache[29] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_meta_topic = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_META_TOPIC = " + cache_meta_topic.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_META_TOPIC - update without value");
                skypeRef.events.FireOnConversationMetaTopic(this, cache_meta_topic);
                break;

            case 913: /* Conversation.P_META_GUIDELINES */
                cache[30] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_meta_guidelines = (String)value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_META_GUIDELINES = " + cache_meta_guidelines.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_META_GUIDELINES - update without value");
                skypeRef.events.FireOnConversationMetaGuidelines(this, cache_meta_guidelines);
                break;

            case 914: /* Conversation.P_META_PICTURE */
                cache[31] = hasValue; // if no value - invalidate cache
                if (hasValue)
                {
                    cache_meta_picture = (byte[])value;
                    if (skypeRef.logging) skypeRef.Log("Conversation.P_META_PICTURE = binary size " + cache_meta_picture.Length.ToString());
                }
                else if (skypeRef.logging) skypeRef.Log("Conversation.P_META_PICTURE - update without value");
                skypeRef.events.FireOnConversationMetaPicture(this, cache_meta_picture);
                break;

            default:
                skypeRef.Error(String.Format("Invalid Conversation class property ID ({0})received from socket.", propId)); break;
            }
        }
Exemple #32
0
 /// <summary>
 /// Converts the value of the specified nullable Boolean to the equivalent SqlChars representation.
 /// </summary>
 /// <param name="value">A nullable Boolean.</param>
 /// <returns>The equivalent SqlChars.</returns>
 public static SqlChars ToSqlChars(Boolean? value) { return value.HasValue ? new SqlChars(value.ToString().ToCharArray()) : SqlChars.Null; }
 public void SetConfig(String configName, Boolean configValue)
 {
     SetConfig(configName, configValue.ToString());
 }
Exemple #34
0
        public static void UpdateVisualForYValue4StackedColumnChart(RenderAs chartType, Chart chart, DataPoint dataPoint, Boolean isAxisChanged)
        {
            if (dataPoint.Faces == null)
                return;

            System.Diagnostics.Debug.WriteLine("Animate--YValue" + dataPoint.YValue.ToString() + " IsAxisChange=" + isAxisChanged.ToString());
            
            Boolean animationEnabled = chart.AnimatedUpdate;                                            // Whether the animation for the DataPoint is enabled   
            DataSeries dataSeries = dataPoint.Parent;                                   // parent of the current DataPoint
            Canvas dataPointVisual = dataPoint.Faces.Visual as Canvas;                  // Old visual for the column
            Canvas labelCanvas = dataPoint.Faces.LabelCanvas;// (columnCanvas.Parent as Canvas).Children[0] as Canvas; // Parent canvas of Datapoint label
            Canvas columnCanvas = (labelCanvas.Parent as Canvas).Children[1] as Canvas; 
                //dataSeries.Faces.Visual as Canvas;// dataPointVisual.Parent as Canvas;                     // Existing parent canvas of column

            UpdateParentVisualCanvasSize(chart, columnCanvas);
            UpdateParentVisualCanvasSize(chart, labelCanvas);

            Double height = labelCanvas.Height;
            Double width = labelCanvas.Width;

            PlotGroup plotGroup = dataSeries.PlotGroup;                                 // PlotGroup reference

            // Calculate 3d depth for the DataPoints
            Double depth3d = chart.ChartArea.PLANK_DEPTH / chart.PlotDetails.Layer3DCount * (chart.View3D ? 1 : 0);

            // Calculate required parameters for Creating new Stacked Columns
            Double minDiff, widthPerColumn, maxColumnWidth;
            widthPerColumn = CalculateWidthOfEachStackedColumn(chart, plotGroup, width, out minDiff, out  maxColumnWidth);

            // List of effected DataPoints for the current update of YValue property of the DataPoint
            XWiseStackedData effectedDataPoints = plotGroup.XWiseStackedDataList[dataPoint.InternalXValue];

            // Marging all DataPoints in to single a single list of DataPoint
            List<DataPoint> positiveList = effectedDataPoints.Positive.ToList();
            List<DataPoint> negativeList = effectedDataPoints.Negative.ToList();
            List<DataPoint> listOfDataPoint = new List<DataPoint>();
            listOfDataPoint.AddRange(positiveList);
            listOfDataPoint.AddRange(negativeList);

            // Storing reference of old Visual 
            foreach(DataPoint dp in listOfDataPoint)
            {   
                if (dp.Marker != null && dp.Marker.Visual != null)
                    dp._oldMarkerPosition = new Point((Double)dp.Marker.Visual.GetValue(Canvas.LeftProperty), (Double)dp.Marker.Visual.GetValue(Canvas.TopProperty));

                if (dp.LabelVisual != null)
                    dp._oldLabelPosition = new Point((Double)dp.LabelVisual.GetValue(Canvas.LeftProperty), (Double)dp.LabelVisual.GetValue(Canvas.TopProperty));

                if (dp.Faces != null)
                {
                    dp._oldVisual = dp.Faces.Visual;
                    columnCanvas.Children.Remove(dp._oldVisual);
                }
            }

            // Calculate limiting value
            Double limitingYValue = (plotGroup.AxisY.InternalAxisMinimum > 0)? plotGroup.AxisY.InternalAxisMinimum : (plotGroup.AxisY.InternalAxisMaximum < 0)? plotGroup.AxisY.InternalAxisMaximum : 0;

            // Create new Column with new YValue
            DrawStackedColumnsAtXValue(chartType, dataPoint.InternalXValue, plotGroup, columnCanvas, labelCanvas, plotGroup.DrawingIndex, dataPointVisual.Width, maxColumnWidth, limitingYValue, depth3d, false);
            
            Boolean isPositive;

            if (animationEnabled)
            {
                // Create new Storyboard for animation
                if (dataPoint.Storyboard != null)
                {
                    dataPoint.Storyboard.Stop();
                    dataPoint.Storyboard = null;
                }

                dataPoint.Storyboard = new Storyboard();

                // Whether to animate the top of DataPoint Visual
                Boolean isAnimateTop = false;

                // Loop through all Datapoints under the PlotGroup of the current DataPoint and apply animation
                foreach (DataPoint dp in listOfDataPoint)
                {
                    if (dp.Faces == null || dp._oldVisual == null)
                        continue;

                    FrameworkElement newVisual = dp.Faces.Visual;                       // New StackedColumn visual reference of DataPoint
                    Double oldTop = (Double)dp._oldVisual.GetValue(Canvas.TopProperty); // Top of the old visual of the DataPoint
                    Double newTop = (Double)newVisual.GetValue(Canvas.TopProperty);     // Top of the new visual of the DataPoint
                    Double oldHeight = dp._oldVisual.Height;                            // Height of the old visual of the DataPoint
                    Double newHeight = newVisual.Height;                                // Height of the new visual of the DataPoint
                    Double oldScale = oldHeight / newHeight;                            // Scale value for the old DataPoint                       

                    System.Diagnostics.Debug.WriteLine("DataPoint--oldTop =" + oldTop.ToString() + " newTop=" + newTop.ToString() + "oldYValue=" + dp._oldYValue.ToString() + " newYValue=" + dp.InternalYValue.ToString());

                    if (dp == dataPoint)
                    {   
                        isPositive = (dataPoint._oldYValue < 0 && dataPoint.InternalYValue > 0) ? true : 
                            (dataPoint._oldYValue > 0 && dataPoint.InternalYValue < 0) ? false : 
                            dp._oldYValue >= 0 ? true : false;
                    }
                    else
                        isPositive = dp.InternalYValue >= 0 ? true : false;

                    if (isPositive)
                        newVisual.RenderTransformOrigin = new Point(0.5, 1);
                    else
                        newVisual.RenderTransformOrigin = new Point(0.5, 0);

                    // Apply new RenderTransform to the DataPoint Visual
                    newVisual.RenderTransform = new ScaleTransform();


                    if(Double.IsInfinity(oldScale) || Double.IsNaN(oldScale))
                        oldScale = 0;

                    // if (oldScale > 1)
                    //    oldScale = 1.1;

                    if (oldScale != 1)
                        dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(newVisual, "(UIElement.RenderTransform).(ScaleTransform.ScaleY)", dataPoint, dataPoint.Storyboard, 0,
                            new Double[] { 0, 1 }, new Double[] { oldScale, 1 }, null);

                    if ((isAnimateTop && oldTop != newTop) || (dp._oldYValue == dp.InternalYValue && oldTop != newTop))
                    {   
                        System.Diagnostics.Debug.WriteLine("Animate Top ----");
                        newVisual.SetValue(Canvas.TopProperty, oldTop);
                        dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(newVisual, "(Canvas.Top)", dataPoint, dataPoint.Storyboard, 0,
                              new Double[] { 0, 1 }, new Double[] { oldTop, newTop }, null);
                    }

                    if (dp == dataPoint)
                        isAnimateTop = true;

                    // Apply animation to markers if marker exists
                    if (dp.Marker != null && dp.Marker.Visual != null)
                    {
                        Double markerNewTop = (Double)dp.Marker.Visual.GetValue(Canvas.TopProperty);

                        dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(dp.Marker.Visual, "(Canvas.Top)", dataPoint, dataPoint.Storyboard, 0,
                            new Double[] { 0, 1 }, new Double[] { dp._oldMarkerPosition.Y, markerNewTop }, null);

                        dp.Marker.Visual.SetValue(Canvas.TopProperty, dp._oldMarkerPosition.Y);
                    }

                    if (dp.LabelVisual != null)
                    {   
                        Double labelNewTop = (Double)dp.LabelVisual.GetValue(Canvas.TopProperty);

                        dataPoint.Storyboard = AnimationHelper.ApplyPropertyAnimation(dp.LabelVisual, "(Canvas.Top)", dataPoint, dataPoint.Storyboard, 0,
                            new Double[] { 0, 1 }, new Double[] { dp._oldLabelPosition.Y, labelNewTop }, null);

                        dp.LabelVisual.SetValue(Canvas.TopProperty, dp._oldLabelPosition.Y);
                    }

                    dataPoint.Storyboard.SpeedRatio = 2;

                    // Remove old visual of the DataPoint from the columncanvas
                    dp._oldVisual = null;
                }

                dataPoint.Storyboard.SpeedRatio = 2;

                // Begin storyboard animation

#if WPF
                dataPoint.Storyboard.Begin(dataPoint.Chart._rootElement, true);
#else
                dataPoint.Storyboard.Begin();
#endif
            }

            if (columnCanvas.Parent != null)
            {
                width = chart.ChartArea.ChartVisualCanvas.Width;
                height = chart.ChartArea.ChartVisualCanvas.Height;

                RectangleGeometry clipRectangle = new RectangleGeometry();
                clipRectangle.Rect = new Rect(0, -chart.ChartArea.PLANK_DEPTH - (chart.View3D ? 0 : 5), width + chart.ChartArea.PLANK_DEPTH, height + chart.ChartArea.PLANK_DEPTH + chart.ChartArea.PLANK_THICKNESS + (chart.View3D ? 0 : 10));
                (columnCanvas.Parent as Canvas).Clip = clipRectangle;
            }

            if (dataPoint.Parent.SelectionEnabled && dataPoint.Selected)
                dataPoint.Select(true);
        }
Exemple #35
0
		/// <summary>Converts the value from <c>Boolean?</c> to an equivalent <c>SqlChars</c> value.</summary>
		public static SqlChars ToSqlChars(Boolean? p)        { return p.HasValue? new SqlChars(p.ToString().ToCharArray()): SqlChars.Null; }
Exemple #36
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Boolean"/> class.
 /// </summary>
 public Boolean(System.Boolean initialValue)
 {
     Name = Header = "Boolean";
     CreateOutputs(1);
     SetOutput(0, initialValue.ToString(CultureInfo.CurrentCulture), initialValue);
 }