Beispiel #1
3
 /// <summary>
 /// 将一个对象序列化为字节数组
 /// </summary>
 /// <param name="data">要序列化的对象</param>
 /// <returns>序列化好的字节数组</returns>
 public static byte[] ToBytes(Object data)
 {
     MemoryStream ms = new MemoryStream();
     BinaryFormatter bf = new BinaryFormatter();
     bf.Serialize(ms, data);
     return ms.ToArray();
 }
        //
        // Write the booleans that this object uses to a BooleanStream
        //
        public override int TightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs)
        {

            int rc = base.TightMarshal1(wireFormat, o, bs);

            return rc + 0;
        }
        protected void submitFacility(Object sender, EventArgs e)
        {
            //If null then this is creating a facility to add
            if (selected_facility == null)
            {
                selected_facility = new facility();
                selected_address = new address();
                selected_address.line_1 = Address1.Text;
                selected_address.line_2 = Address2.Text;
                selected_address.city = CityName.Text;
                selected_address.state = StateName.Text;
                selected_address.zip = ZipName.Text;
                db.addresses.InsertOnSubmit(selected_address);
                db.SubmitChanges();
                selected_facility.user_id = user_id;
                selected_facility.name = FacilityName.Text;
                selected_facility.address_id = selected_address.id;
                selected_facility.add_date = DateTime.Now;
                db.facilities.InsertOnSubmit(selected_facility);
                db.SubmitChanges();

            }
            //If not then we are editing an existing facility
            else
            {
                selected_facility.name = FacilityName.Text;
                selected_address.line_1 = Address1.Text;
                selected_address.line_2 = Address2.Text;
                selected_address.city = CityName.Text;
                selected_address.state = StateName.Text;
                selected_address.zip = ZipName.Text;
                db.SubmitChanges();
            }
            Response.Redirect("~/Pages/Inventory/Facilities.aspx");
        }
        /// <summary>
        /// Füllt die Seite mit Inhalt auf, der bei der Navigation übergeben wird. Gespeicherte Zustände werden ebenfalls
        /// bereitgestellt, wenn eine Seite aus einer vorherigen Sitzung neu erstellt wird.
        /// </summary>
        /// <param name="navigationParameter">Der Parameterwert, der an
        /// <see cref="Frame.Navigate(Type, Object)"/> übergeben wurde, als diese Seite ursprünglich angefordert wurde.
        /// </param>
        /// <param name="pageState">Ein Wörterbuch des Zustands, der von dieser Seite während einer früheren Sitzung
        /// beibehalten wurde. Beim ersten Aufrufen einer Seite ist dieser Wert NULL.</param>
        protected override async void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
        {
            // Zulassen, dass das anfänglich anzuzeigende Element vom gespeicherten Seitenzustand überschrieben wird
            if (pageState != null && pageState.ContainsKey("SelectedItem"))
            {
                navigationParameter = pageState["SelectedItem"];
            }

            ChampionsViewModel championsViewModel = (ChampionsViewModel)App.Current.Resources["championsViewModel"];
            if (championsViewModel != null)
            {
                if (!championsViewModel.Loaded) await championsViewModel.LoadDataAsync();
                this.DefaultViewModel["Items"] = championsViewModel.Champions.OrderBy(c => c.displayName).ToList();
                Champion champion = championsViewModel.Champions.First<Champion>(c => c.id == (int)navigationParameter);
                this.flipView.SelectedItem = champion;

                List<ChampionItemDetailPageView> views = new List<ChampionItemDetailPageView>();
                ChampionItemDetailPageView lore = new ChampionItemDetailPageView("Lore");
                ChampionItemDetailPageView overview = new ChampionItemDetailPageView("Overview");
                ChampionItemDetailPageView tips = new ChampionItemDetailPageView("Tips");

                views.Add(overview);
                views.Add(lore);
                views.Add(tips);

                this.DefaultViewModel["Views"] = views;
            }
        }
