//public VirtualGoodData VirtualGood { get; set; }
 public static MissionMetadata ParseFromDictionary( System.Collections.Generic.Dictionary<string,object> missionMetadataDict )
 {
     MissionMetadata missionMetadata = new MissionMetadata();
     if( missionMetadataDict.ContainsKey( "name" ) ) {
         missionMetadata.Name = Convert.ToString( missionMetadataDict["name"] );
     }
     if( missionMetadataDict.ContainsKey( "virtualGood" ) ) {
         /*
         VirtualGoodData virtualGood = new VirtualGoodData();
         System.Collections.Generic.Dictionary<string,object> virtualGoodDict = missionMetadataDict["virtualGood"] as System.Collections.Generic.Dictionary<string,object>;
         if( virtualGoodDict.ContainsKey( "iconUrl" ) ) {
             virtualGood.IconUrl = Convert.ToString( virtualGoodDict["iconUrl"]);
         }
         if( virtualGoodDict.ContainsKey( "description" ) ) {
             virtualGood.Description = Convert.ToString( virtualGoodDict["description"] );
         }
         if( virtualGoodDict.ContainsKey( "id" ) ) {
             virtualGood.Id = Convert.ToString( virtualGoodDict["id"] );
         }
         if( virtualGoodDict.ContainsKey( "goodId" ) ) {
             virtualGood.GoodId = Convert.ToString( virtualGoodDict["goodId"] );
         }
         virtualGood.Init();
         missionMetadata.VirtualGood = virtualGood;
         */
     }
     if( missionMetadataDict.ContainsKey( "gamedata" ) ) {
         missionMetadata.GameData = Convert.ToString( missionMetadataDict["gamedata"] );
     }
     return missionMetadata;
 }
        /// <summary>
        /// Initializes the converter. This method will be called when the application is starting and
        /// any converter is loaded.
        /// </summary>
        /// <param name="d"></param>
		public override void Initialize(System.Collections.Specialized.StringDictionary d)
		{
			if (d.ContainsKey("mimeType"))
			{
				mimeType = d["mimeType"];

				if (d.ContainsKey("quality"))
				{
					long i = 0;
#if(NET20)
					if (long.TryParse(d["quality"], out i))
						quality = i;
#else
					try
					{
						i = long.Parse(d["quality"]);
						quality = i;
					}
					catch(Exception)
					{
					}
#endif
					
				}
			}
		}
Exemple #3
0
        public override bool EditData(System.Collections.Hashtable table)
        {
            BindDelegate();

            Trace.Assert(table != null);
            Trace.Assert(table.ContainsKey("data"));
            Trace.Assert(table.ContainsKey("event_data"));
            Trace.Assert(table.ContainsKey("prev_data"));
            Trace.Assert(table.ContainsKey("flowchart_name"));
            Trace.Assert(table.ContainsKey("map_name"));

            LuaManager.GetLuaManager().InitOther("flowchart_name", table["flowchart_name"].ToString());
            LuaManager.GetLuaManager().InitOther("map_name", table["map_name"].ToString());
            LuaManager.GetLuaManager().InitOther("client_dir", table["client_dir"].ToString());

            //初始化历史表
            CacheManager.GetCacheManager().Global_Args_Table = table["globe_args"] as Hashtable;
           
            EventListForm eventForm = new EventListForm();
            eventForm.selectedEvent = table["data"] as GameEvent;
            eventForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            if (eventForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (eventForm.selectedEvent == null) return false;
                this.data = eventForm.selectedEvent;
                this.text = eventForm.ToString();
                ScanConst(table);
                return true;
            }
            else
            {
                return false;
            }
        }
        public void Equality_members()
        {
            // Silverlight does not contain Hashset
            var hashset = new[] { ResultSuccess }.ToDictionary(r => r);

            Assert.IsTrue(hashset.ContainsKey(ResultSuccess));
            Assert.IsFalse(hashset.ContainsKey(ResultError));
            Assert.IsTrue(hashset.ContainsKey(10));
        }