Beispiel #5
1
 protected void Page_Command(Object sender, CommandEventArgs e)
 {
     try
     {
         if (e.CommandName == "Edit")
         {
             Response.Redirect("edit.aspx?ID=" + gID.ToString());
         }
         else if (e.CommandName == "Cancel")
         {
             Response.Redirect("default.aspx");
         }
         else if (e.CommandName == "Delete")
         {
            
                 SqlProcs.spTQLogisticsInvoice_Delete(gID);
                 Response.Redirect("default.aspx");
             
            
         }
     }
     catch (Exception ex)
     {
         SplendidError.SystemError(new StackTrace(true).GetFrame(0), ex);
         ctlDynamicButtons.ErrorText = ex.Message;
     }
 }
    // 
    // Un-marshal an object instance from the data input stream
    // 
    public override void TightUnmarshal(OpenWireFormat wireFormat, Object o, BinaryReader dataIn, BooleanStream bs) 
    {
        base.TightUnmarshal(wireFormat, o, dataIn, bs);

        ConsumerInfo info = (ConsumerInfo)o;
        info.ConsumerId = (ConsumerId) TightUnmarshalCachedObject(wireFormat, dataIn, bs);
        info.Browser = bs.ReadBoolean();
        info.Destination = (ActiveMQDestination) TightUnmarshalCachedObject(wireFormat, dataIn, bs);
        info.PrefetchSize = dataIn.ReadInt32();
        info.MaximumPendingMessageLimit = dataIn.ReadInt32();
        info.DispatchAsync = bs.ReadBoolean();
        info.Selector = TightUnmarshalString(dataIn, bs);
        info.SubscriptionName = TightUnmarshalString(dataIn, bs);
        info.NoLocal = bs.ReadBoolean();
        info.Exclusive = bs.ReadBoolean();
        info.Retroactive = bs.ReadBoolean();
        info.Priority = dataIn.ReadByte();

        if (bs.ReadBoolean()) {
            short size = dataIn.ReadInt16();
            BrokerId[] value = new BrokerId[size];
            for( int i=0; i < size; i++ ) {
                value[i] = (BrokerId) TightUnmarshalNestedObject(wireFormat,dataIn, bs);
            }
            info.BrokerPath = value;
        }
        else {
            info.BrokerPath = null;
        }
        info.AdditionalPredicate = (BooleanExpression) TightUnmarshalNestedObject(wireFormat, dataIn, bs);
        info.NetworkSubscription = bs.ReadBoolean();
        info.OptimizedAcknowledge = bs.ReadBoolean();
        info.NoRangeAcks = bs.ReadBoolean();

    }
Beispiel #7
1
		public override bool Equals(Object obj)
		{
			TimeRange rhs = obj as TimeRange;
			return rhs != null
				&& this.minHour == rhs.minHour
				&& this.maxHour == rhs.maxHour;
		}
Beispiel #8
1
        ///<summary>
        /// This method is called to Add a Setter object as a child of the Style.
        ///</summary>
        ///<param name="value">
        /// The object to add as a child; it must be a Setter or subclass.
        ///</param>
        void IAddChild.AddChild (Object value)
        {
            // Verify Context Access
            VerifyAccess();

            Setters.Add(Trigger.CheckChildIsSetter(value));
        }
Beispiel #9
1
 public override bool Equals(Object obj)
 {
     TestDiagnosisInfo p = obj as TestDiagnosisInfo;
     if ((object)p == null)
     {
         return false;
     }
     if (this.info == p.info)
         return true;
     if ((this.info == null) || (p.info == null))
     {
         return false;
     }
     if ((this.info.Comment == p.info.Comment)&&
     (this.info.DiagnosedDate == p.info.DiagnosedDate)&&
     (this.info.DiagnosisChangeReason == p.info.DiagnosisChangeReason)&&
     (this.info.DiagnosisStage == p.info.DiagnosisStage)&&
     (this.info.IdDiagnosisType == p.info.IdDiagnosisType)&&
     (this.info.IdDiseaseType == p.info.IdDiseaseType)&&
     (this.info.IdDispensaryState == p.info.IdDispensaryState)&&
     (this.info.IdTraumaType == p.info.IdTraumaType)&&
     (this.info.MedicalStandard == p.info.MedicalStandard)&&
     (this.info.MESImplementationFeature == p.info.MESImplementationFeature)&&
     (this.info.MkbCode == p.info.MkbCode))
     {
         return true;
     }
     else
     {
         this.FindMismatch(p);
         Global.errors3.Add("несовпадение TestDiagnosisInfo");
         return false;
     }
 }
Beispiel #10
1
 private static void ArgumentCheck(Side side, int m, int n, int k, int ilo, int ihi, Object A, int lda, Object tau, Object C, int ldc) {
   if ( A == null ) {
     throw new ArgumentNullException("A","A cannot be null.");
   }
   if ( tau == null ) {
     throw new ArgumentNullException("tau","tau cannot be null.");
   }
   if ( C == null ) {
     throw new ArgumentNullException("C","C cannot be null.");
   }
   if ( m<0 ) {
     throw new ArgumentException("m must be at least zero.", "m");
   }
   if ( n<0 ) {
     throw new ArgumentException("n must be at least zero.", "n");
   }
   if( side == Side.Left ){
     if( k < 0 || k > m ){
       throw new ArgumentException("k must be positive and less than or equal to m.", "k");
     }
     if (m>0) {
       if (ilo<1 || ilo>m || ilo>ihi)
         throw new ArgumentException("ilo must be a positive number and less than or equal to min(ihi,m) if m>0", "ilo");
       if (ihi<1 || ihi>m)
         throw new ArgumentException("ihi must be between 1 and m if m>0", "ihi");
     } else {
       if (ilo!=1)
         throw new ArgumentException("ilo must be 1 if m=0", "ilo");
       if (ihi!=0)
         throw new ArgumentException("ihi must be 0 if m=0", "ihi");
     }
   }else{
     if( k < 0 || k > n ){
       throw new ArgumentException("k must be positive and less than or equal to n.", "k");
     }
     if (n>0) {
       if (ilo<1 || ilo>n || ilo>ihi)
         throw new ArgumentException("ilo must be a positive number and less than or equal to min(ihi,n) if n>0", "ilo");
       if (ihi<1 || ihi>n)
         throw new ArgumentException("ihi must be a positive number and less than or equal to n if n>0", "ihi");
     } else {
       if (ilo!=1)
         throw new ArgumentException("ilo must be 1 if n=0", "ilo");
       if (ihi!=0)
         throw new ArgumentException("ihi must be 0 if n=0", "ihi");
     }
   }
   if( side == Side.Left ){
     if ( lda < System.Math.Max(1,m) ) {
       throw new ArgumentException("lda must be at least max(1,m)", "lda");
     }
   }else{
     if ( lda < System.Math.Max(1,n) ) {
       throw new ArgumentException("lda must be at least max(1,n)", "lda");
     }
   }
   if ( ldc < System.Math.Max(1,m) ) {
     throw new ArgumentException("ldc must be at least max(1,m)", "ldc");
   }
 }
    // 
    // Write a object instance to data output stream
    //
    public override void TightMarshal2(OpenWireFormat wireFormat, Object o, BinaryWriter dataOut, BooleanStream bs) {
        base.TightMarshal2(wireFormat, o, dataOut, bs);

        RemoveInfo info = (RemoveInfo)o;
        TightMarshalCachedObject2(wireFormat, (DataStructure)info.ObjectId, dataOut, bs);

    }
		public object Create (object parent, object configContext, XmlNode section)
		{
#if (XML_DEP)
			XmlNode file = null;
			if (section.Attributes != null)
				file = section.Attributes.RemoveNamedItem ("file");

			NameValueCollection pairs = ConfigHelper.GetNameValueCollection (
									parent as NameValueCollection,
									section,
									"key",
									"value");

			if (file != null && file.Value != String.Empty) {
				string fileName = ((IConfigXmlNode) section).Filename;
				fileName = Path.GetFullPath (fileName);
				string fullPath = Path.Combine (Path.GetDirectoryName (fileName), file.Value);
				if (!File.Exists (fullPath))
					return pairs;

				ConfigXmlDocument doc = new ConfigXmlDocument ();
				doc.Load (fullPath);
				if (doc.DocumentElement.Name != section.Name)
					throw new ConfigurationException ("Invalid root element", doc.DocumentElement);

				pairs = ConfigHelper.GetNameValueCollection (pairs, doc.DocumentElement,
									     "key", "value");
			}

			return pairs;
#else
			return null;
#endif			
		}
 public NodeEventEditor(CharEvents _chev, Object[] obj)
 {
     InitializeComponent();
     chev = _chev;
     comboBox1.Items.AddRange(obj);
     comboBox2.Items.AddRange(obj);
 }