Exemple #5
0
 /// <summary>
 /// Creates a keys-structure using data from a server.
 /// </summary>
 /// <param name='keys'>
 /// The data from the server.
 /// </param>
 public Keys(System.Collections.Generic.IDictionary<string, object> keys)
 {
     if(keys.ContainsKey("read")){
         this.Read = (string)keys["read"];
     }
     if(keys.ContainsKey("write")){
         this.Write = (string)keys["write"];
     }
 }
 public virtual void Create( System.Collections.Generic.Dictionary<string,object> dataDict )
 {
     if( dataDict.ContainsKey( "id" ) ) {
         this.Id = Convert.ToString( dataDict["id"] );
     }
     if( dataDict.ContainsKey( "progress" ) ) {
         this.Progress = (float)Math.Round( Convert.ToDouble(dataDict["progress"]), 2);
     }
 }
        /// <summary>
        /// Configures the component using the dictionary of attributes specified
        /// in the configuration file.
        /// </summary>
        /// <param name="attributes">The attributes in the configuration element.</param>
        public void Configure(System.Collections.Specialized.StringDictionary attributes)
        {
            if(attributes.ContainsKey(PathArgumentAttribute))
            {
                this.pathArgument = attributes[PathArgumentAttribute];
            }

            if(attributes.ContainsKey(FileAttribute))
            {
                this.file = attributes[FileAttribute];
            }
        }
        /// <summary>
        /// Configures the component using the dictionary of attributes specified
        /// in the configuration file.
        /// </summary>
        /// <param name="attributes">The attributes in the configuration element.</param>
        public void Configure(System.Collections.Specialized.StringDictionary attributes)
        {
            if(attributes.ContainsKey("WebProjectArgumentName"))
            {
                webProjectArgumentName = attributes["WebProjectArgumentName"];
            }

            if(attributes.ContainsKey("Resource"))
            {
                resource = attributes["Resource"];
            }
        }
        /// <summary>
        /// Configures the component using the dictionary of attributes specified
        /// in the configuration file.
        /// </summary>
        /// <param name="attributes">The attributes in the configuration element.</param>
        public void Configure(System.Collections.Specialized.StringDictionary attributes)
        {
            if(attributes.ContainsKey(RegistryPathAttribute))
            {
                this.registryPath = attributes[RegistryPathAttribute];
            }

            if(attributes.ContainsKey(RegistryEntryAttribute))
            {
                this.registryEntry = attributes[RegistryEntryAttribute];
            }
        }
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes != null)
     {
         if (attributes.ContainsKey(FirstOperandAttribute))
         {
             _firstOperandExpression = attributes[FirstOperandAttribute];
         }
         if (attributes.ContainsKey(SecondOperandAttribute))
         {
             _secondOperandExpression = attributes[SecondOperandAttribute];
         }
     }
 }
        public override void PreInitialize(System.Collections.Generic.Dictionary<string, object> navegationParams_)
        {
            if (navegationParams_ != null
                && navegationParams_.ContainsKey("service")
                && navegationParams_.ContainsKey("indicadorVendaUltimoMes")
                && navegationParams_.ContainsKey("vantagens"))
            {
                Vantanges = navegationParams_["vantagens"] as string;
                IndicadorVendaUltimoMes = navegationParams_["indicadorVendaUltimoMes"].Equals(true) ? "Sim" : "Não";
                Service = navegationParams_["service"] as ConsultarServicoNaoElegivelClienteServicoDTO;
            }

            base.PreInitialize(navegationParams_);
        }
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes != null)
     {
         if (attributes.ContainsKey("WebProjectExpression"))
         {
             _webProjectExpression = attributes["WebProjectExpression"];
         }
         if (attributes.ContainsKey("WebFolderExpression"))
         {
             _webFolderExpression = attributes["WebFolderExpression"];
         }
     }
 }
Exemple #13
0
        private void safeAdd(System.Collections.Generic.SortedList<string,string> items, string itemToAdd)
        {
            if (string.IsNullOrEmpty(itemToAdd)) return;

            if (!items.ContainsKey(itemToAdd))
                items.Add(itemToAdd,itemToAdd);
        }