Beispiel #14
1
 /* Events' handlers */
 private void ActionEasterEgg(Object sender, EventArgs e)
 {
     if (--easterEgg < 0)
     {
         lAppName.Text = "O_O";
     }
 }
Beispiel #15
1
		/// <summary>
		/// Checks the type of the object, returning true if
		/// the object is a fixed point numeric type.
		/// </summary>
		/// <param name="obj">The object to check</param>
		/// <returns>true if the object is a fixed point numeric type</returns>
		public static bool IsFixedPointNumeric(Object obj)
		{
			if (null != obj)
			{
				if (obj is byte) return true;
				if (obj is sbyte) return true;
				if (obj is decimal) return true;
				if (obj is int) return true;
				if (obj is uint) return true;
				if (obj is long) return true;
				if (obj is short) return true;
				if (obj is ushort) return true;

				if (obj is System.Byte) return true;
				if (obj is System.SByte) return true;
				if (obj is System.Decimal) return true;
				if (obj is System.Int32) return true;
				if (obj is System.UInt32) return true;
				if (obj is System.Int64) return true;
				if (obj is System.UInt64) return true;
				if (obj is System.Int16) return true;
				if (obj is System.UInt16) return true;
			}
			return false;
		}
Beispiel #16
1
 public static string ObjetoSerializado(Object Objeto)
 {
     System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(Objeto.GetType());
     System.IO.StringWriter textWriter = new System.IO.StringWriter();
     x.Serialize(textWriter, Objeto);
     return textWriter.ToString();
 }
Beispiel #17
1
        internal SoapFault(SerializationInfo info, StreamingContext context)
        {
            SerializationInfoEnumerator siEnum = info.GetEnumerator();        

            while(siEnum.MoveNext())
            {
                String name = siEnum.Name;
                Object value = siEnum.Value;
                SerTrace.Log(this, "SetObjectData enum ",name," value ",value);
                if (String.Compare(name, "faultCode", true, CultureInfo.InvariantCulture) == 0)
                {
                    int index = ((String)value).IndexOf(':');
                    if (index > -1)
                        faultCode = ((String)value).Substring(++index);
                    else
                        faultCode = (String)value;
                }
                else if (String.Compare(name, "faultString", true, CultureInfo.InvariantCulture) == 0)
                    faultString = (String)value;
                else if (String.Compare(name, "faultActor", true, CultureInfo.InvariantCulture) == 0)
                    faultActor = (String)value;
                else if (String.Compare(name, "detail", true, CultureInfo.InvariantCulture) == 0)
                    detail = value;
            }
        }
        /// <summary>
        /// Executes the specified workflow action.
        /// </summary>
        /// <param name="rockContext">The rock context.</param>
        /// <param name="action">The action.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="errorMessages">The error messages.</param>
        /// <returns></returns>
        public override bool Execute( RockContext rockContext, WorkflowAction action, Object entity, out List<string> errorMessages )
        {
            errorMessages = new List<string>();

            Guid? personAliasGuid = GetAttributeValue( action, "Person" ).AsGuidOrNull();
            if ( personAliasGuid.HasValue )
            {
                var personAlias = new PersonAliasService( rockContext ).Queryable( "Person" )
                    .Where( a => a.Guid.Equals( personAliasGuid.Value ) )
                    .FirstOrDefault();

                if (personAlias != null)
                {
                    action.Activity.AssignedPersonAlias = personAlias;
                    action.Activity.AssignedPersonAliasId = personAlias.Id;
                    action.Activity.AssignedGroup = null;
                    action.Activity.AssignedGroupId = null;
                    action.AddLogEntry( string.Format( "Assigned activity to '{0}' ({1})",  personAlias.Person.FullName, personAlias.Person.Id ) );
                    return true;
                }

            }

            return false;
        }
 protected void Application_AuthenticateRequest(Object sender, EventArgs e)
 {
     if (string.Compare(this.Request.Params["profile"], "true", true) != 0)
     {
         MiniProfiler.Stop(discardResults: true);
     }
 }