Exemple #14
0
 private void BuildImageList(System.Collections.Specialized.StringDictionary imageList, string fullPath)
 {
     // Check to see if this is a directory and if so recursively process all objects in it...
     if (System.IO.Directory.Exists(fullPath))
     {
         // First process all of the files in this directory...
         foreach (string fp in System.IO.Directory.GetFiles(fullPath)) BuildImageList(imageList, fp);
         // Now process all of the subdirectories in this directory...
         foreach (string fp in System.IO.Directory.GetDirectories(fullPath)) BuildImageList(imageList, fp);
     }
     else if(System.IO.File.Exists(fullPath))
     {
         // Make sure this file is a valid image file and if so process it...
         try
         {
             // If the image has dimension add it to the list...
             if (!Image.FromFile(fullPath).PhysicalDimension.IsEmpty)
             {
                 System.IO.FileInfo fi = new System.IO.FileInfo(fullPath);
                 string virtualPath = fi.FullName.Replace(fi.Directory.Root.FullName, "");
                 if (!virtualPath.StartsWith("\\")) virtualPath = virtualPath.Insert(0, "\\");
     //if (!imageList.ContainsKey(virtualPath)) imageList.Add(virtualPath, fi.FullName);
                 if (!imageList.ContainsKey(virtualPath)) imageList.Add(fi.FullName, virtualPath);
                 //filePath = filePath.Insert(0, "~\\uploads\\images");
                 //string junk = _webService.UploadImage(username, password, filePath, System.IO.File.ReadAllBytes(fullPath), true, true);
                 //byte[] imgBytes = webService.DownloadImage(filePath);
                 //System.IO.File.WriteAllBytes(@"C:\temp\test.jpg", imgBytes);
             }
         }
         catch
         {
             // This doesn't look like a valid image file so quietly skip it...
         }
     }
 }
 public override void ReceiveCommand(System.Collections.Generic.Dictionary<string, object> command)
 {
     if (command.ContainsKey("ButtonPressed"))
     {
         switch ((string)command["ButtonPressed"])
         {
             case "Joystick":
                 FacadePopUp.ShowMenuPopUp(dataObjectPopUp.joystickPopUp);
                 //dataObjectPopUp.DestroyEventsSystems();
                 //eventSystem.AddComponent<EventSystem>();
                 //EventSystem.current.firstSelectedGameObject = buttonQuit;
                 break;
             case "Keyboard":
                 FacadePopUp.ShowMenuPopUp(dataObjectPopUp.keyboardPopUp);
                 //dataObjectPopUp.DestroyEventsSystems();
                 //eventSystem.AddComponent<EventSystem>();
                 //EventSystem.current.firstSelectedGameObject = buttonQuit;
                 break;
             case "ClosePopUp":
                 FacadePopUp.HideMenuPopUp(dataObjectPopUp.keyboardPopUp);
                 FacadePopUp.HideMenuPopUp(dataObjectPopUp.joystickPopUp);
                 //dataObjectPopUp.DestroyEventsSystems();
                 //eventSystem.AddComponent<EventSystem>();
                 //EventSystem.current.firstSelectedGameObject = buttonSliderMusic;
                 break;
             case "Cancel":
                 gameManager.LoadScene("Main Menu");
                 break;
         }
     }
 }
 /// <summary>
 /// Configures the component using the dictionary of attributes specified
 /// in the configuration file.
 /// </summary>
 /// <param name="attributes">The attributes in the configuration element.</param>
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if(attributes.ContainsKey(ProjectTypeArgument))
     {
         language = (LanguageType)Enum.Parse(typeof(LanguageType), attributes[ProjectTypeArgument]);
     }
 }
        public ByteMatrix encode(System.String contents, BarcodeFormat format, int width, int height, System.Collections.Generic.Dictionary<Object,Object> hints)
        {
            if (contents == null || contents.Length == 0)
            {
                throw new System.ArgumentException("Found empty contents");
            }

            if (format != BarcodeFormat.QR_CODE)
            {
                throw new System.ArgumentException("Can only encode QR_CODE, but got " + format);
            }

            if (width < 0 || height < 0)
            {
                throw new System.ArgumentException("Requested dimensions are too small: " + width + 'x' + height);
            }

            ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.L;
            if (hints != null && hints.ContainsKey(EncodeHintType.ERROR_CORRECTION))
            {
                errorCorrectionLevel = (ErrorCorrectionLevel)hints[EncodeHintType.ERROR_CORRECTION]; //UPGRADE: Fixed dictionary key grab issue
            }

            QRCode code = new QRCode();
            Encoder.encode(contents, errorCorrectionLevel, hints, code);
            return renderResult(code, width, height);
        }
 /// <summary>
 /// Configures the component using the dictionary of attributes specified
 /// in the configuration file.
 /// </summary>
 /// <param name="attributes">The attributes in the configuration element.</param>
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if(attributes.ContainsKey(ArgumentAttribute))
     {
         this.argument = attributes[ArgumentAttribute];
     }
 }
        // added by .net follower (http://dotnetfollower.com)
        // public ByteMatrix encode(System.String contents, BarcodeFormat format, int width, int height, System.Collections.Hashtable hints) // commented by .net follower (http://dotnetfollower.com)
        public ByteMatrix encode(System.String contents, BarcodeFormat format, int width, int height, System.Collections.Generic.Dictionary<Object, Object> hints)
        {
            if (contents == null || contents.Length == 0)
            {
                throw new System.ArgumentException("Found empty contents");
            }

            if (format != BarcodeFormat.QR_CODE)
            {
                throw new System.ArgumentException("Can only encode QR_CODE, but got " + format);
            }

            if (width < 0 || height < 0)
            {
                throw new System.ArgumentException("Requested dimensions are too small: " + width + 'x' + height);
            }

            ErrorCorrectionLevel errorCorrectionLevel = ErrorCorrectionLevel.L;
            if (hints != null)
            {
                // ErrorCorrectionLevel requestedECLevel = (ErrorCorrectionLevel) hints[EncodeHintType.ERROR_CORRECTION]; // commented by .net follower (http://dotnetfollower.com)
                ErrorCorrectionLevel requestedECLevel = hints.ContainsKey(EncodeHintType.ERROR_CORRECTION) ? (ErrorCorrectionLevel)hints[EncodeHintType.ERROR_CORRECTION] : null; // added by .net follower (http://dotnetfollower.com)
                if (requestedECLevel != null)
                {
                    errorCorrectionLevel = requestedECLevel;
                }
            }

            QRCode code = new QRCode();
            Encoder.encode(contents, errorCorrectionLevel, hints, code);
            return renderResult(code, width, height);
        }
 public Result decode(BinaryBitmap image, System.Collections.Hashtable hints)
 {
     DecoderResult decoderResult;
     ResultPoint[] points;
     if (hints != null && hints.ContainsKey(DecodeHintType.PURE_BARCODE))
     {
         BitMatrix bits = extractPureBits(image.BlackMatrix);
         decoderResult = decoder.decode(bits);
         points = NO_POINTS;
     }
     else
     {
         DetectorResult detectorResult = new Detector(image.BlackMatrix).detect();
         decoderResult = decoder.decode(detectorResult.Bits);
         points = detectorResult.Points;
     }
     Result result = new Result(decoderResult.Text, decoderResult.RawBytes, points, BarcodeFormat.DATAMATRIX);
     if (decoderResult.ByteSegments != null)
     {
         result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, decoderResult.ByteSegments);
     }
     if (decoderResult.ECLevel != null)
     {
         result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, decoderResult.ECLevel.ToString());
     }
     return result;
 }