Beispiel #20
1
 public SoapFault(String faultCode, String faultString, String faultActor, ServerFault serverFault)
 {
     this.faultCode = faultCode;
     this.faultString = faultString;
     this.faultActor = faultActor;
     this.detail = serverFault;
 }
Beispiel #21
1
 private static void CurrentDomain_UnhandledException(Object sender, UnhandledExceptionEventArgs e)
 {
     if (e != null && e.ExceptionObject != null)
     {
         log.Error("Error: " + e.ExceptionObject);
     }
 }
Beispiel #22
1
        void DrawGraphics(Object sender, PaintEventArgs PaintNow)
        {
            Rectangle Dot = new Rectangle(SpriteX, SpriteY, SpriteWidth, SpriteHeight); // Create rectangle (start position, and size X & Y)
            SolidBrush WhiteBrush = new SolidBrush(Color.White); // Create Brush(Color) to paint rectangle

            PaintNow.Graphics.FillRectangle(WhiteBrush, Dot);
        }
Beispiel #23
1
		private void OnProcessFileDialog(Object sender, FileDialogEventArgs e)
		{
			switch (e.Mode)
			{
				case FileDialogMode.Save:
					using (var saveDialog = new SaveFileDialog())
					{
						saveDialog.Title = e.Title;
						saveDialog.Filter = e.Filter;
						saveDialog.FileName = e.DefaultFileName;
						if (saveDialog.ShowDialog() != DialogResult.Cancel)
						{
							FormProgress.ShowProgress();
							FormProgress.SetTitle("Downloading…", true);
							FormProgress.SetDetails(Path.GetFileName(saveDialog.FileName));
							TabControl.Enabled = false;
							Application.DoEvents();
							e.Continue(saveDialog.FileName);
						}
						else
							e.Cancel();
					}
					break;
			}
			e.Handled = true;
		}
Beispiel #24
1
 protected void Application_BeginRequest(Object sender, EventArgs e) {
     string filePath = HttpContext.Current.Request.PhysicalPath;
     if (!string.IsNullOrEmpty(filePath)
         && (filePath.IndexOf("Images") >= 0) && !System.IO.File.Exists(filePath)) {
         HttpContext.Current.Response.End();
     }
 }
Beispiel #25
1
 private void addClick(Object sender, EventArgs e)
 {
     //EditText edit = FindViewById<EditText>(Resource.Id.editText1);
     //DBRepository dbr = new DBRepository();
     ////string result = dbr.insertRecord(edit.Text);
     //Toast.MakeText(this, result, ToastLength.Short).Show();
 }
 protected void SaveShareButton_Command(Object sender, CommandEventArgs e)
 {
     SaveButton_Command(sender, e);
     var patron = (Patron)Session["Patron"];
     Response.Redirect(string.Format("~/Avatar/View.aspx?AvatarId={0}",
         patron.AvatarState));
 }
 private void field_DataBinding(Object sender, EventArgs e)
 {
     Control c = (Control)sender;
     GridViewRow row = (GridViewRow)c.NamingContainer;
     if (sender.GetType() == typeof(Label))
     {
         (c as Label).Text = DataBinder.Eval(row.DataItem, columnNameData).ToString();
         (c as Label).Font.Size = 7;
         (c as Label).Font.Name = "Arial";
     }
     else if (sender.GetType() == typeof(TextBox))
     {
         (c as TextBox).Text = DataBinder.Eval(row.DataItem, columnNameData).ToString();
         (c as TextBox).Font.Size = 7;
         (c as TextBox).Font.Name = "Arial";
     }
     else if (sender.GetType() == typeof(DropDownList))
     {
         (c as DropDownList).SelectedValue = DataBinder.Eval(row.DataItem, columnNameData).ToString();
         (c as DropDownList).Font.Size = 7;
         (c as DropDownList).Font.Name = "Arial";
     }
     else if (sender.GetType() == typeof(CheckBox))
     {
         (c as CheckBox).Checked = (bool)DataBinder.Eval(row.DataItem, columnNameData);
     }
 }
        /// <summary>The AddModuleToPane_Click server event handler on this page is used
        /// to add a new portal module into the tab
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AddModuleToPane_Click(Object sender, EventArgs e)
        {
            // All new modules go to the end of the contentpane
            ModuleItem m = new ModuleItem();
            m.ModuleTitle = moduleTitle.Text;
            m.ModuleDefId = Int32.Parse(moduleType.SelectedItem.Value);
            m.ModuleOrder = 999;

            // save to database
            Configuration config = new Configuration();
            m.ModuleId =
                config.AddModule(tabId, m.ModuleOrder, "ContentPane", m.ModuleTitle, m.ModuleDefId, 0, "Admins", false);

            // Obtain portalId from Current Context
            PortalSettings portalSettings = (PortalSettings) Context.Items["PortalSettings"];

            // reload the portalSettings from the database
            HttpContext.Current.Items["PortalSettings"] = new PortalSettings(portalSettings.PortalId, tabId);

            // reorder the modules in the content pane
            ArrayList modules = GetModules("ContentPane");
            OrderModules(modules);

            // resave the order
            foreach (ModuleItem item in modules)
            {
                config.UpdateModuleOrder(item.ModuleId, item.ModuleOrder, "ContentPane");
            }

            // Redirect to the same page to pick up changes
            Response.Redirect(Request.RawUrl);
        }
 GetDialogTitle
 (
     Object oObjectBeingSaved
 )
 {
     return (DialogTitle);
 }
Beispiel #30
1
 public static void TestDatabaseConnection(Object sender, TestDatabaseConnectionEventArgs e)
 {
     using (var connection = new FbConnection(GetConnectionString(e.DatabaseSettings)))
     {
         connection.Open();
     }
 }
 protected abstract Type_Object Reduce_Expression_1(Type_Object expressionSeg, Type_Object termOpSeg, Type_Object termSeg);
Beispiel #32
0
 async void SwatButton_Clicked(System.Object sender, System.EventArgs e)
 {
     await Navigation.PushModalAsync(new FliesPage());
 }
Beispiel #33
0
        public static TypedReference MakeTypedReference(Object target, FieldInfo[] flds)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }
            if (flds == null)
            {
                throw new ArgumentNullException(nameof(flds));
            }
            Contract.EndContractBlock();
            if (flds.Length == 0)
            {
                throw new ArgumentException(Environment.GetResourceString("Arg_ArrayZeroError"));
            }

            IntPtr[] fields = new IntPtr[flds.Length];
            // For proper handling of Nullable<T> don't change GetType() to something like 'IsAssignableFrom'
            // Currently we can't make a TypedReference to fields of Nullable<T>, which is fine.
            RuntimeType targetType = (RuntimeType)target.GetType();

            for (int i = 0; i < flds.Length; i++)
            {
                RuntimeFieldInfo field = flds[i] as RuntimeFieldInfo;
                if (field == null)
                {
                    throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"));
                }

                if (field.IsInitOnly || field.IsStatic)
                {
                    throw new ArgumentException(Environment.GetResourceString("Argument_TypedReferenceInvalidField"));
                }

                if (targetType != field.GetDeclaringTypeInternal() && !targetType.IsSubclassOf(field.GetDeclaringTypeInternal()))
                {
                    throw new MissingMemberException(Environment.GetResourceString("MissingMemberTypeRef"));
                }

                RuntimeType fieldType = (RuntimeType)field.FieldType;
                if (fieldType.IsPrimitive)
                {
                    throw new ArgumentException(Environment.GetResourceString("Arg_TypeRefPrimitve"));
                }

                if (i < (flds.Length - 1) && !fieldType.IsValueType)
                {
                    throw new MissingMemberException(Environment.GetResourceString("MissingMemberNestErr"));
                }

                fields[i]  = field.FieldHandle.Value;
                targetType = fieldType;
            }

            TypedReference result = new TypedReference();

            // reference to TypedReference is banned, so have to pass result as pointer
            unsafe
            {
                InternalMakeTypedReference(&result, target, fields, targetType);
            }
            return(result);
        }
Beispiel #34
0
 internal unsafe extern static void InternalSetTypedReference(void *target, Object value);
Beispiel #35
0
 public unsafe static void SetTypedReference(TypedReference target, Object value)
 {
     InternalSetTypedReference(&target, value);
 }