Exemple #21
0
        public override bool EditData(System.Collections.Hashtable table)
        {
            BindDelegate();

            Trace.Assert(table != null);
            Trace.Assert(table.ContainsKey("data"));
            Trace.Assert(table.ContainsKey("event_data"));
            Trace.Assert(table.ContainsKey("prev_data"));
            Trace.Assert(table.ContainsKey("flowchart_name"));
            Trace.Assert(table.ContainsKey("map_name"));

            LuaManager.GetLuaManager().InitOther("flowchart_name", table["flowchart_name"].ToString());
            LuaManager.GetLuaManager().InitOther("map_name", table["map_name"].ToString());
            LuaManager.GetLuaManager().InitOther("client_dir", table["client_dir"].ToString());

            //初始化历史表
            CacheManager.GetCacheManager().Global_Args_Table = table["globe_args"] as Hashtable;

            System.Windows.Forms.DialogResult r;
            ActionListForm actionlistform;
            try
            {
                ActionExp[] exps = null;
                if (table["data"] != null)
                {
                    exps = (table["data"] as ActionData).ActionExpArray;                    
                }
                actionlistform = new ActionListForm(exps, table["event_data"] as GameEvent);
                actionlistform.StartPosition =  System.Windows.Forms.FormStartPosition.CenterParent;
                r = actionlistform.ShowDialog();
            }
            catch(LuaInterface.LuaException ex)
            {
                this.printInfo(ex.ToString());
                return false;
            }

            if( r == System.Windows.Forms.DialogResult.OK)
            {
                this.data = new ActionData(actionlistform.actionExpList);
                this.text = actionlistform.actionExpListText;
                this.TooltipText = actionlistform.actionExpListText_Full;
                ScanConst(table);
                return true;
            }
            return false;
        }
        /// <summary>
        /// Configures the component using the dictionary of attributes specified
        /// in the configuration file.
        /// </summary>
        /// <param name="attributes">The attributes in the configuration element.</param>
        public void Configure(System.Collections.Specialized.StringDictionary attributes)
        {
            if (attributes.ContainsKey(StoreNameArgumentName))
            {
                storeNameArgument = attributes[StoreNameArgumentName];
            }

            if(attributes.ContainsKey(StoreLocationArgumentName))
            {
                storeLocationArgument = attributes[StoreLocationArgumentName];
            }

            if (attributes.ContainsKey(FindTypeArgumentName))
            {
                findTypeArgument = attributes[FindTypeArgumentName];
            }
        }
        /// <summary>
        /// Configures the component using the dictionary of attributes specified
        /// in the configuration file.
        /// </summary>
        /// <param name="attributes">The attributes in the configuration element.</param>
        public void Configure(System.Collections.Specialized.StringDictionary attributes)
        {
            if(attributes.ContainsKey("Title"))
            {
                title = attributes["Title"];
            }

            if(attributes.ContainsKey("Filter"))
            {
                filter = attributes["Filter"];
            }

            if(attributes.ContainsKey("InitialDirectory"))
            {
                initialDirectory = attributes["InitialDirectory"];
            }
        }
 /// <summary>Initializes the extension</summary>
 /// <param name="parameters">Initialization parameters: Thic class expects following parameters:
 /// <list type="table"><listheader><term>Parameter</term><description>Description</description></listheader>
 /// <item><term><c>PropertyName</c></term><description>Name of property to be altered. Required.</description></item>
 /// <item><term><c>TypeName</c></term><description>Name of type property <c>PropertyName</c> is property of. Required.</description></item>
 /// <item><term><c>Kind</c></term><description>Kind of date time value. Either <c>Date</c> (date only) or <c>DateTime</c> (date including time part). Optional. Default <c>DateTime</c>.</description></item>
 /// <item><term><c>Empty</c></term><description>How to deal with empty values. <c>Empty</c> - Empty string, <c>Null</c> - null. Optional. Not specified - null values are not treated in a a special way.</description></item>
 /// </list></param>
 /// <exception cref="KeyNotFoundException">A required parameter is not present in the <paramref name="parameters"/> dictionary.</exception>
 /// <exception cref="ArgumentException">
 /// Key <c>Kind</c> is present in <paramref name="parameters"/> bot value is neither <c>Date</c> nor <c>DateTime</c>. -or-
 /// Key <c>Empty</c> is present in <paramref name="parameters"/> bot value is neither <c>Empty</c> nor <c>Null</c>.
 /// </exception>
 public void Initialize(System.Collections.Generic.IDictionary<string, string> parameters)
 {
     propertyName = parameters["PropertyName"];
     typeName = parameters["TypeName"];
     if (parameters.ContainsKey("Kind"))
         switch (parameters["Kind"]) {
             case "Date": dateOnly = true; break;
             case "DateTime": dateOnly = false; break;
             default: throw new ArgumentException(string.Format(Resources.ex_UknnownDateSerializationKind));
         }
     if (parameters.ContainsKey("Empty"))
         switch (parameters["Empty"]) {
             case "Empty": empty = true; break;
             case "Null": empty = false; break;
             default: throw new ArgumentException(string.Format(Resources.ex_UknnownNullSerializationOption));
         }
 }
        protected override void LoadState(object navigationParameter, System.Collections.Generic.Dictionary<string, object> pageState)
        {
            base.LoadState(navigationParameter, pageState);
            if (pageState != null && pageState.ContainsKey("virtualizingStackPanelHorizontalOffset"))
            {
                virtualizingStackPanelHorizontalOffset = double.Parse(pageState["virtualizingStackPanelHorizontalOffset"].ToString(), CultureInfo.InvariantCulture.NumberFormat);
            }

        }
        /// <summary>
        /// Configures the component using the dictionary of attributes specified
        /// in the configuration file.
        /// </summary>
        /// <param name="attributes">The attributes in the configuration element.</param>
        public void Configure(System.Collections.Specialized.StringDictionary attributes)
        {
            if (attributes == null)
                throw new ArgumentNullException("attributes");

            if (attributes.ContainsKey(ResponsibilityArgument))
            {
                responsibility = attributes["ResponsibilityArgument"];
            }
        }
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes != null)
     {
         if (attributes.ContainsKey(ValueToNegateAttribute))
         {
             _valueToNegateExpression = attributes[ValueToNegateAttribute];
         }
     }
 }
 public override void ReceiveCommand(System.Collections.Generic.Dictionary<string, object> command)
 {
     if (command.ContainsKey ("ButtonPressed")) {
         switch ((string)command["ButtonPressed"]){
         case "Cancel":
             facadeCredits.LoadScene("Main Menu");
             break;
         }
     }
 }
 public void Configure(System.Collections.Specialized.StringDictionary attributes)
 {
     if (attributes != null)
     {
         if (attributes.ContainsKey(FolderAttribute))
         {
             _folder = attributes[FolderAttribute];
         }
     }
 }