Beispiel #36
0
 public override bool Equals(Object o)
 {
     throw new NotSupportedException(Environment.GetResourceString("NotSupported_NYI"));
 }
Beispiel #37
0
 /// <summary>
 /// 将对象持久化到磁盘。
 /// </summary>
 /// <param name="obj">某特定对象</param>
 /// <param name="fileName">纯文件名称,不包括路径(默认是在 /xcenter/conf/ 下)</param>
 public static void WriteToFile(Object obj, String fileName)
 {
     WriteToFile(obj, fileName, defaultSeparator);
 }
Beispiel #38
0
 /// <summary>
 /// 将对象持久化到磁盘。保存的路径是 /xcenter/conf/{typeFullName}.config
 /// </summary>
 /// <param name="obj">某特定对象</param>
 public static void Write(Object obj)
 {
     WriteToFile(obj, obj.GetType().Name + ".config");
 }
Beispiel #39
0
 void ToolbarItem_Clicked(System.Object sender, System.EventArgs e)
 {
 }
Beispiel #40
0
 async void CocoonButton_Clicked(System.Object sender, System.EventArgs e)
 {
     await Navigation.PopModalAsync();
 }
        static internal void Lua_System_Action_2_float_System_Object(LuaFunction ld, float a1, System.Object a2)
        {
            IntPtr l     = ld.L;
            int    error = pushTry(l);

            pushValue(l, a1);
            pushValue(l, a2);
            ld.pcall(2, error);
            LuaDLL.lua_settop(l, error - 1);
        }
        /// <summary> Returns whether <code>a</code> is less relevant than <code>b</code>.</summary>
        /// <param name="a">ScoreDoc
        /// </param>
        /// <param name="b">ScoreDoc
        /// </param>
        /// <returns> <code>true</code> if document <code>a</code> should be sorted after document <code>b</code>.
        /// </returns>
        public override bool LessThan(System.Object a, System.Object b)
        {
            FieldDoc docA = (FieldDoc)a;
            FieldDoc docB = (FieldDoc)b;
            int      n    = fields.Length;
            int      c    = 0;

            for (int i = 0; i < n && c == 0; ++i)
            {
                int type = fields[i].GetType();
                switch (type)
                {
                case SortField.SCORE:  {
                    float r1 = (float)((System.Single)docA.fields[i]);
                    float r2 = (float)((System.Single)docB.fields[i]);
                    if (r1 > r2)
                    {
                        c = -1;
                    }
                    if (r1 < r2)
                    {
                        c = 1;
                    }
                    break;
                }

                case SortField.DOC:
                case SortField.INT:  {
                    int i1 = ((System.Int32)docA.fields[i]);
                    int i2 = ((System.Int32)docB.fields[i]);
                    if (i1 < i2)
                    {
                        c = -1;
                    }
                    if (i1 > i2)
                    {
                        c = 1;
                    }
                    break;
                }

                case SortField.LONG:  {
                    long l1 = (long)((System.Int64)docA.fields[i]);
                    long l2 = (long)((System.Int64)docB.fields[i]);
                    if (l1 < l2)
                    {
                        c = -1;
                    }
                    if (l1 > l2)
                    {
                        c = 1;
                    }
                    break;
                }

                case SortField.STRING:  {
                    System.String s1 = (System.String)docA.fields[i];
                    System.String s2 = (System.String)docB.fields[i];
                    // null values need to be sorted first, because of how FieldCache.getStringIndex()
                    // works - in that routine, any documents without a value in the given field are
                    // put first.  If both are null, the next SortField is used
                    if (s1 == null)
                    {
                        c = (s2 == null) ? 0 : -1;
                    }
                    else if (s2 == null)
                    {
                        c = 1;
                    }
                    //
                    else if (fields[i].GetLocale() == null)
                    {
                        c = String.CompareOrdinal(s1, s2);
                    }
                    else
                    {
                        c = collators[i].Compare(s1.ToString(), s2.ToString());
                    }
                    break;
                }

                case SortField.FLOAT:  {
                    float f1 = (float)((System.Single)docA.fields[i]);
                    float f2 = (float)((System.Single)docB.fields[i]);
                    if (f1 < f2)
                    {
                        c = -1;
                    }
                    if (f1 > f2)
                    {
                        c = 1;
                    }
                    break;
                }

                case SortField.DOUBLE:  {
                    double d1 = ((System.Double)docA.fields[i]);
                    double d2 = ((System.Double)docB.fields[i]);
                    if (d1 < d2)
                    {
                        c = -1;
                    }
                    if (d1 > d2)
                    {
                        c = 1;
                    }
                    break;
                }

                case SortField.CUSTOM:  {
                    c = docA.fields[i].CompareTo(docB.fields[i]);
                    break;
                }

                case SortField.AUTO:  {
                    // we cannot handle this - even if we determine the type of object (Float or
                    // Integer), we don't necessarily know how to compare them (both SCORE and
                    // FLOAT contain floats, but are sorted opposite of each other). Before
                    // we get here, each AUTO should have been replaced with its actual value.
                    throw new System.SystemException("FieldDocSortedHitQueue cannot use an AUTO SortField");
                }

                default:  {
                    throw new System.SystemException("invalid SortField type: " + type);
                }
                }
                if (fields[i].GetReverse())
                {
                    c = -c;
                }
            }

            // avoid random sort order that could lead to duplicates (bug #31241):
            if (c == 0)
            {
                return(docA.doc > docB.doc);
            }

            return(c > 0);
        }
 void CSharpCompilation_CheckedChanged(System.Object sender, Xamarin.Forms.CheckedChangedEventArgs e)
 {
     CSharpScript.IsChecked = !e.Value;
 }
 void Internal_CheckedChanged(System.Object sender, Xamarin.Forms.CheckedChangedEventArgs e)
 {
     Public.IsChecked = !e.Value;
 }