Exemple #30
0
        public override bool EditData(System.Collections.Hashtable table)
        {
            BindDelegate();
            Trace.Assert(table != null);
            Trace.Assert(table.ContainsKey("data"));
            Trace.Assert(table.ContainsKey("prev_data"));
            Trace.Assert(table.ContainsKey("flowchart_name"));
            Trace.Assert(table.ContainsKey("map_name"));

            LuaManager.GetLuaManager().InitOther("flowchart_name", table["flowchart_name"].ToString());
            LuaManager.GetLuaManager().InitOther("map_name", table["map_name"].ToString());
            LuaManager.GetLuaManager().InitOther("client_dir", table["client_dir"].ToString());

            //初始化历史表
            CacheManager.GetCacheManager().Global_Args_Table = table["globe_args"] as Hashtable;

            Hashtable ht_prev_data = table["prev_data"] as Hashtable;
            if (ht_prev_data.Count == 0) return false;
            List<Exp> prev_List = null;
            foreach (object o in ht_prev_data.Values)
            {
                if ((o as DataElement).Data != null)
                {
                    prev_List = (((o as DataElement).Data as ConditionData).datalist as object[])[1] as List<Exp>;
                }
            }
            if (prev_List == null) return false;

            Exp exp = table["data"] as Exp;

            SelectionForm expform = new SelectionForm(exp, prev_List);
            expform.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
            if (expform.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.data = expform.ResultExp;
                this.text = expform.ResultExp.ToString();
                this.TooltipText = this.Text;
                if (this.text.Length > 15) this.text = this.text.Substring(0, 13) + "...";
                ScanConst(table);
                return true;
            }
            return false;;
        }