Beispiel #45
0
 public void SetValue(System.Object value)
 {
     m_Setter.Invoke(m_Instance, new System.Object[] { value });
 }
Beispiel #46
0
 private static void DeleteCB(System.Object o, DeleteEventArgs args)
 {
     Application.Quit();
 }
Beispiel #47
0
 void otherdocPan_Tapped(System.Object sender, System.EventArgs e)
 {
     Navigation.PushModalAsync(new GalleryPage(otherDocs, "Other Documents"));
 }
Beispiel #48
0
 // Due to the way that Unity overrides the Equals operator,
 // normal null checks such as (x == null) do not always work as
 // expected
 // In those cases you can use this function which will also
 // work with non-unity objects
 public static bool IsNull(System.Object obj)
 {
     return(obj == null || obj.Equals(null));
 }
 protected abstract Type_Object Reduce_Value_2(Type_Token openParenSeg, Type_Object expressionSeg, Type_Token closeParenSeg);
 private void BtnCancelAddOpening(System.Object sender, System.Windows.RoutedEventArgs e) => Close();
 protected abstract Type_Object Reduce_Factor_1(Type_Object valueSeg1, Type_Token powerSeg, Type_Object valueSeg2);
 protected abstract Type_Object Reduce_Factor_2(Type_Object valueSeg);
 protected abstract Type_Object Reduce_Term_1(Type_Object termSeg, Type_Object factorOpSeg, Type_Object factorSeg);
 protected abstract Type_Object Reduce_Term_2(Type_Object factorSeg);
Beispiel #55
0
 // reference to TypedReference is banned, so have to pass result as pointer
 private unsafe static extern void InternalMakeTypedReference(void *result, Object target, IntPtr[] flds, RuntimeType lastFieldType);
 protected abstract Type_Object Reduce_Expression_2(Type_Object termSeg);
Beispiel #57
0
 private void frmAddFoodCost_Load(System.Object sender, System.EventArgs e)
 {
     ComboBox1.SelectedIndex = 0;
     NumericUpDown1.Select(0, NumericUpDown1.Text.Length);
 }
Beispiel #58
0
 void StartButton_Clicked(System.Object sender, System.EventArgs e)
 {
     InitializeTestPaper();
 }
    internal static IntPtr ToIntPtr(System.Object obj)
    {
        GCHandle handle = GCHandle.Alloc(obj);

        return(GCHandle.ToIntPtr(handle));
    }
 protected abstract Type_Object Reduce_Equation_1(Type_Object expressionSeg1, Type_Object comparisonOpSeg, Type_Object expressionSeg2);